summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2007-11-09 17:07:59 +0000
committerroot <root>2007-11-09 17:07:59 +0000
commit54ae3adf55df78d268cd7f1633f5e7d44f687db2 (patch)
treebb46427a6af251878b39736d341f51cafdfed02c
parente73e5ae567e0e8053897ff051ba7bb514cf9007d (diff)
move event_base predeclaration higher in the file
-rw-r--r--README.embed6
-rw-r--r--ev.c6
-rw-r--r--event.c7
-rw-r--r--event.h10
4 files changed, 23 insertions, 6 deletions
diff --git a/README.embed b/README.embed
index cc908a1..2d2b708 100644
--- a/README.embed
+++ b/README.embed
@@ -75,6 +75,12 @@ PREPROCESSOR SYMBOLS
will also not define any of the structs usually found in "event.h"
that are not directly supported by libev code alone.
+ EV_H
+
+ The name of the ev.h header file used to include it. The default
+ if undefined is <ev.h> in event.h and "ev.h" in ev.c. This can be used
+ to virtually rename the ev.h header file
+
EV_USE_MONOTONIC
If undefined or defined to be "1", libev will try to detect the
diff --git a/ev.c b/ev.c
index 8fd359e..20ad7e4 100644
--- a/ev.c
+++ b/ev.c
@@ -128,7 +128,11 @@
#define PID_HASHSIZE 16 /* size of pid hash table, must be power of two */
/*#define CLEANUP_INTERVAL 300. /* how often to try to free memory and re-check fds */
-#include "ev.h"
+#ifdef EV_H
+# include EV_H
+#else
+# include "ev.h"
+#endif
#if __GNUC__ >= 3
# define expect(expr,value) __builtin_expect ((expr),(value))
diff --git a/event.c b/event.c
index 5ed8bc5..992425e 100644
--- a/event.c
+++ b/event.c
@@ -37,8 +37,11 @@
# include <sys/time.h>
#endif
-#include "ev.h"
-#include "event.h"
+#ifdef EV_EVENT_H
+# include EV_EVENT_H
+#else
+# include "event.h"
+#endif
#if EV_MULTIPLICITY
# define dLOOPev struct ev_loop *loop = (struct ev_loop *)ev->ev_base
diff --git a/event.h b/event.h
index 1466f90..392009e 100644
--- a/event.h
+++ b/event.h
@@ -31,12 +31,18 @@
#ifndef _EVENT_H_
#define _EVENT_H_
-#include <ev.h>
+#ifdef EV_H
+# include EV_H
+#else
+# include <ev.h>
+#endif
#ifdef __cplusplus
extern "C" {
#endif
+struct event_base;
+
struct event
{
/* libev watchers we map onto */
@@ -111,8 +117,6 @@ int event_pending (struct event *ev, short, struct timeval *tv);
int event_priority_init (int npri);
int event_priority_set (struct event *ev, int pri);
-struct event_base;
-
int event_base_set (struct event_base *base, struct event *ev);
int event_base_loop (struct event_base *base, int);
int event_base_loopexit (struct event_base *base, struct timeval *tv);