]> granicus.if.org Git - postgresql/blob - src/interfaces/ecpg/preproc/extern.h
This one cleans the cursor problems ecpg had so far. It is now able
[postgresql] / src / interfaces / ecpg / preproc / extern.h
1 #include "parser/keywords.h"
2 #include <errno.h>
3
4 /* variables */
5
6 extern int  braces_open;
7 extern char *yytext;
8 extern int      yylineno,
9                         yyleng;
10 extern FILE *yyin,
11                    *yyout;
12
13 struct _include_path {  char * path;
14                         struct _include_path * next;
15                      };
16
17 extern struct _include_path *include_paths;
18
19 struct cursor { char *name;
20                 char *command;
21                 struct arguments * argsinsert;
22                 struct arguments * argsresult;
23                 struct cursor *next;
24               };
25                                            
26 extern struct cursor *cur;
27
28 /* This is a linked list of the variable names and types. */
29 struct variable
30 {
31     char * name;
32     struct ECPGtype * type;
33     int brace_level;
34     struct variable * next;
35 };
36                 
37 extern struct ECPGtype ecpg_no_indicator;
38 extern struct variable no_indicator;
39
40 struct arguments {
41     struct variable * variable;
42     struct variable * indicator;
43     struct arguments * next;
44 };
45
46 extern struct arguments * argsinsert;
47 extern struct arguments * argsresult;
48
49 /* functions */
50
51 extern void lex_init(void);
52 extern char *input_filename;
53 extern int      yyparse(void);
54 extern void *mm_alloc(size_t), *mm_realloc(void *, size_t);
55 ScanKeyword * ScanECPGKeywordLookup(char *);
56 ScanKeyword * ScanCKeywordLookup(char *);
57 extern void yyerror(char *);
58
59 /* return codes */
60
61 #define OK              0
62 #define PARSE_ERROR     -1
63 #define ILLEGAL_OPTION  -2
64
65 #define NO_INCLUDE_FILE ENOENT
66 #define OUT_OF_MEMORY   ENOMEM