Message377720
for example, there are some of shared libs, all these libs have a function named getList() exported. and getList() will return a list of names which also as a function name been exported.
shared lib A
export getList() -> return ["aaa", "bbb"]
export aaa()
export bbb();
shared lib A
export getList() -> return ["xyz", "abc", "mno"]
export xyz()
export abc();
export mno();
and I want expose shared lib A aaa, bbb or shared lib B xyz abc mno when I load them, (maybe A, maybe B, or maybe both if they exists, work like plugins)
I have a loop like
for (int i = 0; i < length_of_list; ++i) {
char* funcName = getName(i);
PyMethodDef def { funcName, fooCall, MATH_VARARGS, nullptr, /* funcname here */};
/// ....
}
PyObject* fooCall(PyObject* self, PyObject* args, void* context) {
char* funcname = (char*) context;
/// .... load func based on name.
} |
|
Date |
User |
Action |
Args |
2020-09-30 20:01:45 | dexter | set | recipients:
+ dexter |
2020-09-30 20:01:45 | dexter | set | messageid: <1601496105.03.0.485925740285.issue41895@roundup.psfhosted.org> |
2020-09-30 20:01:45 | dexter | link | issue41895 messages |
2020-09-30 20:01:44 | dexter | create | |
|