summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/descriptor.c
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2010-01-05 16:38:23 +0000
committerMichael Meskes <meskes@postgresql.org>2010-01-05 16:38:23 +0000
commit6d4a351fcbb780b89c638f48b81ab34d92c00ba8 (patch)
treea69e6cbb44eab6f6435dffde29637338d4d6be1b /src/interfaces/ecpg/preproc/descriptor.c
parentaf322a8a3ef28d9b0425238353a8bffa94bfaa47 (diff)
Applied patch by Boszormenyi Zoltan <zb@cybertec.at> to add sqlda support to
ecpg in both native and compatiblity mode.
Diffstat (limited to 'src/interfaces/ecpg/preproc/descriptor.c')
-rw-r--r--src/interfaces/ecpg/preproc/descriptor.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/descriptor.c b/src/interfaces/ecpg/preproc/descriptor.c
index 4c1ab42b9d8..983c8cf414a 100644
--- a/src/interfaces/ecpg/preproc/descriptor.c
+++ b/src/interfaces/ecpg/preproc/descriptor.c
@@ -1,7 +1,7 @@
/*
* functions needed for descriptor handling
*
- * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.28 2009/01/23 12:43:32 petere Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/descriptor.c,v 1.29 2010/01/05 16:38:23 meskes Exp $
*
* since descriptor might be either a string constant or a string var
* we need to check for a constant if we expect a constant
@@ -326,3 +326,22 @@ descriptor_variable(const char *name, int input)
strlcpy(descriptor_names[input], name, sizeof(descriptor_names[input]));
return (struct variable *) & varspace[input];
}
+
+struct variable *
+sqlda_variable(const char *name)
+{
+ struct variable *p = (struct variable *) mm_alloc(sizeof(struct variable));
+
+ p->name = mm_strdup(name);
+ p->type = (struct ECPGtype *) mm_alloc(sizeof(struct ECPGtype));
+ p->type->type = ECPGt_sqlda;
+ p->type->size = NULL;
+ p->type->struct_sizeof = NULL;
+ p->type->u.element = NULL;
+ p->type->lineno = 0;
+ p->brace_level = 0;
+ p->next = NULL;
+
+ return p;
+}
+