aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/compatlib/informix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/compatlib/informix.c')
-rw-r--r--src/interfaces/ecpg/compatlib/informix.c47
1 files changed, 3 insertions, 44 deletions
diff --git a/src/interfaces/ecpg/compatlib/informix.c b/src/interfaces/ecpg/compatlib/informix.c
index c4f1f18822f..24906ab487f 100644
--- a/src/interfaces/ecpg/compatlib/informix.c
+++ b/src/interfaces/ecpg/compatlib/informix.c
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.62 2009/10/01 18:03:54 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/compatlib/informix.c,v 1.63 2010/01/26 09:07:31 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
@@ -1004,57 +1004,16 @@ rtypwidth(int sqltype, int sqllen)
return 0;
}
-static struct var_list
-{
- int number;
- void *pointer;
- struct var_list *next;
-} *ivlist = NULL;
-
void
ECPG_informix_set_var(int number, void *pointer, int lineno)
{
- struct var_list *ptr;
-
- for (ptr = ivlist; ptr != NULL; ptr = ptr->next)
- {
- if (ptr->number == number)
- {
- /* already known => just change pointer value */
- ptr->pointer = pointer;
- return;
- }
- }
-
- /* a new one has to be added */
- ptr = (struct var_list *) calloc(1L, sizeof(struct var_list));
- if (!ptr)
- {
- struct sqlca_t *sqlca = ECPGget_sqlca();
-
- sqlca->sqlcode = ECPG_OUT_OF_MEMORY;
- strncpy(sqlca->sqlstate, "YE001", sizeof("YE001"));
- snprintf(sqlca->sqlerrm.sqlerrmc, sizeof(sqlca->sqlerrm.sqlerrmc), "out of memory on line %d", lineno);
- sqlca->sqlerrm.sqlerrml = strlen(sqlca->sqlerrm.sqlerrmc);
- /* free all memory we have allocated for the user */
- ECPGfree_auto_mem();
- }
- else
- {
- ptr->number = number;
- ptr->pointer = pointer;
- ptr->next = ivlist;
- ivlist = ptr;
- }
+ ECPGset_var(number, pointer, lineno);
}
void *
ECPG_informix_get_var(int number)
{
- struct var_list *ptr;
-
- for (ptr = ivlist; ptr != NULL && ptr->number != number; ptr = ptr->next);
- return (ptr) ? ptr->pointer : NULL;
+ return ECPGget_var(number);
}
void