summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-30 16:36:08 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2010-10-30 16:36:08 +0200
commit1e7f5ae6bd5738855f077e4c117a018409ab6a1b (patch)
tree3ffc8663be3850b10067012a591187d820597e1d
parent0f745d1ac0acc4fa0614ea441272a6f75ff24f71 (diff)
Rename struct
-rw-r--r--hiredis.c10
-rw-r--r--hiredis.h10
2 files changed, 10 insertions, 10 deletions
diff --git a/hiredis.c b/hiredis.c
index 15bc2a7..7fbe016 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -60,7 +60,7 @@ static void *createNilObject(redisReadTask *task);
static void redisSetReplyReaderError(redisReader *r, sds err);
/* Default set of functions to build the reply. */
-static redisReplyFunctions defaultFunctions = {
+static redisReplyObjectFunctions defaultFunctions = {
createStringObject,
createArrayObject,
createIntegerObject,
@@ -339,7 +339,7 @@ static int processItem(redisReader *r) {
}
}
-void *redisReplyReaderCreate(redisReplyFunctions *fn) {
+void *redisReplyReaderCreate(redisReplyObjectFunctions *fn) {
redisReader *r = calloc(sizeof(redisReader),1);
r->error = NULL;
r->fn = fn == NULL ? &defaultFunctions : fn;
@@ -574,7 +574,7 @@ static int redisContextConnect(redisContext *c, const char *ip, int port) {
return REDIS_OK;
}
-static redisContext *redisContextInit(redisReplyFunctions *fn) {
+static redisContext *redisContextInit(redisReplyObjectFunctions *fn) {
redisContext *c = calloc(sizeof(redisContext),1);
c->error = NULL;
c->obuf = sdsempty();
@@ -629,7 +629,7 @@ void redisFree(redisContext *c) {
/* Connect to a Redis instance. On error the field error in the returned
* context will be set to the return value of the error function.
* When no set of reply functions is given, the default set will be used. */
-redisContext *redisConnect(const char *ip, int port, redisReplyFunctions *fn) {
+redisContext *redisConnect(const char *ip, int port, redisReplyObjectFunctions *fn) {
redisContext *c = redisContextInit(fn);
c->flags |= REDIS_BLOCK;
c->flags |= REDIS_CONNECTED;
@@ -637,7 +637,7 @@ redisContext *redisConnect(const char *ip, int port, redisReplyFunctions *fn) {
return c;
}
-redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyFunctions *fn) {
+redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyObjectFunctions *fn) {
redisContext *c = redisContextInit(fn);
c->flags &= ~REDIS_BLOCK;
c->flags |= REDIS_CONNECTED;
diff --git a/hiredis.h b/hiredis.h
index b8c69bb..58b9066 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -72,7 +72,7 @@ typedef struct redisReplyObjectFunctions {
void *(*createInteger)(redisReadTask*, long long);
void *(*createNil)(redisReadTask*);
void (*freeObject)(void*);
-} redisReplyFunctions;
+} redisReplyObjectFunctions;
struct redisContext; /* need forward declaration of redisContext */
@@ -101,7 +101,7 @@ typedef struct redisContext {
sds obuf; /* Write buffer */
/* Function set for reply buildup and reply reader */
- redisReplyFunctions *fn;
+ redisReplyObjectFunctions *fn;
void *reader;
/* Non-reply callbacks */
@@ -116,15 +116,15 @@ typedef struct redisContext {
} redisContext;
void freeReplyObject(void *reply);
-void *redisReplyReaderCreate(redisReplyFunctions *fn);
+void *redisReplyReaderCreate(redisReplyObjectFunctions *fn);
void *redisReplyReaderGetObject(void *reader);
char *redisReplyReaderGetError(void *reader);
void redisReplyReaderFree(void *ptr);
void redisReplyReaderFeed(void *reader, char *buf, int len);
int redisReplyReaderGetReply(void *reader, void **reply);
-redisContext *redisConnect(const char *ip, int port, redisReplyFunctions *fn);
-redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyFunctions *fn);
+redisContext *redisConnect(const char *ip, int port, redisReplyObjectFunctions *fn);
+redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyObjectFunctions *fn);
void redisDisconnect(redisContext *c);
void redisFree(redisContext *c);
int redisBufferRead(redisContext *c);