diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-09-25 15:09:13 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-09-25 15:09:13 +0200 |
commit | a7d76181415b4b0ace9d6863ef71eb08ebd1b7ef (patch) | |
tree | 10861935888a9d25cdb7525540d008949a931560 /hiredis.h | |
parent | e6fb160b4479cacb2c9e4e35a9557726ee4cc3d7 (diff) |
Deprecate the error object for I/O and protocol errors
Rather, use the return value REDIS_OK and REDIS_ERR to designate if
calling a function has a successful outcome. When there was an error in
performing the call the error field will be set inside the reader or the
context.
Diffstat (limited to 'hiredis.h')
-rw-r--r-- | hiredis.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -63,7 +63,6 @@ typedef struct redisReadTask { } redisReadTask; typedef struct redisReplyObjectFunctions { - void *(*createError)(const char*, size_t); void *(*createString)(redisReadTask*, char*, size_t); void *(*createArray)(redisReadTask*, int); void *(*createInteger)(redisReadTask*, long long); @@ -85,7 +84,7 @@ typedef struct redisCallback { typedef struct redisContext { int fd; int flags; - void *error; /* Error object is set when in erronous state */ + sds error; /* Error object is set when in erronous state */ sds obuf; /* Write buffer */ redisReplyFunctions *fn; void *reader; @@ -97,15 +96,16 @@ typedef struct redisContext { void freeReplyObject(void *reply); void *redisReplyReaderCreate(redisReplyFunctions *fn); void *redisReplyReaderGetObject(void *reader); +char *redisReplyReaderGetError(void *reader); void redisReplyReaderFree(void *ptr); void redisReplyReaderFeed(void *reader, char *buf, int len); -void *redisReplyReaderGetReply(void *reader); +int redisReplyReaderGetReply(void *reader, void **reply); redisContext *redisConnect(const char *ip, int port, redisReplyFunctions *fn); redisContext *redisConnectNonBlock(const char *ip, int port, redisReplyFunctions *fn); int redisBufferRead(redisContext *c); int redisBufferWrite(redisContext *c, int *done); -void *redisGetReply(redisContext *c); +int redisGetReply(redisContext *c, void **reply); int redisProcessCallbacks(redisContext *c); void *redisCommand(redisContext *c, const char *format, ...); |