diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-09-25 12:06:47 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-09-25 12:06:47 +0200 |
commit | e6fb160b4479cacb2c9e4e35a9557726ee4cc3d7 (patch) | |
tree | f7d6b3d4de2d644257334952aacacdd6de8f44a3 | |
parent | bb668e1b9450bb86da4ea2cff8ef3a0ea146f0e7 (diff) | |
download | hiredict-e6fb160b4479cacb2c9e4e35a9557726ee4cc3d7.tar.xz |
Rename defines HIREDIS_* to REDIS_*
-rw-r--r-- | hiredis.c | 22 | ||||
-rw-r--r-- | hiredis.h | 4 |
2 files changed, 13 insertions, 13 deletions
@@ -572,13 +572,13 @@ static int redisContextConnect(redisContext *c, const char *ip, int port) { if (c->fd == ANET_ERR) { c->error = c->fn->createError(err,strlen(err)); - return HIREDIS_ERR; + return REDIS_ERR; } if (anetTcpNoDelay(err,c->fd) == ANET_ERR) { c->error = c->fn->createError(err,strlen(err)); - return HIREDIS_ERR; + return REDIS_ERR; } - return HIREDIS_OK; + return REDIS_OK; } static redisContext *redisContextInit(redisReplyFunctions *fn) { @@ -625,16 +625,16 @@ int redisBufferRead(redisContext *c) { /* Set error in context */ c->error = formatError(c->fn, "Error reading from socket: %s", strerror(errno)); - return HIREDIS_ERR; + return REDIS_ERR; } } else if (nread == 0) { c->error = formatError(c->fn, "Server closed the connection"); - return HIREDIS_ERR; + return REDIS_ERR; } else { redisReplyReaderFeed(c->reader,buf,nread); } - return HIREDIS_OK; + return REDIS_OK; } static void redisPopCallback(redisContext *c) { @@ -659,7 +659,7 @@ int redisProcessCallbacks(redisContext *c) { cb.fn(c,reply,cb.privdata); redisPopCallback(c); } - return HIREDIS_OK; + return REDIS_OK; } /* Use this function to try and write the entire output buffer to the @@ -673,7 +673,7 @@ int redisBufferWrite(redisContext *c, int *done) { /* Set error in context */ c->error = formatError(c->fn, "Error writing to socket: %s", strerror(errno)); - return HIREDIS_ERR; + return REDIS_ERR; } } else if (nwritten > 0) { if (nwritten == (signed)sdslen(c->obuf)) { @@ -684,7 +684,7 @@ int redisBufferWrite(redisContext *c, int *done) { } } if (done != NULL) *done = (sdslen(c->obuf) == 0); - return HIREDIS_OK; + return REDIS_OK; } static void* redisCommandWrite(redisContext *c, redisCallback *cb, char *str, size_t len) { @@ -695,12 +695,12 @@ static void* redisCommandWrite(redisContext *c, redisCallback *cb, char *str, si /* Read reply immediately when the context is blocking. */ if (c->flags & HIREDIS_BLOCK) { do { /* Write until done. */ - if (redisBufferWrite(c,&wdone) == HIREDIS_ERR) + if (redisBufferWrite(c,&wdone) == REDIS_ERR) return c->error; } while (!wdone); do { /* Read until there is a reply. */ - if (redisBufferRead(c) == HIREDIS_ERR) + if (redisBufferRead(c) == REDIS_ERR) return c->error; reply = redisGetReply(c); } while (reply == NULL); @@ -30,8 +30,8 @@ #ifndef __HIREDIS_H #define __HIREDIS_H -#define HIREDIS_ERR -1 -#define HIREDIS_OK 0 +#define REDIS_ERR -1 +#define REDIS_OK 0 /* Connection type can be blocking or non-blocking and is set in the * least significant bit of the flags field in redisContext. */ |