28 |
|
|
29 |
#include "m4module.h" |
#include "m4module.h" |
30 |
|
|
31 |
|
typedef struct m4__search_path_info m4__search_path_info; |
32 |
|
|
33 |
typedef enum { |
typedef enum { |
34 |
M4_SYMBOL_VOID, |
M4_SYMBOL_VOID, |
35 |
M4_SYMBOL_TEXT, |
M4_SYMBOL_TEXT, |
44 |
/* --- CONTEXT MANAGEMENT --- */ |
/* --- CONTEXT MANAGEMENT --- */ |
45 |
|
|
46 |
struct m4 { |
struct m4 { |
47 |
m4_symbol_table *symtab; |
m4_symbol_table * symtab; |
48 |
m4_syntax_table *syntax; |
m4_syntax_table * syntax; |
49 |
|
|
50 |
FILE * debug_file; /* File for debugging output. */ |
FILE * debug_file; /* File for debugging output. */ |
51 |
m4_obstack trace_messages; |
m4_obstack trace_messages; |
52 |
|
|
53 |
/* Option flags (set in src/main.c). */ |
/* Option flags (set in src/main.c). */ |
54 |
int warning_status; /* -E */ |
int warning_status; /* -E */ |
57 |
int debug_level; /* -d */ |
int debug_level; /* -d */ |
58 |
int max_debug_arg_length; /* -l */ |
int max_debug_arg_length; /* -l */ |
59 |
int opt_flags; |
int opt_flags; |
60 |
|
|
61 |
|
/* __PRIVATE__: */ |
62 |
|
m4__search_path_info *search_path; /* The list of path directories. */ |
63 |
}; |
}; |
64 |
|
|
65 |
#define M4_OPT_PREFIX_BUILTINS_BIT (1 << 0) /* -P */ |
#define M4_OPT_PREFIX_BUILTINS_BIT (1 << 0) /* -P */ |
69 |
#define M4_OPT_SYNC_OUTPUT_BIT (1 << 4) /* -s */ |
#define M4_OPT_SYNC_OUTPUT_BIT (1 << 4) /* -s */ |
70 |
#define M4_OPT_POSIXLY_CORRECT_BIT (1 << 5) /* POSIXLY_CORRECT */ |
#define M4_OPT_POSIXLY_CORRECT_BIT (1 << 5) /* POSIXLY_CORRECT */ |
71 |
|
|
72 |
|
/* Fast macro versions of accessor functions for public fields of m4, |
73 |
|
that also have an identically named function exported in m4module.h. */ |
74 |
#ifdef NDEBUG |
#ifdef NDEBUG |
75 |
# define m4_get_symbol_table(C) ((C)->symtab) |
# define m4_get_symbol_table(C) ((C)->symtab) |
76 |
# define m4_get_syntax_table(C) ((C)->syntax) |
# define m4_get_syntax_table(C) ((C)->syntax) |
96 |
(BIT_TEST((C)->opt_flags, M4_OPT_POSIXLY_CORRECT_BIT)) |
(BIT_TEST((C)->opt_flags, M4_OPT_POSIXLY_CORRECT_BIT)) |
97 |
#endif |
#endif |
98 |
|
|
99 |
|
/* Accessors for private fields of m4, which have no function version |
100 |
|
exported in m4module.h. */ |
101 |
|
#define m4__get_search_path(C) ((C)->search_path) |
102 |
|
|
103 |
|
|
104 |
|
|
105 |
/* --- MODULE MANAGEMENT --- */ |
/* --- MODULE MANAGEMENT --- */ |
196 |
#define SYMBOL_ARG_REST_BIT (1 << 0) |
#define SYMBOL_ARG_REST_BIT (1 << 0) |
197 |
#define SYMBOL_ARG_KEY_BIT (1 << 1) |
#define SYMBOL_ARG_KEY_BIT (1 << 1) |
198 |
|
|
199 |
extern void m4__symtab_remove_module_references (m4_symbol_table*, lt_dlhandle); |
extern void m4__symtab_remove_module_references (m4_symbol_table*, lt_dlhandle); |
200 |
|
|
201 |
|
|
202 |
|
|
256 |
|
|
257 |
|
|
258 |
|
|
259 |
|
/* --- PATH MANAGEMENT --- */ |
260 |
|
|
261 |
|
typedef struct m4__search_path m4__search_path; |
262 |
|
|
263 |
|
struct m4__search_path { |
264 |
|
m4__search_path *next; /* next directory to search */ |
265 |
|
const char *dir; /* directory */ |
266 |
|
int len; |
267 |
|
}; |
268 |
|
|
269 |
|
struct m4__search_path_info { |
270 |
|
m4__search_path *list; /* the list of path directories */ |
271 |
|
m4__search_path *list_end; /* the end of same */ |
272 |
|
int max_length; /* length of longest directory name */ |
273 |
|
}; |
274 |
|
|
275 |
|
|
276 |
|
|
277 |
/* Debugging the memory allocator. */ |
/* Debugging the memory allocator. */ |
278 |
|
|
279 |
#if WITH_DMALLOC |
#if WITH_DMALLOC |