Browse code

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

Henning Westerholt authored on 22/04/2009 08:41:55
Showing 8 changed files
... ...
@@ -266,15 +266,15 @@ static void cfg_destory_groups(unsigned char *block)
266 266
 }
267 267
 
268 268
 /* initiate the cfg framework */
269
-int cfg_init(void)
269
+int sr_cfg_init(void)
270 270
 {
271 271
 	cfg_global_lock = lock_alloc();
272 272
 	if (!cfg_global_lock) {
273
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
273
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
274 274
 		goto error;
275 275
 	}
276 276
 	if (lock_init(cfg_global_lock) == 0) {
277
-		LOG(L_ERR, "ERROR: cfg_init(): failed to init lock\n");
277
+		LOG(L_ERR, "ERROR: sr_cfg_init(): failed to init lock\n");
278 278
 		lock_dealloc(cfg_global_lock);
279 279
 		cfg_global_lock = 0;
280 280
 		goto error;
... ...
@@ -282,11 +282,11 @@ int cfg_init(void)
282 282
 
283 283
 	cfg_writer_lock = lock_alloc();
284 284
 	if (!cfg_writer_lock) {
285
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
285
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
286 286
 		goto error;
287 287
 	}
288 288
 	if (lock_init(cfg_writer_lock) == 0) {
289
-		LOG(L_ERR, "ERROR: cfg_init(): failed to init lock\n");
289
+		LOG(L_ERR, "ERROR: sr_cfg_init(): failed to init lock\n");
290 290
 		lock_dealloc(cfg_writer_lock);
291 291
 		cfg_writer_lock = 0;
292 292
 		goto error;
... ...
@@ -294,21 +294,21 @@ int cfg_init(void)
294 294
 
295 295
 	cfg_global = (cfg_block_t **)shm_malloc(sizeof(cfg_block_t *));
296 296
 	if (!cfg_global) {
297
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
297
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
298 298
 		goto error;
299 299
 	}
300 300
 	*cfg_global = NULL;
301 301
 
302 302
 	cfg_child_cb_first = (cfg_child_cb_t **)shm_malloc(sizeof(cfg_child_cb_t *));
303 303
 	if (!cfg_child_cb_first) {
304
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
304
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
305 305
 		goto error;
306 306
 	}
307 307
 	*cfg_child_cb_first = NULL;
308 308
 
309 309
 	cfg_child_cb_last = (cfg_child_cb_t **)shm_malloc(sizeof(cfg_child_cb_t *));
310 310
 	if (!cfg_child_cb_last) {
311
-		LOG(L_ERR, "ERROR: cfg_init(): not enough shm memory\n");
311
+		LOG(L_ERR, "ERROR: sr_cfg_init(): not enough shm memory\n");
312 312
 		goto error;
313 313
 	}
314 314
 	*cfg_child_cb_last = NULL;
... ...
@@ -119,7 +119,7 @@ extern cfg_child_cb_t	*cfg_child_cb;
119 119
 #define CFG_INPUT_TYPE(var)	CFG_INPUT_MASK((var)->def->type)
120 120
 
121 121
 /* initiate the cfg framework */
122
-int cfg_init(void);
122
+int sr_cfg_init(void);
123 123
 
124 124
 /* destroy the memory allocated for the cfg framework */
125 125
 void cfg_destroy(void);
... ...
@@ -42,7 +42,7 @@
42 42
  *
43 43
  *	cfg_set_options(parser, options);
44 44
  *
45
- *	if (cfg_parse(parser) < 0) {
45
+ *	if (sr_cfg_parse(parser) < 0) {
46 46
  *		ERR("Error while parsing configuration file\n");
47 47
  *      cfg_parser_close(parser);
48 48
  *		return -1;
... ...
@@ -668,7 +668,7 @@ static int process_option(cfg_parser_t* st, cfg_option_t* opt)
668 668
 }
669 669
 
670 670
 
671
-int cfg_parse(cfg_parser_t* st)
671
+int sr_cfg_parse(cfg_parser_t* st)
672 672
 {
673 673
 	int ret;
674 674
 	cfg_token_t t;
... ...
@@ -145,7 +145,7 @@ void cfg_section_parser(struct cfg_parser* st, cfg_func_f parser, void* param);
145 145
 
146 146
 void cfg_set_options(struct cfg_parser* st, struct cfg_option* options);
147 147
 
148
-int cfg_parse(struct cfg_parser* st);
148
+int sr_cfg_parse(struct cfg_parser* st);
149 149
 
150 150
 void cfg_parser_close(struct cfg_parser* st);
151 151
 
... ...
@@ -1934,7 +1934,7 @@ try_again:
1934 1934
 		LOG(L_CRIT, "could not initialize base* framework\n");
1935 1935
 		goto error;
1936 1936
 	}
1937
-	if (cfg_init() < 0) {
1937
+	if (sr_cfg_init() < 0) {
1938 1938
 		LOG(L_CRIT, "could not initialize configuration framework\n");
1939 1939
 		goto error;
1940 1940
 	}
... ...
@@ -344,7 +344,7 @@ tls_cfg_t* tls_load_config(str* filename)
344 344
 
345 345
 	cfg_section_parser(parser, parse_domain, NULL);
346 346
 
347
-	if (cfg_parse(parser)) goto error;
347
+	if (sr_cfg_parse(parser)) goto error;
348 348
 	cfg_parser_close(parser);
349 349
 	return cfg;
350 350
 
... ...
@@ -491,7 +491,7 @@ int ld_load_cfg(str* filename)
491 491
 
492 492
 	cfg_section_parser(parser, parse_section, NULL);
493 493
 
494
-	if (cfg_parse(parser)) {
494
+	if (sr_cfg_parse(parser)) {
495 495
 		if (cfg == NULL) {
496 496
 			ERR("ldap: A table name (i.e. [table_name]) is missing in the "
497 497
 				"configuration file.\n");
... ...
@@ -344,7 +344,7 @@ tls_cfg_t* tls_load_config(str* filename)
344 344
 
345 345
 	cfg_section_parser(parser, parse_domain, NULL);
346 346
 
347
-	if (cfg_parse(parser)) goto error;
347
+	if (sr_cfg_parse(parser)) goto error;
348 348
 	cfg_parser_close(parser);
349 349
 	return cfg;
350 350