2017-04-07 14:43:12 +00:00
|
|
|
#ifndef MM_LOOP_H_
|
|
|
|
#define MM_LOOP_H_
|
|
|
|
|
|
|
|
/*
|
|
|
|
* machinarium.
|
|
|
|
*
|
|
|
|
* cooperative multitasking engine.
|
|
|
|
*/
|
|
|
|
|
2017-04-07 15:04:43 +00:00
|
|
|
typedef struct mm_loop_t mm_loop_t;
|
2017-04-07 14:43:12 +00:00
|
|
|
|
|
|
|
struct mm_loop_t {
|
2017-04-10 12:11:06 +00:00
|
|
|
mm_clock_t clock;
|
|
|
|
mm_poll_t *poll;
|
2017-04-07 14:43:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
int mm_loop_init(mm_loop_t*);
|
|
|
|
int mm_loop_shutdown(mm_loop_t*);
|
|
|
|
int mm_loop_step(mm_loop_t*);
|
|
|
|
int mm_loop_add(mm_loop_t*, mm_fd_t*, int);
|
|
|
|
int mm_loop_modify(mm_loop_t*, mm_fd_t*, int);
|
|
|
|
int mm_loop_delete(mm_loop_t*, mm_fd_t*);
|
|
|
|
|
|
|
|
#endif
|