From 3eb7630f28e40f884af76afeb4b20443ab08f5d3 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Wed, 9 Oct 2013 17:07:52 -0400 Subject: [PATCH] making parse redis connstr externally available --- lib/redis.c | 13 +------------ lib/redis.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/redis.c b/lib/redis.c index aeacf08..9383a39 100644 --- a/lib/redis.c +++ b/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) { diff --git a/lib/redis.h b/lib/redis.h index e382375..ca636bf 100644 --- a/lib/redis.h +++ b/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);