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
17/*
18 * "Location tracking" support --- see ecpg.header for more comments.
19 */
20typedef const char *YYLTYPE;
21
22#define YYLTYPE_IS_DECLARED 1
23
24/* variables */
25
26extern bool autocommit,
33extern int braces_open,
37extern char *current_function;
38extern char *descriptor_name;
39extern char *connection;
40extern char *input_filename;
41extern char *base_yytext,
43
44#ifdef YYDEBUG
45extern int base_yydebug;
46#endif
47extern int base_yylineno;
48extern FILE *base_yyin,
50extern char *output_filename;
51
52extern struct _include_path *include_paths;
53extern struct cursor *cur;
54extern struct typedefs *types;
55extern struct _defines *defines;
56extern struct declared_list *g_declared_list;
57extern struct ECPGtype ecpg_no_indicator;
58extern struct variable no_indicator;
59extern struct arguments *argsinsert;
60extern struct arguments *argsresult;
61extern struct when when_error,
62 when_nf,
65
66/* Globals from keywords.c */
67extern const uint16 SQLScanKeywordTokens[];
68
69/* functions */
70
71extern const char *get_dtype(enum ECPGdtype);
72extern void lex_init(void);
73extern void output_line_number(void);
74extern void output_statement(const char *stmt, int whenever_mode, enum ECPG_statement_type st);
75extern void output_prepare_statement(const char *name, const char *stmt);
76extern void output_deallocate_prepare_statement(const char *name);
77extern void output_simple_statement(const char *stmt, int whenever_mode);
78extern char *hashline_number(void);
79extern int base_yyparse(void);
80extern int base_yylex(void);
81extern void base_yyerror(const char *error);
82extern void *mm_alloc(size_t size);
83extern char *mm_strdup(const char *string);
84extern void *loc_alloc(size_t size);
85extern char *loc_strdup(const char *string);
86extern void reclaim_local_storage(void);
87extern char *cat2_str(const char *str1, const char *str2);
88extern char *cat_str(int count,...);
89extern char *make2_str(const char *str1, const char *str2);
90extern char *make3_str(const char *str1, const char *str2, const char *str3);
91extern void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3, 4);
92extern void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2, 3) pg_attribute_noreturn();
93extern void output_get_descr_header(const char *desc_name);
94extern void output_get_descr(const char *desc_name, const char *index);
95extern void output_set_descr_header(const char *desc_name);
96extern void output_set_descr(const char *desc_name, const char *index);
97extern void push_assignment(const char *var, enum ECPGdtype value);
98extern struct variable *find_variable(const char *name);
99extern void whenever_action(int mode);
100extern void add_descriptor(const char *name, const char *connection);
101extern void drop_descriptor(const char *name, const char *connection);
102extern struct descriptor *lookup_descriptor(const char *name, const char *connection);
103extern struct variable *descriptor_variable(const char *name, int input);
104extern struct variable *sqlda_variable(const char *name);
105extern void add_variable_to_head(struct arguments **list,
106 struct variable *var,
107 struct variable *ind);
108extern void add_variable_to_tail(struct arguments **list,
109 struct variable *var,
110 struct variable *ind);
111extern void remove_variable_from_list(struct arguments **list, struct variable *var);
112extern void dump_variables(struct arguments *list, int mode);
113extern struct typedefs *get_typedef(const char *name, bool noerror);
114extern void adjust_array(enum ECPGttype type_enum, const char **dimension,
115 const char **length, const char *type_dimension,
116 const char *type_index, int pointer_len,
117 bool type_definition);
118extern void reset_variables(void);
119extern void check_indicator(struct ECPGtype *var);
120extern void remove_typedefs(int brace_level);
121extern void remove_variables(int brace_level);
122extern struct variable *new_variable(const char *name,
123 struct ECPGtype *type,
124 int brace_level);
125extern int ScanCKeywordLookup(const char *text);
126extern int ScanECPGKeywordLookup(const char *text);
127extern void parser_init(void);
128extern int filtered_base_yylex(void);
129
130/* return codes */
131
132#define ILLEGAL_OPTION 1
133#define NO_INCLUDE_FILE 2
134#define PARSE_ERROR 3
135#define INDICATOR_NOT_ARRAY 4
136#define OUT_OF_MEMORY 5
137#define INDICATOR_NOT_STRUCT 6
138#define INDICATOR_NOT_SIMPLE 7
139
141{
144extern enum COMPAT_MODE compat;
145
146#define INFORMIX_MODE (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
147#define ORACLE_MODE (compat == ECPG_COMPAT_ORACLE)
148
149
150#endif /* _ECPG_PREPROC_EXTERN_H */
#define pg_attribute_printf(f, a)
Definition: c.h:213
uint16_t uint16
Definition: c.h:487
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 @162 value
static PgChecksumMode mode
Definition: pg_checksums.c:55
void lex_init(void)
Definition: pgc.l:1616
void output_line_number(void)
Definition: output.c:10
struct descriptor * lookup_descriptor(const char *name, const char *connection)
Definition: descriptor.c:125
int braces_open
#define STRUCT_DEPTH
void * loc_alloc(size_t size)
Definition: util.c:138
struct _include_path * include_paths
Definition: ecpg.c:28
bool auto_prepare
char * output_filename
Definition: ecpg.c:24
struct variable * sqlda_variable(const char *name)
Definition: descriptor.c:345
void output_simple_statement(const char *stmt, int whenever_mode)
Definition: output.c:18
char * mm_strdup(const char *string)
Definition: util.c:97
bool regression_mode
void base_yyerror(const char *error)
struct variable * new_variable(const char *name, struct ECPGtype *type, int brace_level)
Definition: variable.c:10
void output_prepare_statement(const char *name, const char *stmt)
Definition: output.c:168
int base_yyparse(void)
int ScanCKeywordLookup(const char *text)
Definition: c_keywords.c:36
char * descriptor_name
const char * YYLTYPE
struct when when_error when_nf when_warn
Definition: output.c:30
const char * get_dtype(enum ECPGdtype)
Definition: type.c:672
char * connection
void output_set_descr(const char *desc_name, const char *index)
Definition: descriptor.c:269
void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3
@ ECPG_COMPAT_PGSQL
@ ECPG_COMPAT_ORACLE
@ ECPG_COMPAT_INFORMIX
@ ECPG_COMPAT_INFORMIX_SE
void whenever_action(int mode)
Definition: output.c:64
void add_descriptor(const char *name, const char *connection)
Definition: descriptor.c:75
void add_variable_to_tail(struct arguments **list, struct variable *var, struct variable *ind)
Definition: variable.c:413
int base_yylex(void)
struct variable no_indicator
void parser_init(void)
const uint16 SQLScanKeywordTokens[]
Definition: keywords.c:34
char * cat_str(int count,...)
Definition: util.c:220
void dump_variables(struct arguments *list, int mode)
Definition: variable.c:461
struct _defines * defines
Definition: ecpg.c:31
char * token_start
void adjust_array(enum ECPGttype type_enum, const char **dimension, const char **length, const char *type_dimension, const char *type_index, int pointer_len, bool type_definition)
Definition: variable.c:540
int ScanECPGKeywordLookup(const char *text)
Definition: ecpg_keywords.c:39
struct typedefs * get_typedef(const char *name, bool noerror)
Definition: variable.c:523
int ecpg_internal_var
void output_statement(const char *stmt, int whenever_mode, enum ECPG_statement_type st)
Definition: output.c:134
void reset_variables(void)
Definition: variable.c:378
char * hashline_number(void)
Definition: output.c:92
int base_yylineno
void remove_variables(int brace_level)
Definition: variable.c:298
char * cat2_str(const char *str1, const char *str2)
Definition: util.c:205
void push_assignment(const char *var, enum ECPGdtype value)
Definition: descriptor.c:21
char * input_filename
bool system_includes
bool autocommit
Definition: ecpg.c:15
struct arguments * argsresult
Definition: variable.c:375
void output_get_descr_header(const char *desc_name)
Definition: descriptor.c:156
void * mm_alloc(size_t size)
Definition: util.c:85
char * current_function
void remove_variable_from_list(struct arguments **list, struct variable *var)
Definition: variable.c:431
void void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2
void void pg_attribute_noreturn()
struct typedefs * types
Definition: ecpg.c:30
enum COMPAT_MODE compat
Definition: ecpg.c:26
int struct_level
struct ECPGstruct_member * struct_member_list[STRUCT_DEPTH]
int ret_value
void drop_descriptor(const char *name, const char *connection)
Definition: descriptor.c:94
bool auto_create_c
char * make3_str(const char *str1, const char *str2, const char *str3)
Definition: util.c:256
void add_variable_to_head(struct arguments **list, struct variable *var, struct variable *ind)
Definition: variable.c:401
struct ECPGtype ecpg_no_indicator
struct arguments * argsinsert
Definition: variable.c:374
void reclaim_local_storage(void)
Definition: util.c:182
void output_get_descr(const char *desc_name, const char *index)
Definition: descriptor.c:175
bool force_indicator
FILE * base_yyin
void remove_typedefs(int brace_level)
Definition: variable.c:264
void check_indicator(struct ECPGtype *var)
Definition: variable.c:490
struct variable * descriptor_variable(const char *name, int input)
Definition: descriptor.c:331
struct variable * find_variable(const char *name)
Definition: variable.c:193
void output_set_descr_header(const char *desc_name)
Definition: descriptor.c:208
char * base_yytext
FILE * base_yyout
char * loc_strdup(const char *string)
Definition: util.c:170
struct declared_list * g_declared_list
Definition: ecpg.c:32
bool questionmarks
char * make2_str(const char *str1, const char *str2)
Definition: util.c:243
struct cursor * cur
Definition: ecpg.c:29
int filtered_base_yylex(void)
Definition: parser.c:57
void output_deallocate_prepare_statement(const char *name)
Definition: output.c:179
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:180
Definition: type.h:138
Definition: type.h:96
Definition: type.h:159
Definition: c.h:644
Definition: type.h:89
errortype
Definition: type.h:219
const char * type
const char * name