29 |
/* Exit code from last "syscmd" command. */ |
/* Exit code from last "syscmd" command. */ |
30 |
int m4_sysval = 0; |
int m4_sysval = 0; |
31 |
|
|
|
/* input syntax table. */ |
|
|
unsigned short m4_syntax_table[256]; |
|
|
|
|
|
/* Quote chars. */ |
|
|
m4_string rquote; |
|
|
m4_string lquote; |
|
|
|
|
|
/* Comment chars. */ |
|
|
m4_string bcomm; |
|
|
m4_string ecomm; |
|
|
|
|
32 |
|
|
33 |
/* Give friendly warnings if a builtin macro is passed an |
/* Give friendly warnings if a builtin macro is passed an |
34 |
inappropriate number of arguments. ARGC/ARGV are the arguments, |
inappropriate number of arguments. ARGC/ARGV are the arguments, |
59 |
} |
} |
60 |
|
|
61 |
const char * |
const char * |
62 |
m4_skip_space (const char *arg) |
m4_skip_space (m4 *context, const char *arg) |
63 |
{ |
{ |
64 |
while (M4_IS_SPACE(*arg)) |
while (M4_IS_SPACE (M4SYNTAX, *arg)) |
65 |
arg++; |
arg++; |
66 |
return arg; |
return arg; |
67 |
} |
} |
76 |
char *endp; |
char *endp; |
77 |
|
|
78 |
if (*M4ARG (arg) == 0 |
if (*M4ARG (arg) == 0 |
79 |
|| (*valuep = strtol (m4_skip_space (M4ARG (arg)), &endp, 10), |
|| (*valuep = strtol (m4_skip_space (context, M4ARG (arg)), &endp, 10), |
80 |
*m4_skip_space (endp) != 0)) |
*m4_skip_space (context, endp) != 0)) |
81 |
{ |
{ |
82 |
M4WARN ((m4_get_warning_status_opt (context), 0, |
M4WARN ((m4_get_warning_status_opt (context), 0, |
83 |
_("Warning: %s: argument %d non-numeric: %s"), |
_("Warning: %s: argument %d non-numeric: %s"), |
91 |
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by |
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by |
92 |
SEP, and quoted by the current quotes, if QUOTED is TRUE. */ |
SEP, and quoted by the current quotes, if QUOTED is TRUE. */ |
93 |
void |
void |
94 |
m4_dump_args (struct obstack *obs, int argc, m4_symbol_value **argv, |
m4_dump_args (m4 *context, struct obstack *obs, int argc, |
95 |
const char *sep, boolean quoted) |
m4_symbol_value **argv, const char *sep, boolean quoted) |
96 |
{ |
{ |
97 |
int i; |
int i; |
98 |
size_t len = strlen (sep); |
size_t len = strlen (sep); |
102 |
if (i > 1) |
if (i > 1) |
103 |
obstack_grow (obs, sep, len); |
obstack_grow (obs, sep, len); |
104 |
|
|
105 |
m4_shipout_string (obs, M4ARG (i), 0, quoted); |
m4_shipout_string (context, obs, M4ARG (i), 0, quoted); |
106 |
} |
} |
107 |
} |
} |
108 |
|
|
158 |
/* The function dump_symbol () is for use by "dumpdef". It builds up a |
/* The function dump_symbol () is for use by "dumpdef". It builds up a |
159 |
table of all defined symbol names. */ |
table of all defined symbol names. */ |
160 |
void * |
void * |
161 |
m4_dump_symbol_CB (m4_symtab *ignored, const char *name, m4_symbol *symbol, |
m4_dump_symbol_CB (m4_symbol_table *ignored, const char *name, m4_symbol *symbol, |
162 |
void *userdata) |
void *userdata) |
163 |
{ |
{ |
164 |
assert (name); |
assert (name); |