diff options
author | Vincent Sanders <vince@kyllikki.org> | 2014-03-08 14:13:27 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2014-03-09 15:37:40 +0000 |
commit | 87f6314dabdc2067a19e01f8b29f9ecc38ed825b (patch) | |
tree | 78f8f8395e3bf3b7ee2c18a7b5a5e6d2d5ca9ddc /cocoa/schedule.m | |
parent | fb9b171e325488dc9792ee0f3062f15d8ec597ee (diff) | |
download | netsurf-87f6314dabdc2067a19e01f8b29f9ecc38ed825b.tar.gz netsurf-87f6314dabdc2067a19e01f8b29f9ecc38ed825b.tar.bz2 |
move scheduleing into browser operation table
Diffstat (limited to 'cocoa/schedule.m')
-rw-r--r-- | cocoa/schedule.m | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/cocoa/schedule.m b/cocoa/schedule.m index 1ad75b390..2dd9a81f6 100644 --- a/cocoa/schedule.m +++ b/cocoa/schedule.m @@ -17,7 +17,8 @@ */ #import <Cocoa/Cocoa.h> -#import "utils/schedule.h" + +#import "cocoa/schedule.h" @interface ScheduledCallback : NSObject { void (*callback)( void *userData ); @@ -73,18 +74,15 @@ static NSMutableSet *timerSet = nil; @end -/* In platform specific schedule.c. */ -void schedule(int t, void (*callback)(void *p), void *p) -{ - ScheduledCallback *cb = [[ScheduledCallback alloc] initWithCallback: callback userData: p]; - [cb schedule: (NSTimeInterval)t / 100]; - [cb release]; -} - -void schedule_remove(void (*callback)(void *p), void *p) +/* exported interface documented in cocoa/schedule.h */ +nserror cocoa_schedule(int t, void (*callback)(void *p), void *p) { ScheduledCallback *cb = [[ScheduledCallback alloc] initWithCallback: callback userData: p]; [timerSet removeObject: cb]; + if (t >= 0) { + [cb schedule: (NSTimeInterval)t / 1000]; + } [cb release]; -} + return NSERROR_OK; +} |