* Module initialize function: fetch function pointers for cross-module calls. */
| 38 | * Module initialize function: fetch function pointers for cross-module calls. |
| 39 | */ |
| 40 | void |
| 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) |
nothing calls this directly
no test coverage detected