Skip to content

Instantly share code, notes, and snippets.

@priteau
Created January 14, 2011 12:10
Show Gist options
  • Save priteau/779533 to your computer and use it in GitHub Desktop.
Save priteau/779533 to your computer and use it in GitHub Desktop.
--- /home/priteau/hiredis/adapters/libev.h 2011-01-14 12:56:48.000000000 +0100
+++ /usr/local/include/hiredis/adapters/libev.h 2011-01-14 13:01:59.000000000 +0100
@@ -1,3 +1,6 @@
+#ifndef __HIREDIS_ADAPTERS_LIBEV_H
+#define __HIREDIS_ADAPTERS_LIBEV_H
+
#include <sys/types.h>
#include <ev.h>
#include "../hiredis.h"
@@ -10,7 +13,7 @@
ev_io rev, wev;
} redisLibevEvents;
-void redisLibevReadEvent(EV_P_ ev_io *watcher, int revents) {
+static void redisLibevReadEvent(EV_P_ ev_io *watcher, int revents) {
#if EV_MULTIPLICITY
((void)loop);
#endif
@@ -20,7 +23,7 @@
redisAsyncHandleRead(e->context);
}
-void redisLibevWriteEvent(EV_P_ ev_io *watcher, int revents) {
+static void redisLibevWriteEvent(EV_P_ ev_io *watcher, int revents) {
#if EV_MULTIPLICITY
((void)loop);
#endif
@@ -30,7 +33,7 @@
redisAsyncHandleWrite(e->context);
}
-void redisLibevAddRead(void *privdata) {
+static void redisLibevAddRead(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
struct ev_loop *loop = e->loop;
((void)loop);
@@ -40,7 +43,7 @@
}
}
-void redisLibevDelRead(void *privdata) {
+static void redisLibevDelRead(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
struct ev_loop *loop = e->loop;
((void)loop);
@@ -50,7 +53,7 @@
}
}
-void redisLibevAddWrite(void *privdata) {
+static void redisLibevAddWrite(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
struct ev_loop *loop = e->loop;
((void)loop);
@@ -60,7 +63,7 @@
}
}
-void redisLibevDelWrite(void *privdata) {
+static void redisLibevDelWrite(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
struct ev_loop *loop = e->loop;
((void)loop);
@@ -70,14 +73,14 @@
}
}
-void redisLibevCleanup(void *privdata) {
+static void redisLibevCleanup(void *privdata) {
redisLibevEvents *e = (redisLibevEvents*)privdata;
redisLibevDelRead(privdata);
redisLibevDelWrite(privdata);
free(e);
}
-int redisLibevAttach(EV_P_ redisAsyncContext *ac) {
+static int redisLibevAttach(EV_P_ redisAsyncContext *ac) {
redisContext *c = &(ac->c);
redisLibevEvents *e;
@@ -111,3 +114,4 @@
return REDIS_OK;
}
+#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment