Remove accessor functions now the redisReader struct is public

This commit is contained in:
Pieter Noordhuis 2011-04-21 14:27:03 +02:00
parent f0307c6172
commit 026636b0cd
2 changed files with 4 additions and 16 deletions

View File

@ -559,15 +559,6 @@ int redisReplyReaderSetPrivdata(redisReader *reader, void *privdata) {
return REDIS_ERR;
}
/* External libraries wrapping hiredis might need access to the temporary
* variable while the reply is built up. When the reader contains an
* object in between receiving some bytes to parse, this object might
* otherwise be free'd by garbage collection. */
void *redisReplyReaderGetObject(redisReader *reader) {
redisReader *r = reader;
return r->reply;
}
void redisReplyReaderFree(redisReader *reader) {
redisReader *r = reader;
if (r->reply != NULL && r->fn && r->fn->freeObject)
@ -577,11 +568,6 @@ void redisReplyReaderFree(redisReader *reader) {
free(r);
}
char *redisReplyReaderGetError(redisReader *reader) {
redisReader *r = reader;
return r->errstr;
}
void redisReplyReaderFeed(redisReader *reader, const char *buf, size_t len) {
redisReader *r = reader;

View File

@ -135,12 +135,14 @@ void freeReplyObject(void *reply);
redisReader *redisReplyReaderCreate(void);
int redisReplyReaderSetReplyObjectFunctions(redisReader *reader, redisReplyObjectFunctions *fn);
int redisReplyReaderSetPrivdata(redisReader *reader, void *privdata);
void *redisReplyReaderGetObject(redisReader *reader);
char *redisReplyReaderGetError(redisReader *reader);
void redisReplyReaderFree(redisReader *ptr);
void redisReplyReaderFeed(redisReader *reader, const char *buf, size_t len);
int redisReplyReaderGetReply(redisReader *reader, void **reply);
/* Backwards compatibility, can be removed on big version bump. */
#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);
int redisFormatCommand(char **target, const char *format, ...);