-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhiredis.h
More file actions
25 lines (20 loc) · 787 Bytes
/
hiredis.h
File metadata and controls
25 lines (20 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef __HIREDIS_H
#define __HIREDIS_H
#define REDIS_REPLY_ERROR 0
#define REDIS_REPLY_STRING 1
#define REDIS_REPLY_ARRAY 2
#define REDIS_REPLY_INTEGER 3
#define REDIS_REPLY_NIL 4
#include "sds.h"
/* This is the reply object returned by redisCommand() */
typedef struct redisReply {
int type; /* REDIS_REPLY_* */
long long integer; /* The integer when type is REDIS_REPLY_INTEGER */
char *reply; /* Used for both REDIS_REPLY_ERROR and REDIS_REPLY_STRING */
size_t elements; /* number of elements, for REDIS_REPLY_ARRAY */
struct redisReply **element; /* elements vector for REDIS_REPLY_ARRAY */
} redisReply;
redisReply *redisConnect(int *fd, char *ip, int port);
void freeReplyObject(redisReply *r);
redisReply *redisCommand(int fd, char *format, ...);
#endif