summaryrefslogtreecommitdiff
path: root/hiredis.h
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-04-21 14:34:03 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-04-21 14:34:03 +0200
commit5ba49014da410b3e671c341469ac372d6a383822 (patch)
tree7ea7dd4825943ce6bd6639dfaf0b84a54dc845a8 /hiredis.h
parent2002218981c4aa6ab8a55e9513962adc2268b657 (diff)
Privdata can be set directly on the struct
Diffstat (limited to 'hiredis.h')
-rw-r--r--hiredis.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/hiredis.h b/hiredis.h
index 6a2257f..55342a3 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -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);