diff options
-rw-r--r-- | hiredis.c | 10 | ||||
-rw-r--r-- | hiredis.h | 6 |
2 files changed, 3 insertions, 13 deletions
@@ -552,16 +552,6 @@ int redisReplyReaderSetReplyObjectFunctions(redisReader *r, redisReplyObjectFunc return REDIS_ERR; } -/* Set the private data field that is used in the read tasks. This argument can - * be used to curry arbitrary data to the custom reply object functions. */ -int redisReplyReaderSetPrivdata(redisReader *r, void *privdata) { - if (r->reply == NULL) { - r->privdata = privdata; - return REDIS_OK; - } - return REDIS_ERR; -} - void redisReplyReaderFree(redisReader *r) { if (r->reply != NULL && r->fn && r->fn->freeObject) r->fn->freeObject(r->reply); @@ -134,14 +134,14 @@ typedef struct redisReader { void freeReplyObject(void *reply); redisReader *redisReplyReaderCreate(void); int redisReplyReaderSetReplyObjectFunctions(redisReader *r, redisReplyObjectFunctions *fn); -int redisReplyReaderSetPrivdata(redisReader *r, void *privdata); void redisReplyReaderFree(redisReader *r); void redisReplyReaderFeed(redisReader *r, const char *buf, size_t len); int redisReplyReaderGetReply(redisReader *r, void **reply); /* Backwards compatibility, can be removed on big version bump. */ -#define redisReplyReaderGetObject(_r) (((redisReader*)(r))->reply) -#define redisReplyReaderGetError(_r) (((redisReader*)(r))->errstr) +#define redisReplyReaderSetPrivdata(_r, _p) (int)(((redisReader*)(_r))->privdata = (_p)) +#define redisReplyReaderGetObject(_r) (((redisReader*)(_r))->reply) +#define redisReplyReaderGetError(_r) (((redisReader*)(_r))->errstr) /* Functions to format a command according to the protocol. */ int redisvFormatCommand(char **target, const char *format, va_list ap); |