call Mac gcc -framework from CTypes how

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • p.lavarre@ieee.org

    call Mac gcc -framework from CTypes how

    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 <CoreFoundati on/CoreFoundation. h>
    void const * kCFTypeDictiona ryKeyCallBacks_ p(void)
    {
    return &kCFTypeDiction aryKeyCallBacks ;
    }

    ?

    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.Create FileW call.

  • p.lavarre@ieee.org

    #2
    Re: call Mac gcc -framework from CTypes how

    can I somehow call the IONotificationP ortCreate 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 IONotificationP ortCreate
    .... (__TEXT,__text) external _IONotification PortCreate
    $

    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,

    Comment

    • p.lavarre@ieee.org

      #3
      Re: call Mac gcc -framework from CTypes how

      can I somehow call the IONotificationP ortCreate in the
      Framework that Apple built instead,
      >
      $ cd /System/Library/Frameworks/
      $ cd IOKit.framework/Versions/Current/
      $ file IOKit
      Also ctypes.util.fin d_library('Core Foundation')

      Comment

      Working...