From f0307c61724c19fa4b1788f7b6b3ca83387ea8be Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 21 Apr 2011 14:23:59 +0200 Subject: Move definitions around --- hiredis.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/hiredis.h b/hiredis.h index b809e56..514025b 100644 --- a/hiredis.h +++ b/hiredis.h @@ -114,19 +114,7 @@ typedef struct redisReplyObjectFunctions { void (*freeObject)(void*); } redisReplyObjectFunctions; -/* Context for a connection to Redis */ -typedef struct redisContext { - int fd; - int flags; - char *obuf; /* Write buffer */ - int err; /* Error flags, 0 when there is no error */ - char *errstr; /* String representation of error when applicable */ - - /* Function set for reply buildup and reply reader */ - redisReplyObjectFunctions *fn; - void *reader; -} redisContext; - +/* State for the protocol parser */ typedef struct redisReader { int err; /* Error flags, 0 when there is no error */ char errstr[128]; /* String representation of error when applicable */ @@ -158,6 +146,19 @@ int redisvFormatCommand(char **target, const char *format, va_list ap); int redisFormatCommand(char **target, const char *format, ...); int redisFormatCommandArgv(char **target, int argc, const char **argv, const size_t *argvlen); +/* Context for a connection to Redis */ +typedef struct redisContext { + int fd; + int flags; + char *obuf; /* Write buffer */ + int err; /* Error flags, 0 when there is no error */ + char *errstr; /* String representation of error when applicable */ + + /* Function set for reply buildup and reply reader */ + redisReplyObjectFunctions *fn; + void *reader; +} redisContext; + redisContext *redisConnect(const char *ip, int port); redisContext *redisConnectWithTimeout(const char *ip, int port, struct timeval tv); redisContext *redisConnectNonBlock(const char *ip, int port); -- cgit v1.2.3