From f9de1e9a96a8e63bd4d3b9e615abd9cf6d8de703 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 29 Dec 2011 22:55:49 +0200 Subject: [PATCH] PL/Python: Add argument names to function declarations For easier source reading --- src/pl/plpython/plpy_cursorobject.c | 12 ++++---- src/pl/plpython/plpy_cursorobject.h | 2 +- src/pl/plpython/plpy_elog.c | 8 +++--- src/pl/plpython/plpy_elog.h | 6 ++-- src/pl/plpython/plpy_exec.c | 20 ++++++------- src/pl/plpython/plpy_exec.h | 4 +-- src/pl/plpython/plpy_main.c | 6 ++-- src/pl/plpython/plpy_planobject.c | 4 +-- src/pl/plpython/plpy_planobject.h | 2 +- src/pl/plpython/plpy_plpymodule.c | 24 ++++++++-------- src/pl/plpython/plpy_procedure.c | 8 +++--- src/pl/plpython/plpy_procedure.h | 8 +++--- src/pl/plpython/plpy_resultobject.c | 16 +++++------ src/pl/plpython/plpy_spi.c | 8 +++--- src/pl/plpython/plpy_spi.h | 4 +-- src/pl/plpython/plpy_subxactobject.c | 6 ++-- src/pl/plpython/plpy_subxactobject.h | 2 +- src/pl/plpython/plpy_typeio.c | 42 ++++++++++++++-------------- src/pl/plpython/plpy_typeio.h | 18 ++++++------ src/pl/plpython/plpy_util.h | 8 +++--- 20 files changed, 104 insertions(+), 104 deletions(-) diff --git a/src/pl/plpython/plpy_cursorobject.c b/src/pl/plpython/plpy_cursorobject.c index 48a7727b79..b1ef7d73a3 100644 --- a/src/pl/plpython/plpy_cursorobject.c +++ b/src/pl/plpython/plpy_cursorobject.c @@ -20,12 +20,12 @@ #include "plpy_spi.h" -static PyObject *PLy_cursor_query(const char *); -static PyObject *PLy_cursor_plan(PyObject *, PyObject *); -static void PLy_cursor_dealloc(PyObject *); -static PyObject *PLy_cursor_iternext(PyObject *); -static PyObject *PLy_cursor_fetch(PyObject *, PyObject *); -static PyObject *PLy_cursor_close(PyObject *, PyObject *); +static PyObject *PLy_cursor_query(const char *query); +static PyObject *PLy_cursor_plan(PyObject *ob, PyObject *args); +static void PLy_cursor_dealloc(PyObject *arg); +static PyObject *PLy_cursor_iternext(PyObject *self); +static PyObject *PLy_cursor_fetch(PyObject *self, PyObject *args); +static PyObject *PLy_cursor_close(PyObject *self, PyObject *unused); static char PLy_cursor_doc[] = { "Wrapper around a PostgreSQL cursor" diff --git a/src/pl/plpython/plpy_cursorobject.h b/src/pl/plpython/plpy_cursorobject.h index 706134ea2c..1dd9d48fd5 100644 --- a/src/pl/plpython/plpy_cursorobject.h +++ b/src/pl/plpython/plpy_cursorobject.h @@ -17,6 +17,6 @@ typedef struct PLyCursorObject } PLyCursorObject; extern void PLy_cursor_init_type(void); -extern PyObject *PLy_cursor(PyObject *, PyObject *); +extern PyObject *PLy_cursor(PyObject *self, PyObject *args); #endif /* PLPY_CURSOROBJECT_H */ diff --git a/src/pl/plpython/plpy_elog.c b/src/pl/plpython/plpy_elog.c index 0ff55ac8bd..741980c7c5 100644 --- a/src/pl/plpython/plpy_elog.c +++ b/src/pl/plpython/plpy_elog.c @@ -20,10 +20,10 @@ PyObject *PLy_exc_fatal = NULL; PyObject *PLy_exc_spi_error = NULL; -static void PLy_traceback(char **, char **, int *); -static void PLy_get_spi_error_data(PyObject *, int *, char **, - char **, char **, int *); -static char * get_source_line(const char *, int); +static void PLy_traceback(char **xmsg, char **tbmsg, int *tb_depth); +static void PLy_get_spi_error_data(PyObject *exc, int *sqlerrcode, char **detail, + char **hint, char **query, int *position); +static char * get_source_line(const char *src, int lineno); /* diff --git a/src/pl/plpython/plpy_elog.h b/src/pl/plpython/plpy_elog.h index eafc6e4e10..f7223b0056 100644 --- a/src/pl/plpython/plpy_elog.h +++ b/src/pl/plpython/plpy_elog.h @@ -10,13 +10,13 @@ extern PyObject *PLy_exc_error; extern PyObject *PLy_exc_fatal; extern PyObject *PLy_exc_spi_error; -extern void PLy_elog(int, const char *,...) +extern void PLy_elog(int elevel, const char *fmt,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); -extern void PLy_exception_set(PyObject *, const char *,...) +extern void PLy_exception_set(PyObject *exc, const char *fmt,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3))); -extern void PLy_exception_set_plural(PyObject *, const char *, const char *, +extern void PLy_exception_set_plural(PyObject *exc, const char *fmt_singular, const char *fmt_plural, unsigned long n,...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 5))) __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 5))); diff --git a/src/pl/plpython/plpy_exec.c b/src/pl/plpython/plpy_exec.c index 7724f3f0cd..ecf4996e8c 100644 --- a/src/pl/plpython/plpy_exec.c +++ b/src/pl/plpython/plpy_exec.c @@ -25,18 +25,18 @@ #include "plpy_subxactobject.h" -static PyObject *PLy_function_build_args(FunctionCallInfo, PLyProcedure *); -static void PLy_function_delete_args(PLyProcedure *); -static void plpython_return_error_callback(void *); +static PyObject *PLy_function_build_args(FunctionCallInfo fcinfo, PLyProcedure *proc); +static void PLy_function_delete_args(PLyProcedure *proc); +static void plpython_return_error_callback(void *arg); -static PyObject *PLy_trigger_build_args(FunctionCallInfo, PLyProcedure *, - HeapTuple *); -static HeapTuple PLy_modify_tuple(PLyProcedure *, PyObject *, - TriggerData *, HeapTuple); -static void plpython_trigger_error_callback(void *); +static PyObject *PLy_trigger_build_args(FunctionCallInfo fcinfo, PLyProcedure *proc, + HeapTuple *rv); +static HeapTuple PLy_modify_tuple(PLyProcedure *proc, PyObject *pltd, + TriggerData *tdata, HeapTuple otup); +static void plpython_trigger_error_callback(void *arg); -static PyObject *PLy_procedure_call(PLyProcedure *, char *, PyObject *); -static void PLy_abort_open_subtransactions(int); +static PyObject *PLy_procedure_call(PLyProcedure *proc, char *kargs, PyObject *vargs); +static void PLy_abort_open_subtransactions(int save_subxact_level); /* function subhandler */ diff --git a/src/pl/plpython/plpy_exec.h b/src/pl/plpython/plpy_exec.h index 86ceba13c4..f3dec074c1 100644 --- a/src/pl/plpython/plpy_exec.h +++ b/src/pl/plpython/plpy_exec.h @@ -7,7 +7,7 @@ #include "plpy_procedure.h" -extern Datum PLy_exec_function(FunctionCallInfo, PLyProcedure *); -extern HeapTuple PLy_exec_trigger(FunctionCallInfo, PLyProcedure *); +extern Datum PLy_exec_function(FunctionCallInfo fcinfo, PLyProcedure *proc); +extern HeapTuple PLy_exec_trigger(FunctionCallInfo fcinfo, PLyProcedure *proc); #endif /* PLPY_EXEC_H */ diff --git a/src/pl/plpython/plpy_main.c b/src/pl/plpython/plpy_main.c index 03c03d1d7d..ae9d87e9a6 100644 --- a/src/pl/plpython/plpy_main.c +++ b/src/pl/plpython/plpy_main.c @@ -61,9 +61,9 @@ PG_FUNCTION_INFO_V1(plpython2_inline_handler); #endif -static bool PLy_procedure_is_trigger(Form_pg_proc); -static void plpython_error_callback(void *); -static void plpython_inline_error_callback(void *); +static bool PLy_procedure_is_trigger(Form_pg_proc procStruct); +static void plpython_error_callback(void *arg); +static void plpython_inline_error_callback(void *arg); static void PLy_init_interp(void); static const int plpython_python_version = PY_MAJOR_VERSION; diff --git a/src/pl/plpython/plpy_planobject.c b/src/pl/plpython/plpy_planobject.c index 01b40d1d81..8305bd68e9 100644 --- a/src/pl/plpython/plpy_planobject.c +++ b/src/pl/plpython/plpy_planobject.c @@ -13,8 +13,8 @@ #include "plpy_elog.h" -static void PLy_plan_dealloc(PyObject *); -static PyObject *PLy_plan_status(PyObject *, PyObject *); +static void PLy_plan_dealloc(PyObject *arg); +static PyObject *PLy_plan_status(PyObject *self, PyObject *args); static char PLy_plan_doc[] = { "Store a PostgreSQL plan" diff --git a/src/pl/plpython/plpy_planobject.h b/src/pl/plpython/plpy_planobject.h index 959813a24c..febc5c25ef 100644 --- a/src/pl/plpython/plpy_planobject.h +++ b/src/pl/plpython/plpy_planobject.h @@ -21,6 +21,6 @@ typedef struct PLyPlanObject extern void PLy_plan_init_type(void); extern PyObject *PLy_plan_new(void); -extern bool is_PLyPlanObject(PyObject *); +extern bool is_PLyPlanObject(PyObject *ob); #endif /* PLPY_PLANOBJECT_H */ diff --git a/src/pl/plpython/plpy_plpymodule.c b/src/pl/plpython/plpy_plpymodule.c index e911107d9a..d2d0a2a232 100644 --- a/src/pl/plpython/plpy_plpymodule.c +++ b/src/pl/plpython/plpy_plpymodule.c @@ -24,20 +24,20 @@ HTAB *PLy_spi_exceptions = NULL; -static void PLy_add_exceptions(PyObject *); -static void PLy_generate_spi_exceptions(PyObject *, PyObject *); +static void PLy_add_exceptions(PyObject *plpy); +static void PLy_generate_spi_exceptions(PyObject *mod, PyObject *base); /* module functions */ -static PyObject *PLy_debug(PyObject *, PyObject *); -static PyObject *PLy_log(PyObject *, PyObject *); -static PyObject *PLy_info(PyObject *, PyObject *); -static PyObject *PLy_notice(PyObject *, PyObject *); -static PyObject *PLy_warning(PyObject *, PyObject *); -static PyObject *PLy_error(PyObject *, PyObject *); -static PyObject *PLy_fatal(PyObject *, PyObject *); -static PyObject *PLy_quote_literal(PyObject *, PyObject *); -static PyObject *PLy_quote_nullable(PyObject *, PyObject *); -static PyObject *PLy_quote_ident(PyObject *, PyObject *); +static PyObject *PLy_debug(PyObject *self, PyObject *args); +static PyObject *PLy_log(PyObject *self, PyObject *args); +static PyObject *PLy_info(PyObject *self, PyObject *args); +static PyObject *PLy_notice(PyObject *self, PyObject *args); +static PyObject *PLy_warning(PyObject *self, PyObject *args); +static PyObject *PLy_error(PyObject *self, PyObject *args); +static PyObject *PLy_fatal(PyObject *self, PyObject *args); +static PyObject *PLy_quote_literal(PyObject *self, PyObject *args); +static PyObject *PLy_quote_nullable(PyObject *self, PyObject *args); +static PyObject *PLy_quote_ident(PyObject *self, PyObject *args); /* A list of all known exceptions, generated from backend/utils/errcodes.txt */ diff --git a/src/pl/plpython/plpy_procedure.c b/src/pl/plpython/plpy_procedure.c index b4f2abe262..229966ad79 100644 --- a/src/pl/plpython/plpy_procedure.c +++ b/src/pl/plpython/plpy_procedure.c @@ -28,10 +28,10 @@ PLyProcedure *PLy_curr_procedure = NULL; static HTAB *PLy_procedure_cache = NULL; static HTAB *PLy_trigger_cache = NULL; -static PLyProcedure *PLy_procedure_create(HeapTuple, Oid, bool); -static bool PLy_procedure_argument_valid(PLyTypeInfo *); -static bool PLy_procedure_valid(PLyProcedure *, HeapTuple procTup); -static char *PLy_procedure_munge_source(const char *, const char *); +static PLyProcedure *PLy_procedure_create(HeapTuple procTup, Oid fn_oid, bool is_trigger); +static bool PLy_procedure_argument_valid(PLyTypeInfo *arg); +static bool PLy_procedure_valid(PLyProcedure *proc, HeapTuple procTup); +static char *PLy_procedure_munge_source(const char *name, const char *src); void diff --git a/src/pl/plpython/plpy_procedure.h b/src/pl/plpython/plpy_procedure.h index 632b975cc1..e986c7ecc5 100644 --- a/src/pl/plpython/plpy_procedure.h +++ b/src/pl/plpython/plpy_procedure.h @@ -40,10 +40,10 @@ typedef struct PLyProcedureEntry } PLyProcedureEntry; /* PLyProcedure manipulation */ -extern char *PLy_procedure_name(PLyProcedure *); -extern PLyProcedure *PLy_procedure_get(Oid, bool); -extern void PLy_procedure_compile(PLyProcedure *, const char *); -extern void PLy_procedure_delete(PLyProcedure *); +extern char *PLy_procedure_name(PLyProcedure *proc); +extern PLyProcedure *PLy_procedure_get(Oid fn_oid, bool is_trigger); +extern void PLy_procedure_compile(PLyProcedure *proc, const char *src); +extern void PLy_procedure_delete(PLyProcedure *proc); /* currently active plpython function */ diff --git a/src/pl/plpython/plpy_resultobject.c b/src/pl/plpython/plpy_resultobject.c index e1b89260ff..bf46a16595 100644 --- a/src/pl/plpython/plpy_resultobject.c +++ b/src/pl/plpython/plpy_resultobject.c @@ -11,14 +11,14 @@ #include "plpy_resultobject.h" -static void PLy_result_dealloc(PyObject *); -static PyObject *PLy_result_nrows(PyObject *, PyObject *); -static PyObject *PLy_result_status(PyObject *, PyObject *); -static Py_ssize_t PLy_result_length(PyObject *); -static PyObject *PLy_result_item(PyObject *, Py_ssize_t); -static PyObject *PLy_result_slice(PyObject *, Py_ssize_t, Py_ssize_t); -static int PLy_result_ass_item(PyObject *, Py_ssize_t, PyObject *); -static int PLy_result_ass_slice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); +static void PLy_result_dealloc(PyObject *arg); +static PyObject *PLy_result_nrows(PyObject *self, PyObject *args); +static PyObject *PLy_result_status(PyObject *self, PyObject *args); +static Py_ssize_t PLy_result_length(PyObject *arg); +static PyObject *PLy_result_item(PyObject *arg, Py_ssize_t idx); +static PyObject *PLy_result_slice(PyObject *arg, Py_ssize_t lidx, Py_ssize_t hidx); +static int PLy_result_ass_item(PyObject *arg, Py_ssize_t idx, PyObject *item); +static int PLy_result_ass_slice(PyObject *rg, Py_ssize_t lidx, Py_ssize_t hidx, PyObject *slice); static char PLy_result_doc[] = { "Results of a PostgreSQL query" diff --git a/src/pl/plpython/plpy_spi.c b/src/pl/plpython/plpy_spi.c index 5e3099ee5b..3afb1093d5 100644 --- a/src/pl/plpython/plpy_spi.c +++ b/src/pl/plpython/plpy_spi.c @@ -24,10 +24,10 @@ #include "plpy_resultobject.h" -static PyObject *PLy_spi_execute_query(char *, long ); -static PyObject *PLy_spi_execute_plan(PyObject *, PyObject *, long); -static PyObject *PLy_spi_execute_fetch_result(SPITupleTable *, int, int); -static void PLy_spi_exception_set(PyObject *, ErrorData *); +static PyObject *PLy_spi_execute_query(char *query, long limit); +static PyObject *PLy_spi_execute_plan(PyObject *ob, PyObject *list, long limit); +static PyObject *PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status); +static void PLy_spi_exception_set(PyObject *excclass, ErrorData *edata); /* prepare(query="select * from foo") diff --git a/src/pl/plpython/plpy_spi.h b/src/pl/plpython/plpy_spi.h index c59482a3f0..f8d31638ec 100644 --- a/src/pl/plpython/plpy_spi.h +++ b/src/pl/plpython/plpy_spi.h @@ -8,8 +8,8 @@ #include "utils/palloc.h" #include "utils/resowner.h" -extern PyObject *PLy_spi_prepare(PyObject *, PyObject *); -extern PyObject *PLy_spi_execute(PyObject *, PyObject *); +extern PyObject *PLy_spi_prepare(PyObject *self, PyObject *args); +extern PyObject *PLy_spi_execute(PyObject *self, PyObject *args); typedef struct PLyExceptionEntry { diff --git a/src/pl/plpython/plpy_subxactobject.c b/src/pl/plpython/plpy_subxactobject.c index 6c3cc69adf..9feeddb723 100644 --- a/src/pl/plpython/plpy_subxactobject.c +++ b/src/pl/plpython/plpy_subxactobject.c @@ -19,9 +19,9 @@ List *explicit_subtransactions = NIL; -static void PLy_subtransaction_dealloc(PyObject *); -static PyObject *PLy_subtransaction_enter(PyObject *, PyObject *); -static PyObject *PLy_subtransaction_exit(PyObject *, PyObject *); +static void PLy_subtransaction_dealloc(PyObject *subxact); +static PyObject *PLy_subtransaction_enter(PyObject *self, PyObject *unused); +static PyObject *PLy_subtransaction_exit(PyObject *self, PyObject *args); static char PLy_subtransaction_doc[] = { "PostgreSQL subtransaction context manager" diff --git a/src/pl/plpython/plpy_subxactobject.h b/src/pl/plpython/plpy_subxactobject.h index 0db8aa9f3f..7e3002fc2f 100644 --- a/src/pl/plpython/plpy_subxactobject.h +++ b/src/pl/plpython/plpy_subxactobject.h @@ -24,6 +24,6 @@ typedef struct PLySubtransactionData } PLySubtransactionData; extern void PLy_subtransaction_init_type(void); -extern PyObject *PLy_subtransaction_new(PyObject *, PyObject *); +extern PyObject *PLy_subtransaction_new(PyObject *self, PyObject *unused); #endif /* PLPY_SUBXACTOBJECT */ diff --git a/src/pl/plpython/plpy_typeio.c b/src/pl/plpython/plpy_typeio.c index cd6a46d8da..d5cac9f1f0 100644 --- a/src/pl/plpython/plpy_typeio.c +++ b/src/pl/plpython/plpy_typeio.c @@ -26,35 +26,35 @@ /* I/O function caching */ -static void PLy_input_datum_func2(PLyDatumToOb *, Oid, HeapTuple); -static void PLy_output_datum_func2(PLyObToDatum *, HeapTuple); +static void PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup); +static void PLy_output_datum_func2(PLyObToDatum *arg, HeapTuple typeTup); /* conversion from Datums to Python objects */ -static PyObject *PLyBool_FromBool(PLyDatumToOb *, Datum); -static PyObject *PLyFloat_FromFloat4(PLyDatumToOb *, Datum); -static PyObject *PLyFloat_FromFloat8(PLyDatumToOb *, Datum); -static PyObject *PLyFloat_FromNumeric(PLyDatumToOb *, Datum); -static PyObject *PLyInt_FromInt16(PLyDatumToOb *, Datum); -static PyObject *PLyInt_FromInt32(PLyDatumToOb *, Datum); -static PyObject *PLyLong_FromInt64(PLyDatumToOb *, Datum); -static PyObject *PLyBytes_FromBytea(PLyDatumToOb *, Datum); -static PyObject *PLyString_FromDatum(PLyDatumToOb *, Datum); -static PyObject *PLyList_FromArray(PLyDatumToOb *, Datum); +static PyObject *PLyBool_FromBool(PLyDatumToOb *arg, Datum d); +static PyObject *PLyFloat_FromFloat4(PLyDatumToOb *arg, Datum d); +static PyObject *PLyFloat_FromFloat8(PLyDatumToOb *arg, Datum d); +static PyObject *PLyFloat_FromNumeric(PLyDatumToOb *arg, Datum d); +static PyObject *PLyInt_FromInt16(PLyDatumToOb *arg, Datum d); +static PyObject *PLyInt_FromInt32(PLyDatumToOb *arg, Datum d); +static PyObject *PLyLong_FromInt64(PLyDatumToOb *arg, Datum d); +static PyObject *PLyBytes_FromBytea(PLyDatumToOb *arg, Datum d); +static PyObject *PLyString_FromDatum(PLyDatumToOb *arg, Datum d); +static PyObject *PLyList_FromArray(PLyDatumToOb *arg, Datum d); /* conversion from Python objects to Datums */ -static Datum PLyObject_ToBool(PLyObToDatum *, int32, PyObject *); -static Datum PLyObject_ToBytea(PLyObToDatum *, int32, PyObject *); -static Datum PLyObject_ToComposite(PLyObToDatum *, int32, PyObject *); -static Datum PLyObject_ToDatum(PLyObToDatum *, int32, PyObject *); -static Datum PLySequence_ToArray(PLyObToDatum *, int32, PyObject *); +static Datum PLyObject_ToBool(PLyObToDatum *arg, int32 typmod, PyObject *plrv); +static Datum PLyObject_ToBytea(PLyObToDatum *arg, int32 typmod, PyObject *plrv); +static Datum PLyObject_ToComposite(PLyObToDatum *arg, int32 typmod, PyObject *plrv); +static Datum PLyObject_ToDatum(PLyObToDatum *arg, int32 typmod, PyObject *plrv); +static Datum PLySequence_ToArray(PLyObToDatum *arg, int32 typmod, PyObject *plrv); /* conversion from Python objects to heap tuples (used by triggers and SRFs) */ -static HeapTuple PLyMapping_ToTuple(PLyTypeInfo *, TupleDesc, PyObject *); -static HeapTuple PLySequence_ToTuple(PLyTypeInfo *, TupleDesc, PyObject *); -static HeapTuple PLyGenericObject_ToTuple(PLyTypeInfo *, TupleDesc, PyObject *); +static HeapTuple PLyMapping_ToTuple(PLyTypeInfo *info, TupleDesc desc, PyObject *mapping); +static HeapTuple PLySequence_ToTuple(PLyTypeInfo *info, TupleDesc desc, PyObject *sequence); +static HeapTuple PLyGenericObject_ToTuple(PLyTypeInfo *info, TupleDesc desc, PyObject *object); /* make allocations in the TopMemoryContext */ -static void perm_fmgr_info(Oid, FmgrInfo *); +static void perm_fmgr_info(Oid functionId, FmgrInfo *finfo); void PLy_typeinfo_init(PLyTypeInfo *arg) diff --git a/src/pl/plpython/plpy_typeio.h b/src/pl/plpython/plpy_typeio.h index 6708bf9c9b..e52c5d5047 100644 --- a/src/pl/plpython/plpy_typeio.h +++ b/src/pl/plpython/plpy_typeio.h @@ -87,21 +87,21 @@ typedef struct PLyTypeInfo ItemPointerData typrel_tid; } PLyTypeInfo; -extern void PLy_typeinfo_init(PLyTypeInfo *); -extern void PLy_typeinfo_dealloc(PLyTypeInfo *); +extern void PLy_typeinfo_init(PLyTypeInfo *arg); +extern void PLy_typeinfo_dealloc(PLyTypeInfo *arg); -extern void PLy_input_datum_func(PLyTypeInfo *, Oid, HeapTuple); -extern void PLy_output_datum_func(PLyTypeInfo *, HeapTuple); +extern void PLy_input_datum_func(PLyTypeInfo *arg, Oid typeOid, HeapTuple typeTup); +extern void PLy_output_datum_func(PLyTypeInfo *arg, HeapTuple typeTup); -extern void PLy_input_tuple_funcs(PLyTypeInfo *, TupleDesc); -extern void PLy_output_tuple_funcs(PLyTypeInfo *, TupleDesc); +extern void PLy_input_tuple_funcs(PLyTypeInfo *arg, TupleDesc desc); +extern void PLy_output_tuple_funcs(PLyTypeInfo *arg, TupleDesc desc); -extern void PLy_output_record_funcs(PLyTypeInfo *, TupleDesc); +extern void PLy_output_record_funcs(PLyTypeInfo *arg, TupleDesc desc); /* conversion from Python objects to heap tuples */ -extern HeapTuple PLyObject_ToTuple(PLyTypeInfo *, TupleDesc, PyObject *); +extern HeapTuple PLyObject_ToTuple(PLyTypeInfo *info, TupleDesc desc, PyObject *plrv); /* conversion from heap tuples to Python dictionaries */ -extern PyObject *PLyDict_FromTuple(PLyTypeInfo *, HeapTuple, TupleDesc); +extern PyObject *PLyDict_FromTuple(PLyTypeInfo *info, HeapTuple tuple, TupleDesc desc); #endif /* PLPY_TYPEIO_H */ diff --git a/src/pl/plpython/plpy_util.h b/src/pl/plpython/plpy_util.h index 237d6c5751..9b9eca0050 100644 --- a/src/pl/plpython/plpy_util.h +++ b/src/pl/plpython/plpy_util.h @@ -6,10 +6,10 @@ #ifndef PLPY_UTIL_H #define PLPY_UTIL_H -extern void *PLy_malloc(size_t); -extern void *PLy_malloc0(size_t); -extern char *PLy_strdup(const char *); -extern void PLy_free(void *); +extern void *PLy_malloc(size_t bytes); +extern void *PLy_malloc0(size_t bytes); +extern char *PLy_strdup(const char *str); +extern void PLy_free(void *ptr); extern PyObject *PLyUnicode_Bytes(PyObject *unicode); extern char *PLyUnicode_AsString(PyObject *unicode);