Wed, 15 Jul 2009 10:39:10 -0400
Merge branch 'v0.2'
20
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
1 | /* LuaEvent - Copyright (C) 2007 Thomas Harning <harningt@gmail.com> |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
2 | * Licensed as LGPL - See doc/COPYING for details */ |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
3 | #ifndef EVENT_CALLBACK |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
4 | #define EVENT_CALLBACK |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
5 | |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
6 | #include "luaevent.h" |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
7 | #include <lua.h> |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
8 | #include <sys/types.h> |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
9 | #include <sys/time.h> |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
10 | #include <event.h> |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
11 | |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
12 | typedef struct { |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
13 | struct event ev; |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
14 | le_base* base; |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
15 | int callbackRef; |
23
897150985f13
Added support for timeouts and timers.
Thomas Harning Jr <harningt@gmail.com>
parents:
22
diff
changeset
|
16 | struct timeval timeout; |
20
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
17 | } le_callback; |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
18 | |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
19 | int event_callback_register(lua_State* L); |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
20 | |
22
48a109847dce
Completely refactored event_callback creation out into event_callback.
Thomas Harning Jr <harningt@gmail.com>
parents:
20
diff
changeset
|
21 | le_callback* event_callback_push(lua_State* L, int baseIdx, int callbackIdx); |
48a109847dce
Completely refactored event_callback creation out into event_callback.
Thomas Harning Jr <harningt@gmail.com>
parents:
20
diff
changeset
|
22 | |
20
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
23 | void luaevent_callback(int fd, short event, void* p); |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
24 | |
71bc2e49366c
Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff
changeset
|
25 | #endif |