Commit 1e7f5ae6 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Rename struct

parent 0f745d1a
...@@ -60,7 +60,7 @@ static void *createNilObject(redisReadTask *task); ...@@ -60,7 +60,7 @@ static void *createNilObject(redisReadTask *task);
static void redisSetReplyReaderError(redisReader *r, sds err); static void redisSetReplyReaderError(redisReader *r, sds err);
/* Default set of functions to build the reply. */ /* Default set of functions to build the reply. */
static redisReplyFunctions defaultFunctions = { static redisReplyObjectFunctions defaultFunctions = {
createStringObject, createStringObject,
createArrayObject, createArrayObject,
createIntegerObject, createIntegerObject,
...@@ -339,7 +339,7 @@ static int processItem(redisReader *r) { ...@@ -339,7 +339,7 @@ static int processItem(redisReader *r) {
} }
} }
void *redisReplyReaderCreate(redisReplyFunctions *fn) { void *redisReplyReaderCreate(redisReplyObjectFunctions *fn) {
redisReader *r = calloc(sizeof(redisReader),1); redisReader *r = calloc(sizeof(redisReader),1);
r->error = NULL; r->error = NULL;
r->fn = fn == NULL ? &defaultFunctions : fn; r->fn = fn == NULL ? &defaultFunctions : fn;
...@@ -574,7 +574,7 @@ static int redisContextConnect(redisContext *c, const char *ip, int port) { ...@@ -574,7 +574,7 @@ static int redisContextConnect(redisContext *c, const char *ip, int port) {
return REDIS_OK; return REDIS_OK;
} }
static redisContext *redisContextInit(redisReplyFunctions *fn) { static redisContext *redisContextInit(redisReplyObjectFunctions *fn) {
redisContext *c = calloc(sizeof(redisContext),1); redisContext *c = calloc(sizeof(redisContext),1);
c->error = NULL; c->error = NULL;
c->obuf = sdsempty(); c->obuf = sdsempty();
...@@ -629,7 +629,7 @@ void redisFree(redisContext *c) { ...@@ -629,7 +629,7 @@ void redisFree(redisContext *c) {
/* Connect to a Redis instance. On error the field error in the returned /* 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. * 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. */ * 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); redisContext *c = redisContextInit(fn);
c->flags |= REDIS_BLOCK; c->flags |= REDIS_BLOCK;
c->flags |= REDIS_CONNECTED; c->flags |= REDIS_CONNECTED;
...@@ -637,7 +637,7 @@ redisContext *redisConnect(const char *ip, int port, redisReplyFunctions *fn) { ...@@ -637,7 +637,7 @@ redisContext *redisConnect(const char *ip, int port, redisReplyFunctions *fn) {
return c; return c;
} }
redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyFunctions *fn) { redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyObjectFunctions *fn) {
redisContext *c = redisContextInit(fn); redisContext *c = redisContextInit(fn);
c->flags &= ~REDIS_BLOCK; c->flags &= ~REDIS_BLOCK;
c->flags |= REDIS_CONNECTED; c->flags |= REDIS_CONNECTED;
......
...@@ -72,7 +72,7 @@ typedef struct redisReplyObjectFunctions { ...@@ -72,7 +72,7 @@ typedef struct redisReplyObjectFunctions {
void *(*createInteger)(redisReadTask*, long long); void *(*createInteger)(redisReadTask*, long long);
void *(*createNil)(redisReadTask*); void *(*createNil)(redisReadTask*);
void (*freeObject)(void*); void (*freeObject)(void*);
} redisReplyFunctions; } redisReplyObjectFunctions;
struct redisContext; /* need forward declaration of redisContext */ struct redisContext; /* need forward declaration of redisContext */
...@@ -101,7 +101,7 @@ typedef struct redisContext { ...@@ -101,7 +101,7 @@ typedef struct redisContext {
sds obuf; /* Write buffer */ sds obuf; /* Write buffer */
/* Function set for reply buildup and reply reader */ /* Function set for reply buildup and reply reader */
redisReplyFunctions *fn; redisReplyObjectFunctions *fn;
void *reader; void *reader;
/* Non-reply callbacks */ /* Non-reply callbacks */
...@@ -116,15 +116,15 @@ typedef struct redisContext { ...@@ -116,15 +116,15 @@ typedef struct redisContext {
} redisContext; } redisContext;
void freeReplyObject(void *reply); void freeReplyObject(void *reply);
void *redisReplyReaderCreate(redisReplyFunctions *fn); void *redisReplyReaderCreate(redisReplyObjectFunctions *fn);
void *redisReplyReaderGetObject(void *reader); void *redisReplyReaderGetObject(void *reader);
char *redisReplyReaderGetError(void *reader); char *redisReplyReaderGetError(void *reader);
void redisReplyReaderFree(void *ptr); void redisReplyReaderFree(void *ptr);
void redisReplyReaderFeed(void *reader, char *buf, int len); void redisReplyReaderFeed(void *reader, char *buf, int len);
int redisReplyReaderGetReply(void *reader, void **reply); int redisReplyReaderGetReply(void *reader, void **reply);
redisContext *redisConnect(const char *ip, int port, redisReplyFunctions *fn); redisContext *redisConnect(const char *ip, int port, redisReplyObjectFunctions *fn);
redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyFunctions *fn); redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyObjectFunctions *fn);
void redisDisconnect(redisContext *c); void redisDisconnect(redisContext *c);
void redisFree(redisContext *c); void redisFree(redisContext *c);
int redisBufferRead(redisContext *c); int redisBufferRead(redisContext *c);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment