2013-08-16 15:12:47 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <hiredis/hiredis.h>
|
|
|
|
|
2013-08-26 18:30:02 +00:00
|
|
|
#ifndef REDIS_ZHELPERS_H
|
|
|
|
#define REDIS_ZHELPERS_H
|
2013-08-16 15:12:47 +00:00
|
|
|
|
2013-10-09 21:07:52 +00:00
|
|
|
#define T_TCP 0
|
|
|
|
#define T_LOCAL 1
|
|
|
|
|
|
|
|
typedef struct redisconf {
|
|
|
|
int type;
|
|
|
|
char *path;
|
|
|
|
char *server;
|
|
|
|
uint16_t port;
|
|
|
|
char *list_name;
|
|
|
|
} redisconf_t;
|
|
|
|
|
|
|
|
redisconf_t *redis_parse_connstr(char *connstr);
|
|
|
|
|
2013-10-09 19:11:23 +00:00
|
|
|
int redis_init(char*);
|
2013-08-16 15:12:47 +00:00
|
|
|
|
|
|
|
int redis_close(void);
|
|
|
|
|
|
|
|
int redis_existconf(const char*);
|
|
|
|
|
|
|
|
int redis_flush(void);
|
|
|
|
|
|
|
|
int redis_delconf(const char*);
|
|
|
|
|
|
|
|
int redis_setconf(const char*, char*);
|
|
|
|
|
|
|
|
int redis_getconf(const char*, char*, size_t);
|
|
|
|
|
|
|
|
long redis_get_sizeof_list(const char*);
|
|
|
|
|
|
|
|
long redis_get_sizeof_set(const char*);
|
|
|
|
|
|
|
|
int redis_lpush(char*, void*, int, size_t);
|
|
|
|
|
|
|
|
int redis_lpull(char*, void*, int, size_t, int*);
|
|
|
|
|
|
|
|
int redis_spull(char*, void*, int, size_t, int*);
|
|
|
|
|
|
|
|
int redis_spush(char*, void*, int, size_t);
|
|
|
|
|
|
|
|
redisContext* redis_get_context(void);
|
|
|
|
|
|
|
|
uint32_t redis_getconf_uint32_t(const char*);
|
|
|
|
|
|
|
|
int redis_setconf_uint32_t(const char*, uint32_t);
|
|
|
|
|
|
|
|
#endif // _REDIS_ZHELPERS_H
|