Fixed libSystem::Plugin::lookup()
This commit is contained in:
parent
875c5584f7
commit
55bc15fbb3
|
@ -25,6 +25,7 @@
|
||||||
static char const _libsystem_config_name[] = "libSystem::Config";
|
static char const _libsystem_config_name[] = "libSystem::Config";
|
||||||
static char const _libsystem_event_name[] = "libSystem::Event";
|
static char const _libsystem_event_name[] = "libSystem::Event";
|
||||||
static char const _libsystem_plugin_name[] = "libSystem::Plugin";
|
static char const _libsystem_plugin_name[] = "libSystem::Plugin";
|
||||||
|
static char const _libsystem_plugin_symbol_name[] = "libSystem::Plugin::symbol";
|
||||||
|
|
||||||
|
|
||||||
/* prototypes */
|
/* prototypes */
|
||||||
|
@ -343,11 +344,13 @@ static PyObject * _libsystem_plugin_lookup(PyObject * self, PyObject * args)
|
||||||
char const * symbol;
|
char const * symbol;
|
||||||
void * ret;
|
void * ret;
|
||||||
|
|
||||||
|
if(!PyArg_ParseTuple(args, "Os", &self, &symbol))
|
||||||
|
return NULL;
|
||||||
if((plugin = PyCapsule_GetPointer(self, _libsystem_plugin_name))
|
if((plugin = PyCapsule_GetPointer(self, _libsystem_plugin_name))
|
||||||
== NULL)
|
== NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
if(!PyArg_ParseTuple(args, "s", &symbol))
|
if((ret = plugin_lookup(plugin, symbol)) == NULL)
|
||||||
|
/* XXX differentiate from a real error */
|
||||||
return NULL;
|
return NULL;
|
||||||
ret = plugin_lookup(plugin, symbol);
|
return PyCapsule_New(ret, _libsystem_plugin_symbol_name, NULL);
|
||||||
return Py_BuildValue("p", ret);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user