include/event_callback.h

Wed, 05 Sep 2007 22:48:49 -0400

author
Thomas Harning Jr <harningt@gmail.com>
date
Wed, 05 Sep 2007 22:48:49 -0400
changeset 20
71bc2e49366c
child 22
48a109847dce
permissions
-rw-r--r--

Beginning refactoring of the event_callback outside of the core

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 #define EVENT_CALLBACK_ARG_MT "EVENT_CALLBACK_ARG_MT"
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
13
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
14 typedef struct {
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
15 struct event ev;
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
16 le_base* base;
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
17 int callbackRef;
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
18 } le_callback;
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
19
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
20 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
21
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
22 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
23
71bc2e49366c Beginning refactoring of the event_callback outside of the core
Thomas Harning Jr <harningt@gmail.com>
parents:
diff changeset
24 #endif

mercurial