46 |
|
|
47 |
static int m4_symbol_destroy (const void *name, void *symbol, |
static int m4_symbol_destroy (const void *name, void *symbol, |
48 |
void *symtab); |
void *symtab); |
49 |
static int m4_arg_destroy (const void *ignored, void *arg, |
static int m4_arg_destroy (const void *name, void *arg, |
50 |
void *also_ignored); |
void *arg_signature); |
51 |
|
|
52 |
/* Pointer to symbol table. */ |
/* Pointer to symbol table. */ |
53 |
m4_hash *m4_symtab = 0; |
m4_hash *m4_symtab = 0; |
220 |
if (TOKEN_ARG_SIGNATURE (stale)) |
if (TOKEN_ARG_SIGNATURE (stale)) |
221 |
{ |
{ |
222 |
m4_hash_apply (TOKEN_ARG_SIGNATURE (stale), |
m4_hash_apply (TOKEN_ARG_SIGNATURE (stale), |
223 |
m4_arg_destroy, NULL); |
m4_arg_destroy, TOKEN_ARG_SIGNATURE (stale)); |
224 |
m4_hash_delete (TOKEN_ARG_SIGNATURE (stale)); |
m4_hash_delete (TOKEN_ARG_SIGNATURE (stale)); |
225 |
} |
} |
226 |
if (TOKEN_TYPE (stale) == M4_TOKEN_TEXT) |
if (TOKEN_TYPE (stale) == M4_TOKEN_TEXT) |
250 |
/* Callback used by m4_symbol_popdef () to release the memory used |
/* Callback used by m4_symbol_popdef () to release the memory used |
251 |
by values in the arg_signature hash. */ |
by values in the arg_signature hash. */ |
252 |
static int |
static int |
253 |
m4_arg_destroy (const void *ignored, void *arg, void *also_ignored) |
m4_arg_destroy (const void *name, void *arg, void *arg_signature) |
254 |
{ |
{ |
255 |
struct m4_token_arg *token_arg = (struct m4_token_arg *) arg; |
struct m4_token_arg *token_arg = (struct m4_token_arg *) arg; |
256 |
|
|
257 |
|
assert (name); |
258 |
|
assert (arg_signature); |
259 |
|
|
260 |
if (TOKEN_ARG_DEFAULT (token_arg)) |
if (TOKEN_ARG_DEFAULT (token_arg)) |
261 |
XFREE (TOKEN_ARG_DEFAULT (token_arg)); |
XFREE (TOKEN_ARG_DEFAULT (token_arg)); |
262 |
xfree (arg); |
xfree (token_arg); |
263 |
|
xfree (m4_hash_remove ((m4_hash *) arg_signature, (const char *) name)); |
264 |
|
|
265 |
return 0; |
return 0; |
266 |
} |
} |