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,
31 extern char *current_function;
32 extern char *descriptor_name;
33 extern char *connection;
34 extern char *input_filename;
35 extern char *base_yytext,
37 
38 #ifdef YYDEBUG
39 extern int base_yydebug;
40 #endif
41 extern int base_yylineno;
42 extern FILE *base_yyin,
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 *stmt, int whenever_mode, enum ECPG_statement_type st);
69 extern void output_prepare_statement(char *name, char *stmt);
70 extern void output_deallocate_prepare_statement(char *name);
71 extern void output_simple_statement(char *stmt, int whenever_mode);
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 *error);
76 extern void *mm_alloc(size_t size);
77 extern char *mm_strdup(const char *string);
78 extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
79 extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
80 extern void output_get_descr_header(char *desc_name);
81 extern void output_get_descr(char *desc_name, char *index);
82 extern void output_set_descr_header(char *desc_name);
83 extern void output_set_descr(char *desc_name, char *index);
84 extern void push_assignment(char *var, enum ECPGdtype value);
85 extern struct variable *find_variable(char *name);
86 extern void whenever_action(int mode);
87 extern void add_descriptor(char *name, char *connection);
88 extern void drop_descriptor(char *name, char *connection);
89 extern struct descriptor *lookup_descriptor(char *name, char *connection);
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 **list,
93  struct variable *var,
94  struct variable *ind);
95 extern void add_variable_to_tail(struct arguments **list,
96  struct variable *var,
97  struct variable *ind);
98 extern void remove_variable_from_list(struct arguments **list, struct variable *var);
99 extern void dump_variables(struct arguments *list, int mode);
100 extern struct typedefs *get_typedef(const char *name, bool noerror);
101 extern void adjust_array(enum ECPGttype type_enum, char **dimension,
102  char **length, char *type_dimension,
103  char *type_index, int pointer_len,
104  bool type_definition);
105 extern void reset_variables(void);
106 extern void check_indicator(struct ECPGtype *var);
107 extern void remove_typedefs(int brace_level);
108 extern void remove_variables(int brace_level);
109 extern struct variable *new_variable(const char *name,
110  struct ECPGtype *type,
111  int brace_level);
112 extern int ScanCKeywordLookup(const char *text);
113 extern int ScanECPGKeywordLookup(const char *text);
114 extern void parser_init(void);
115 extern int filtered_base_yylex(void);
116 
117 /* return codes */
118 
119 #define ILLEGAL_OPTION 1
120 #define NO_INCLUDE_FILE 2
121 #define PARSE_ERROR 3
122 #define INDICATOR_NOT_ARRAY 4
123 #define OUT_OF_MEMORY 5
124 #define INDICATOR_NOT_STRUCT 6
125 #define INDICATOR_NOT_SIMPLE 7
126 
128 {
130 };
131 extern enum COMPAT_MODE compat;
132 
133 #define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
134 #define ORACLE_MODE (compat == ECPG_COMPAT_ORACLE)
135 
136 
137 #endif /* _ECPG_PREPROC_EXTERN_H */
unsigned short uint16
Definition: c.h:508
#define pg_attribute_printf(f, a)
Definition: c.h:194
COMPAT_MODE
ECPG_statement_type
Definition: ecpgtype.h:96
ECPGttype
Definition: ecpgtype.h:42
ECPGdtype
Definition: ecpgtype.h:72
#define stmt
Definition: indent_codes.h:59
FILE * input
static struct @157 value
static PgChecksumMode mode
Definition: pg_checksums.c:56
void lex_init(void)
void output_line_number(void)
Definition: output.c:10
int braces_open
#define STRUCT_DEPTH
struct _include_path * include_paths
Definition: ecpg.c:27
bool auto_prepare
char * output_filename
Definition: ecpg.c:23
bool regression_mode
void base_yyerror(const char *error)
int base_yyparse(void)
int ScanCKeywordLookup(const char *text)
Definition: c_keywords.c:36
char * descriptor_name
struct when when_error when_nf when_warn
Definition: output.c:32
char * connection
void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3
struct variable * descriptor_variable(const char *name, int input)
Definition: descriptor.c:337
struct variable * find_variable(char *name)
Definition: variable.c:193
void push_assignment(char *var, enum ECPGdtype value)
Definition: descriptor.c:21
@ ECPG_COMPAT_PGSQL
@ ECPG_COMPAT_ORACLE
@ ECPG_COMPAT_INFORMIX
@ ECPG_COMPAT_INFORMIX_SE
void whenever_action(int mode)
Definition: output.c:66
void add_variable_to_tail(struct arguments **list, struct variable *var, struct variable *ind)
Definition: variable.c:390
int base_yylex(void)
struct variable no_indicator
void output_set_descr(char *desc_name, char *index)
Definition: descriptor.c:275
void parser_init(void)
const uint16 SQLScanKeywordTokens[]
Definition: keywords.c:34
char * mm_strdup(const char *string)
Definition: type.c:25
void add_descriptor(char *name, char *connection)
Definition: descriptor.c:76
void dump_variables(struct arguments *list, int mode)
Definition: variable.c:437
struct _defines * defines
Definition: ecpg.c:30
char * token_start
void adjust_array(enum ECPGttype type_enum, char **dimension, char **length, char *type_dimension, char *type_index, int pointer_len, bool type_definition)
Definition: variable.c:516
void output_prepare_statement(char *name, char *stmt)
Definition: output.c:170
int ScanECPGKeywordLookup(const char *text)
Definition: ecpg_keywords.c:39
void output_simple_statement(char *stmt, int whenever_mode)
Definition: output.c:19
int ecpg_internal_var
void reset_variables(void)
Definition: variable.c:368
int base_yylineno
void remove_variables(int brace_level)
Definition: variable.c:294
void output_get_descr_header(char *desc_name)
Definition: descriptor.c:162
void output_statement(char *stmt, int whenever_mode, enum ECPG_statement_type st)
Definition: output.c:136
void output_get_descr(char *desc_name, char *index)
Definition: descriptor.c:181
char * input_filename
bool system_includes
bool autocommit
Definition: ecpg.c:15
struct arguments * argsresult
Definition: variable.c:365
char * current_function
void remove_variable_from_list(struct arguments **list, struct variable *var)
Definition: variable.c:408
void void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2
void void pg_attribute_noreturn()
struct typedefs * types
Definition: ecpg.c:29
enum COMPAT_MODE compat
Definition: ecpg.c:25
int struct_level
const char * get_dtype(enum ECPGdtype)
Definition: type.c:693
struct ECPGstruct_member * struct_member_list[STRUCT_DEPTH]
void output_deallocate_prepare_statement(char *name)
Definition: output.c:182
int ret_value
void drop_descriptor(char *name, char *connection)
Definition: descriptor.c:99
bool auto_create_c
void add_variable_to_head(struct arguments **list, struct variable *var, struct variable *ind)
Definition: variable.c:378
struct ECPGtype ecpg_no_indicator
struct arguments * argsinsert
Definition: variable.c:364
bool force_indicator
struct typedefs * get_typedef(const char *name, bool noerror)
Definition: variable.c:499
FILE * base_yyin
void remove_typedefs(int brace_level)
Definition: variable.c:260
void check_indicator(struct ECPGtype *var)
Definition: variable.c:466
struct variable * new_variable(const char *name, struct ECPGtype *type, int brace_level)
Definition: variable.c:10
char * base_yytext
FILE * base_yyout
struct declared_list * g_declared_list
Definition: ecpg.c:31
bool questionmarks
struct variable * sqlda_variable(const char *name)
Definition: descriptor.c:351
void output_set_descr_header(char *desc_name)
Definition: descriptor.c:214
char * hashline_number(void)
Definition: output.c:94
struct cursor * cur
Definition: ecpg.c:28
int filtered_base_yylex(void)
Definition: parser.c:56
void * mm_alloc(size_t size)
Definition: type.c:13
struct descriptor * lookup_descriptor(char *name, char *connection)
Definition: descriptor.c:131
static pg_noinline void Size size
Definition: slab.c:607
static void error(void)
Definition: sql-dyntest.c:147
Definition: type.h:18
Definition: type.h:179
Definition: type.h:137
Definition: type.h:95
Definition: type.h:158
Definition: c.h:690
Definition: type.h:88
errortype
Definition: type.h:218
const char * type
const char * name