1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-05 02:22:28 +03:00

Added dynamic cursor names to ecpg. Almost the whole patch was done by

Boszormenyi Zoltan, with only a minor tweak or two from me.
This commit is contained in:
Michael Meskes
2009-11-26 15:06:47 +00:00
parent da29cc8022
commit a160c421a5
9 changed files with 162 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.50 2009/08/07 10:51:20 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/variable.c,v 1.51 2009/11/26 15:06:47 meskes Exp $ */
#include "postgres_fe.h"
@@ -401,6 +401,30 @@ add_variable_to_tail(struct arguments ** list, struct variable * var, struct var
*list = new;
}
void
remove_variable_from_list(struct arguments ** list, struct variable * var)
{
struct arguments *p, *prev = NULL;
bool found = false;
for (p = *list; p; p = p->next)
{
if (p->variable == var)
{
found = true;
break;
}
prev = p;
}
if (found)
{
if (prev)
prev->next = p->next;
else
*list = p->next;
}
}
/* Dump out a list of all the variable on this list.
This is a recursive function that works from the end of the list and
deletes the list as we go on.