2021-08-13 10:20:45 +00:00
|
|
|
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8 -*-│
|
|
|
|
│vi: set net ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi│
|
|
|
|
╞══════════════════════════════════════════════════════════════════════════════╡
|
|
|
|
│ Python 3 │
|
|
|
|
│ https://docs.python.org/3/license.html │
|
|
|
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
2021-08-12 07:42:14 +00:00
|
|
|
#include "third_party/python/Include/pyerrors.h"
|
|
|
|
#include "third_party/python/Python/importdl.h"
|
2021-08-10 17:26:13 +00:00
|
|
|
/* clang-format off */
|
2021-08-08 04:08:33 +00:00
|
|
|
|
|
|
|
/* Support for dynamic loading of extension modules */
|
|
|
|
|
|
|
|
extern char *Py_GetProgramName(void);
|
|
|
|
|
|
|
|
const char *_PyImport_DynLoadFiletab[] = {".o", NULL};
|
|
|
|
|
|
|
|
dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
|
|
|
|
const char *shortname,
|
|
|
|
const char *pathname, FILE *fp)
|
|
|
|
{
|
|
|
|
char funcname[258];
|
|
|
|
PyOS_snprintf(funcname, sizeof(funcname), "%.20s_%.200s", prefix, shortname);
|
|
|
|
return dl_loadmod(Py_GetProgramName(), pathname, funcname);
|
|
|
|
}
|