LispWorks FLI for Mac OS X CoreFoundation Framework
Common Lisp
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
cf-array-ffi.lisp
cf-bag-ffi.lisp
cf-base-ffi.lisp
cf-binary-heap-ffi.lisp
cf-bit-vector-ffi.lisp
cf-bundle-ffi.lisp
cf-byte-order-ffi.lisp
cf-character-set-ffi.lisp
cf-data-ffi.lisp
cf-date-ffi.lisp
cf-date-formatter-ffi.lisp
cf-dictionary-ffi.lisp
cf-locale-ffi.lisp
cf-mach-port-ffi.lisp
cf-message-port-ffi.lisp
cf-notification-center-ffi.lisp
cf-number-ffi.lisp
cf-number-formatter-ffi.lisp
cf-plug-in-ffi.lisp
cf-preferences-ffi.lisp
cf-property-list-ffi.lisp
cf-run-loop-ffi.lisp
cf-set-ffi.lisp
cf-socket-ffi.lisp
cf-stream-ffi.lisp
cf-string-encoding-ffi.lisp
cf-string-ffi.lisp
cf-time-zone-ffi.lisp
cf-tree-ffi.lisp
cf-url-access-ffi.lisp
cf-url-ffi.lisp
cf-user-notification-ffi.lisp
cf-uuid-ffi.lisp
cf-xml-node-ffi.lisp
cf-xml-parser-ffi.lisp
core-foundation-package.lisp
core-foundation-utils.lisp
defsys.lisp

README

1. Installation

1.1 Obtain and Load the MAC-TYPES FFI
    
    You 

    (load "/path/to/mac-types/defsys.lisp")

    At this point you should be ready to compile the CoreFoundation
    FFI. Its system definition declares a dependency on the MAC-TYPES
    system so it will get compiled and loaded as needed.

1.2 Compiling and Loading the CORE-FOUNDATION FFI 

    (load "/path/to/core-foundation/defsys.lisp")
    (compile-system 'core-foundation)
    (load-system 'core-foundation)
 
    In the future all that is needed to load the FFI is two load the
    two system definitions and load the core-foundation system.

2. Testing

Very limited testing on the CFString to Lisp string conversion
routines has been done so far but they do work under typical
conditions. The follow is an excerpt from some interactive
experimentation in the LispWorks IDE's listener:

CL-USER> (setf a (cf:cf-uuid-create (cf:k-cf-allocator-default)))
#<Pointer: CORE-FOUNDATION:CF-UUID-REF = #x00300BA0>
CL-USER> (setf b (cf:cf-uuid-create (cf:k-cf-allocator-default)))
#<Pointer: CORE-FOUNDATION:CF-UUID-REF = #x00300C10>
CL-USER> (cf:cf-get-type-id a)
24
CL-USER> (cf:cf-get-type-id b)
24
CL-USER> (cf:cf-equal a b)
NIL
CL-USER> (cf:cf-copy-description a)
#<Pointer: CORE-FOUNDATION:CF-STRING-REF = #x00300E70>
CL-USER> (cf:cf-string->string *)
"<CFUUID 0x300ba0> 116DA749-8457-11D9-A7A2-000A95C49478"
CL-USER> (cf:cf-uuid-create-string (cf:k-cf-allocator-default) a)
#<Pointer: CORE-FOUNDATION:CF-STRING-REF = #x00300D40>
CL-USER> (setf a-str *)
#<Pointer: CORE-FOUNDATION:CF-STRING-REF = #x00300D40>
CL-USER> (cf:cf-string->string a-str)
"116DA749-8457-11D9-A7A2-000A95C49478"
CL-USER> (cf:cf-retain a-str)
#<Pointer: CORE-FOUNDATION:CF-TYPE-REF = #x00300D40>
CL-USER> (cf:cf-get-retain-count a-str)
2