1 | /* src/interfaces/ecpg/preproc/preproc_extern.h */ |
2 | |
3 | #ifndef _ECPG_PREPROC_EXTERN_H |
4 | #define _ECPG_PREPROC_EXTERN_H |
5 | |
6 | #include "type.h" |
7 | |
8 | #include "common/keywords.h" |
9 | |
10 | #ifndef CHAR_BIT |
11 | #include <limits.h> |
12 | #endif |
13 | |
14 | /* defines */ |
15 | |
16 | #define STRUCT_DEPTH 128 |
17 | #define EMPTY mm_strdup("") |
18 | |
19 | /* variables */ |
20 | |
21 | extern bool autocommit, |
22 | auto_create_c, |
23 | system_includes, |
24 | force_indicator, |
25 | questionmarks, |
26 | regression_mode, |
27 | auto_prepare; |
28 | extern int braces_open, |
29 | ret_value, |
30 | struct_level, |
31 | ecpg_internal_var; |
32 | extern char *current_function; |
33 | extern char *descriptor_index; |
34 | extern char *descriptor_name; |
35 | extern char *connection; |
36 | extern char *input_filename; |
37 | extern char *base_yytext, |
38 | *token_start; |
39 | |
40 | #ifdef YYDEBUG |
41 | extern int base_yydebug; |
42 | #endif |
43 | extern int base_yylineno; |
44 | extern FILE *base_yyin, |
45 | *base_yyout; |
46 | extern char *output_filename; |
47 | |
48 | extern struct _include_path *include_paths; |
49 | extern struct cursor *cur; |
50 | extern struct typedefs *types; |
51 | extern struct _defines *defines; |
52 | extern struct ECPGtype ecpg_no_indicator; |
53 | extern struct variable no_indicator; |
54 | extern struct arguments *argsinsert; |
55 | extern struct arguments *argsresult; |
56 | extern struct when when_error, |
57 | when_nf, |
58 | when_warn; |
59 | extern struct ECPGstruct_member *struct_member_list[STRUCT_DEPTH]; |
60 | |
61 | /* Globals from keywords.c */ |
62 | extern const uint16 SQLScanKeywordTokens[]; |
63 | |
64 | /* functions */ |
65 | |
66 | extern const char *get_dtype(enum ECPGdtype); |
67 | extern void lex_init(void); |
68 | extern void output_line_number(void); |
69 | extern void output_statement(char *, int, enum ECPG_statement_type); |
70 | extern void output_prepare_statement(char *, char *); |
71 | extern void output_deallocate_prepare_statement(char *); |
72 | extern void output_simple_statement(char *, int); |
73 | extern char *hashline_number(void); |
74 | extern int base_yyparse(void); |
75 | extern int base_yylex(void); |
76 | extern void base_yyerror(const char *); |
77 | extern void *mm_alloc(size_t); |
78 | extern char *mm_strdup(const char *); |
79 | extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4); |
80 | extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn(); |
81 | extern void (char *); |
82 | extern void output_get_descr(char *, char *); |
83 | extern void (char *); |
84 | extern void output_set_descr(char *, char *); |
85 | extern void push_assignment(char *, enum ECPGdtype); |
86 | extern struct variable *find_variable(char *); |
87 | extern void whenever_action(int); |
88 | extern void add_descriptor(char *, char *); |
89 | extern void drop_descriptor(char *, char *); |
90 | extern struct descriptor *lookup_descriptor(char *, char *); |
91 | extern struct variable *descriptor_variable(const char *name, int input); |
92 | extern struct variable *sqlda_variable(const char *name); |
93 | extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *); |
94 | extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *); |
95 | extern void remove_variable_from_list(struct arguments **list, struct variable *var); |
96 | extern void dump_variables(struct arguments *, int); |
97 | extern struct typedefs *get_typedef(char *); |
98 | extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool); |
99 | extern void reset_variables(void); |
100 | extern void check_indicator(struct ECPGtype *); |
101 | extern void remove_typedefs(int); |
102 | extern void remove_variables(int); |
103 | extern struct variable *new_variable(const char *, struct ECPGtype *, int); |
104 | extern int ScanCKeywordLookup(const char *text); |
105 | extern int ScanECPGKeywordLookup(const char *text); |
106 | extern void parser_init(void); |
107 | extern int filtered_base_yylex(void); |
108 | |
109 | /* return codes */ |
110 | |
111 | #define ILLEGAL_OPTION 1 |
112 | #define NO_INCLUDE_FILE 2 |
113 | #define PARSE_ERROR 3 |
114 | #define INDICATOR_NOT_ARRAY 4 |
115 | #define OUT_OF_MEMORY 5 |
116 | #define INDICATOR_NOT_STRUCT 6 |
117 | #define INDICATOR_NOT_SIMPLE 7 |
118 | |
119 | enum COMPAT_MODE |
120 | { |
121 | ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE, ECPG_COMPAT_ORACLE |
122 | }; |
123 | extern enum COMPAT_MODE compat; |
124 | |
125 | #define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE) |
126 | #define ORACLE_MODE (compat == ECPG_COMPAT_ORACLE) |
127 | |
128 | |
129 | #endif /* _ECPG_PREPROC_EXTERN_H */ |
130 | |