making parse redis connstr externally available
This commit is contained in:
parent
76f848bf79
commit
3eb7630f28
13
lib/redis.c
13
lib/redis.c
@ -25,18 +25,7 @@
|
||||
|
||||
static redisContext *rctx;
|
||||
|
||||
#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;
|
||||
|
||||
static redisconf_t *redis_parse_connstr(char *connstr)
|
||||
redisconf_t *redis_parse_connstr(char *connstr)
|
||||
{
|
||||
redisconf_t *retv = malloc(sizeof(redisconf_t));
|
||||
if (strcmp("tcp://", connstr) == 6) {
|
||||
|
13
lib/redis.h
13
lib/redis.h
@ -5,6 +5,19 @@
|
||||
#ifndef REDIS_ZHELPERS_H
|
||||
#define REDIS_ZHELPERS_H
|
||||
|
||||
#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);
|
||||
|
||||
int redis_init(char*);
|
||||
|
||||
int redis_close(void);
|
||||
|
Loading…
Reference in New Issue
Block a user