MCPcopy Create free account
hub / github.com/apache/cloudberry / _PG_init

Function _PG_init

contrib/jsonb_plpython/jsonb_plpython.c:40–59  ·  view source on GitHub ↗

* Module initialize function: fetch function pointers for cross-module calls. */

Source from the content-addressed store, hash-verified

38 * Module initialize function: fetch function pointers for cross-module calls.
39 */
40void
41_PG_init(void)
42{
43 /* Asserts verify that typedefs above match original declarations */
44 AssertVariableIsOfType(&PLyObject_AsString, PLyObject_AsString_t);
45 PLyObject_AsString_p = (PLyObject_AsString_t)
46 load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyObject_AsString",
47 true, NULL);
48#if PY_MAJOR_VERSION >= 3
49 AssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);
50 PLyUnicode_FromStringAndSize_p = (PLyUnicode_FromStringAndSize_t)
51 load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyUnicode_FromStringAndSize",
52 true, NULL);
53#endif
54
55 AssertVariableIsOfType(&PLy_elog_impl, PLy_elog_impl_t);
56 PLy_elog_impl_p = (PLy_elog_impl_t)
57 load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLy_elog_impl",
58 true, NULL);
59}
60
61/* These defines must be after the _PG_init */
62#define PLyObject_AsString (PLyObject_AsString_p)

Callers

nothing calls this directly

Calls 1

load_external_functionFunction · 0.85

Tested by

no test coverage detected