1 #ifndef __LUAIXP_INSTANCE_H__
2 #define __LUAIXP_INSTANCE_H__
6 #define L_EVENTLOOP_MT "eventloop.eventloop_mt"
8 /* the C representation of a eventloop instance object */
10 struct lel_eventloop
{
11 struct lel_program
**progs
; // array of programs, sorted by fd
12 size_t progs_size
; // number allocated entries
13 size_t progs_count
; // first unused entry
18 #define LEL_PROGS_ARRAY_GROWS_BY 32
28 char buf
[0]; // this has to be last in the structure
30 #define LEL_PROGRAM_IO_BUF_SIZE 4096
32 extern struct lel_eventloop
*lel_checkeventloop (lua_State
*L
, int narg
);
33 extern int l_eventloop_tostring (lua_State
*L
);
36 extern int l_eventloop_add_exec (lua_State
*L
);
37 extern int l_eventloop_check_exec (lua_State
*L
);
38 extern int l_eventloop_kill_exec (lua_State
*L
);
39 extern int l_eventloop_run_loop (lua_State
*L
);
40 extern int l_eventloop_kill_all (lua_State
*L
);
42 #endif // __LUAIXP_INSTANCE_H__