Rename struct
This commit is contained in:
parent
0f745d1ac0
commit
1e7f5ae6bd
10
hiredis.c
10
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;
|
||||
|
|
10
hiredis.h
10
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);
|
||||
|
|
Loading…
Reference in New Issue