PostgreSQL Source Code  git master
preproc_extern.h
Go to the documentation of this file.
1 /* src/interfaces/ecpg/preproc/preproc_extern.h */
2 
3 #ifndef _ECPG_PREPROC_EXTERN_H
4 #define _ECPG_PREPROC_EXTERN_H
5 
6 #include "common/keywords.h"
7 #include "type.h"
8 
9 #ifndef CHAR_BIT
10 #include <limits.h>
11 #endif
12 
13 /* defines */
14 
15 #define STRUCT_DEPTH 128
16 #define EMPTY mm_strdup("")
17 
18 /* variables */
19 
20 extern bool autocommit,
27 extern int braces_open,
28  ret_value,
31 extern char *current_function;
32 extern char *descriptor_name;
33 extern char *connection;
34 extern char *input_filename;
35 extern char *base_yytext,
36  *token_start;
37 
38 #ifdef YYDEBUG
39 extern int base_yydebug;
40 #endif
41 extern int base_yylineno;
42 extern FILE *base_yyin,
43  *base_yyout;
44 extern char *output_filename;
45 
46 extern struct _include_path *include_paths;
47 extern struct cursor *cur;
48 extern struct typedefs *types;
49 extern struct _defines *defines;
50 extern struct declared_list *g_declared_list;
51 extern struct ECPGtype ecpg_no_indicator;
52 extern struct variable no_indicator;
53 extern struct arguments *argsinsert;
54 extern struct arguments *argsresult;
55 extern struct when when_error,
56  when_nf,
57  when_warn;
59 
60 /* Globals from keywords.c */
61 extern const uint16 SQLScanKeywordTokens[];
62 
63 /* functions */
64 
65 extern const char *get_dtype(enum ECPGdtype);
66 extern void lex_init(void);
67 extern void output_line_number(void);
68 extern void output_statement(char *, int, enum ECPG_statement_type);
69 extern void output_prepare_statement(char *, char *);
70 extern void output_deallocate_prepare_statement(char *);
71 extern void output_simple_statement(char *, int);
72 extern char *hashline_number(void);
73 extern int base_yyparse(void);
74 extern int base_yylex(void);
75 extern void base_yyerror(const char *);
76 extern void *mm_alloc(size_t);
77 extern char *mm_strdup(const char *);
78 extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
79 extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
80 extern void output_get_descr_header(char *);
81 extern void output_get_descr(char *, char *);
82 extern void output_set_descr_header(char *);
83 extern void output_set_descr(char *, char *);
84 extern void push_assignment(char *, enum ECPGdtype);
85 extern struct variable *find_variable(char *);
86 extern void whenever_action(int);
87 extern void add_descriptor(char *, char *);
88 extern void drop_descriptor(char *, char *);
89 extern struct descriptor *lookup_descriptor(char *, char *);
90 extern struct variable *descriptor_variable(const char *name, int input);
91 extern struct variable *sqlda_variable(const char *name);
92 extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *);
93 extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *);
94 extern void remove_variable_from_list(struct arguments **list, struct variable *var);
95 extern void dump_variables(struct arguments *, int);
96 extern struct typedefs *get_typedef(char *);
97 extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool);
98 extern void reset_variables(void);
99 extern void check_indicator(struct ECPGtype *);
100 extern void remove_typedefs(int);
101 extern void remove_variables(int);
102 extern struct variable *new_variable(const char *, struct ECPGtype *, int);
103 extern int ScanCKeywordLookup(const char *text);
104 extern int ScanECPGKeywordLookup(const char *text);
105 extern void parser_init(void);
106 extern int filtered_base_yylex(void);
107 
108 /* return codes */
109 
110 #define ILLEGAL_OPTION 1
111 #define NO_INCLUDE_FILE 2
112 #define PARSE_ERROR 3
113 #define INDICATOR_NOT_ARRAY 4
114 #define OUT_OF_MEMORY 5
115 #define INDICATOR_NOT_STRUCT 6
116 #define INDICATOR_NOT_SIMPLE 7
117 
119 {
121 };
122 extern enum COMPAT_MODE compat;
123 
124 #define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
125 #define ORACLE_MODE (compat == ECPG_COMPAT_ORACLE)
126 
127 
128 #endif /* _ECPG_PREPROC_EXTERN_H */
struct _include_path * include_paths
Definition: ecpg.c:27
bool regression_mode
Definition: ecpg.c:20
struct variable * sqlda_variable(const char *name)
Definition: descriptor.c:352
errortype
Definition: type.h:199
COMPAT_MODE
void remove_variables(int)
Definition: variable.c:295
void output_simple_statement(char *, int)
Definition: output.c:19
struct ECPGstruct_member * struct_member_list[STRUCT_DEPTH]
static void error(void)
Definition: sql-dyntest.c:147
void void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2
void output_set_descr(char *, char *)
Definition: descriptor.c:276
struct variable * new_variable(const char *, struct ECPGtype *, int)
Definition: variable.c:10
void whenever_action(int)
Definition: output.c:66
void add_variable_to_tail(struct arguments **, struct variable *, struct variable *)
Definition: variable.c:391
void output_prepare_statement(char *, char *)
Definition: output.c:170
int struct_level
enum COMPAT_MODE compat
Definition: ecpg.c:25
bool force_indicator
Definition: ecpg.c:18
struct cursor * cur
Definition: ecpg.c:28
FILE * base_yyin
void check_indicator(struct ECPGtype *)
Definition: variable.c:467
void output_statement(char *, int, enum ECPG_statement_type)
Definition: output.c:136
void add_variable_to_head(struct arguments **, struct variable *, struct variable *)
Definition: variable.c:379
struct typedefs * get_typedef(char *)
Definition: variable.c:500
void output_set_descr_header(char *)
Definition: descriptor.c:215
Definition: type.h:160
void base_yyerror(const char *)
struct descriptor * lookup_descriptor(char *, char *)
Definition: descriptor.c:132
Definition: type.h:151
void drop_descriptor(char *, char *)
Definition: descriptor.c:99
Definition: type.h:17
#define pg_attribute_printf(f, a)
Definition: c.h:164
struct _defines * defines
Definition: ecpg.c:30
char * mm_strdup(const char *)
Definition: type.c:25
void void pg_attribute_noreturn()
void lex_init(void)
bool system_includes
Definition: ecpg.c:17
void reset_variables(void)
Definition: variable.c:369
ECPG_statement_type
Definition: ecpgtype.h:95
struct ECPGtype ecpg_no_indicator
char * base_yytext
const uint16 SQLScanKeywordTokens[]
Definition: keywords.c:34
int ret_value
Definition: ecpg.c:14
unsigned short uint16
Definition: c.h:440
void remove_variable_from_list(struct arguments **list, struct variable *var)
Definition: variable.c:409
struct variable * descriptor_variable(const char *name, int input)
Definition: descriptor.c:338
void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool)
Definition: variable.c:512
const char * get_dtype(enum ECPGdtype)
Definition: type.c:693
int base_yylex(void)
void add_descriptor(char *, char *)
Definition: descriptor.c:76
void remove_typedefs(int)
Definition: variable.c:261
bool autocommit
Definition: ecpg.c:15
int braces_open
int ScanCKeywordLookup(const char *text)
Definition: c_keywords.c:36
int ScanECPGKeywordLookup(const char *text)
Definition: ecpg_keywords.c:39
char * descriptor_name
char * hashline_number(void)
Definition: output.c:94
void dump_variables(struct arguments *, int)
Definition: variable.c:438
Definition: type.h:130
Definition: type.h:82
void push_assignment(char *, enum ECPGdtype)
Definition: descriptor.c:21
bool auto_prepare
Definition: ecpg.c:21
void parser_init(void)
struct variable * find_variable(char *)
Definition: variable.c:194
void output_get_descr_header(char *)
Definition: descriptor.c:163
int base_yylineno
struct declared_list * g_declared_list
Definition: ecpg.c:31
int ecpg_internal_var
void output_line_number(void)
Definition: output.c:10
ECPGdtype
Definition: ecpgtype.h:71
struct typedefs * types
Definition: ecpg.c:29
void output_deallocate_prepare_statement(char *)
Definition: output.c:182
char * token_start
char * current_function
bool auto_create_c
Definition: ecpg.c:16
bool questionmarks
Definition: ecpg.c:19
struct variable no_indicator
void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3
const char * name
Definition: encode.c:561
#define STRUCT_DEPTH
struct when when_error when_nf when_warn
Definition: output.c:32
int base_yyparse(void)
void * mm_alloc(size_t)
Definition: type.c:13
int filtered_base_yylex(void)
Definition: parser.c:56
void output_get_descr(char *, char *)
Definition: descriptor.c:182
char * input_filename
char * output_filename
Definition: ecpg.c:23
struct arguments * argsresult
Definition: variable.c:366
Definition: c.h:621
char * connection
struct arguments * argsinsert
Definition: variable.c:365
ECPGttype
Definition: ecpgtype.h:41
FILE * base_yyout