core-foundation: define some more callbacks.
parent
37af86428f
commit
d6019337f9
|
@ -6,7 +6,13 @@ IN: core-foundation.file-descriptors
|
|||
|
||||
TYPEDEF: void* CFFileDescriptorRef
|
||||
TYPEDEF: int CFFileDescriptorNativeDescriptor
|
||||
TYPEDEF: void* CFFileDescriptorCallBack
|
||||
|
||||
CALLBACK: void CFFileDescriptorCallBack (
|
||||
CFFileDescriptorRef f,
|
||||
CFOptionFlags callBackTypes,
|
||||
void *info
|
||||
) ;
|
||||
|
||||
C-TYPE: CFFileDescriptorContext
|
||||
|
||||
FUNCTION: CFFileDescriptorRef CFFileDescriptorCreate (
|
||||
|
|
|
@ -56,11 +56,6 @@ FUNCTION: void CFRunLoopRemoveTimer (
|
|||
CFStringRef mode
|
||||
) ;
|
||||
|
||||
CALLBACK: void CFRunLoopTimerCallBack (
|
||||
CFRunLoopTimerRef timer,
|
||||
void *info
|
||||
) ;
|
||||
|
||||
CFSTRING: CFRunLoopDefaultMode "kCFRunLoopDefaultMode"
|
||||
|
||||
TUPLE: run-loop-state fds sources timers ;
|
||||
|
|
|
@ -5,7 +5,12 @@ core-foundation.time calendar.unix kernel locals math system ;
|
|||
IN: core-foundation.timers
|
||||
|
||||
TYPEDEF: void* CFRunLoopTimerRef
|
||||
TYPEDEF: void* CFRunLoopTimerCallBack
|
||||
|
||||
CALLBACK: void CFRunLoopTimerCallBack (
|
||||
CFRunLoopTimerRef timer,
|
||||
void *info
|
||||
) ;
|
||||
|
||||
TYPEDEF: void* CFRunLoopTimerContext
|
||||
|
||||
FUNCTION: CFRunLoopTimerRef CFRunLoopTimerCreate (
|
||||
|
|
|
@ -10,13 +10,12 @@ IN: io.backend.unix.multiplexers.run-loop
|
|||
TUPLE: run-loop-mx kqueue-mx ;
|
||||
|
||||
: file-descriptor-callback ( -- callback )
|
||||
void { CFFileDescriptorRef CFOptionFlags void* }
|
||||
cdecl [
|
||||
[
|
||||
3drop
|
||||
0 mx get-global kqueue-mx>> wait-for-events
|
||||
reset-run-loop
|
||||
yield
|
||||
] alien-callback ;
|
||||
] CFFileDescriptorCallBack ;
|
||||
|
||||
: <run-loop-mx> ( -- mx )
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue