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 ECPGtype ecpg_no_indicator;
51 extern struct variable no_indicator;
52 extern struct arguments *argsinsert;
53 extern struct arguments *argsresult;
54 extern struct when when_error,
55  when_nf,
56  when_warn;
58 
59 /* Globals from keywords.c */
60 extern const uint16 SQLScanKeywordTokens[];
61 
62 /* functions */
63 
64 extern const char *get_dtype(enum ECPGdtype);
65 extern void lex_init(void);
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 *, int);
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);
76 extern char *mm_strdup(const char *);
77 extern void mmerror(int errorcode, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
78 extern void mmfatal(int errorcode, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
79 extern void output_get_descr_header(char *);
80 extern void output_get_descr(char *, char *);
81 extern void output_set_descr_header(char *);
82 extern void output_set_descr(char *, char *);
83 extern void push_assignment(char *, enum ECPGdtype);
84 extern struct variable *find_variable(char *);
85 extern void whenever_action(int);
86 extern void add_descriptor(char *, char *);
87 extern void drop_descriptor(char *, char *);
88 extern struct descriptor *lookup_descriptor(char *, char *);
89 extern struct variable *descriptor_variable(const char *name, int input);
90 extern struct variable *sqlda_variable(const char *name);
91 extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *);
92 extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *);
93 extern void remove_variable_from_list(struct arguments **list, struct variable *var);
94 extern void dump_variables(struct arguments *, int);
95 extern struct typedefs *get_typedef(char *);
96 extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool);
97 extern void reset_variables(void);
98 extern void check_indicator(struct ECPGtype *);
99 extern void remove_typedefs(int);
100 extern void remove_variables(int);
101 extern struct variable *new_variable(const char *, struct ECPGtype *, int);
102 extern int ScanCKeywordLookup(const char *text);
103 extern int ScanECPGKeywordLookup(const char *text);
104 extern void parser_init(void);
105 extern int filtered_base_yylex(void);
106 
107 /* return codes */
108 
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
116 
118 {
120 };
121 extern enum COMPAT_MODE compat;
122 
123 #define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
124 #define ORACLE_MODE (compat == ECPG_COMPAT_ORACLE)
125 
126 
127 #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:340
errortype
Definition: type.h:192
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:264
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:173
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:203
Definition: type.h:153
void base_yyerror(const char *)
struct descriptor * lookup_descriptor(char *, char *)
Definition: descriptor.c:129
Definition: type.h:144
void drop_descriptor(char *, char *)
Definition: descriptor.c:99
Definition: type.h:17
#define pg_attribute_printf(f, a)
Definition: c.h:130
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:366
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:326
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:151
int base_yylineno
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:188
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:555
#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:170
char * input_filename
char * output_filename
Definition: ecpg.c:23
struct arguments * argsresult
Definition: variable.c:366
Definition: c.h:555
char * connection
struct arguments * argsinsert
Definition: variable.c:365
ECPGttype
Definition: ecpgtype.h:41
FILE * base_yyout