diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-11-15 10:42:30 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-11-15 20:04:43 +1000 |
commit | c436661c19ac193007af0d2d878f554bad08f905 (patch) | |
tree | 7c0f1fa45f091e72dc9d578d39441d2fe758dd25 /jim-eventloop.h | |
parent | 939e88f7e49732167155568cbdd36ce38fb58053 (diff) | |
download | jimtcl-c436661c19ac193007af0d2d878f554bad08f905.zip jimtcl-c436661c19ac193007af0d2d878f554bad08f905.tar.gz jimtcl-c436661c19ac193007af0d2d878f554bad08f905.tar.bz2 |
eventloop: Add convenience functions for adding script file handlers
Add Jim_CreateScriptFileHandler() to create a standard script filehandler
event that evaluates the given script with Jim_EvalObjBackground()
when the event occurs.
Also add Jim_FindFileHandler() to find a registered event handler.
Simplify aio by using these.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-eventloop.h')
-rw-r--r-- | jim-eventloop.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/jim-eventloop.h b/jim-eventloop.h index 545ef4d..f2b2abf 100644 --- a/jim-eventloop.h +++ b/jim-eventloop.h @@ -64,6 +64,8 @@ JIM_EXPORT void Jim_CreateFileHandler (Jim_Interp *interp, int fd, int mask, Jim_FileProc *proc, void *clientData, Jim_EventFinalizerProc *finalizerProc); +JIM_EXPORT void Jim_CreateScriptFileHandler(Jim_Interp *interp, + int fd, int mask, Jim_Obj *scriptObj); JIM_EXPORT void Jim_DeleteFileHandler (Jim_Interp *interp, int fd, int mask); JIM_EXPORT jim_wide Jim_CreateTimeHandler (Jim_Interp *interp, @@ -71,6 +73,7 @@ JIM_EXPORT jim_wide Jim_CreateTimeHandler (Jim_Interp *interp, Jim_TimeProc *proc, void *clientData, Jim_EventFinalizerProc *finalizerProc); JIM_EXPORT jim_wide Jim_DeleteTimeHandler (Jim_Interp *interp, jim_wide id); +JIM_EXPORT void *Jim_FindFileHandler(Jim_Interp *interp, int fd, int mask); #define JIM_FILE_EVENTS 1 #define JIM_TIME_EVENTS 2 |