By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,272 Members | 1,733 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,272 IT Pros & Developers. It's quick & easy.

call Mac gcc -framework from CTypes how

P: n/a
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.

Oct 19 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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,

Oct 25 '06 #2

P: n/a
can I somehow call the IONotificationPortCreate in the
Framework that Apple built instead,

$ cd /System/Library/Frameworks/
$ cd IOKit.framework/Versions/Current/
$ file IOKit
Also ctypes.util.find_library('CoreFoundation')

Oct 25 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.