1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
/* ISC license. */
#ifndef EXECLINE_H
#define EXECLINE_H
#include <sys/types.h>
#include <skalibs/gccattributes.h>
#include <skalibs/buffer.h>
#include <skalibs/stralloc.h>
#define EXECLINE_BLOCK_QUOTE_STRING " "
#define EXECLINE_BLOCK_QUOTE_CHAR ' '
#define EXECLINE_BLOCK_END_STRING ""
#define EXECLINE_BLOCK_END_CHAR '\0'
/* Parsing */
typedef int el_chargen_func_t (unsigned char *, void *) ;
typedef el_chargen_func_t *el_chargen_func_t_ref ;
extern int el_parse (stralloc *, el_chargen_func_t_ref, void *) ;
extern int el_parse_from_string (stralloc *, char const *) ;
extern int el_parse_from_buffer (stralloc *, buffer *) ;
/* Basics */
extern int el_vardupl (char const *, char const *, unsigned int) gccattr_pure ;
extern unsigned int el_getstrict (void) gccattr_const ;
/* Environment shifting */
extern int el_pushenv (stralloc *, char const *const *, unsigned int, char const *const *, unsigned int) ;
extern int el_popenv (stralloc *, char const *const *, unsigned int, char const *const *, unsigned int) ;
/* Sequence */
extern pid_t el_spawn0 (char const *, char const *const *, char const *const *) ;
extern pid_t el_spawn1 (char const *, char const *const *, char const *const *, int *, int) ;
extern void el_execsequence (char const *const *, char const *const *, char const *const *) gccattr_noreturn ;
/* Block unquoting */
extern int el_semicolon (char const **) ;
/* Value transformation */
typedef struct eltransforminfo_s eltransforminfo_t, *eltransforminfo_t_ref ;
struct eltransforminfo_s
{
char const *delim ;
unsigned int crunch : 1 ;
unsigned int chomp : 1 ;
unsigned int split : 1 ;
} ;
#define ELTRANSFORMINFO_ZERO { .delim = " \n\r\t", .crunch = 0, .chomp = 0, .split = 0 }
extern int el_transform (stralloc *, unsigned int, eltransforminfo_t const *) ;
/* Substitution */
typedef struct elsubst_s elsubst_t, *elsubst_t_ref ;
struct elsubst_s
{
unsigned int var ;
unsigned int value ;
unsigned int n ;
} ;
extern int el_substitute (stralloc *, char const *, unsigned int, char const *, char const *, elsubst_t const *, unsigned int) ;
#endif
|