From a9a221e51adeb9ef5cd4e22dd71eb33031016bf4 Mon Sep 17 00:00:00 2001 From: crass Date: Mon, 24 Jun 2013 11:59:08 +0700 Subject: [PATCH] Move string tables into common.c --- src/common.c | 20 ++++++++++++++++++++ src/common.h | 4 ++++ src/debug.c | 20 -------------------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/common.c b/src/common.c index 525310a..9cab4ff 100644 --- a/src/common.c +++ b/src/common.c @@ -3,6 +3,26 @@ #include #include +const char *proxy_type_strmap[] = { + "http", + "socks4", + "socks5", +}; + +const char *chain_type_strmap[] = { + "dynamic_chain", + "strict_chain", + "random_chain", + "round_robin_chain", +}; + +const char *proxy_state_strmap[] = { + "play", + "down", + "blocked", + "busy", +}; + // stolen from libulz (C) rofl0r void pc_stringfromipv4(unsigned char *ip_buf_4_bytes, char *outbuf_16_bytes) { unsigned char *p; diff --git a/src/common.h b/src/common.h index 2a3f017..5335bd1 100644 --- a/src/common.h +++ b/src/common.h @@ -11,6 +11,10 @@ #include +extern const char *proxy_type_strmap[]; +extern const char *chain_type_strmap[]; +extern const char *proxy_state_strmap[]; + char *get_config_path(char* default_path, char* pbuf, size_t bufsize); void pc_stringfromipv4(unsigned char *ip_buf_4_bytes, char *outbuf_16_bytes); diff --git a/src/debug.c b/src/debug.c index bbf1474..d867569 100644 --- a/src/debug.c +++ b/src/debug.c @@ -4,26 +4,6 @@ # include "common.h" # include "debug.h" -const char *proxy_type_strmap[] = { - "http", - "socks4", - "socks5", -}; - -const char *chain_type_strmap[] = { - "dynamic_chain", - "strict_chain", - "random_chain", - "round_robin_chain", -}; - -const char *proxy_state_strmap[] = { - "play", - "down", - "blocked", - "busy", -}; - void DUMP_PROXY_CHAIN(proxy_data *pchain, unsigned int count) { char ip_buf[16]; for (; count; pchain++, count--) {