1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* ... */
/* ... */
#ifndef __JIM_EVENTLOOP_H__
#define __JIM_EVENTLOOP_H__
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
typedef int Jim_FileProc(Jim_Interp *interp, void *clientData, int mask);
typedef int Jim_SignalProc(Jim_Interp *interp, void *clientData, void *msg);
typedef void Jim_TimeProc(Jim_Interp *interp, void *clientData);
typedef void Jim_EventFinalizerProc(Jim_Interp *interp, void *clientData);
#define JIM_EVENT_READABLE 1
#define JIM_EVENT_WRITABLE 2
#define JIM_EVENT_EXCEPTION 4
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,
jim_wide milliseconds,
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
#define JIM_ALL_EVENTS (JIM_FILE_EVENTS|JIM_TIME_EVENTS)
#define JIM_DONT_WAIT 4
JIM_EXPORT int Jim_ProcessEvents (Jim_Interp *interp, int flags);
JIM_EXPORT int Jim_EvalObjBackground (Jim_Interp *interp, Jim_Obj *scriptObjPtr);
int Jim_eventloopInit(Jim_Interp *interp);
#ifdef __cplusplus
}extern "C" { ... }
#endif
/* ... */
#endif