From 18c55a8f1e93aaa4df6c970333ad3d691e3438b0 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Wed, 29 Dec 2010 15:41:03 +0100 Subject: Scope event library related data and hooks to a struct --- adapters/libevent.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'adapters/libevent.h') diff --git a/adapters/libevent.h b/adapters/libevent.h index dc1f5c7..2cc2823 100644 --- a/adapters/libevent.h +++ b/adapters/libevent.h @@ -52,7 +52,7 @@ int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { redisLibeventEvents *e; /* Nothing should be attached when something is already attached */ - if (ac->_adapter_data != NULL) + if (ac->ev.data != NULL) return REDIS_ERR; /* Create container for context and r/w events */ @@ -60,12 +60,12 @@ int redisLibeventAttach(redisAsyncContext *ac, struct event_base *base) { e->context = ac; /* Register functions to start/stop listening for events */ - ac->evAddRead = redisLibeventAddRead; - ac->evDelRead = redisLibeventDelRead; - ac->evAddWrite = redisLibeventAddWrite; - ac->evDelWrite = redisLibeventDelWrite; - ac->evCleanup = redisLibeventCleanup; - ac->_adapter_data = e; + ac->ev.addRead = redisLibeventAddRead; + ac->ev.delRead = redisLibeventDelRead; + ac->ev.addWrite = redisLibeventAddWrite; + ac->ev.delWrite = redisLibeventDelWrite; + ac->ev.cleanup = redisLibeventCleanup; + ac->ev.data = e; /* Initialize and install read/write events */ event_set(&e->rev,c->fd,EV_READ,redisLibeventReadEvent,e); -- cgit v1.2.3