mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-30 01:47:20 +02:00
Remove a bunch of "extern Datum foo(PG_FUNCTION_ARGS);" declarations that
are no longer needed now that PG_FUNCTION_INFO_V1(foo) provides that.
Some of these were evidently missed in commit e7128e8dbb
, but others
were cargo-culted in in code added since then. Possibly that can be blamed
in part on the fact that we'd not fixed relevant documentation examples,
which I've now done.
32 lines
563 B
C
32 lines
563 B
C
#include "postgres.h"
|
|
#include "fmgr.h"
|
|
#include "plpython.h"
|
|
#include "ltree.h"
|
|
|
|
PG_MODULE_MAGIC;
|
|
|
|
|
|
PG_FUNCTION_INFO_V1(ltree_to_plpython);
|
|
|
|
Datum
|
|
ltree_to_plpython(PG_FUNCTION_ARGS)
|
|
{
|
|
ltree *in = PG_GETARG_LTREE(0);
|
|
int i;
|
|
PyObject *list;
|
|
ltree_level *curlevel;
|
|
|
|
list = PyList_New(in->numlevel);
|
|
|
|
curlevel = LTREE_FIRST(in);
|
|
for (i = 0; i < in->numlevel; i++)
|
|
{
|
|
PyList_SetItem(list, i, PyString_FromStringAndSize(curlevel->name, curlevel->len));
|
|
curlevel = LEVEL_NEXT(curlevel);
|
|
}
|
|
|
|
PG_FREE_IF_COPY(in, 0);
|
|
|
|
return PointerGetDatum(list);
|
|
}
|