79 |
internal data structure, so they are safe to export for use in |
internal data structure, so they are safe to export for use in |
80 |
external modules. */ |
external modules. */ |
81 |
m4_token_data_t |
m4_token_data_t |
82 |
m4_symbol_type (m4_symbol *name) |
m4_token_data_type (m4_token_data *name) |
83 |
{ |
{ |
84 |
return M4_SYMBOL_TYPE(name); |
return M4_TOKEN_DATA_TYPE(name); |
85 |
} |
} |
86 |
|
|
87 |
char * |
char * |
88 |
m4_symbol_text (m4_symbol *name) |
m4_token_data_text (m4_token_data *name) |
89 |
{ |
{ |
90 |
return M4_SYMBOL_TEXT(name); |
return M4_TOKEN_DATA_TEXT(name); |
91 |
} |
} |
92 |
|
|
93 |
m4_builtin_func * |
m4_builtin_func * |
94 |
m4_symbol_func (m4_symbol *name) |
m4_token_data_func (m4_token_data *name) |
95 |
{ |
{ |
96 |
return M4_SYMBOL_FUNC(name); |
return M4_TOKEN_DATA_FUNC(name); |
97 |
} |
} |
98 |
|
|
99 |
|
|
104 |
negative if not applicable, MAX is the maximum number, negative if not |
negative if not applicable, MAX is the maximum number, negative if not |
105 |
applicable. */ |
applicable. */ |
106 |
boolean |
boolean |
107 |
m4_bad_argc (m4_symbol *name, int argc, int min, int max) |
m4_bad_argc (m4_token_data *name, int argc, int min, int max) |
108 |
{ |
{ |
109 |
if (min > 0 && argc < min) |
if (min > 0 && argc < min) |
110 |
{ |
{ |
111 |
M4WARN ((warning_status, 0, |
M4WARN ((warning_status, 0, |
112 |
_("Warning: %s: too few arguments"), |
_("Warning: %s: too few arguments"), |
113 |
M4_SYMBOL_TEXT (name))); |
M4_TOKEN_DATA_TEXT (name))); |
114 |
return TRUE; |
return TRUE; |
115 |
} |
} |
116 |
|
|
118 |
{ |
{ |
119 |
M4WARN ((warning_status, 0, |
M4WARN ((warning_status, 0, |
120 |
_("Warning: %s: too many arguments (ignored)"), |
_("Warning: %s: too many arguments (ignored)"), |
121 |
M4_SYMBOL_TEXT (name))); |
M4_TOKEN_DATA_TEXT (name))); |
122 |
/* Return FALSE, otherwise it is not exactly `ignored'. */ |
/* Return FALSE, otherwise it is not exactly `ignored'. */ |
123 |
return FALSE; |
return FALSE; |
124 |
} |
} |
138 |
VALUEP. If the conversion fails, print error message for macro MACRO. |
VALUEP. If the conversion fails, print error message for macro MACRO. |
139 |
Return TRUE iff conversion succeeds. */ |
Return TRUE iff conversion succeeds. */ |
140 |
boolean |
boolean |
141 |
m4_numeric_arg (m4_symbol *macro, const char *arg, int *valuep) |
m4_numeric_arg (m4_token_data *macro, const char *arg, int *valuep) |
142 |
{ |
{ |
143 |
char *endp; |
char *endp; |
144 |
|
|
147 |
{ |
{ |
148 |
M4WARN ((warning_status, 0, |
M4WARN ((warning_status, 0, |
149 |
_("Warning: %s: non-numeric argument: %s"), |
_("Warning: %s: non-numeric argument: %s"), |
150 |
M4_SYMBOL_TEXT (macro), arg)); |
M4_TOKEN_DATA_TEXT (macro), arg)); |
151 |
return FALSE; |
return FALSE; |
152 |
} |
} |
153 |
return TRUE; |
return TRUE; |
157 |
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by |
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by |
158 |
SEP, and quoted by the current quotes, if QUOTED is TRUE. */ |
SEP, and quoted by the current quotes, if QUOTED is TRUE. */ |
159 |
void |
void |
160 |
m4_dump_args (struct obstack *obs, int argc, m4_symbol **argv, |
m4_dump_args (struct obstack *obs, int argc, m4_token_data **argv, |
161 |
const char *sep, boolean quoted) |
const char *sep, boolean quoted) |
162 |
{ |
{ |
163 |
int i; |
int i; |
168 |
if (i > 1) |
if (i > 1) |
169 |
obstack_grow (obs, sep, len); |
obstack_grow (obs, sep, len); |
170 |
|
|
171 |
m4_shipout_string (obs, M4_SYMBOL_TEXT (argv[i]), 0, quoted); |
m4_shipout_string (obs, M4_TOKEN_DATA_TEXT (argv[i]), 0, quoted); |
172 |
} |
} |
173 |
} |
} |
174 |
|
|
243 |
symbols, otherwise, only the specified symbols. */ |
symbols, otherwise, only the specified symbols. */ |
244 |
void |
void |
245 |
m4_dump_symbols (struct m4_dump_symbol_data *data, int argc, |
m4_dump_symbols (struct m4_dump_symbol_data *data, int argc, |
246 |
m4_symbol **argv, boolean complain) |
m4_token_data **argv, boolean complain) |
247 |
{ |
{ |
248 |
data->base = (const char **) obstack_base (data->obs); |
data->base = (const char **) obstack_base (data->obs); |
249 |
data->size = 0; |
data->size = 0; |
259 |
|
|
260 |
for (i = 1; i < argc; i++) |
for (i = 1; i < argc; i++) |
261 |
{ |
{ |
262 |
symbol = m4_symbol_lookup (M4_SYMBOL_TEXT (argv[i])); |
symbol = m4_symbol_lookup (M4_TOKEN_DATA_TEXT (argv[i])); |
263 |
if (symbol != NULL && M4_SYMBOL_TYPE (symbol) != M4_TOKEN_VOID) |
if (symbol != NULL && M4_SYMBOL_TYPE (symbol) != M4_TOKEN_VOID) |
264 |
m4_dump_symbol (M4_SYMBOL_TEXT (argv[i]), symbol, data); |
m4_dump_symbol (M4_TOKEN_DATA_TEXT (argv[i]), symbol, data); |
265 |
else if (complain) |
else if (complain) |
266 |
M4WARN ((warning_status, 0, |
M4WARN ((warning_status, 0, |
267 |
_("Warning: %s: undefined name: %s"), |
_("Warning: %s: undefined name: %s"), |