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

Function _PG_init

contrib/hstore_plpython/hstore_plpython.c:36–70  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

34 * Module initialize function: fetch function pointers for cross-module calls.
35 */
36void
37_PG_init(void)
38{
39 /* Asserts verify that typedefs above match original declarations */
40 AssertVariableIsOfType(&PLyObject_AsString, PLyObject_AsString_t);
41 PLyObject_AsString_p = (PLyObject_AsString_t)
42 load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyObject_AsString",
43 true, NULL);
44#if PY_MAJOR_VERSION >= 3
45 AssertVariableIsOfType(&PLyUnicode_FromStringAndSize, PLyUnicode_FromStringAndSize_t);
46 PLyUnicode_FromStringAndSize_p = (PLyUnicode_FromStringAndSize_t)
47 load_external_function("$libdir/" PLPYTHON_LIBNAME, "PLyUnicode_FromStringAndSize",
48 true, NULL);
49#endif
50 AssertVariableIsOfType(&hstoreUpgrade, hstoreUpgrade_t);
51 hstoreUpgrade_p = (hstoreUpgrade_t)
52 load_external_function("$libdir/hstore", "hstoreUpgrade",
53 true, NULL);
54 AssertVariableIsOfType(&hstoreUniquePairs, hstoreUniquePairs_t);
55 hstoreUniquePairs_p = (hstoreUniquePairs_t)
56 load_external_function("$libdir/hstore", "hstoreUniquePairs",
57 true, NULL);
58 AssertVariableIsOfType(&hstorePairs, hstorePairs_t);
59 hstorePairs_p = (hstorePairs_t)
60 load_external_function("$libdir/hstore", "hstorePairs",
61 true, NULL);
62 AssertVariableIsOfType(&hstoreCheckKeyLen, hstoreCheckKeyLen_t);
63 hstoreCheckKeyLen_p = (hstoreCheckKeyLen_t)
64 load_external_function("$libdir/hstore", "hstoreCheckKeyLen",
65 true, NULL);
66 AssertVariableIsOfType(&hstoreCheckValLen, hstoreCheckValLen_t);
67 hstoreCheckValLen_p = (hstoreCheckValLen_t)
68 load_external_function("$libdir/hstore", "hstoreCheckValLen",
69 true, NULL);
70}
71
72
73/* These defines must be after the module init function */

Callers

nothing calls this directly

Calls 1

load_external_functionFunction · 0.85

Tested by

no test coverage detected