oop-www.h | oop-www.h | |||
---|---|---|---|---|
skipping to change at line 22 | skipping to change at line 22 | |||
#endif | #endif | |||
#include "oop.h" | #include "oop.h" | |||
/* Register an event manager with libwww to get events from a liboop source . | /* Register an event manager with libwww to get events from a liboop source . | |||
Because libwww's event loop is global, so is ours. */ | Because libwww's event loop is global, so is ours. */ | |||
void oop_www_register(oop_source *); | void oop_www_register(oop_source *); | |||
/* Release any resources associated with the event manager, and | /* Release any resources associated with the event manager, and | |||
unregister it with libwww. This will leave libwww with no event manager . */ | unregister it with libwww. This will leave libwww with no event manager . */ | |||
void oop_www_cancel(); | void oop_www_cancel(void); | |||
/* Use libwww's memory management for liboop. | /* Use libwww's memory management for liboop. | |||
** If you use this, you must do so before any other liboop function! ** */ | ** If you use this, you must do so before any other liboop function! ** */ | |||
void oop_www_memory(); | void oop_www_memory(void); | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
oop.h | oop.h | |||
---|---|---|---|---|
skipping to change at line 34 | skipping to change at line 34 | |||
OOP_NUM_EVENTS | OOP_NUM_EVENTS | |||
} oop_event; | } oop_event; | |||
/* Pass this to on_time to schedule an event immediately */ | /* Pass this to on_time to schedule an event immediately */ | |||
static const struct timeval OOP_TIME_NOW = { 0, 0 }; | static const struct timeval OOP_TIME_NOW = { 0, 0 }; | |||
/* Maximum signal number. (The OS may have a stricter limit!) */ | /* Maximum signal number. (The OS may have a stricter limit!) */ | |||
#define OOP_NUM_SIGNALS 256 | #define OOP_NUM_SIGNALS 256 | |||
/* Callbacks may return one of these */ | /* Callbacks may return one of these */ | |||
extern int _oop_continue; /* internal only */ | extern int _oop_continue,_oop_error; /* internal only */ | |||
#define OOP_CONTINUE ((void *) &_oop_continue) | #define OOP_CONTINUE ((void *) &_oop_continue) | |||
#define OOP_HALT ((void *) NULL) /* (or any other value except OOP_CONTINUE | #define OOP_ERROR ((void *) &_oop_error) | |||
) */ | #define OOP_HALT ((void *) NULL) /* (or any other value besides OOP_CONTINU | |||
E) */ | ||||
/* Callback function prototypes */ | /* Callback function prototypes */ | |||
typedef void *oop_call_fd(oop_source *,int fd,oop_event,void *); | typedef void *oop_call_fd(oop_source *,int fd,oop_event,void *); | |||
typedef void *oop_call_time(oop_source *,struct timeval,void *); | typedef void *oop_call_time(oop_source *,struct timeval,void *); | |||
typedef void *oop_call_signal(oop_source *,int sig,void *); | typedef void *oop_call_signal(oop_source *,int sig,void *); | |||
struct oop_source { | struct oop_source { | |||
void (*on_fd)(oop_source *,int fd,oop_event,oop_call_fd *,void *); | void (*on_fd)(oop_source *,int fd,oop_event,oop_call_fd *,void *); | |||
void (*cancel_fd)(oop_source *,int fd,oop_event); | void (*cancel_fd)(oop_source *,int fd,oop_event); | |||
skipping to change at line 71 | skipping to change at line 72 | |||
/* ------------------------------------------------------------------------ - */ | /* ------------------------------------------------------------------------ - */ | |||
/* System event source. */ | /* System event source. */ | |||
typedef struct oop_source_sys oop_source_sys; | typedef struct oop_source_sys oop_source_sys; | |||
/* Create a system event source. Returns NULL on failure. */ | /* Create a system event source. Returns NULL on failure. */ | |||
oop_source_sys *oop_sys_new(void); | oop_source_sys *oop_sys_new(void); | |||
/* Process events until either of the following two conditions: | /* Process events until either of the following two conditions: | |||
1 -- some callback returns non-NULL; will return the value in question. | 1 -- some callback returns anything but OOP_CONTINUE; | |||
2 -- no callbacks are registered; will return NULL. */ | will return the value in question. | |||
2 -- no callbacks are registered; will return OOP_CONTINUE. | ||||
3 -- an error occurs; will return OOP_ERROR (check errno). */ | ||||
void *oop_sys_run(oop_source_sys *); | void *oop_sys_run(oop_source_sys *); | |||
/* Delete a system event source. No callbacks may be registered. */ | /* Delete a system event source. No callbacks may be registered. */ | |||
void oop_sys_delete(oop_source_sys *); | void oop_sys_delete(oop_source_sys *); | |||
/* Get the event registration interface for a system event source. */ | /* Get the event registration interface for a system event source. */ | |||
oop_source *oop_sys_source(oop_source_sys *); | oop_source *oop_sys_source(oop_source_sys *); | |||
/* ------------------------------------------------------------------------ - */ | /* ------------------------------------------------------------------------ - */ | |||
End of changes. 3 change blocks. | ||||
5 lines changed or deleted | 8 lines changed or added | |||