Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / interfaces / ecpg / preproc / extern.h
blobbd6699a7bc76aa213f3d9855ee63c4829b66d24a
1 /* $PostgreSQL$ */
3 #ifndef _ECPG_PREPROC_EXTERN_H
4 #define _ECPG_PREPROC_EXTERN_H
6 #include "type.h"
7 #include "parser/keywords.h"
9 #include <errno.h>
10 #ifndef CHAR_BIT
11 #include <limits.h>
12 #endif
14 /* defines */
16 #define STRUCT_DEPTH 128
17 #define EMPTY make_str("")
19 /* variables */
21 extern int braces_open,
22 autocommit,
23 auto_create_c,
24 system_includes,
25 force_indicator,
26 questionmarks,
27 ret_value,
28 struct_level,
29 ecpg_informix_var,
30 regression_mode,
31 auto_prepare;
32 extern char *descriptor_index;
33 extern char *descriptor_name;
34 extern char *connection;
35 extern char *input_filename;
36 extern char *yytext,
37 *token_start;
39 #ifdef YYDEBUG
40 extern int yydebug;
41 #endif
42 extern int yylineno,
43 yyleng;
44 extern FILE *yyin,
45 *yyout;
46 extern char *output_filename;
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];
61 /* functions */
63 extern const char *get_dtype(enum ECPGdtype);
64 extern void lex_init(void);
65 extern char *make_str(const char *);
66 extern void output_line_number(void);
67 extern void output_statement(char *, int, enum ECPG_statement_type);
68 extern void output_prepare_statement(char *, char *);
69 extern void output_deallocate_prepare_statement(char *);
70 extern void output_simple_statement(char *);
71 extern char *hashline_number(void);
72 extern int base_yyparse(void);
73 extern int base_yylex(void);
74 extern void base_yyerror(const char *);
75 extern void *mm_alloc(size_t), *mm_realloc(void *, size_t);
76 extern char *mm_strdup(const char *);
77 extern void mmerror(int, enum errortype, char *,...);
78 extern void output_get_descr_header(char *);
79 extern void output_get_descr(char *, char *);
80 extern void output_set_descr_header(char *);
81 extern void output_set_descr(char *, char *);
82 extern void push_assignment(char *, enum ECPGdtype);
83 extern struct variable *find_variable(char *);
84 extern void whenever_action(int);
85 extern void add_descriptor(char *, char *);
86 extern void drop_descriptor(char *, char *);
87 extern struct descriptor *lookup_descriptor(char *, char *);
88 extern struct variable *descriptor_variable(const char *name, int input);
89 extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *);
90 extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *);
91 extern void dump_variables(struct arguments *, int);
92 extern struct typedefs *get_typedef(char *);
93 extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool);
94 extern void reset_variables(void);
95 extern void check_indicator(struct ECPGtype *);
96 extern void remove_typedefs(int);
97 extern void remove_variables(int);
98 extern struct variable *new_variable(const char *, struct ECPGtype *, int);
99 extern const ScanKeyword *ScanCKeywordLookup(const char *);
100 extern const ScanKeyword *ScanECPGKeywordLookup(const char *text);
101 extern const ScanKeyword *DoLookup(const char *, const ScanKeyword *, const ScanKeyword *);
102 extern void scanner_init(const char *);
103 extern void parser_init(void);
104 extern void scanner_finish(void);
105 extern int filtered_base_yylex(void);
107 /* return codes */
109 #define ILLEGAL_OPTION 1
110 #define NO_INCLUDE_FILE 2
111 #define PARSE_ERROR 3
112 #define INDICATOR_NOT_ARRAY 4
113 #define OUT_OF_MEMORY 5
114 #define INDICATOR_NOT_STRUCT 6
115 #define INDICATOR_NOT_SIMPLE 7
117 enum COMPAT_MODE
119 ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE
121 extern enum COMPAT_MODE compat;
123 #define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
125 #endif /* _ECPG_PREPROC_EXTERN_H */