28 |
#endif |
#endif |
29 |
|
|
30 |
#include <m4module.h> |
#include <m4module.h> |
31 |
|
#include <modules/m4.h> |
32 |
|
|
33 |
#if HAVE_ERRNO_H |
#if HAVE_ERRNO_H |
34 |
# include <errno.h> |
# include <errno.h> |
368 |
third argument, with \& substituted by the matched text, and \N |
third argument, with \& substituted by the matched text, and \N |
369 |
substituted by the text matched by the Nth parenthesized sub-expression. */ |
substituted by the text matched by the Nth parenthesized sub-expression. */ |
370 |
|
|
|
/** |
|
|
* patsubst(STRING, REGEXP, [REPLACEMENT]) |
|
|
**/ |
|
371 |
static void |
static void |
372 |
m4_patsubst_do (m4 *context, m4_obstack *obs, int argc, |
m4_patsubst_do (m4 *context, m4_obstack *obs, int argc, |
373 |
m4_symbol_value **argv, int syntax) |
m4_symbol_value **argv, int syntax) |
442 |
} |
} |
443 |
|
|
444 |
/** |
/** |
445 |
* patsubst(STRING, REGEXP, [REPLACEMENT]) |
* epatsubst(STRING, REGEXP, [REPLACEMENT]) |
446 |
**/ |
**/ |
447 |
M4BUILTIN_HANDLER (epatsubst) |
M4BUILTIN_HANDLER (epatsubst) |
448 |
{ |
{ |
449 |
m4_patsubst_do (context, obs, argc, argv, RE_SYNTAX_ERE); |
m4_patsubst_do (context, obs, argc, argv, RE_SYNTAX_ERE); |
450 |
} |
} |
451 |
|
|
452 |
/* Implementation of "symbols" itself. It builds up a table of pointers to |
/* Implementation of "symbols". It builds up a table of pointers to |
453 |
symbols, sorts it and ships out the symbols name. */ |
symbols, sorts it and ships out the symbol names. */ |
454 |
|
|
455 |
|
/* TODO: Import this through the m4_export list of m4 module. */ |
456 |
|
extern void m4_dump_symbols (m4 *context, m4_dump_symbol_data *data, int argc, |
457 |
|
m4_symbol_value **argv, boolean complain); |
458 |
|
|
459 |
/** |
/** |
460 |
* symbols([...]) |
* symbols([...]) |
461 |
**/ |
**/ |
462 |
M4BUILTIN_HANDLER (symbols) |
M4BUILTIN_HANDLER (symbols) |
463 |
{ |
{ |
464 |
struct m4_dump_symbol_data data; |
m4_dump_symbol_data data; |
465 |
m4_obstack data_obs; |
m4_obstack data_obs; |
466 |
|
|
467 |
obstack_init (&data_obs); |
obstack_init (&data_obs); |