Header And Logo

PostgreSQL
| The world's most advanced open source database.

extern.h

Go to the documentation of this file.
00001 /* src/interfaces/ecpg/preproc/extern.h */
00002 
00003 #ifndef _ECPG_PREPROC_EXTERN_H
00004 #define _ECPG_PREPROC_EXTERN_H
00005 
00006 #include "type.h"
00007 #include "parser/keywords.h"
00008 
00009 #include <errno.h>
00010 #ifndef CHAR_BIT
00011 #include <limits.h>
00012 #endif
00013 
00014 /* defines */
00015 
00016 #define STRUCT_DEPTH 128
00017 #define EMPTY mm_strdup("")
00018 
00019 /* variables */
00020 
00021 extern bool autocommit,
00022             auto_create_c,
00023             system_includes,
00024             force_indicator,
00025             questionmarks,
00026             regression_mode,
00027             auto_prepare;
00028 extern int  braces_open,
00029             ret_value,
00030             struct_level,
00031             ecpg_internal_var;
00032 extern char *current_function;
00033 extern char *descriptor_index;
00034 extern char *descriptor_name;
00035 extern char *connection;
00036 extern char *input_filename;
00037 extern char *yytext,
00038            *token_start;
00039 
00040 #ifdef YYDEBUG
00041 extern int  yydebug;
00042 #endif
00043 extern int  yylineno;
00044 extern FILE *yyin,
00045            *yyout;
00046 extern char *output_filename;
00047 
00048 extern struct _include_path *include_paths;
00049 extern struct cursor *cur;
00050 extern struct typedefs *types;
00051 extern struct _defines *defines;
00052 extern struct ECPGtype ecpg_no_indicator;
00053 extern struct variable no_indicator;
00054 extern struct arguments *argsinsert;
00055 extern struct arguments *argsresult;
00056 extern struct when when_error,
00057             when_nf,
00058             when_warn;
00059 extern struct ECPGstruct_member *struct_member_list[STRUCT_DEPTH];
00060 
00061 /* functions */
00062 
00063 extern const char *get_dtype(enum ECPGdtype);
00064 extern void lex_init(void);
00065 extern void output_line_number(void);
00066 extern void output_statement(char *, int, enum ECPG_statement_type);
00067 extern void output_prepare_statement(char *, char *);
00068 extern void output_deallocate_prepare_statement(char *);
00069 extern void output_simple_statement(char *);
00070 extern char *hashline_number(void);
00071 extern int  base_yyparse(void);
00072 extern int  base_yylex(void);
00073 extern void base_yyerror(const char *);
00074 extern void *mm_alloc(size_t), *mm_realloc(void *, size_t);
00075 extern char *mm_strdup(const char *);
00076 extern void
00077 mmerror(int, enum errortype, const char *,...)
00078 /* This extension allows gcc to check the format string */
00079 __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));
00080 extern void output_get_descr_header(char *);
00081 extern void output_get_descr(char *, char *);
00082 extern void output_set_descr_header(char *);
00083 extern void output_set_descr(char *, char *);
00084 extern void push_assignment(char *, enum ECPGdtype);
00085 extern struct variable *find_variable(char *);
00086 extern void whenever_action(int);
00087 extern void add_descriptor(char *, char *);
00088 extern void drop_descriptor(char *, char *);
00089 extern struct descriptor *lookup_descriptor(char *, char *);
00090 extern struct variable *descriptor_variable(const char *name, int input);
00091 extern struct variable *sqlda_variable(const char *name);
00092 extern void add_variable_to_head(struct arguments **, struct variable *, struct variable *);
00093 extern void add_variable_to_tail(struct arguments **, struct variable *, struct variable *);
00094 extern void remove_variable_from_list(struct arguments ** list, struct variable * var);
00095 extern void dump_variables(struct arguments *, int);
00096 extern struct typedefs *get_typedef(char *);
00097 extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int, bool);
00098 extern void reset_variables(void);
00099 extern void check_indicator(struct ECPGtype *);
00100 extern void remove_typedefs(int);
00101 extern void remove_variables(int);
00102 extern struct variable *new_variable(const char *, struct ECPGtype *, int);
00103 extern const ScanKeyword *ScanCKeywordLookup(const char *);
00104 extern const ScanKeyword *ScanECPGKeywordLookup(const char *text);
00105 extern void scanner_init(const char *);
00106 extern void parser_init(void);
00107 extern void scanner_finish(void);
00108 extern int  filtered_base_yylex(void);
00109 
00110 /* return codes */
00111 
00112 #define ILLEGAL_OPTION      1
00113 #define NO_INCLUDE_FILE     2
00114 #define PARSE_ERROR         3
00115 #define INDICATOR_NOT_ARRAY 4
00116 #define OUT_OF_MEMORY       5
00117 #define INDICATOR_NOT_STRUCT    6
00118 #define INDICATOR_NOT_SIMPLE    7
00119 
00120 enum COMPAT_MODE
00121 {
00122     ECPG_COMPAT_PGSQL = 0, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE
00123 };
00124 extern enum COMPAT_MODE compat;
00125 
00126 #define INFORMIX_MODE   (compat == ECPG_COMPAT_INFORMIX || compat == ECPG_COMPAT_INFORMIX_SE)
00127 
00128 #endif   /* _ECPG_PREPROC_EXTERN_H */