diff options
author | Marc G. Fournier <scrappy@hub.org> | 1998-08-25 12:17:27 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1998-08-25 12:17:27 +0000 |
commit | 35478b8028a2332a3e9c4da230091b031a65ed28 (patch) | |
tree | 63261b80336af1ff7abe4ef045ee503425f0118d /src/interfaces/ecpg/preproc/ecpg.c | |
parent | 32cfc4aa00f19750b1786430d5cffad5ec7887ac (diff) |
From: Michael Meskes <meskes@online-club.de>
+
+ Fri Aug 14 12:44:21 CEST 1998
+
+ - Added EXEC SQL DEFINE statement
+ - Set version to 2.4.0
+
+ Tue Aug 18 09:24:15 CEST 1998
+
+ - Removed keyword IS from DEFINE statement
+ - Added latest changes from gram.y
+ - Removed duplicate symbols from preproc.y
+ - Initialize sqlca structure
+ - Added check for connection to ecpglib
+ - Set version to 2.4.1
+
+ Thu Aug 20 15:31:29 CEST 1998
+
+ - Cleaned up memory allocation in ecpglib.c
+ - Set library version to 2.6
+
Diffstat (limited to 'src/interfaces/ecpg/preproc/ecpg.c')
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 1fe777845b7..3d8624b334a 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -22,7 +22,7 @@ extern char *optarg; #include "extern.h" struct _include_path *include_paths; -static int no_auto_trans = 0; +int no_auto_trans = 0; struct cursor *cur = NULL; static void @@ -138,10 +138,12 @@ main(int argc, char *const argv[]) else { struct cursor *ptr; + struct _defines *defptr; /* remove old cursor definitions if any are still there */ - for (ptr = cur; ptr != NULL; ptr=ptr->next) + for (ptr = cur; ptr != NULL;) { + struct cursor *this = ptr; struct arguments *l1, *l2; free(ptr->command); @@ -156,12 +158,25 @@ main(int argc, char *const argv[]) l2 = l1->next; free(l1); } + ptr = ptr->next; + free(this); } + + /* remove old defines as well */ + for (defptr = defines; defptr != NULL;) + { + struct _defines *this = defptr; + free(defptr->new); + free(defptr->old); + defptr = defptr->next; + free(this); + } + /* initialize lex */ lex_init(); /* we need two includes and a constant */ - fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n/*These two include files are added by the preprocessor */\n#include <ecpgtype.h>\n#include <ecpglib.h>\n\nconst int no_auto_trans = %d;\n\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL, no_auto_trans); + fprintf(yyout, "/* Processed by ecpg (%d.%d.%d) */\n/* These two include files are added by the preprocessor */\n#include <ecpgtype.h>\n#include <ecpglib.h>\n\n", MAJOR_VERSION, MINOR_VERSION, PATCHLEVEL); /* and parse the source */ yyparse(); |