> Subject: call Mac gcc -framework from CTypes how
> Newsgroups: comp.lang.python
Sometimes I write tedious wrapper shim C for Mac OS X:
#include <IOKit/IOKitLib.h>
void * aliasedIONotificationPortCreate(int arg1)
{
return IONotificationPortCreate(arg1);
}
gcc -dynamiclib -framework IOKit builds this C so that I can call it
from a separately-linked C program, such as Python CTypes.
Given that I can call the aliasedIONotificationPortCreate in the Dylib
that I built, can I somehow call the IONotificationPortCreate in the
Framework that Apple built instead, and skip the drudgery of writing
the tedious wrapper shim C?
Thanks in advance, Pat LaVarre
p.lavarre@ieee.org - 25 Oct 2006 19:50 GMT
> can I somehow call the IONotificationPortCreate in the
> Framework that Apple built instead,
$ cd /System/Library/Frameworks/
$ cd IOKit.framework/Versions/Current/
$ file IOKit
... Mach-O dynamically linked shared library ...
$ nm -m IOKit | grep IONotificationPortCreate
... (__TEXT,__text) external _IONotificationPortCreate
$
Looks like it will work. Not named .dylib or .so, but correct `file`
type and relevant `nm -m` symbols.
Thanks all for help offline, especially Nlzero.com,