[SR-Dev] git:master: fix overlapping symbols of libconfuse and sr core cfg parser

Henning Westerholt henning.westerholt at 1und1.de
Wed Apr 22 10:44:25 CEST 2009


Module: sip-router
Branch: master
Commit: 50ca02e5e68d7ea44609d50e8e3fb38babe77424
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=50ca02e5e68d7ea44609d50e8e3fb38babe77424

Author: Henning Westerholt <henning.westerholt at 1und1.de>
Committer: Henning Westerholt <henning.westerholt at 1und1.de>
Date:   Wed Apr 22 10:41:55 2009 +0200

fix overlapping symbols of libconfuse and sr core cfg parser

- fix overlapping symbols for the libconfuse library used from carrierroute,
  added 'sr_' prefix to cfg_init and cfg_parse core functions
- fix all modules that called this functions

---

 cfg/cfg_struct.c           |   16 ++++++++--------
 cfg/cfg_struct.h           |    2 +-
 cfg_parser.c               |    4 ++--
 cfg_parser.h               |    2 +-
 main.c                     |    2 +-
 modules/tls/tls_config.c   |    2 +-
 modules_s/ldap/ld_cfg.c    |    2 +-
 modules_s/tls/tls_config.c |    2 +-
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/cfg/cfg_struct.c b/cfg/cfg_struct.c
index fe7d8d6..533228b 100644
--- a/cfg/cfg_struct.c
+++ b/cfg/cfg_struct.c
@@ -266,15 +266,15 @@ static void cfg_destory_groups(unsigned char *block)
 }
 
 /* initiate the cfg framework */
-int cfg_init(void)
+int sr_cfg_init(void)
 {
 	cfg_global_lock = lock_alloc();
 	if (!cfg_global_lock) {
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
 		goto error;
 	}
 	if (lock_init(cfg_global_lock) == 0) {
-		LOG(L_ERR, "ERROR: cfg_init(): failed to init lock\n");
+		LOG(L_ERR, "ERROR: sr_cfg_init(): failed to init lock\n");
 		lock_dealloc(cfg_global_lock);
 		cfg_global_lock = 0;
 		goto error;
@@ -282,11 +282,11 @@ int cfg_init(void)
 
 	cfg_writer_lock = lock_alloc();
 	if (!cfg_writer_lock) {
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
 		goto error;
 	}
 	if (lock_init(cfg_writer_lock) == 0) {
-		LOG(L_ERR, "ERROR: cfg_init(): failed to init lock\n");
+		LOG(L_ERR, "ERROR: sr_cfg_init(): failed to init lock\n");
 		lock_dealloc(cfg_writer_lock);
 		cfg_writer_lock = 0;
 		goto error;
@@ -294,21 +294,21 @@ int cfg_init(void)
 
 	cfg_global = (cfg_block_t **)shm_malloc(sizeof(cfg_block_t *));
 	if (!cfg_global) {
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
 		goto error;
 	}
 	*cfg_global = NULL;
 
 	cfg_child_cb_first = (cfg_child_cb_t **)shm_malloc(sizeof(cfg_child_cb_t *));
 	if (!cfg_child_cb_first) {
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
 		goto error;
 	}
 	*cfg_child_cb_first = NULL;
 
 	cfg_child_cb_last = (cfg_child_cb_t **)shm_malloc(sizeof(cfg_child_cb_t *));
 	if (!cfg_child_cb_last) {
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
 		goto error;
 	}
 	*cfg_child_cb_last = NULL;
diff --git a/cfg/cfg_struct.h b/cfg/cfg_struct.h
index 682afc2..975e3aa 100644
--- a/cfg/cfg_struct.h
+++ b/cfg/cfg_struct.h
@@ -119,7 +119,7 @@ extern cfg_child_cb_t	*cfg_child_cb;
 #define CFG_INPUT_TYPE(var)	CFG_INPUT_MASK((var)->def->type)
 
 /* initiate the cfg framework */
-int cfg_init(void);
+int sr_cfg_init(void);
 
 /* destroy the memory allocated for the cfg framework */
 void cfg_destroy(void);
diff --git a/cfg_parser.c b/cfg_parser.c
index db8781a..690230d 100644
--- a/cfg_parser.c
+++ b/cfg_parser.c
@@ -42,7 +42,7 @@
  *
  *	cfg_set_options(parser, options);
  *
- *	if (cfg_parse(parser) < 0) {
+ *	if (sr_cfg_parse(parser) < 0) {
  *		ERR("Error while parsing configuration file\n");
  *      cfg_parser_close(parser);
  *		return -1;
@@ -668,7 +668,7 @@ static int process_option(cfg_parser_t* st, cfg_option_t* opt)
 }
 
 
-int cfg_parse(cfg_parser_t* st)
+int sr_cfg_parse(cfg_parser_t* st)
 {
 	int ret;
 	cfg_token_t t;
diff --git a/cfg_parser.h b/cfg_parser.h
index ade0471..648b438 100644
--- a/cfg_parser.h
+++ b/cfg_parser.h
@@ -145,7 +145,7 @@ void cfg_section_parser(struct cfg_parser* st, cfg_func_f parser, void* param);
 
 void cfg_set_options(struct cfg_parser* st, struct cfg_option* options);
 
-int cfg_parse(struct cfg_parser* st);
+int sr_cfg_parse(struct cfg_parser* st);
 
 void cfg_parser_close(struct cfg_parser* st);
 
diff --git a/main.c b/main.c
index 228e6f3..9befadd 100644
--- a/main.c
+++ b/main.c
@@ -1934,7 +1934,7 @@ try_again:
 		LOG(L_CRIT, "could not initialize base* framework\n");
 		goto error;
 	}
-	if (cfg_init() < 0) {
+	if (sr_cfg_init() < 0) {
 		LOG(L_CRIT, "could not initialize configuration framework\n");
 		goto error;
 	}
diff --git a/modules/tls/tls_config.c b/modules/tls/tls_config.c
index f32cc4d..ad40d85 100644
--- a/modules/tls/tls_config.c
+++ b/modules/tls/tls_config.c
@@ -344,7 +344,7 @@ tls_cfg_t* tls_load_config(str* filename)
 
 	cfg_section_parser(parser, parse_domain, NULL);
 
-	if (cfg_parse(parser)) goto error;
+	if (sr_cfg_parse(parser)) goto error;
 	cfg_parser_close(parser);
 	return cfg;
 
diff --git a/modules_s/ldap/ld_cfg.c b/modules_s/ldap/ld_cfg.c
index 82a7af5..e442758 100644
--- a/modules_s/ldap/ld_cfg.c
+++ b/modules_s/ldap/ld_cfg.c
@@ -491,7 +491,7 @@ int ld_load_cfg(str* filename)
 
 	cfg_section_parser(parser, parse_section, NULL);
 
-	if (cfg_parse(parser)) {
+	if (sr_cfg_parse(parser)) {
 		if (cfg == NULL) {
 			ERR("ldap: A table name (i.e. [table_name]) is missing in the "
 				"configuration file.\n");
diff --git a/modules_s/tls/tls_config.c b/modules_s/tls/tls_config.c
index f32cc4d..ad40d85 100644
--- a/modules_s/tls/tls_config.c
+++ b/modules_s/tls/tls_config.c
@@ -344,7 +344,7 @@ tls_cfg_t* tls_load_config(str* filename)
 
 	cfg_section_parser(parser, parse_domain, NULL);
 
-	if (cfg_parse(parser)) goto error;
+	if (sr_cfg_parse(parser)) goto error;
 	cfg_parser_close(parser);
 	return cfg;
 




More information about the sr-dev mailing list