Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9de1e9

Browse files
committed
PL/Python: Add argument names to function declarations
For easier source reading
1 parenta671d94 commitf9de1e9

20 files changed

+106
-106
lines changed

‎src/pl/plpython/plpy_cursorobject.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
#include"plpy_spi.h"
2121

2222

23-
staticPyObject*PLy_cursor_query(constchar*);
24-
staticPyObject*PLy_cursor_plan(PyObject*,PyObject*);
25-
staticvoidPLy_cursor_dealloc(PyObject*);
26-
staticPyObject*PLy_cursor_iternext(PyObject*);
27-
staticPyObject*PLy_cursor_fetch(PyObject*,PyObject*);
28-
staticPyObject*PLy_cursor_close(PyObject*,PyObject*);
23+
staticPyObject*PLy_cursor_query(constchar*query);
24+
staticPyObject*PLy_cursor_plan(PyObject*ob,PyObject*args);
25+
staticvoidPLy_cursor_dealloc(PyObject*arg);
26+
staticPyObject*PLy_cursor_iternext(PyObject*self);
27+
staticPyObject*PLy_cursor_fetch(PyObject*self,PyObject*args);
28+
staticPyObject*PLy_cursor_close(PyObject*self,PyObject*unused);
2929

3030
staticcharPLy_cursor_doc[]= {
3131
"Wrapper around a PostgreSQL cursor"

‎src/pl/plpython/plpy_cursorobject.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ typedef struct PLyCursorObject
1717
}PLyCursorObject;
1818

1919
externvoidPLy_cursor_init_type(void);
20-
externPyObject*PLy_cursor(PyObject*,PyObject*);
20+
externPyObject*PLy_cursor(PyObject*self,PyObject*args);
2121

2222
#endif/* PLPY_CURSOROBJECT_H */

‎src/pl/plpython/plpy_elog.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ PyObject *PLy_exc_fatal = NULL;
2020
PyObject*PLy_exc_spi_error=NULL;
2121

2222

23-
staticvoidPLy_traceback(char**,char**,int*);
24-
staticvoidPLy_get_spi_error_data(PyObject*,int*,char**,
25-
char**,char**,int*);
26-
staticchar*get_source_line(constchar*,int);
23+
staticvoidPLy_traceback(char**xmsg,char**tbmsg,int*tb_depth);
24+
staticvoidPLy_get_spi_error_data(PyObject*exc,int*sqlerrcode,char**detail,
25+
char**hint,char**query,int*position);
26+
staticchar*get_source_line(constchar*src,intlineno);
2727

2828

2929
/*

‎src/pl/plpython/plpy_elog.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ extern PyObject *PLy_exc_error;
1010
externPyObject*PLy_exc_fatal;
1111
externPyObject*PLy_exc_spi_error;
1212

13-
externvoidPLy_elog(int,constchar*,...)
13+
externvoidPLy_elog(intelevel,constchar*fmt,...)
1414
__attribute__((format(PG_PRINTF_ATTRIBUTE,2,3)));
1515

16-
externvoidPLy_exception_set(PyObject*,constchar*,...)
16+
externvoidPLy_exception_set(PyObject*exc,constchar*fmt,...)
1717
__attribute__((format(PG_PRINTF_ATTRIBUTE,2,3)));
1818

19-
externvoidPLy_exception_set_plural(PyObject*,constchar*,constchar*,
19+
externvoidPLy_exception_set_plural(PyObject*exc,constchar*fmt_singular,constchar*fmt_plural,
2020
unsigned longn,...)
2121
__attribute__((format(PG_PRINTF_ATTRIBUTE,2,5)))
2222
__attribute__((format(PG_PRINTF_ATTRIBUTE,3,5)));

‎src/pl/plpython/plpy_exec.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
#include"plpy_subxactobject.h"
2626

2727

28-
staticPyObject*PLy_function_build_args(FunctionCallInfo,PLyProcedure*);
29-
staticvoidPLy_function_delete_args(PLyProcedure*);
30-
staticvoidplpython_return_error_callback(void*);
31-
32-
staticPyObject*PLy_trigger_build_args(FunctionCallInfo,PLyProcedure*,
33-
HeapTuple*);
34-
staticHeapTuplePLy_modify_tuple(PLyProcedure*,PyObject*,
35-
TriggerData*,HeapTuple);
36-
staticvoidplpython_trigger_error_callback(void*);
37-
38-
staticPyObject*PLy_procedure_call(PLyProcedure*,char*,PyObject*);
39-
staticvoidPLy_abort_open_subtransactions(int);
28+
staticPyObject*PLy_function_build_args(FunctionCallInfofcinfo,PLyProcedure*proc);
29+
staticvoidPLy_function_delete_args(PLyProcedure*proc);
30+
staticvoidplpython_return_error_callback(void*arg);
31+
32+
staticPyObject*PLy_trigger_build_args(FunctionCallInfofcinfo,PLyProcedure*proc,
33+
HeapTuple*rv);
34+
staticHeapTuplePLy_modify_tuple(PLyProcedure*proc,PyObject*pltd,
35+
TriggerData*tdata,HeapTupleotup);
36+
staticvoidplpython_trigger_error_callback(void*arg);
37+
38+
staticPyObject*PLy_procedure_call(PLyProcedure*proc,char*kargs,PyObject*vargs);
39+
staticvoidPLy_abort_open_subtransactions(intsave_subxact_level);
4040

4141

4242
/* function subhandler */

‎src/pl/plpython/plpy_exec.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#include"plpy_procedure.h"
99

10-
externDatumPLy_exec_function(FunctionCallInfo,PLyProcedure*);
11-
externHeapTuplePLy_exec_trigger(FunctionCallInfo,PLyProcedure*);
10+
externDatumPLy_exec_function(FunctionCallInfofcinfo,PLyProcedure*proc);
11+
externHeapTuplePLy_exec_trigger(FunctionCallInfofcinfo,PLyProcedure*proc);
1212

1313
#endif/* PLPY_EXEC_H */

‎src/pl/plpython/plpy_main.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ PG_FUNCTION_INFO_V1(plpython2_inline_handler);
6161
#endif
6262

6363

64-
staticboolPLy_procedure_is_trigger(Form_pg_proc);
65-
staticvoidplpython_error_callback(void*);
66-
staticvoidplpython_inline_error_callback(void*);
64+
staticboolPLy_procedure_is_trigger(Form_pg_procprocStruct);
65+
staticvoidplpython_error_callback(void*arg);
66+
staticvoidplpython_inline_error_callback(void*arg);
6767
staticvoidPLy_init_interp(void);
6868

6969
staticconstintplpython_python_version=PY_MAJOR_VERSION;

‎src/pl/plpython/plpy_planobject.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#include"plpy_elog.h"
1414

1515

16-
staticvoidPLy_plan_dealloc(PyObject*);
17-
staticPyObject*PLy_plan_status(PyObject*,PyObject*);
16+
staticvoidPLy_plan_dealloc(PyObject*arg);
17+
staticPyObject*PLy_plan_status(PyObject*self,PyObject*args);
1818

1919
staticcharPLy_plan_doc[]= {
2020
"Store a PostgreSQL plan"

‎src/pl/plpython/plpy_planobject.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ typedef struct PLyPlanObject
2121

2222
externvoidPLy_plan_init_type(void);
2323
externPyObject*PLy_plan_new(void);
24-
externboolis_PLyPlanObject(PyObject*);
24+
externboolis_PLyPlanObject(PyObject*ob);
2525

2626
#endif/* PLPY_PLANOBJECT_H */

‎src/pl/plpython/plpy_plpymodule.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@
2424
HTAB*PLy_spi_exceptions=NULL;
2525

2626

27-
staticvoidPLy_add_exceptions(PyObject*);
28-
staticvoidPLy_generate_spi_exceptions(PyObject*,PyObject*);
27+
staticvoidPLy_add_exceptions(PyObject*plpy);
28+
staticvoidPLy_generate_spi_exceptions(PyObject*mod,PyObject*base);
2929

3030
/* module functions */
31-
staticPyObject*PLy_debug(PyObject*,PyObject*);
32-
staticPyObject*PLy_log(PyObject*,PyObject*);
33-
staticPyObject*PLy_info(PyObject*,PyObject*);
34-
staticPyObject*PLy_notice(PyObject*,PyObject*);
35-
staticPyObject*PLy_warning(PyObject*,PyObject*);
36-
staticPyObject*PLy_error(PyObject*,PyObject*);
37-
staticPyObject*PLy_fatal(PyObject*,PyObject*);
38-
staticPyObject*PLy_quote_literal(PyObject*,PyObject*);
39-
staticPyObject*PLy_quote_nullable(PyObject*,PyObject*);
40-
staticPyObject*PLy_quote_ident(PyObject*,PyObject*);
31+
staticPyObject*PLy_debug(PyObject*self,PyObject*args);
32+
staticPyObject*PLy_log(PyObject*self,PyObject*args);
33+
staticPyObject*PLy_info(PyObject*self,PyObject*args);
34+
staticPyObject*PLy_notice(PyObject*self,PyObject*args);
35+
staticPyObject*PLy_warning(PyObject*self,PyObject*args);
36+
staticPyObject*PLy_error(PyObject*self,PyObject*args);
37+
staticPyObject*PLy_fatal(PyObject*self,PyObject*args);
38+
staticPyObject*PLy_quote_literal(PyObject*self,PyObject*args);
39+
staticPyObject*PLy_quote_nullable(PyObject*self,PyObject*args);
40+
staticPyObject*PLy_quote_ident(PyObject*self,PyObject*args);
4141

4242

4343
/* A list of all known exceptions, generated from backend/utils/errcodes.txt */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp