comparison nodejs/X_supp_njs.h @ 1039:176cba3ad32c refine_backend_if

IO manager for njs
author Thinker K.F. Li <thinker@codemud.net>
date Tue, 23 Nov 2010 10:12:49 +0800
parents 67d0fed24120
children 22e5cf38d8e8
comparison
equal deleted inserted replaced
1038:48c69a18f2e4 1039:176cba3ad32c
2 // vim: sw=4:ts=8:sts=4 2 // vim: sw=4:ts=8:sts=4
3 #ifndef __X_SUPP_NJS_H_ 3 #ifndef __X_SUPP_NJS_H_
4 #define __X_SUPP_NJS_H_ 4 #define __X_SUPP_NJS_H_
5 5
6 #include <ev.h> 6 #include <ev.h>
7 #include <mb_backend.h>
7 8
8 typedef struct _njs_runtime { 9 typedef struct _njs_runtime {
9 ev_io iowatcher;
10 ev_timer tmwatcher; 10 ev_timer tmwatcher;
11 int enable_io; 11 int enable_io;
12 int enable_timer; 12 int enable_timer;
13 void *xrt; 13 mb_rt_t *xrt;
14 } njs_runtime_t; 14 } njs_runtime_t;
15 15
16 extern void X_njs_MB_reg_IO_man(void);
16 extern void X_njs_MB_init_handle_connection(njs_runtime_t *rt); 17 extern void X_njs_MB_init_handle_connection(njs_runtime_t *rt);
17 extern void X_njs_MB_free(njs_runtime_t *rt); 18 extern void X_njs_MB_free(njs_runtime_t *rt);
18 extern njs_runtime_t *X_njs_MB_new(char *display_name, int w, int h); 19 extern njs_runtime_t *X_njs_MB_new(char *display_name, int w, int h);
19 extern void X_njs_MB_free_keep_win(njs_runtime_t *rt); 20 extern void X_njs_MB_free_keep_win(njs_runtime_t *rt);
20 extern njs_runtime_t *X_njs_MB_new_with_win(void *display, long win); 21 extern njs_runtime_t *X_njs_MB_new_with_win(void *display, long win);
21 extern int X_njs_MB_flush(njs_runtime_t *rt); 22 extern int X_njs_MB_flush(njs_runtime_t *rt);
22 extern void X_njs_MB_handle_single_event(njs_runtime_t *rt, void *evt); 23 extern void X_njs_MB_handle_single_event(njs_runtime_t *rt, void *evt);
23 extern void X_njs_MB_no_more_event(njs_runtime_t *rt); 24 extern void X_njs_MB_no_more_event(njs_runtime_t *rt);
24 extern void *_X_njs_MB_get_X_runtime(njs_runtime_t *rt); 25 extern mb_rt_t *_X_njs_MB_get_X_runtime(njs_runtime_t *rt);
25 26
26 #define X_njs_MB_kbevents(rt) X_MB_kbevents((rt)->xrt) 27 #define X_njs_MB_kbevents(rt) mb_runtime_kbevents((rt)->xrt)
27 #define X_njs_MB_rdman(rt) X_MB_rdman((rt)->xrt) 28 #define X_njs_MB_rdman(rt) mb_runtime_rdman((rt)->xrt)
28 #define X_njs_MB_tman(rt) X_MB_tman((rt)->xrt) 29 #define X_njs_MB_timer_man(rt) mb_runtime_timer_man((rt)->xrt)
29 #define X_njs_MB_ob_factory(rt) X_MB_ob_factory((rt)->xrt) 30 #define X_njs_MB_ob_factory(rt) mb_runtime_ob_factory((rt)->xrt)
30 #define X_njs_MB_img_ldr(rt) X_MB_img_ldr((rt)->xrt) 31 #define X_njs_MB_img_ldr(rt) mb_runtime_img_ldr((rt)->xrt)
31 #define X_njs_MB_kbevents(rt) X_MB_kbevents((rt)->xrt)
32 32
33 #endif /* __X_SUPP_NJS_H_ */ 33 #endif /* __X_SUPP_NJS_H_ */