]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/core-foundation/fsevents/fsevents.factor
Updating code to use with-out-parameters
[factor.git] / basis / core-foundation / fsevents / fsevents.factor
old mode 100755 (executable)
new mode 100644 (file)
index 24ac24b..fd17843
@@ -36,7 +36,6 @@ STRUCT: FSEventStreamContext
     { release void* }
     { copyDescription void* } ;
 
-! callback(
 CALLBACK: void FSEventStreamCallback ( FSEventStreamRef streamRef, void* clientCallBackInfo, size_t numEvents, void* eventPaths, FSEventStreamEventFlags* eventFlags, FSEventStreamEventId* eventIds ) ;
 
 CONSTANT: FSEventStreamEventIdSinceNow HEX: FFFFFFFFFFFFFFFF
@@ -120,8 +119,7 @@ FUNCTION: CFStringRef FSEventStreamCopyDescription ( FSEventStreamRef streamRef
     flags
     FSEventStreamCreate ;
 
-: kCFRunLoopCommonModes ( -- string )
-    &: kCFRunLoopCommonModes *void* ;
+C-GLOBAL: void* kCFRunLoopCommonModes
 
 : schedule-event-stream ( event-stream -- )
     CFRunLoopGetMain
@@ -156,7 +154,7 @@ SYMBOL: event-stream-callbacks
 [
     event-stream-callbacks
     [ [ drop expired? not ] assoc-filter H{ } assoc-like ] change-global
-] "core-foundation" add-init-hook
+] "core-foundation" add-startup-hook
 
 : add-event-source-callback ( quot -- id )
     event-stream-counter <alien>
@@ -173,16 +171,7 @@ SYMBOL: event-stream-callbacks
     info event-stream-callbacks get at [ drop ] or call( changes -- ) ;
 
 : master-event-source-callback ( -- alien )
-    "void"
-    {
-        "FSEventStreamRef"
-        "void*"                     ! info
-        "size_t"                    ! numEvents
-        "void*"                     ! eventPaths
-        "FSEventStreamEventFlags*"
-        "FSEventStreamEventId*"
-    }
-    "cdecl" [ (master-event-source-callback) ] alien-callback ;
+    [ (master-event-source-callback) ] FSEventStreamCallback ;
 
 TUPLE: event-stream < disposable info handle ;