summaryrefslogtreecommitdiff
path: root/src/pl
diff options
context:
space:
mode:
authorBruce Momjian2005-11-22 18:17:34 +0000
committerBruce Momjian2005-11-22 18:17:34 +0000
commit436a2956d80db29ac1dff640b631620d856b4f70 (patch)
treedb2252048385dd23a7d7a196e8685cb0a5816f7a /src/pl
parente196eedd8a95380fb392c00b9e7ea88a0e46053e (diff)
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
Diffstat (limited to 'src/pl')
-rw-r--r--src/pl/plperl/plperl.c22
-rw-r--r--src/pl/plperl/ppport.h8
-rw-r--r--src/pl/plpgsql/src/pl_comp.c58
-rw-r--r--src/pl/plpgsql/src/pl_exec.c303
-rw-r--r--src/pl/plpgsql/src/pl_funcs.c106
-rw-r--r--src/pl/plpgsql/src/plpgsql.h106
-rw-r--r--src/pl/tcl/pltcl.c60
7 files changed, 331 insertions, 332 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 274add609b3..5cd286bf547 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -33,7 +33,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.95 2005/11/18 17:00:28 adunstan Exp $
+ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.96 2005/11/22 18:17:33 momjian Exp $
*
**********************************************************************/
@@ -90,7 +90,7 @@ typedef struct plperl_proc_desc
FmgrInfo arg_out_func[FUNC_MAX_ARGS];
bool arg_is_rowtype[FUNC_MAX_ARGS];
SV *reference;
-} plperl_proc_desc;
+} plperl_proc_desc;
/**********************************************************************
@@ -319,7 +319,7 @@ strip_trailing_ws(const char *msg)
/* Build a tuple from a hash. */
static HeapTuple
-plperl_build_tuple_result(HV * perlhash, AttInMetadata *attinmeta)
+plperl_build_tuple_result(HV *perlhash, AttInMetadata *attinmeta)
{
TupleDesc td = attinmeta->tupdesc;
char **values;
@@ -354,7 +354,7 @@ plperl_build_tuple_result(HV * perlhash, AttInMetadata *attinmeta)
* convert perl array to postgres string representation
*/
static SV *
-plperl_convert_to_pg_array(SV * src)
+plperl_convert_to_pg_array(SV *src)
{
SV *rv;
int count;
@@ -478,7 +478,7 @@ plperl_trigger_build_args(FunctionCallInfo fcinfo)
/* Set up the new tuple returned from a trigger. */
static HeapTuple
-plperl_modify_tuple(HV * hvTD, TriggerData *tdata, HeapTuple otup)
+plperl_modify_tuple(HV *hvTD, TriggerData *tdata, HeapTuple otup)
{
SV **svp;
HV *hvNew;
@@ -747,8 +747,8 @@ plperl_create_sub(char *s, bool trusted)
*
**********************************************************************/
-EXTERN_C void boot_DynaLoader(pTHX_ CV * cv);
-EXTERN_C void boot_SPI(pTHX_ CV * cv);
+EXTERN_C void boot_DynaLoader(pTHX_ CV *cv);
+EXTERN_C void boot_SPI(pTHX_ CV *cv);
static void
plperl_init_shared_libs(pTHX)
@@ -761,7 +761,7 @@ plperl_init_shared_libs(pTHX)
static SV *
-plperl_call_perl_func(plperl_proc_desc * desc, FunctionCallInfo fcinfo)
+plperl_call_perl_func(plperl_proc_desc *desc, FunctionCallInfo fcinfo)
{
dSP;
SV *retval;
@@ -854,8 +854,8 @@ plperl_call_perl_func(plperl_proc_desc * desc, FunctionCallInfo fcinfo)
static SV *
-plperl_call_perl_trigger_func(plperl_proc_desc * desc, FunctionCallInfo fcinfo,
- SV * td)
+plperl_call_perl_trigger_func(plperl_proc_desc *desc, FunctionCallInfo fcinfo,
+ SV *td)
{
dSP;
SV *retval;
@@ -1553,7 +1553,7 @@ plperl_spi_execute_fetch_result(SPITupleTable *tuptable, int processed,
/*
* Note: plperl_return_next is called both in Postgres and Perl contexts.
- * We report any errors in Postgres fashion (via ereport). If called in
+ * We report any errors in Postgres fashion (via ereport). If called in
* Perl context, it is SPI.xs's responsibility to catch the error and
* convert to a Perl error. We assume (perhaps without adequate justification)
* that we need not abort the current transaction if the Perl code traps the
diff --git a/src/pl/plperl/ppport.h b/src/pl/plperl/ppport.h
index d9c64deabf4..e89ab4fc066 100644
--- a/src/pl/plperl/ppport.h
+++ b/src/pl/plperl/ppport.h
@@ -344,7 +344,7 @@ typedef NVTYPE NV;
#else
#if defined(USE_THREADS)
static SV *
-newRV_noinc(SV * sv)
+newRV_noinc(SV *sv)
{
SV *nsv = (SV *) newRV(sv);
@@ -366,7 +366,7 @@ newRV_noinc(SV * sv)
#if defined(NEED_newCONSTSUB)
static
#else
-extern void newCONSTSUB(HV * stash, char *name, SV * sv);
+extern void newCONSTSUB(HV *stash, char *name, SV *sv);
#endif
#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
@@ -543,7 +543,7 @@ SV *sv;
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
? ((lp = SvCUR(sv)), SvPVX(sv)) : my_sv_2pvbyte(aTHX_ sv, &lp))
static char *
-my_sv_2pvbyte(pTHX_ register SV * sv, STRLEN * lp)
+my_sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp)
{
sv_utf8_downgrade(sv, 0);
return SvPV(sv, *lp);
@@ -558,7 +558,7 @@ my_sv_2pvbyte(pTHX_ register SV * sv, STRLEN * lp)
((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
? SvPVX(sv) : sv_2pv_nolen(sv))
static char *
-sv_2pv_nolen(pTHX_ register SV * sv)
+sv_2pv_nolen(pTHX_ register SV *sv)
{
STRLEN n_a;
diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c
index f899bb25262..ebe5d691124 100644
--- a/src/pl/plpgsql/src/pl_comp.c
+++ b/src/pl/plpgsql/src/pl_comp.c
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.95 2005/11/17 22:14:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.96 2005/11/22 18:17:33 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -95,7 +95,7 @@ typedef struct plpgsql_hashent
{
PLpgSQL_func_hashkey key;
PLpgSQL_function *function;
-} plpgsql_HashEnt;
+} plpgsql_HashEnt;
#define FUNCS_PER_USER 128 /* initial table size */
@@ -107,7 +107,7 @@ typedef struct
{
const char *label;
int sqlerrstate;
-} ExceptionLabelMap;
+} ExceptionLabelMap;
static const ExceptionLabelMap exception_label_map[] = {
#include "plerrcodes.h"
@@ -121,27 +121,27 @@ static const ExceptionLabelMap exception_label_map[] = {
*/
static PLpgSQL_function *do_compile(FunctionCallInfo fcinfo,
HeapTuple procTup,
- PLpgSQL_func_hashkey * hashkey,
+ PLpgSQL_func_hashkey *hashkey,
bool forValidator);
static int fetchArgInfo(HeapTuple procTup,
Oid **p_argtypes, char ***p_argnames,
char **p_argmodes);
static PLpgSQL_row *build_row_from_class(Oid classOid);
-static PLpgSQL_row *build_row_from_vars(PLpgSQL_variable ** vars, int numvars);
+static PLpgSQL_row *build_row_from_vars(PLpgSQL_variable **vars, int numvars);
static PLpgSQL_type *build_datatype(HeapTuple typeTup, int32 typmod);
static void compute_function_hashkey(FunctionCallInfo fcinfo,
Form_pg_proc procStruct,
- PLpgSQL_func_hashkey * hashkey,
+ PLpgSQL_func_hashkey *hashkey,
bool forValidator);
static void plpgsql_resolve_polymorphic_argtypes(int numargs,
Oid *argtypes, char *argmodes,
Node *call_expr, bool forValidator,
const char *proname);
-static PLpgSQL_function *plpgsql_HashTableLookup(PLpgSQL_func_hashkey * func_key);
-static void plpgsql_HashTableInsert(PLpgSQL_function * function,
- PLpgSQL_func_hashkey * func_key);
-static void plpgsql_HashTableDelete(PLpgSQL_function * function);
-static void delete_function(PLpgSQL_function * func);
+static PLpgSQL_function *plpgsql_HashTableLookup(PLpgSQL_func_hashkey *func_key);
+static void plpgsql_HashTableInsert(PLpgSQL_function *function,
+ PLpgSQL_func_hashkey *func_key);
+static void plpgsql_HashTableDelete(PLpgSQL_function *function);
+static void delete_function(PLpgSQL_function *func);
/* ----------
* plpgsql_compile Make an execution tree for a PL/pgSQL function.
@@ -252,7 +252,7 @@ plpgsql_compile(FunctionCallInfo fcinfo, bool forValidator)
static PLpgSQL_function *
do_compile(FunctionCallInfo fcinfo,
HeapTuple procTup,
- PLpgSQL_func_hashkey * hashkey,
+ PLpgSQL_func_hashkey *hashkey,
bool forValidator)
{
Form_pg_proc procStruct = (Form_pg_proc) GETSTRUCT(procTup);
@@ -352,8 +352,8 @@ do_compile(FunctionCallInfo fcinfo,
* Fetch info about the procedure's parameters. Allocations aren't
* needed permanently, so make them in tmp cxt.
*
- * We also need to resolve any polymorphic input or output argument
- * types. In validation mode we won't be able to, so we
+ * We also need to resolve any polymorphic input or output
+ * argument types. In validation mode we won't be able to, so we
* arbitrarily assume we are dealing with integers.
*/
MemoryContextSwitchTo(compile_tmp_cxt);
@@ -1560,7 +1560,7 @@ plpgsql_parse_dblwordrowtype(char *word)
* array, and optionally to the current namespace.
*/
PLpgSQL_variable *
-plpgsql_build_variable(const char *refname, int lineno, PLpgSQL_type * dtype,
+plpgsql_build_variable(const char *refname, int lineno, PLpgSQL_type *dtype,
bool add2namespace)
{
PLpgSQL_variable *result;
@@ -1707,12 +1707,12 @@ build_row_from_class(Oid classOid)
/*
* Create the internal variable for the field
*
- * We know if the table definitions contain a default value or if the
- * field is declared in the table as NOT NULL. But it's possible
- * to create a table field as NOT NULL without a default value and
- * that would lead to problems later when initializing the
- * variables due to entering a block at execution time. Thus we
- * ignore this information for now.
+ * We know if the table definitions contain a default value or if
+ * the field is declared in the table as NOT NULL. But it's
+ * possible to create a table field as NOT NULL without a default
+ * value and that would lead to problems later when initializing
+ * the variables due to entering a block at execution time. Thus
+ * we ignore this information for now.
*/
var = plpgsql_build_variable(refname, 0,
plpgsql_build_datatype(attrStruct->atttypid,
@@ -1740,7 +1740,7 @@ build_row_from_class(Oid classOid)
* Build a row-variable data structure given the component variables.
*/
static PLpgSQL_row *
-build_row_from_vars(PLpgSQL_variable ** vars, int numvars)
+build_row_from_vars(PLpgSQL_variable **vars, int numvars)
{
PLpgSQL_row *row;
int i;
@@ -1944,7 +1944,7 @@ plpgsql_parse_err_condition(char *condname)
* ----------
*/
void
-plpgsql_adddatum(PLpgSQL_datum * new)
+plpgsql_adddatum(PLpgSQL_datum *new)
{
if (plpgsql_nDatums == datums_alloc)
{
@@ -2020,7 +2020,7 @@ plpgsql_add_initdatums(int **varnos)
static void
compute_function_hashkey(FunctionCallInfo fcinfo,
Form_pg_proc procStruct,
- PLpgSQL_func_hashkey * hashkey,
+ PLpgSQL_func_hashkey *hashkey,
bool forValidator)
{
/* Make sure any unused bytes of the struct are zero */
@@ -2103,7 +2103,7 @@ plpgsql_resolve_polymorphic_argtypes(int numargs,
}
static void
-delete_function(PLpgSQL_function * func)
+delete_function(PLpgSQL_function *func)
{
/* remove function from hash table */
plpgsql_HashTableDelete(func);
@@ -2137,7 +2137,7 @@ plpgsql_HashTableInit(void)
}
static PLpgSQL_function *
-plpgsql_HashTableLookup(PLpgSQL_func_hashkey * func_key)
+plpgsql_HashTableLookup(PLpgSQL_func_hashkey *func_key)
{
plpgsql_HashEnt *hentry;
@@ -2152,8 +2152,8 @@ plpgsql_HashTableLookup(PLpgSQL_func_hashkey * func_key)
}
static void
-plpgsql_HashTableInsert(PLpgSQL_function * function,
- PLpgSQL_func_hashkey * func_key)
+plpgsql_HashTableInsert(PLpgSQL_function *function,
+ PLpgSQL_func_hashkey *func_key)
{
plpgsql_HashEnt *hentry;
bool found;
@@ -2171,7 +2171,7 @@ plpgsql_HashTableInsert(PLpgSQL_function * function,
}
static void
-plpgsql_HashTableDelete(PLpgSQL_function * function)
+plpgsql_HashTableDelete(PLpgSQL_function *function)
{
plpgsql_HashEnt *hentry;
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index 58f6d814b8f..11b0bc0eb3f 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.156 2005/11/18 02:38:24 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.157 2005/11/22 18:17:33 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -75,97 +75,97 @@ static PLpgSQL_expr *active_simple_exprs = NULL;
* Local function forward declarations
************************************************************/
static void plpgsql_exec_error_callback(void *arg);
-static PLpgSQL_datum *copy_plpgsql_datum(PLpgSQL_datum * datum);
+static PLpgSQL_datum *copy_plpgsql_datum(PLpgSQL_datum *datum);
-static int exec_stmt_block(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_block * block);
-static int exec_stmts(PLpgSQL_execstate * estate,
+static int exec_stmt_block(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_block *block);
+static int exec_stmts(PLpgSQL_execstate *estate,
List *stmts);
-static int exec_stmt(PLpgSQL_execstate * estate,
- PLpgSQL_stmt * stmt);
-static int exec_stmt_assign(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_assign * stmt);
-static int exec_stmt_perform(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_perform * stmt);
-static int exec_stmt_getdiag(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_getdiag * stmt);
-static int exec_stmt_if(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_if * stmt);
-static int exec_stmt_loop(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_loop * stmt);
-static int exec_stmt_while(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_while * stmt);
-static int exec_stmt_fori(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_fori * stmt);
-static int exec_stmt_fors(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_fors * stmt);
-static int exec_stmt_select(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_select * stmt);
-static int exec_stmt_open(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_open * stmt);
-static int exec_stmt_fetch(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_fetch * stmt);
-static int exec_stmt_close(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_close * stmt);
-static int exec_stmt_exit(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_exit * stmt);
-static int exec_stmt_return(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_return * stmt);
-static int exec_stmt_return_next(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_return_next * stmt);
-static int exec_stmt_raise(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_raise * stmt);
-static int exec_stmt_execsql(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_execsql * stmt);
-static int exec_stmt_dynexecute(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_dynexecute * stmt);
-static int exec_stmt_dynfors(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_dynfors * stmt);
-
-static void plpgsql_estate_setup(PLpgSQL_execstate * estate,
- PLpgSQL_function * func,
+static int exec_stmt(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt *stmt);
+static int exec_stmt_assign(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_assign *stmt);
+static int exec_stmt_perform(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_perform *stmt);
+static int exec_stmt_getdiag(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_getdiag *stmt);
+static int exec_stmt_if(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_if *stmt);
+static int exec_stmt_loop(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_loop *stmt);
+static int exec_stmt_while(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_while *stmt);
+static int exec_stmt_fori(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_fori *stmt);
+static int exec_stmt_fors(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_fors *stmt);
+static int exec_stmt_select(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_select *stmt);
+static int exec_stmt_open(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_open *stmt);
+static int exec_stmt_fetch(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_fetch *stmt);
+static int exec_stmt_close(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_close *stmt);
+static int exec_stmt_exit(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_exit *stmt);
+static int exec_stmt_return(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_return *stmt);
+static int exec_stmt_return_next(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_return_next *stmt);
+static int exec_stmt_raise(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_raise *stmt);
+static int exec_stmt_execsql(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_execsql *stmt);
+static int exec_stmt_dynexecute(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_dynexecute *stmt);
+static int exec_stmt_dynfors(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_dynfors *stmt);
+
+static void plpgsql_estate_setup(PLpgSQL_execstate *estate,
+ PLpgSQL_function *func,
ReturnSetInfo *rsi);
-static void exec_eval_cleanup(PLpgSQL_execstate * estate);
+static void exec_eval_cleanup(PLpgSQL_execstate *estate);
-static void exec_prepare_plan(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr);
+static void exec_prepare_plan(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr);
static bool exec_simple_check_node(Node *node);
-static void exec_simple_check_plan(PLpgSQL_expr * expr);
-static Datum exec_eval_simple_expr(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+static void exec_simple_check_plan(PLpgSQL_expr *expr);
+static Datum exec_eval_simple_expr(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull,
Oid *rettype);
-static void exec_assign_expr(PLpgSQL_execstate * estate,
- PLpgSQL_datum * target,
- PLpgSQL_expr * expr);
-static void exec_assign_value(PLpgSQL_execstate * estate,
- PLpgSQL_datum * target,
+static void exec_assign_expr(PLpgSQL_execstate *estate,
+ PLpgSQL_datum *target,
+ PLpgSQL_expr *expr);
+static void exec_assign_value(PLpgSQL_execstate *estate,
+ PLpgSQL_datum *target,
Datum value, Oid valtype, bool *isNull);
-static void exec_eval_datum(PLpgSQL_execstate * estate,
- PLpgSQL_datum * datum,
+static void exec_eval_datum(PLpgSQL_execstate *estate,
+ PLpgSQL_datum *datum,
Oid expectedtypeid,
Oid *typeid,
Datum *value,
bool *isnull);
-static int exec_eval_integer(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+static int exec_eval_integer(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull);
-static bool exec_eval_boolean(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+static bool exec_eval_boolean(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull);
-static Datum exec_eval_expr(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+static Datum exec_eval_expr(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull,
Oid *rettype);
-static int exec_run_select(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr, long maxtuples, Portal *portalP);
-static void exec_move_row(PLpgSQL_execstate * estate,
- PLpgSQL_rec * rec,
- PLpgSQL_row * row,
+static int exec_run_select(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr, long maxtuples, Portal *portalP);
+static void exec_move_row(PLpgSQL_execstate *estate,
+ PLpgSQL_rec *rec,
+ PLpgSQL_row *row,
HeapTuple tup, TupleDesc tupdesc);
-static HeapTuple make_tuple_from_row(PLpgSQL_execstate * estate,
- PLpgSQL_row * row,
+static HeapTuple make_tuple_from_row(PLpgSQL_execstate *estate,
+ PLpgSQL_row *row,
TupleDesc tupdesc);
static char *convert_value_to_string(Datum value, Oid valtype);
static Datum exec_cast_value(Datum value, Oid valtype,
@@ -177,10 +177,10 @@ static Datum exec_cast_value(Datum value, Oid valtype,
static Datum exec_simple_cast_value(Datum value, Oid valtype,
Oid reqtype, int32 reqtypmod,
bool isnull);
-static void exec_init_tuple_store(PLpgSQL_execstate * estate);
+static void exec_init_tuple_store(PLpgSQL_execstate *estate);
static bool compatible_tupdesc(TupleDesc td1, TupleDesc td2);
-static void exec_set_found(PLpgSQL_execstate * estate, bool state);
-static void free_var(PLpgSQL_var * var);
+static void exec_set_found(PLpgSQL_execstate *estate, bool state);
+static void free_var(PLpgSQL_var *var);
/* ----------
@@ -189,7 +189,7 @@ static void free_var(PLpgSQL_var * var);
* ----------
*/
Datum
-plpgsql_exec_function(PLpgSQL_function * func, FunctionCallInfo fcinfo)
+plpgsql_exec_function(PLpgSQL_function *func, FunctionCallInfo fcinfo)
{
PLpgSQL_execstate estate;
ErrorContextCallback plerrcontext;
@@ -399,7 +399,7 @@ plpgsql_exec_function(PLpgSQL_function * func, FunctionCallInfo fcinfo)
* ----------
*/
HeapTuple
-plpgsql_exec_trigger(PLpgSQL_function * func,
+plpgsql_exec_trigger(PLpgSQL_function *func,
TriggerData *trigdata)
{
PLpgSQL_execstate estate;
@@ -677,7 +677,7 @@ plpgsql_exec_error_callback(void *arg)
* ----------
*/
static PLpgSQL_datum *
-copy_plpgsql_datum(PLpgSQL_datum * datum)
+copy_plpgsql_datum(PLpgSQL_datum *datum)
{
PLpgSQL_datum *result;
@@ -735,7 +735,7 @@ copy_plpgsql_datum(PLpgSQL_datum * datum)
static bool
-exception_matches_conditions(ErrorData *edata, PLpgSQL_condition * cond)
+exception_matches_conditions(ErrorData *edata, PLpgSQL_condition *cond)
{
for (; cond != NULL; cond = cond->next)
{
@@ -767,7 +767,7 @@ exception_matches_conditions(ErrorData *edata, PLpgSQL_condition * cond)
* ----------
*/
static int
-exec_stmt_block(PLpgSQL_execstate * estate, PLpgSQL_stmt_block * block)
+exec_stmt_block(PLpgSQL_execstate *estate, PLpgSQL_stmt_block *block)
{
volatile int rc = -1;
int i;
@@ -970,7 +970,7 @@ exec_stmt_block(PLpgSQL_execstate * estate, PLpgSQL_stmt_block * block)
* ----------
*/
static int
-exec_stmts(PLpgSQL_execstate * estate, List *stmts)
+exec_stmts(PLpgSQL_execstate *estate, List *stmts)
{
ListCell *s;
@@ -1004,7 +1004,7 @@ exec_stmts(PLpgSQL_execstate * estate, List *stmts)
* ----------
*/
static int
-exec_stmt(PLpgSQL_execstate * estate, PLpgSQL_stmt * stmt)
+exec_stmt(PLpgSQL_execstate *estate, PLpgSQL_stmt *stmt)
{
PLpgSQL_stmt *save_estmt;
int rc = -1;
@@ -1113,7 +1113,7 @@ exec_stmt(PLpgSQL_execstate * estate, PLpgSQL_stmt * stmt)
* ----------
*/
static int
-exec_stmt_assign(PLpgSQL_execstate * estate, PLpgSQL_stmt_assign * stmt)
+exec_stmt_assign(PLpgSQL_execstate *estate, PLpgSQL_stmt_assign *stmt)
{
Assert(stmt->varno >= 0);
@@ -1129,7 +1129,7 @@ exec_stmt_assign(PLpgSQL_execstate * estate, PLpgSQL_stmt_assign * stmt)
* ----------
*/
static int
-exec_stmt_perform(PLpgSQL_execstate * estate, PLpgSQL_stmt_perform * stmt)
+exec_stmt_perform(PLpgSQL_execstate *estate, PLpgSQL_stmt_perform *stmt)
{
PLpgSQL_expr *expr = stmt->expr;
@@ -1146,7 +1146,7 @@ exec_stmt_perform(PLpgSQL_execstate * estate, PLpgSQL_stmt_perform * stmt)
* ----------
*/
static int
-exec_stmt_getdiag(PLpgSQL_execstate * estate, PLpgSQL_stmt_getdiag * stmt)
+exec_stmt_getdiag(PLpgSQL_execstate *estate, PLpgSQL_stmt_getdiag *stmt)
{
ListCell *lc;
@@ -1196,7 +1196,7 @@ exec_stmt_getdiag(PLpgSQL_execstate * estate, PLpgSQL_stmt_getdiag * stmt)
* ----------
*/
static int
-exec_stmt_if(PLpgSQL_execstate * estate, PLpgSQL_stmt_if * stmt)
+exec_stmt_if(PLpgSQL_execstate *estate, PLpgSQL_stmt_if *stmt)
{
bool value;
bool isnull;
@@ -1225,7 +1225,7 @@ exec_stmt_if(PLpgSQL_execstate * estate, PLpgSQL_stmt_if * stmt)
* ----------
*/
static int
-exec_stmt_loop(PLpgSQL_execstate * estate, PLpgSQL_stmt_loop * stmt)
+exec_stmt_loop(PLpgSQL_execstate *estate, PLpgSQL_stmt_loop *stmt)
{
for (;;)
{
@@ -1278,7 +1278,7 @@ exec_stmt_loop(PLpgSQL_execstate * estate, PLpgSQL_stmt_loop * stmt)
* ----------
*/
static int
-exec_stmt_while(PLpgSQL_execstate * estate, PLpgSQL_stmt_while * stmt)
+exec_stmt_while(PLpgSQL_execstate *estate, PLpgSQL_stmt_while *stmt)
{
for (;;)
{
@@ -1341,7 +1341,7 @@ exec_stmt_while(PLpgSQL_execstate * estate, PLpgSQL_stmt_while * stmt)
* ----------
*/
static int
-exec_stmt_fori(PLpgSQL_execstate * estate, PLpgSQL_stmt_fori * stmt)
+exec_stmt_fori(PLpgSQL_execstate *estate, PLpgSQL_stmt_fori *stmt)
{
PLpgSQL_var *var;
Datum value;
@@ -1483,7 +1483,7 @@ exec_stmt_fori(PLpgSQL_execstate * estate, PLpgSQL_stmt_fori * stmt)
* ----------
*/
static int
-exec_stmt_fors(PLpgSQL_execstate * estate, PLpgSQL_stmt_fors * stmt)
+exec_stmt_fors(PLpgSQL_execstate *estate, PLpgSQL_stmt_fors *stmt)
{
PLpgSQL_rec *rec = NULL;
PLpgSQL_row *row = NULL;
@@ -1635,7 +1635,7 @@ exec_stmt_fors(PLpgSQL_execstate * estate, PLpgSQL_stmt_fors * stmt)
* ----------
*/
static int
-exec_stmt_select(PLpgSQL_execstate * estate, PLpgSQL_stmt_select * stmt)
+exec_stmt_select(PLpgSQL_execstate *estate, PLpgSQL_stmt_select *stmt)
{
PLpgSQL_rec *rec = NULL;
PLpgSQL_row *row = NULL;
@@ -1693,7 +1693,7 @@ exec_stmt_select(PLpgSQL_execstate * estate, PLpgSQL_stmt_select * stmt)
* ----------
*/
static int
-exec_stmt_exit(PLpgSQL_execstate * estate, PLpgSQL_stmt_exit * stmt)
+exec_stmt_exit(PLpgSQL_execstate *estate, PLpgSQL_stmt_exit *stmt)
{
/*
* If the exit / continue has a condition, evaluate it
@@ -1723,7 +1723,7 @@ exec_stmt_exit(PLpgSQL_execstate * estate, PLpgSQL_stmt_exit * stmt)
* ----------
*/
static int
-exec_stmt_return(PLpgSQL_execstate * estate, PLpgSQL_stmt_return * stmt)
+exec_stmt_return(PLpgSQL_execstate *estate, PLpgSQL_stmt_return *stmt)
{
/*
* If processing a set-returning PL/PgSQL function, the final RETURN
@@ -1834,8 +1834,8 @@ exec_stmt_return(PLpgSQL_execstate * estate, PLpgSQL_stmt_return * stmt)
* ----------
*/
static int
-exec_stmt_return_next(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_return_next * stmt)
+exec_stmt_return_next(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_return_next *stmt)
{
TupleDesc tupdesc;
int natts;
@@ -1974,7 +1974,7 @@ exec_stmt_return_next(PLpgSQL_execstate * estate,
}
static void
-exec_init_tuple_store(PLpgSQL_execstate * estate)
+exec_init_tuple_store(PLpgSQL_execstate *estate)
{
ReturnSetInfo *rsi = estate->rsi;
MemoryContext oldcxt;
@@ -2003,7 +2003,7 @@ exec_init_tuple_store(PLpgSQL_execstate * estate)
* ----------
*/
static int
-exec_stmt_raise(PLpgSQL_execstate * estate, PLpgSQL_stmt_raise * stmt)
+exec_stmt_raise(PLpgSQL_execstate *estate, PLpgSQL_stmt_raise *stmt)
{
char *cp;
PLpgSQL_dstring ds;
@@ -2086,8 +2086,8 @@ exec_stmt_raise(PLpgSQL_execstate * estate, PLpgSQL_stmt_raise * stmt)
* ----------
*/
static void
-plpgsql_estate_setup(PLpgSQL_execstate * estate,
- PLpgSQL_function * func,
+plpgsql_estate_setup(PLpgSQL_execstate *estate,
+ PLpgSQL_function *func,
ReturnSetInfo *rsi)
{
estate->retval = (Datum) 0;
@@ -2152,7 +2152,7 @@ plpgsql_estate_setup(PLpgSQL_execstate * estate,
* ----------
*/
static void
-exec_eval_cleanup(PLpgSQL_execstate * estate)
+exec_eval_cleanup(PLpgSQL_execstate *estate)
{
/* Clear result of a full SPI_execute */
if (estate->eval_tuptable != NULL)
@@ -2170,8 +2170,8 @@ exec_eval_cleanup(PLpgSQL_execstate * estate)
* ----------
*/
static void
-exec_prepare_plan(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr)
+exec_prepare_plan(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr)
{
int i;
_SPI_plan *spi_plan;
@@ -2239,8 +2239,8 @@ exec_prepare_plan(PLpgSQL_execstate * estate,
* ----------
*/
static int
-exec_stmt_execsql(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_execsql * stmt)
+exec_stmt_execsql(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_execsql *stmt)
{
int i;
Datum *values;
@@ -2331,8 +2331,8 @@ exec_stmt_execsql(PLpgSQL_execstate * estate,
* ----------
*/
static int
-exec_stmt_dynexecute(PLpgSQL_execstate * estate,
- PLpgSQL_stmt_dynexecute * stmt)
+exec_stmt_dynexecute(PLpgSQL_execstate *estate,
+ PLpgSQL_stmt_dynexecute *stmt)
{
Datum query;
bool isnull = false;
@@ -2469,7 +2469,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate * estate,
* ----------
*/
static int
-exec_stmt_dynfors(PLpgSQL_execstate * estate, PLpgSQL_stmt_dynfors * stmt)
+exec_stmt_dynfors(PLpgSQL_execstate *estate, PLpgSQL_stmt_dynfors *stmt)
{
Datum query;
bool isnull;
@@ -2650,7 +2650,7 @@ exec_stmt_dynfors(PLpgSQL_execstate * estate, PLpgSQL_stmt_dynfors * stmt)
* ----------
*/
static int
-exec_stmt_open(PLpgSQL_execstate * estate, PLpgSQL_stmt_open * stmt)
+exec_stmt_open(PLpgSQL_execstate *estate, PLpgSQL_stmt_open *stmt)
{
PLpgSQL_var *curvar = NULL;
char *curname = NULL;
@@ -2852,7 +2852,7 @@ exec_stmt_open(PLpgSQL_execstate * estate, PLpgSQL_stmt_open * stmt)
* ----------
*/
static int
-exec_stmt_fetch(PLpgSQL_execstate * estate, PLpgSQL_stmt_fetch * stmt)
+exec_stmt_fetch(PLpgSQL_execstate *estate, PLpgSQL_stmt_fetch *stmt)
{
PLpgSQL_var *curvar = NULL;
PLpgSQL_rec *rec = NULL;
@@ -2925,7 +2925,7 @@ exec_stmt_fetch(PLpgSQL_execstate * estate, PLpgSQL_stmt_fetch * stmt)
* ----------
*/
static int
-exec_stmt_close(PLpgSQL_execstate * estate, PLpgSQL_stmt_close * stmt)
+exec_stmt_close(PLpgSQL_execstate *estate, PLpgSQL_stmt_close *stmt)
{
PLpgSQL_var *curvar = NULL;
Portal portal;
@@ -2965,8 +2965,8 @@ exec_stmt_close(PLpgSQL_execstate * estate, PLpgSQL_stmt_close * stmt)
* ----------
*/
static void
-exec_assign_expr(PLpgSQL_execstate * estate, PLpgSQL_datum * target,
- PLpgSQL_expr * expr)
+exec_assign_expr(PLpgSQL_execstate *estate, PLpgSQL_datum *target,
+ PLpgSQL_expr *expr)
{
Datum value;
Oid valtype;
@@ -2983,8 +2983,8 @@ exec_assign_expr(PLpgSQL_execstate * estate, PLpgSQL_datum * target,
* ----------
*/
static void
-exec_assign_value(PLpgSQL_execstate * estate,
- PLpgSQL_datum * target,
+exec_assign_value(PLpgSQL_execstate *estate,
+ PLpgSQL_datum *target,
Datum value, Oid valtype, bool *isNull)
{
switch (target->dtype)
@@ -3256,8 +3256,8 @@ exec_assign_value(PLpgSQL_execstate * estate,
/*
* Target is an element of an array
*
- * To handle constructs like x[1][2] := something, we have to be
- * prepared to deal with a chain of arrayelem datums. Chase
+ * To handle constructs like x[1][2] := something, we have to
+ * be prepared to deal with a chain of arrayelem datums. Chase
* back to find the base array datum, and save the subscript
* expressions as we go. (We are scanning right to left here,
* but want to evaluate the subscripts left-to-right to
@@ -3325,11 +3325,10 @@ exec_assign_value(PLpgSQL_execstate * estate,
* subscript. This only works for varlena arrays, though; for
* fixed-length array types we skip the assignment. We can't
* support assignment of a null entry into a fixed-length
- * array, either, so that's a no-op too. This is all ugly
- * but corresponds to the current behavior of
- * ExecEvalArrayRef().
+ * array, either, so that's a no-op too. This is all ugly but
+ * corresponds to the current behavior of ExecEvalArrayRef().
*/
- if (arraytyplen > 0 && /* fixed-length array? */
+ if (arraytyplen > 0 && /* fixed-length array? */
(oldarrayisnull || *isNull))
return;
@@ -3359,8 +3358,8 @@ exec_assign_value(PLpgSQL_execstate * estate,
pfree(DatumGetPointer(coerced_value));
/*
- * Assign the new array to the base variable. It's never
- * NULL at this point.
+ * Assign the new array to the base variable. It's never NULL
+ * at this point.
*/
*isNull = false;
exec_assign_value(estate, target,
@@ -3394,8 +3393,8 @@ exec_assign_value(PLpgSQL_execstate * estate,
* the estate's short-term memory context.
*/
static void
-exec_eval_datum(PLpgSQL_execstate * estate,
- PLpgSQL_datum * datum,
+exec_eval_datum(PLpgSQL_execstate *estate,
+ PLpgSQL_datum *datum,
Oid expectedtypeid,
Oid *typeid,
Datum *value,
@@ -3552,8 +3551,8 @@ exec_eval_datum(PLpgSQL_execstate * estate,
* ----------
*/
static int
-exec_eval_integer(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+exec_eval_integer(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull)
{
Datum exprdatum;
@@ -3574,8 +3573,8 @@ exec_eval_integer(PLpgSQL_execstate * estate,
* ----------
*/
static bool
-exec_eval_boolean(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+exec_eval_boolean(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull)
{
Datum exprdatum;
@@ -3596,8 +3595,8 @@ exec_eval_boolean(PLpgSQL_execstate * estate,
* ----------
*/
static Datum
-exec_eval_expr(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+exec_eval_expr(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull,
Oid *rettype)
{
@@ -3659,8 +3658,8 @@ exec_eval_expr(PLpgSQL_execstate * estate,
* ----------
*/
static int
-exec_run_select(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr, long maxtuples, Portal *portalP)
+exec_run_select(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr, long maxtuples, Portal *portalP)
{
int i;
Datum *values;
@@ -3741,8 +3740,8 @@ exec_run_select(PLpgSQL_execstate * estate,
* ----------
*/
static Datum
-exec_eval_simple_expr(PLpgSQL_execstate * estate,
- PLpgSQL_expr * expr,
+exec_eval_simple_expr(PLpgSQL_execstate *estate,
+ PLpgSQL_expr *expr,
bool *isNull,
Oid *rettype)
{
@@ -3773,10 +3772,10 @@ exec_eval_simple_expr(PLpgSQL_execstate * estate,
/*
* Param list can live in econtext's temporary memory context.
*
- * XXX think about avoiding repeated palloc's for param lists? Beware however
- * that this routine is re-entrant: exec_eval_datum() can call it back for
- * subscript evaluation, and so there can be a need to have more than one
- * active param list.
+ * XXX think about avoiding repeated palloc's for param lists? Beware
+ * however that this routine is re-entrant: exec_eval_datum() can call it
+ * back for subscript evaluation, and so there can be a need to have more
+ * than one active param list.
*/
paramLI = (ParamListInfo)
MemoryContextAlloc(econtext->ecxt_per_tuple_memory,
@@ -3854,9 +3853,9 @@ exec_eval_simple_expr(PLpgSQL_execstate * estate,
* ----------
*/
static void
-exec_move_row(PLpgSQL_execstate * estate,
- PLpgSQL_rec * rec,
- PLpgSQL_row * row,
+exec_move_row(PLpgSQL_execstate *estate,
+ PLpgSQL_rec *rec,
+ PLpgSQL_row *row,
HeapTuple tup, TupleDesc tupdesc)
{
/*
@@ -3920,16 +3919,16 @@ exec_move_row(PLpgSQL_execstate * estate,
* Row is a bit more complicated in that we assign the individual
* attributes of the tuple to the variables the row points to.
*
- * NOTE: this code used to demand row->nfields == tup->t_data->t_natts, but
- * that's wrong. The tuple might have more fields than we expected if
+ * NOTE: this code used to demand row->nfields == tup->t_data->t_natts,
+ * but that's wrong. The tuple might have more fields than we expected if
* it's from an inheritance-child table of the current table, or it might
* have fewer if the table has had columns added by ALTER TABLE. Ignore
* extra columns and assume NULL for missing columns, the same as
* heap_getattr would do. We also have to skip over dropped columns in
* either the source or destination.
*
- * If we have no tuple data at all, we'll assign NULL to all columns of the
- * row variable.
+ * If we have no tuple data at all, we'll assign NULL to all columns of
+ * the row variable.
*/
if (row != NULL)
{
@@ -3988,8 +3987,8 @@ exec_move_row(PLpgSQL_execstate * estate,
* ----------
*/
static HeapTuple
-make_tuple_from_row(PLpgSQL_execstate * estate,
- PLpgSQL_row * row,
+make_tuple_from_row(PLpgSQL_execstate *estate,
+ PLpgSQL_row *row,
TupleDesc tupdesc)
{
int natts = tupdesc->natts;
@@ -4355,7 +4354,7 @@ exec_simple_check_node(Node *node)
* ----------
*/
static void
-exec_simple_check_plan(PLpgSQL_expr * expr)
+exec_simple_check_plan(PLpgSQL_expr *expr)
{
_SPI_plan *spi_plan = (_SPI_plan *) expr->plan;
Plan *plan;
@@ -4442,7 +4441,7 @@ compatible_tupdesc(TupleDesc td1, TupleDesc td2)
* ----------
*/
static void
-exec_set_found(PLpgSQL_execstate * estate, bool state)
+exec_set_found(PLpgSQL_execstate *estate, bool state)
{
PLpgSQL_var *var;
@@ -4489,7 +4488,7 @@ plpgsql_xact_cb(XactEvent event, void *arg)
}
static void
-free_var(PLpgSQL_var * var)
+free_var(PLpgSQL_var *var)
{
if (var->freeval)
{
diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c
index dd12a061f34..8413e3064bb 100644
--- a/src/pl/plpgsql/src/pl_funcs.c
+++ b/src/pl/plpgsql/src/pl_funcs.c
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.46 2005/10/15 02:49:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.47 2005/11/22 18:17:33 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -56,7 +56,7 @@ static bool ns_localmode = false;
* ----------
*/
void
-plpgsql_dstring_init(PLpgSQL_dstring * ds)
+plpgsql_dstring_init(PLpgSQL_dstring *ds)
{
ds->value = palloc(ds->alloc = 512);
ds->used = 1;
@@ -69,13 +69,13 @@ plpgsql_dstring_init(PLpgSQL_dstring * ds)
* ----------
*/
void
-plpgsql_dstring_free(PLpgSQL_dstring * ds)
+plpgsql_dstring_free(PLpgSQL_dstring *ds)
{
pfree(ds->value);
}
static void
-plpgsql_dstring_expand(PLpgSQL_dstring * ds, int needed)
+plpgsql_dstring_expand(PLpgSQL_dstring *ds, int needed)
{
/* Don't allow truncating the string */
Assert(needed > ds->alloc);
@@ -94,7 +94,7 @@ plpgsql_dstring_expand(PLpgSQL_dstring * ds, int needed)
* ----------
*/
void
-plpgsql_dstring_append(PLpgSQL_dstring * ds, const char *str)
+plpgsql_dstring_append(PLpgSQL_dstring *ds, const char *str)
{
int len = strlen(str);
int needed = ds->used + len;
@@ -113,7 +113,7 @@ plpgsql_dstring_append(PLpgSQL_dstring * ds, const char *str)
* ----------
*/
void
-plpgsql_dstring_append_char(PLpgSQL_dstring * ds, char c)
+plpgsql_dstring_append_char(PLpgSQL_dstring *ds, char c)
{
if (ds->used == ds->alloc)
plpgsql_dstring_expand(ds, ds->used + 1);
@@ -129,7 +129,7 @@ plpgsql_dstring_append_char(PLpgSQL_dstring * ds, char c)
* ----------
*/
char *
-plpgsql_dstring_get(PLpgSQL_dstring * ds)
+plpgsql_dstring_get(PLpgSQL_dstring *ds)
{
return ds->value;
}
@@ -443,7 +443,7 @@ plpgsql_convert_ident(const char *s, char **output, int numidents)
* Statement type as a string, for use in error messages etc.
*/
const char *
-plpgsql_stmt_typename(PLpgSQL_stmt * stmt)
+plpgsql_stmt_typename(PLpgSQL_stmt *stmt)
{
switch (stmt->cmd_type)
{
@@ -499,28 +499,28 @@ plpgsql_stmt_typename(PLpgSQL_stmt * stmt)
static int dump_indent;
static void dump_ind();
-static void dump_stmt(PLpgSQL_stmt * stmt);
-static void dump_block(PLpgSQL_stmt_block * block);
-static void dump_assign(PLpgSQL_stmt_assign * stmt);
-static void dump_if(PLpgSQL_stmt_if * stmt);
-static void dump_loop(PLpgSQL_stmt_loop * stmt);
-static void dump_while(PLpgSQL_stmt_while * stmt);
-static void dump_fori(PLpgSQL_stmt_fori * stmt);
-static void dump_fors(PLpgSQL_stmt_fors * stmt);
-static void dump_select(PLpgSQL_stmt_select * stmt);
-static void dump_exit(PLpgSQL_stmt_exit * stmt);
-static void dump_return(PLpgSQL_stmt_return * stmt);
-static void dump_return_next(PLpgSQL_stmt_return_next * stmt);
-static void dump_raise(PLpgSQL_stmt_raise * stmt);
-static void dump_execsql(PLpgSQL_stmt_execsql * stmt);
-static void dump_dynexecute(PLpgSQL_stmt_dynexecute * stmt);
-static void dump_dynfors(PLpgSQL_stmt_dynfors * stmt);
-static void dump_getdiag(PLpgSQL_stmt_getdiag * stmt);
-static void dump_open(PLpgSQL_stmt_open * stmt);
-static void dump_fetch(PLpgSQL_stmt_fetch * stmt);
-static void dump_close(PLpgSQL_stmt_close * stmt);
-static void dump_perform(PLpgSQL_stmt_perform * stmt);
-static void dump_expr(PLpgSQL_expr * expr);
+static void dump_stmt(PLpgSQL_stmt *stmt);
+static void dump_block(PLpgSQL_stmt_block *block);
+static void dump_assign(PLpgSQL_stmt_assign *stmt);
+static void dump_if(PLpgSQL_stmt_if *stmt);
+static void dump_loop(PLpgSQL_stmt_loop *stmt);
+static void dump_while(PLpgSQL_stmt_while *stmt);
+static void dump_fori(PLpgSQL_stmt_fori *stmt);
+static void dump_fors(PLpgSQL_stmt_fors *stmt);
+static void dump_select(PLpgSQL_stmt_select *stmt);
+static void dump_exit(PLpgSQL_stmt_exit *stmt);
+static void dump_return(PLpgSQL_stmt_return *stmt);
+static void dump_return_next(PLpgSQL_stmt_return_next *stmt);
+static void dump_raise(PLpgSQL_stmt_raise *stmt);
+static void dump_execsql(PLpgSQL_stmt_execsql *stmt);
+static void dump_dynexecute(PLpgSQL_stmt_dynexecute *stmt);
+static void dump_dynfors(PLpgSQL_stmt_dynfors *stmt);
+static void dump_getdiag(PLpgSQL_stmt_getdiag *stmt);
+static void dump_open(PLpgSQL_stmt_open *stmt);
+static void dump_fetch(PLpgSQL_stmt_fetch *stmt);
+static void dump_close(PLpgSQL_stmt_close *stmt);
+static void dump_perform(PLpgSQL_stmt_perform *stmt);
+static void dump_expr(PLpgSQL_expr *expr);
static void
@@ -533,7 +533,7 @@ dump_ind(void)
}
static void
-dump_stmt(PLpgSQL_stmt * stmt)
+dump_stmt(PLpgSQL_stmt *stmt)
{
printf("%3d:", stmt->lineno);
switch (stmt->cmd_type)
@@ -616,7 +616,7 @@ dump_stmts(List *stmts)
}
static void
-dump_block(PLpgSQL_stmt_block * block)
+dump_block(PLpgSQL_stmt_block *block)
{
char *name;
@@ -657,7 +657,7 @@ dump_block(PLpgSQL_stmt_block * block)
}
static void
-dump_assign(PLpgSQL_stmt_assign * stmt)
+dump_assign(PLpgSQL_stmt_assign *stmt)
{
dump_ind();
printf("ASSIGN var %d := ", stmt->varno);
@@ -666,7 +666,7 @@ dump_assign(PLpgSQL_stmt_assign * stmt)
}
static void
-dump_if(PLpgSQL_stmt_if * stmt)
+dump_if(PLpgSQL_stmt_if *stmt)
{
dump_ind();
printf("IF ");
@@ -687,7 +687,7 @@ dump_if(PLpgSQL_stmt_if * stmt)
}
static void
-dump_loop(PLpgSQL_stmt_loop * stmt)
+dump_loop(PLpgSQL_stmt_loop *stmt)
{
dump_ind();
printf("LOOP\n");
@@ -699,7 +699,7 @@ dump_loop(PLpgSQL_stmt_loop * stmt)
}
static void
-dump_while(PLpgSQL_stmt_while * stmt)
+dump_while(PLpgSQL_stmt_while *stmt)
{
dump_ind();
printf("WHILE ");
@@ -713,7 +713,7 @@ dump_while(PLpgSQL_stmt_while * stmt)
}
static void
-dump_fori(PLpgSQL_stmt_fori * stmt)
+dump_fori(PLpgSQL_stmt_fori *stmt)
{
dump_ind();
printf("FORI %s %s\n", stmt->var->refname, (stmt->reverse) ? "REVERSE" : "NORMAL");
@@ -736,7 +736,7 @@ dump_fori(PLpgSQL_stmt_fori * stmt)
}
static void
-dump_fors(PLpgSQL_stmt_fors * stmt)
+dump_fors(PLpgSQL_stmt_fors *stmt)
{
dump_ind();
printf("FORS %s ", (stmt->rec != NULL) ? stmt->rec->refname : stmt->row->refname);
@@ -750,7 +750,7 @@ dump_fors(PLpgSQL_stmt_fors * stmt)
}
static void
-dump_select(PLpgSQL_stmt_select * stmt)
+dump_select(PLpgSQL_stmt_select *stmt)
{
dump_ind();
printf("SELECT ");
@@ -773,7 +773,7 @@ dump_select(PLpgSQL_stmt_select * stmt)
}
static void
-dump_open(PLpgSQL_stmt_open * stmt)
+dump_open(PLpgSQL_stmt_open *stmt)
{
dump_ind();
printf("OPEN curvar=%d\n", stmt->curvar);
@@ -805,7 +805,7 @@ dump_open(PLpgSQL_stmt_open * stmt)
}
static void
-dump_fetch(PLpgSQL_stmt_fetch * stmt)
+dump_fetch(PLpgSQL_stmt_fetch *stmt)
{
dump_ind();
printf("FETCH curvar=%d\n", stmt->curvar);
@@ -826,14 +826,14 @@ dump_fetch(PLpgSQL_stmt_fetch * stmt)
}
static void
-dump_close(PLpgSQL_stmt_close * stmt)
+dump_close(PLpgSQL_stmt_close *stmt)
{
dump_ind();
printf("CLOSE curvar=%d\n", stmt->curvar);
}
static void
-dump_perform(PLpgSQL_stmt_perform * stmt)
+dump_perform(PLpgSQL_stmt_perform *stmt)
{
dump_ind();
printf("PERFORM expr = ");
@@ -842,7 +842,7 @@ dump_perform(PLpgSQL_stmt_perform * stmt)
}
static void
-dump_exit(PLpgSQL_stmt_exit * stmt)
+dump_exit(PLpgSQL_stmt_exit *stmt)
{
dump_ind();
printf("%s label='%s'",
@@ -856,7 +856,7 @@ dump_exit(PLpgSQL_stmt_exit * stmt)
}
static void
-dump_return(PLpgSQL_stmt_return * stmt)
+dump_return(PLpgSQL_stmt_return *stmt)
{
dump_ind();
printf("RETURN ");
@@ -870,7 +870,7 @@ dump_return(PLpgSQL_stmt_return * stmt)
}
static void
-dump_return_next(PLpgSQL_stmt_return_next * stmt)
+dump_return_next(PLpgSQL_stmt_return_next *stmt)
{
dump_ind();
printf("RETURN NEXT ");
@@ -884,7 +884,7 @@ dump_return_next(PLpgSQL_stmt_return_next * stmt)
}
static void
-dump_raise(PLpgSQL_stmt_raise * stmt)
+dump_raise(PLpgSQL_stmt_raise *stmt)
{
ListCell *lc;
int i = 0;
@@ -903,7 +903,7 @@ dump_raise(PLpgSQL_stmt_raise * stmt)
}
static void
-dump_execsql(PLpgSQL_stmt_execsql * stmt)
+dump_execsql(PLpgSQL_stmt_execsql *stmt)
{
dump_ind();
printf("EXECSQL ");
@@ -912,7 +912,7 @@ dump_execsql(PLpgSQL_stmt_execsql * stmt)
}
static void
-dump_dynexecute(PLpgSQL_stmt_dynexecute * stmt)
+dump_dynexecute(PLpgSQL_stmt_dynexecute *stmt)
{
dump_ind();
printf("EXECUTE ");
@@ -934,7 +934,7 @@ dump_dynexecute(PLpgSQL_stmt_dynexecute * stmt)
}
static void
-dump_dynfors(PLpgSQL_stmt_dynfors * stmt)
+dump_dynfors(PLpgSQL_stmt_dynfors *stmt)
{
dump_ind();
printf("FORS %s EXECUTE ", (stmt->rec != NULL) ? stmt->rec->refname : stmt->row->refname);
@@ -948,7 +948,7 @@ dump_dynfors(PLpgSQL_stmt_dynfors * stmt)
}
static void
-dump_getdiag(PLpgSQL_stmt_getdiag * stmt)
+dump_getdiag(PLpgSQL_stmt_getdiag *stmt)
{
ListCell *lc;
@@ -982,7 +982,7 @@ dump_getdiag(PLpgSQL_stmt_getdiag * stmt)
}
static void
-dump_expr(PLpgSQL_expr * expr)
+dump_expr(PLpgSQL_expr *expr)
{
int i;
@@ -1002,7 +1002,7 @@ dump_expr(PLpgSQL_expr * expr)
}
void
-plpgsql_dumptree(PLpgSQL_function * func)
+plpgsql_dumptree(PLpgSQL_function *func)
{
int i;
PLpgSQL_datum *d;
diff --git a/src/pl/plpgsql/src/plpgsql.h b/src/pl/plpgsql/src/plpgsql.h
index 38b1aa1329b..d9e3a894c53 100644
--- a/src/pl/plpgsql/src/plpgsql.h
+++ b/src/pl/plpgsql/src/plpgsql.h
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.65 2005/10/15 02:49:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/plpgsql.h,v 1.66 2005/11/22 18:17:33 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -150,7 +150,7 @@ typedef struct
int alloc;
int used; /* Including NUL terminator */
char *value;
-} PLpgSQL_dstring;
+} PLpgSQL_dstring;
typedef struct
@@ -164,7 +164,7 @@ typedef struct
Oid typioparam;
FmgrInfo typinput; /* lookup info for typinput function */
int32 atttypmod; /* typmod (taken from someplace else) */
-} PLpgSQL_type;
+} PLpgSQL_type;
/*
@@ -176,7 +176,7 @@ typedef struct
{ /* Generic datum array item */
int dtype;
int dno;
-} PLpgSQL_datum;
+} PLpgSQL_datum;
/*
* The variants PLpgSQL_var, PLpgSQL_row, and PLpgSQL_rec share these
@@ -188,7 +188,7 @@ typedef struct
int dno;
char *refname;
int lineno;
-} PLpgSQL_variable;
+} PLpgSQL_variable;
typedef struct PLpgSQL_expr
{ /* SQL Query to plan and execute */
@@ -206,7 +206,7 @@ typedef struct PLpgSQL_expr
/* params to pass to expr */
int nparams;
int params[1]; /* VARIABLE SIZE ARRAY ... must be last */
-} PLpgSQL_expr;
+} PLpgSQL_expr;
typedef struct
@@ -226,7 +226,7 @@ typedef struct
Datum value;
bool isnull;
bool freeval;
-} PLpgSQL_var;
+} PLpgSQL_var;
typedef struct
@@ -248,7 +248,7 @@ typedef struct
int nfields;
char **fieldnames;
int *varnos;
-} PLpgSQL_row;
+} PLpgSQL_row;
typedef struct
@@ -262,7 +262,7 @@ typedef struct
TupleDesc tupdesc;
bool freetup;
bool freetupdesc;
-} PLpgSQL_rec;
+} PLpgSQL_rec;
typedef struct
@@ -271,7 +271,7 @@ typedef struct
int rfno;
char *fieldname;
int recparentno; /* dno of parent record */
-} PLpgSQL_recfield;
+} PLpgSQL_recfield;
typedef struct
@@ -280,7 +280,7 @@ typedef struct
int dno;
PLpgSQL_expr *subscript;
int arrayparentno; /* dno of parent array variable */
-} PLpgSQL_arrayelem;
+} PLpgSQL_arrayelem;
typedef struct
@@ -288,7 +288,7 @@ typedef struct
int dtype;
int dno;
PLpgSQL_expr *argnum;
-} PLpgSQL_trigarg;
+} PLpgSQL_trigarg;
typedef struct
@@ -296,7 +296,7 @@ typedef struct
int itemtype;
int itemno;
char name[1];
-} PLpgSQL_nsitem;
+} PLpgSQL_nsitem;
/* XXX: consider adapting this to use List */
@@ -306,14 +306,14 @@ typedef struct PLpgSQL_ns
int items_used;
PLpgSQL_nsitem **items;
struct PLpgSQL_ns *upper;
-} PLpgSQL_ns;
+} PLpgSQL_ns;
typedef struct
{ /* Generic execution node */
int cmd_type;
int lineno;
-} PLpgSQL_stmt;
+} PLpgSQL_stmt;
typedef struct PLpgSQL_condition
@@ -321,21 +321,21 @@ typedef struct PLpgSQL_condition
int sqlerrstate; /* SQLSTATE code */
char *condname; /* condition name (for debugging) */
struct PLpgSQL_condition *next;
-} PLpgSQL_condition;
+} PLpgSQL_condition;
typedef struct
{
int sqlstate_varno;
int sqlerrm_varno;
List *exc_list; /* List of WHEN clauses */
-} PLpgSQL_exception_block;
+} PLpgSQL_exception_block;
typedef struct
{ /* One EXCEPTION ... WHEN clause */
int lineno;
PLpgSQL_condition *conditions;
List *action; /* List of statements */
-} PLpgSQL_exception;
+} PLpgSQL_exception;
typedef struct
@@ -347,7 +347,7 @@ typedef struct
int n_initvars;
int *initvarnos;
PLpgSQL_exception_block *exceptions;
-} PLpgSQL_stmt_block;
+} PLpgSQL_stmt_block;
typedef struct
@@ -356,27 +356,27 @@ typedef struct
int lineno;
int varno;
PLpgSQL_expr *expr;
-} PLpgSQL_stmt_assign;
+} PLpgSQL_stmt_assign;
typedef struct
{ /* PERFORM statement */
int cmd_type;
int lineno;
PLpgSQL_expr *expr;
-} PLpgSQL_stmt_perform;
+} PLpgSQL_stmt_perform;
typedef struct
{ /* Get Diagnostics item */
int kind; /* id for diagnostic value desired */
int target; /* where to assign it */
-} PLpgSQL_diag_item;
+} PLpgSQL_diag_item;
typedef struct
{ /* Get Diagnostics statement */
int cmd_type;
int lineno;
List *diag_items; /* List of PLpgSQL_diag_item */
-} PLpgSQL_stmt_getdiag;
+} PLpgSQL_stmt_getdiag;
typedef struct
@@ -386,7 +386,7 @@ typedef struct
PLpgSQL_expr *cond;
List *true_body; /* List of statements */
List *false_body; /* List of statements */
-} PLpgSQL_stmt_if;
+} PLpgSQL_stmt_if;
typedef struct
@@ -395,7 +395,7 @@ typedef struct
int lineno;
char *label;
List *body; /* List of statements */
-} PLpgSQL_stmt_loop;
+} PLpgSQL_stmt_loop;
typedef struct
@@ -405,7 +405,7 @@ typedef struct
char *label;
PLpgSQL_expr *cond;
List *body; /* List of statements */
-} PLpgSQL_stmt_while;
+} PLpgSQL_stmt_while;
typedef struct
@@ -418,7 +418,7 @@ typedef struct
PLpgSQL_expr *upper;
int reverse;
List *body; /* List of statements */
-} PLpgSQL_stmt_fori;
+} PLpgSQL_stmt_fori;
typedef struct
@@ -430,7 +430,7 @@ typedef struct
PLpgSQL_row *row;
PLpgSQL_expr *query;
List *body; /* List of statements */
-} PLpgSQL_stmt_fors;
+} PLpgSQL_stmt_fors;
typedef struct
@@ -442,7 +442,7 @@ typedef struct
PLpgSQL_row *row;
PLpgSQL_expr *query;
List *body; /* List of statements */
-} PLpgSQL_stmt_dynfors;
+} PLpgSQL_stmt_dynfors;
typedef struct
@@ -452,7 +452,7 @@ typedef struct
PLpgSQL_rec *rec;
PLpgSQL_row *row;
PLpgSQL_expr *query;
-} PLpgSQL_stmt_select;
+} PLpgSQL_stmt_select;
typedef struct
@@ -464,7 +464,7 @@ typedef struct
PLpgSQL_expr *argquery;
PLpgSQL_expr *query;
PLpgSQL_expr *dynquery;
-} PLpgSQL_stmt_open;
+} PLpgSQL_stmt_open;
typedef struct
@@ -474,7 +474,7 @@ typedef struct
PLpgSQL_rec *rec;
PLpgSQL_row *row;
int curvar;
-} PLpgSQL_stmt_fetch;
+} PLpgSQL_stmt_fetch;
typedef struct
@@ -482,7 +482,7 @@ typedef struct
int cmd_type;
int lineno;
int curvar;
-} PLpgSQL_stmt_close;
+} PLpgSQL_stmt_close;
typedef struct
@@ -492,7 +492,7 @@ typedef struct
bool is_exit; /* Is this an exit or a continue? */
char *label;
PLpgSQL_expr *cond;
-} PLpgSQL_stmt_exit;
+} PLpgSQL_stmt_exit;
typedef struct
@@ -501,7 +501,7 @@ typedef struct
int lineno;
PLpgSQL_expr *expr;
int retvarno;
-} PLpgSQL_stmt_return;
+} PLpgSQL_stmt_return;
typedef struct
{ /* RETURN NEXT statement */
@@ -509,7 +509,7 @@ typedef struct
int lineno;
PLpgSQL_expr *expr;
int retvarno;
-} PLpgSQL_stmt_return_next;
+} PLpgSQL_stmt_return_next;
typedef struct
{ /* RAISE statement */
@@ -518,7 +518,7 @@ typedef struct
int elog_level;
char *message;
List *params; /* list of expressions */
-} PLpgSQL_stmt_raise;
+} PLpgSQL_stmt_raise;
typedef struct
@@ -526,7 +526,7 @@ typedef struct
int cmd_type;
int lineno;
PLpgSQL_expr *sqlstmt;
-} PLpgSQL_stmt_execsql;
+} PLpgSQL_stmt_execsql;
typedef struct
@@ -536,7 +536,7 @@ typedef struct
PLpgSQL_rec *rec; /* INTO record or row variable */
PLpgSQL_row *row;
PLpgSQL_expr *query;
-} PLpgSQL_stmt_dynexecute;
+} PLpgSQL_stmt_dynexecute;
typedef struct PLpgSQL_func_hashkey
@@ -556,7 +556,7 @@ typedef struct PLpgSQL_func_hashkey
* PLpgSQL functions. Be careful that extra positions are zeroed!
*/
Oid argtypes[FUNC_MAX_ARGS];
-} PLpgSQL_func_hashkey;
+} PLpgSQL_func_hashkey;
typedef struct PLpgSQL_function
@@ -595,7 +595,7 @@ typedef struct PLpgSQL_function
int ndatums;
PLpgSQL_datum **datums;
PLpgSQL_stmt_block *action;
-} PLpgSQL_function;
+} PLpgSQL_function;
typedef struct
@@ -635,7 +635,7 @@ typedef struct
PLpgSQL_function *err_func; /* current func */
PLpgSQL_stmt *err_stmt; /* current stmt */
const char *err_text; /* additional state info */
-} PLpgSQL_execstate;
+} PLpgSQL_execstate;
/**********************************************************************
@@ -680,10 +680,10 @@ extern int plpgsql_parse_dblwordrowtype(char *word);
extern PLpgSQL_type *plpgsql_parse_datatype(const char *string);
extern PLpgSQL_type *plpgsql_build_datatype(Oid typeOid, int32 typmod);
extern PLpgSQL_variable *plpgsql_build_variable(const char *refname, int lineno,
- PLpgSQL_type * dtype,
+ PLpgSQL_type *dtype,
bool add2namespace);
extern PLpgSQL_condition *plpgsql_parse_err_condition(char *condname);
-extern void plpgsql_adddatum(PLpgSQL_datum * new);
+extern void plpgsql_adddatum(PLpgSQL_datum *new);
extern int plpgsql_add_initdatums(int **varnos);
extern void plpgsql_HashTableInit(void);
extern void plpgsql_compile_error_callback(void *arg);
@@ -700,9 +700,9 @@ extern Datum plpgsql_validator(PG_FUNCTION_ARGS);
* Functions in pl_exec.c
* ----------
*/
-extern Datum plpgsql_exec_function(PLpgSQL_function * func,
+extern Datum plpgsql_exec_function(PLpgSQL_function *func,
FunctionCallInfo fcinfo);
-extern HeapTuple plpgsql_exec_trigger(PLpgSQL_function * func,
+extern HeapTuple plpgsql_exec_trigger(PLpgSQL_function *func,
TriggerData *trigdata);
extern void plpgsql_xact_cb(XactEvent event, void *arg);
@@ -710,11 +710,11 @@ extern void plpgsql_xact_cb(XactEvent event, void *arg);
* Functions for the dynamic string handling in pl_funcs.c
* ----------
*/
-extern void plpgsql_dstring_init(PLpgSQL_dstring * ds);
-extern void plpgsql_dstring_free(PLpgSQL_dstring * ds);
-extern void plpgsql_dstring_append(PLpgSQL_dstring * ds, const char *str);
-extern void plpgsql_dstring_append_char(PLpgSQL_dstring * ds, char c);
-extern char *plpgsql_dstring_get(PLpgSQL_dstring * ds);
+extern void plpgsql_dstring_init(PLpgSQL_dstring *ds);
+extern void plpgsql_dstring_free(PLpgSQL_dstring *ds);
+extern void plpgsql_dstring_append(PLpgSQL_dstring *ds, const char *str);
+extern void plpgsql_dstring_append_char(PLpgSQL_dstring *ds, char c);
+extern char *plpgsql_dstring_get(PLpgSQL_dstring *ds);
/* ----------
* Functions for the namestack handling in pl_funcs.c
@@ -733,8 +733,8 @@ extern void plpgsql_ns_rename(char *oldname, char *newname);
* ----------
*/
extern void plpgsql_convert_ident(const char *s, char **output, int numidents);
-extern const char *plpgsql_stmt_typename(PLpgSQL_stmt * stmt);
-extern void plpgsql_dumptree(PLpgSQL_function * func);
+extern const char *plpgsql_stmt_typename(PLpgSQL_stmt *stmt);
+extern void plpgsql_dumptree(PLpgSQL_function *func);
/* ----------
* Externs in gram.y and scan.l
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index fe4e9f030ec..de8a2ded9c8 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.98 2005/10/15 02:49:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/pl/tcl/pltcl.c,v 1.99 2005/11/22 18:17:34 momjian Exp $
*
**********************************************************************/
@@ -112,7 +112,7 @@ typedef struct pltcl_proc_desc
int nargs;
FmgrInfo arg_out_func[FUNC_MAX_ARGS];
bool arg_is_rowtype[FUNC_MAX_ARGS];
-} pltcl_proc_desc;
+} pltcl_proc_desc;
/**********************************************************************
@@ -126,7 +126,7 @@ typedef struct pltcl_query_desc
Oid *argtypes;
FmgrInfo *arginfuncs;
Oid *argtypioparams;
-} pltcl_query_desc;
+} pltcl_query_desc;
/**********************************************************************
@@ -149,9 +149,9 @@ static pltcl_proc_desc *pltcl_current_prodesc = NULL;
* Forward declarations
**********************************************************************/
static void pltcl_init_all(void);
-static void pltcl_init_interp(Tcl_Interp * interp);
+static void pltcl_init_interp(Tcl_Interp *interp);
-static void pltcl_init_load_unknown(Tcl_Interp * interp);
+static void pltcl_init_load_unknown(Tcl_Interp *interp);
Datum pltcl_call_handler(PG_FUNCTION_ARGS);
Datum pltclu_call_handler(PG_FUNCTION_ARGS);
@@ -163,34 +163,34 @@ static HeapTuple pltcl_trigger_handler(PG_FUNCTION_ARGS);
static pltcl_proc_desc *compile_pltcl_function(Oid fn_oid, Oid tgreloid);
-static int pltcl_elog(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_elog(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static int pltcl_quote(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_quote(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static int pltcl_argisnull(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_argisnull(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static int pltcl_returnnull(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_returnnull(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static int pltcl_SPI_execute(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_SPI_execute(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static int pltcl_process_SPI_result(Tcl_Interp * interp,
+static int pltcl_process_SPI_result(Tcl_Interp *interp,
CONST84 char *arrayname,
CONST84 char *loop_body,
int spi_rc,
SPITupleTable *tuptable,
int ntuples);
-static int pltcl_SPI_prepare(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_SPI_prepare(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static int pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static int pltcl_SPI_lastoid(ClientData cdata, Tcl_Interp * interp,
+static int pltcl_SPI_lastoid(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[]);
-static void pltcl_set_tuple_values(Tcl_Interp * interp, CONST84 char *arrayname,
+static void pltcl_set_tuple_values(Tcl_Interp *interp, CONST84 char *arrayname,
int tupno, HeapTuple tuple, TupleDesc tupdesc);
static void pltcl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc,
- Tcl_DString * retval);
+ Tcl_DString *retval);
/*
@@ -296,7 +296,7 @@ pltcl_init_all(void)
* pltcl_init_interp() - initialize a Tcl interpreter
**********************************************************************/
static void
-pltcl_init_interp(Tcl_Interp * interp)
+pltcl_init_interp(Tcl_Interp *interp)
{
/************************************************************
* Install the commands for SPI support in the interpreter
@@ -326,7 +326,7 @@ pltcl_init_interp(Tcl_Interp * interp)
* table pltcl_modules (if it exists)
**********************************************************************/
static void
-pltcl_init_load_unknown(Tcl_Interp * interp)
+pltcl_init_load_unknown(Tcl_Interp *interp)
{
int spi_rc;
int tcl_rc;
@@ -1270,7 +1270,7 @@ compile_pltcl_function(Oid fn_oid, Oid tgreloid)
* pltcl_elog() - elog() support for PLTcl
**********************************************************************/
static int
-pltcl_elog(ClientData cdata, Tcl_Interp * interp,
+pltcl_elog(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
volatile int level;
@@ -1342,7 +1342,7 @@ pltcl_elog(ClientData cdata, Tcl_Interp * interp,
* be used in SPI_execute query strings
**********************************************************************/
static int
-pltcl_quote(ClientData cdata, Tcl_Interp * interp,
+pltcl_quote(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
char *tmp;
@@ -1395,7 +1395,7 @@ pltcl_quote(ClientData cdata, Tcl_Interp * interp,
* pltcl_argisnull() - determine if a specific argument is NULL
**********************************************************************/
static int
-pltcl_argisnull(ClientData cdata, Tcl_Interp * interp,
+pltcl_argisnull(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
int argno;
@@ -1452,7 +1452,7 @@ pltcl_argisnull(ClientData cdata, Tcl_Interp * interp,
* pltcl_returnnull() - Cause a NULL return from a function
**********************************************************************/
static int
-pltcl_returnnull(ClientData cdata, Tcl_Interp * interp,
+pltcl_returnnull(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
FunctionCallInfo fcinfo = pltcl_current_fcinfo;
@@ -1535,7 +1535,7 @@ pltcl_subtrans_commit(MemoryContext oldcontext, ResourceOwner oldowner)
}
static void
-pltcl_subtrans_abort(Tcl_Interp * interp,
+pltcl_subtrans_abort(Tcl_Interp *interp,
MemoryContext oldcontext, ResourceOwner oldowner)
{
ErrorData *edata;
@@ -1568,7 +1568,7 @@ pltcl_subtrans_abort(Tcl_Interp * interp,
* for the Tcl interpreter
**********************************************************************/
static int
-pltcl_SPI_execute(ClientData cdata, Tcl_Interp * interp,
+pltcl_SPI_execute(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
int my_rc;
@@ -1671,7 +1671,7 @@ pltcl_SPI_execute(ClientData cdata, Tcl_Interp * interp,
* Shared code between pltcl_SPI_execute and pltcl_SPI_execute_plan
*/
static int
-pltcl_process_SPI_result(Tcl_Interp * interp,
+pltcl_process_SPI_result(Tcl_Interp *interp,
CONST84 char *arrayname,
CONST84 char *loop_body,
int spi_rc,
@@ -1775,7 +1775,7 @@ pltcl_process_SPI_result(Tcl_Interp * interp,
* and not save the plan currently.
**********************************************************************/
static int
-pltcl_SPI_prepare(ClientData cdata, Tcl_Interp * interp,
+pltcl_SPI_prepare(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
int nargs;
@@ -1920,7 +1920,7 @@ pltcl_SPI_prepare(ClientData cdata, Tcl_Interp * interp,
* pltcl_SPI_execute_plan() - Execute a prepared plan
**********************************************************************/
static int
-pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp * interp,
+pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
int my_rc;
@@ -2140,7 +2140,7 @@ pltcl_SPI_execute_plan(ClientData cdata, Tcl_Interp * interp,
* be used after insert queries
**********************************************************************/
static int
-pltcl_SPI_lastoid(ClientData cdata, Tcl_Interp * interp,
+pltcl_SPI_lastoid(ClientData cdata, Tcl_Interp *interp,
int argc, CONST84 char *argv[])
{
char buf[64];
@@ -2156,7 +2156,7 @@ pltcl_SPI_lastoid(ClientData cdata, Tcl_Interp * interp,
* of a given tuple
**********************************************************************/
static void
-pltcl_set_tuple_values(Tcl_Interp * interp, CONST84 char *arrayname,
+pltcl_set_tuple_values(Tcl_Interp *interp, CONST84 char *arrayname,
int tupno, HeapTuple tuple, TupleDesc tupdesc)
{
int i;
@@ -2249,7 +2249,7 @@ pltcl_set_tuple_values(Tcl_Interp * interp, CONST84 char *arrayname,
**********************************************************************/
static void
pltcl_build_tuple_argument(HeapTuple tuple, TupleDesc tupdesc,
- Tcl_DString * retval)
+ Tcl_DString *retval)
{
int i;
char *outputstr;