37 |
/* Various declarations. */ |
/* Various declarations. */ |
38 |
|
|
39 |
typedef struct m4_symbol m4_symbol; |
typedef struct m4_symbol m4_symbol; |
40 |
typedef struct m4_module m4_module; |
typedef struct m4_module_data m4_module_data; |
41 |
typedef struct m4_token_data m4_token_data; |
typedef struct m4_token_data m4_token_data; |
42 |
|
|
43 |
typedef void m4_builtin_func M4_PARAMS((struct obstack *, int, |
typedef void m4_builtin_func M4_PARAMS((struct obstack *, int, |
75 |
} m4_builtin; |
} m4_builtin; |
76 |
|
|
77 |
|
|
78 |
/* This list is used to check for repeated loading of the same modules, |
extern void m4_module_init M4_PARAMS((void)); |
79 |
and expanding the __modules__ macro. */ |
extern lt_dlhandle m4_module_load M4_PARAMS((const char*, struct obstack*)); |
80 |
|
extern void m4_module_unload M4_PARAMS((const char*, struct obstack*)); |
81 |
|
extern lt_dlhandle m4_module_open M4_PARAMS((const char*, struct obstack*)); |
82 |
|
extern void m4_module_close M4_PARAMS((lt_dlhandle, struct obstack*)); |
83 |
|
extern void m4_module_close_all M4_PARAMS((struct obstack*)); |
84 |
|
|
85 |
M4_SCOPE List *m4_modules; |
extern const char *m4_module_name M4_PARAMS((lt_dlhandle)); |
86 |
|
extern m4_builtin *m4_module_builtins M4_PARAMS((lt_dlhandle)); |
87 |
|
extern m4_macro *m4_module_macros M4_PARAMS((lt_dlhandle)); |
88 |
|
|
89 |
extern void m4_module_init M4_PARAMS((void)); |
extern lt_dlhandle m4_module_find_by_builtin M4_PARAMS((const m4_builtin*)); |
|
extern const m4_module *m4_module_load M4_PARAMS((const char *, |
|
|
struct obstack *)); |
|
|
extern void m4_module_install M4_PARAMS((const char *)); |
|
90 |
|
|
|
extern void m4_module_unload M4_PARAMS((const char *, |
|
|
struct obstack *)); |
|
|
extern void m4_module_unload_all M4_PARAMS((void)); |
|
91 |
|
|
92 |
extern const char *m4_module_name M4_PARAMS((const m4_module *module)); |
extern void m4_macro_define M4_PARAMS((const lt_dlhandle, |
|
extern const m4_builtin *m4_module_builtins M4_PARAMS((const m4_module *module)); |
|
|
extern const m4_macro *m4_module_macros M4_PARAMS((const m4_module *module)); |
|
|
|
|
|
|
|
|
extern VOID *m4_module_find_by_modname M4_PARAMS((List *, VOID *)); |
|
|
extern VOID *m4_module_find_by_builtin M4_PARAMS((List *, VOID *)); |
|
|
|
|
|
extern void m4_macro_define M4_PARAMS((const m4_module *, |
|
93 |
const char *, const char *, m4_symbol_lookup)); |
const char *, const char *, m4_symbol_lookup)); |
94 |
extern void m4_macro_table_install M4_PARAMS(( |
extern void m4_macro_table_install M4_PARAMS(( |
95 |
const m4_module *, const m4_macro *)); |
const lt_dlhandle, const m4_macro *)); |
|
|
|
96 |
|
|
97 |
extern void m4_builtin_define M4_PARAMS((const m4_module *, |
extern void m4_builtin_define M4_PARAMS((const lt_dlhandle, |
98 |
const char *, const m4_builtin *, |
const char *, const m4_builtin *, |
99 |
m4_symbol_lookup, boolean)); |
m4_symbol_lookup, boolean)); |
100 |
extern void m4_builtin_table_install M4_PARAMS(( |
extern void m4_builtin_table_install M4_PARAMS(( |
101 |
const m4_module *, const m4_builtin *)); |
const lt_dlhandle, const m4_builtin *)); |
102 |
extern const m4_builtin *m4_builtin_find_by_name M4_PARAMS(( |
|
103 |
|
extern const m4_builtin *m4_builtin_find_by_name M4_PARAMS(( |
104 |
const m4_builtin *, const char *)); |
const m4_builtin *, const char *)); |
105 |
extern const m4_builtin *m4_builtin_find_by_func M4_PARAMS(( |
extern const m4_builtin *m4_builtin_find_by_func M4_PARAMS(( |
106 |
const m4_builtin *, m4_builtin_func *)); |
const m4_builtin *, m4_builtin_func *)); |
107 |
|
|
108 |
extern m4_symbol **m4_symtab; |
extern m4_symbol **m4_symtab; |
134 |
M4_TOKEN_FUNC |
M4_TOKEN_FUNC |
135 |
} m4_token_data_t; |
} m4_token_data_t; |
136 |
|
|
137 |
typedef void m4_module_init_t M4_PARAMS((struct obstack *)); |
typedef void m4_module_init_func M4_PARAMS((lt_dlhandle, struct obstack*)); |
138 |
typedef void m4_module_finish_t M4_PARAMS((void)); |
typedef void m4_module_finish_func M4_PARAMS((lt_dlhandle, struct obstack*)); |
139 |
|
|
140 |
|
extern m4_token_data_t m4_token_data_type M4_PARAMS((m4_token_data*)); |
141 |
|
extern char *m4_token_data_text M4_PARAMS((m4_token_data*)); |
142 |
|
extern char *m4_token_data_orig_text M4_PARAMS((m4_token_data*)); |
143 |
|
extern m4_builtin_func *m4_token_data_func M4_PARAMS((m4_token_data*)); |
144 |
|
extern boolean m4_token_data_func_traced M4_PARAMS((m4_token_data*)); |
145 |
|
|
|
m4_token_data_t m4_token_data_type M4_PARAMS((m4_token_data *)); |
|
|
char *m4_token_data_text M4_PARAMS((m4_token_data *)); |
|
|
char *m4_token_data_orig_text M4_PARAMS((m4_token_data *)); |
|
|
m4_builtin_func *m4_token_data_func M4_PARAMS((m4_token_data *)); |
|
|
boolean m4_token_data_func_traced M4_PARAMS((m4_token_data *)); |
|
146 |
|
|
147 |
#define M4ARG(i) (argc > (i) ? m4_token_data_text (argv[i]) : "") |
#define M4ARG(i) (argc > (i) ? m4_token_data_text (argv[i]) : "") |
148 |
|
|
154 |
static void CONC(builtin_, name) (obs, argc, argv) \ |
static void CONC(builtin_, name) (obs, argc, argv) \ |
155 |
struct obstack *obs; int argc; m4_token_data **argv; |
struct obstack *obs; int argc; m4_token_data **argv; |
156 |
|
|
157 |
|
#define M4INIT_HANDLER(name) \ |
158 |
|
void CONC(name, CONC(_LTX_, m4_init_module)) (handle, obs) \ |
159 |
|
lt_dlhandle handle; struct obstack *obs; |
160 |
|
|
161 |
|
#define M4FINISH_HANDLER(name) \ |
162 |
|
void CONC(name, CONC(_LTX_, m4_finish_module)) (handle, obs) \ |
163 |
|
lt_dlhandle handle; struct obstack *obs; |
164 |
|
|
165 |
/* Error handling. */ |
/* Error handling. */ |
166 |
#define M4ERROR(Arglist) (error Arglist) |
#define M4ERROR(Arglist) (error Arglist) |
167 |
|
|
387 |
/* push back input */ |
/* push back input */ |
388 |
extern void m4_push_file M4_PARAMS((FILE *, const char *)); |
extern void m4_push_file M4_PARAMS((FILE *, const char *)); |
389 |
extern void m4_push_single M4_PARAMS((int ch)); |
extern void m4_push_single M4_PARAMS((int ch)); |
390 |
extern void m4_push_macro M4_PARAMS((m4_builtin_func *, boolean)); |
extern void m4_push_macro M4_PARAMS((m4_builtin_func *, lt_dlhandle, |
391 |
|
boolean)); |
392 |
extern struct obstack *m4_push_string_init M4_PARAMS((void)); |
extern struct obstack *m4_push_string_init M4_PARAMS((void)); |
393 |
extern const char *m4_push_string_finish M4_PARAMS((void)); |
extern const char *m4_push_string_finish M4_PARAMS((void)); |
394 |
extern void m4_push_wrapup M4_PARAMS((const char *)); |
extern void m4_push_wrapup M4_PARAMS((const char *)); |