Skip to content

Commit d03a067

Browse files
author
Michael Meskes
committed
ecpg now recognizes named structs/unions. So you don't have to list the whole definition everytime you declare a variable anymore.
1 parent 0b5b3e9 commit d03a067

File tree

10 files changed

+264
-114
lines changed

10 files changed

+264
-114
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,10 @@ Tue May 20 11:47:00 CEST 2003
14321432
- Reversed my fix for ifdef. It was the example, not ecpg which was
14331433
incorrect.
14341434
- Changed DBPATH variable to PG_DBPATH.
1435+
1436+
Thu May 22 09:33:54 CEST 2003
1437+
1438+
- ecpg now recognizes named struct/union usage.
14351439
- Set ecpg version to 2.12.0.
14361440
- Set ecpg library to 3.4.2.
14371441
- Set pgtypes library to 1.0.0

src/interfaces/ecpg/preproc/descriptor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ output_get_descr(char *desc_name, char *index)
192192
break;
193193
}
194194
fprintf(yyout, "%s,", get_dtype(results->value));
195-
ECPGdump_a_type(yyout, v->name, v->type, NULL, NULL, NULL, NULL, make_str("0"), NULL, NULL);
195+
ECPGdump_a_type(yyout, v->name, v->type, NULL, NULL, NULL, NULL, NULL, NULL, make_str("0"), NULL, NULL);
196196
}
197197
drop_assignments();
198198
fputs("ECPGd_EODT);\n", yyout);

src/interfaces/ecpg/preproc/extern.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ extern void add_descriptor(char *, char *);
7373
extern void drop_descriptor(char *, char *);
7474
extern struct descriptor *lookup_descriptor(char *, char *);
7575
extern struct variable *descriptor_variable(const char *name, int input);
76-
extern void add_variable(struct arguments **, struct variable *, struct variable *);
77-
extern void append_variable(struct arguments **, struct variable *, struct variable *);
76+
extern void add_variable(struct arguments **, struct variable *, char *i, struct variable *, char *);
77+
extern void append_variable(struct arguments **, struct variable *, char *, struct variable *, char *);
7878
extern void dump_variables(struct arguments *, int);
7979
extern struct typedefs *get_typedef(char *);
8080
extern void adjust_array(enum ECPGttype, char **, char **, char *, char *, int);

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.109 2003/05/20 11:05:27 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.110 2003/05/22 07:58:41 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -434,20 +434,6 @@ cppline {space}*#(.*\\{space})+.*
434434
else
435435
return yytext[0];
436436
}
437-
<C>{informix_special}{struct} {
438-
/* are we simulating Informix? */
439-
if (compat == ECPG_COMPAT_INFORMIX)
440-
{
441-
string_unput("typedef struct ");
442-
BEGIN SQL;
443-
return SQL_START;
444-
}
445-
else
446-
{
447-
string_unput("struct ");
448-
return S_ANYTHING;
449-
}
450-
}
451437
<SQL>{self} { /*
452438
* We may find a ';' inside a structure
453439
* definition in a TYPE or VAR statement.
@@ -905,7 +891,7 @@ cppline {space}*#(.*\\{space})+.*
905891

906892
<xskip>{other} { /* ignore */ }
907893

908-
<xcond>{identifier}{space}*';' {
894+
<xcond>{identifier}{space}*";" {
909895
if ( preproc_tos >= MAX_NESTED_IF-1 ) {
910896
mmerror(PARSE_ERROR, ET_FATAL, "Too many nested 'EXEC SQL IFDEF' conditions");
911897
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy