Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / October 2006



Tip: Looking for answers? Try searching our database.

Apple Framework in place of my Dylib how

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
p.lavarre@ieee.org - 20 Oct 2006 16:30 GMT
> 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,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.