26 lines
787 B
C
26 lines
787 B
C
|
#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
|