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