ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/EV/EV/EVAPI.h
(Generate patch)

Comparing EV/EV/EVAPI.h (file contents):
Revision 1.32 by root, Sun Dec 9 19:46:55 2007 UTC vs.
Revision 1.33 by root, Thu Dec 20 07:12:57 2007 UTC

12# define aTHX 12# define aTHX
13#endif 13#endif
14 14
15#define EV_COMMON \ 15#define EV_COMMON \
16 int flags; /* cheap on 64 bit systems */ \ 16 int flags; /* cheap on 64 bit systems */ \
17 struct ev_loop *loop; \
17 SV *self; /* contains this struct */ \ 18 SV *self; /* contains this struct */ \
18 SV *cb_sv, *fh, *data; 19 SV *cb_sv, *fh, *data;
19 20
20#ifndef EV_PROTOTYPES 21#ifndef EV_PROTOTYPES
21# define EV_PROTOTYPES 0 22# define EV_PROTOTYPES 0
22#endif 23#endif
23 24
24#define EV_STANDALONE 1 25#define EV_STANDALONE 1
25#define EV_MULTIPLICITY 0 26#define EV_MULTIPLICITY 1
26 27
27#include <ev.h> 28#include <ev.h>
28 29
29struct EVAPI { 30struct EVAPI {
30 I32 ver; 31 I32 ver;
31 I32 rev; 32 I32 rev;
32#define EV_API_VERSION 3 33#define EV_API_VERSION 4
33#define EV_API_REVISION 0 34#define EV_API_REVISION 0
35
36 struct ev_loop *default_loop;
37 unsigned int supported_backends;
38 unsigned int recommended_backends;
39 unsigned int embeddable_backends;
34 40
35 /* perl fh or fd int to fd */ 41 /* perl fh or fd int to fd */
36 int (*sv_fileno) (SV *fh); 42 int (*sv_fileno) (SV *fh);
37 /* signal number/name to signum */ 43 /* signal number/name to signum */
38 int (*sv_signum) (SV *fh); 44 int (*sv_signum) (SV *fh);
39 45
40 /* same as libev functions */ 46 /* same as libev functions */
47 ev_tstamp (*(time))(void);
41 ev_tstamp (*now)(EV_P); 48 ev_tstamp (*now)(EV_P);
42 ev_tstamp (*(time))(void); 49 struct ev_loop *(*loop_new)(unsigned int);
50 void (*loop_destroy)(EV_P);
51 void (*loop_fork)(EV_P);
52 unsigned int (*loop_count)(EV_P);
43 unsigned int (*backend)(EV_P); 53 unsigned int (*backend)(EV_P);
44 void (*loop)(EV_P_ int flags); 54 void (*loop)(EV_P_ int flags);
45 void (*unloop)(EV_P_ int how); 55 void (*unloop)(EV_P_ int how);
46 void (*ref)(EV_P); 56 void (*ref)(EV_P);
47 void (*unref)(EV_P); 57 void (*unref)(EV_P);
66 void (*idle_stop) (EV_P_ ev_idle *); 76 void (*idle_stop) (EV_P_ ev_idle *);
67 void (*prepare_start)(EV_P_ ev_prepare *); 77 void (*prepare_start)(EV_P_ ev_prepare *);
68 void (*prepare_stop) (EV_P_ ev_prepare *); 78 void (*prepare_stop) (EV_P_ ev_prepare *);
69 void (*check_start)(EV_P_ ev_check *); 79 void (*check_start)(EV_P_ ev_check *);
70 void (*check_stop) (EV_P_ ev_check *); 80 void (*check_stop) (EV_P_ ev_check *);
81 void (*embed_start)(EV_P_ ev_embed *);
82 void (*embed_stop) (EV_P_ ev_embed *);
83 void (*embed_sweep)(EV_P_ ev_embed *);
84 void (*fork_start) (EV_P_ ev_fork *);
85 void (*fork_stop) (EV_P_ ev_fork *);
71}; 86};
72 87
73#if !EV_PROTOTYPES 88#if !EV_PROTOTYPES
89# undef EV_DEFAULT
90# undef EV_DEFAULT_
91# undef EV_A_
92# define EV_DEFAULT GEVAPI->default_loop
93# define ev_supported_backends() GEVAPI->supported_backends
94# define ev_recommended_backends() GEVAPI->recommended_backends
95# define ev_embeddable_backends() GEVAPI->embeddable_backends
96
74# define sv_fileno(sv) GEVAPI->sv_fileno (sv) 97# define sv_fileno(sv) GEVAPI->sv_fileno (sv)
75# define sv_signum(sv) GEVAPI->sv_signum (sv) 98# define sv_signum(sv) GEVAPI->sv_signum (sv)
76# define ev_now(loop) GEVAPI->now (loop)
77# define ev_time() GEVAPI->(time) () 99# define ev_time() GEVAPI->(time) ()
100# define ev_loop_new(flags) GEVAPI->loop_new ((flags))
101# define ev_loop_destroy(loop) GEVAPI->loop_destroy ((loop))
102# define ev_loop_fork(loop) GEVAPI->loop_fork ((loop))
103# define ev_loop_count(loop) GEVAPI->loop_count ((loop))
104# define ev_now(loop) GEVAPI->now ((loop))
78# define ev_backend(loop) GEVAPI->backend (loop) 105# define ev_backend(loop) GEVAPI->backend ((loop))
79# define ev_loop(flags) GEVAPI->loop (flags) 106# define ev_loop(loop,flags) GEVAPI->loop ((loop), (flags))
80# define ev_unloop(how) GEVAPI->unloop (how) 107# define ev_unloop(loop,how) GEVAPI->unloop ((loop), (how)
81# define ev_once(fd,events,timeout,cb,arg) GEVAPI->once ((fd), (events), (timeout), (cb), (arg)) 108# define ev_once(loop,fd,events,timeout,cb,arg) GEVAPI->once ((loop), (fd), (events), (timeout), (cb), (arg))
82# define ev_io_start(w) GEVAPI->io_start (w) 109# define ev_io_start(l,w) GEVAPI->io_start ((l), (w))
83# define ev_io_stop(w) GEVAPI->io_stop (w) 110# define ev_io_stop(l,w) GEVAPI->io_stop ((l), (w))
84# define ev_timer_start(w) GEVAPI->timer_start (w) 111# define ev_timer_start(l,w) GEVAPI->timer_start ((l), (w))
85# define ev_timer_stop(w) GEVAPI->timer_stop (w) 112# define ev_timer_stop(l,w) GEVAPI->timer_stop ((l), (w))
86# define ev_timer_again(w) GEVAPI->timer_again (w) 113# define ev_timer_again(l,w) GEVAPI->timer_again ((l), (w))
87# define ev_periodic_start(w) GEVAPI->periodic_start (w) 114# define ev_periodic_start(l,w) GEVAPI->periodic_start ((l), (w))
88# define ev_periodic_stop(w) GEVAPI->periodic_stop (w) 115# define ev_periodic_stop(l,w) GEVAPI->periodic_stop ((l), (w))
89# define ev_signal_start(w) GEVAPI->signal_start (w) 116# define ev_signal_start(l,w) GEVAPI->signal_start ((l), (w))
90# define ev_signal_stop(w) GEVAPI->signal_stop (w) 117# define ev_signal_stop(l,w) GEVAPI->signal_stop ((l), (w))
91# define ev_idle_start(w) GEVAPI->idle_start (w) 118# define ev_idle_start(l,w) GEVAPI->idle_start ((l), (w))
92# define ev_idle_stop(w) GEVAPI->idle_stop (w) 119# define ev_idle_stop(l,w) GEVAPI->idle_stop ((l), (w))
93# define ev_prepare_start(w) GEVAPI->prepare_start (w) 120# define ev_prepare_start(l,w) GEVAPI->prepare_start ((l), (w))
94# define ev_prepare_stop(w) GEVAPI->prepare_stop (w) 121# define ev_prepare_stop(l,w) GEVAPI->prepare_stop ((l), (w))
95# define ev_check_start(w) GEVAPI->check_start (w) 122# define ev_check_start(l,w) GEVAPI->check_start ((l), (w))
96# define ev_check_stop(w) GEVAPI->check_stop (w) 123# define ev_check_stop(l,w) GEVAPI->check_stop ((l), (w))
97# define ev_child_start(w) GEVAPI->child_start (w) 124# define ev_child_start(l,w) GEVAPI->child_start ((l), (w))
98# define ev_child_stop(w) GEVAPI->child_stop (w) 125# define ev_child_stop(l,w) GEVAPI->child_stop ((l), (w))
99# define ev_stat_start(w) GEVAPI->stat_start (w) 126# define ev_stat_start(l,w) GEVAPI->stat_start ((l), (w))
100# define ev_stat_stop(w) GEVAPI->stat_stop (w) 127# define ev_stat_stop(l,w) GEVAPI->stat_stop ((l), (w))
101# define ev_stat_stat(w) GEVAPI->stat_stat (w) 128# define ev_stat_stat(l,w) GEVAPI->stat_stat ((l), (w))
129# define ev_embed_start(l,w) GEVAPI->embed_start ((l), (w))
130# define ev_embed_stop(l,w) GEVAPI->embed_stop ((l), (w))
131# define ev_embed_sweep(l,w) GEVAPI->embed_sweep ((l), (w))
102# define ev_ref(loop) GEVAPI->ref (loop) 132# define ev_ref(loop) GEVAPI->ref (loop)
103# define ev_unref(loop) GEVAPI->unref (loop) 133# define ev_unref(loop) GEVAPI->unref (loop)
104# define ev_clear_pending(w) GEVAPI->clear_pending (w) 134# define ev_clear_pending(l,w) GEVAPI->clear_pending ((l), (w))
105# define ev_invoke(w,rev) GEVAPI->invoke (w, rev) 135# define ev_invoke(l,w,rev) GEVAPI->invoke (l, w, rev)
106#endif 136#endif
107 137
108static struct EVAPI *GEVAPI; 138static struct EVAPI *GEVAPI;
109 139
110#define I_EV_API(YourName) \ 140#define I_EV_API(YourName) \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines