summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hiredis.h27
1 files 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);