call Mac gcc -framework from CTypes how

P

p.lavarre

gcc -dynamiclib -framework CoreFoundation
builds C code for Mac OS X that I call from Py code.

Can I somehow get rid of the C, such as:

#include <CoreFoundation/CoreFoundation.h>
void const * kCFTypeDictionaryKeyCallBacks_p(void)
{
return &kCFTypeDictionaryKeyCallBacks;
}

?

Thanks in advance, Pat LaVarre

P.S. In Windows, I duck tedium of this kind by finding the Dll that the
C compiler calls under the covers, e.g., the CreateFile of my Win C
code becomes a kernel32.CreateFileW call.
 
P

p.lavarre

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,
 
P

p.lavarre

can I somehow call the IONotificationPortCreate in the
$ cd /System/Library/Frameworks/
$ cd IOKit.framework/Versions/Current/
$ file IOKit

Also ctypes.util.find_library('CoreFoundation')
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top