[asterisk-commits] tilghman: branch group/res_config_ldap r81399 - /team/group/res_config_ldap/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 30 17:10:10 CDT 2007


Author: tilghman
Date: Thu Aug 30 17:10:10 2007
New Revision: 81399

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81399
Log:
Update to current trunk API

Modified:
    team/group/res_config_ldap/res/res_config_ldap.c

Modified: team/group/res_config_ldap/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/res/res_config_ldap.c?view=diff&rev=81399&r1=81398&r2=81399
==============================================================================
--- team/group/res_config_ldap/res/res_config_ldap.c (original)
+++ team/group/res_config_ldap/res/res_config_ldap.c Thu Aug 30 17:10:10 2007
@@ -188,7 +188,7 @@
 	if (ast_strlen_zero(attribute_name) || ast_strlen_zero(attribute_value))
  		return;
 
-	if (!(var = ast_variable_new(attribute_name, attribute_value)))
+	if (!(var = ast_variable_new(attribute_name, attribute_value, table_config->table_name)))
  		return;
 
 	if (table_config->attributes)
@@ -307,12 +307,12 @@
 							if (value->bv_val[i] == ';'){
 								value->bv_val[i] = '\0';
 								if (prev) {
-									prev->next = ast_variable_new(attribute_name, &value->bv_val[pos]);
+									prev->next = ast_variable_new(attribute_name, &value->bv_val[pos], table_config->table_name);
 									if (prev->next) {
 										prev = prev->next;
 									}
 								} else {
-									prev = var = ast_variable_new(attribute_name, &value->bv_val[pos]);
+									prev = var = ast_variable_new(attribute_name, &value->bv_val[pos], table_config->table_name);
 								}
 								pos = i + 1;
 							}
@@ -321,12 +321,12 @@
 					}
 					/* for the last delimited value or if the value is not delimited: */
 					if (prev) {
-						prev->next = ast_variable_new(attribute_name, &value->bv_val[pos]);
+						prev->next = ast_variable_new(attribute_name, &value->bv_val[pos], table_config->table_name);
 						if (prev->next) {
 							prev = prev->next;
 						}
 					} else {
-						prev = var = ast_variable_new(attribute_name, &value->bv_val[pos]);
+						prev = var = ast_variable_new(attribute_name, &value->bv_val[pos], table_config->table_name);
 					}
 				}
 				v++;
@@ -447,12 +447,12 @@
 										ast_debug(2, "LINE(%d) DELIM - attribute_name: %s value: %s pos: %d\n", __LINE__, attribute_name, &delim_value[pos], pos);
 							
 										if (prev) {
-											prev->next = ast_variable_new(attribute_name, &delim_value[pos]);
+											prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
 											if (prev->next) {
 												prev = prev->next;
 											}
 										} else {
-											prev = var = ast_variable_new(attribute_name, &delim_value[pos]);
+											prev = var = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
 										}
 										pos = i + 1;
 
@@ -467,12 +467,12 @@
 									/* Last delimited value */
 									ast_debug(4, "LINE(%d) DELIM - attribute_name: %s value: %s pos: %d\n", __LINE__, attribute_name, &delim_value[pos], pos);
 									if (prev) {
-										prev->next = ast_variable_new(attribute_name, &delim_value[pos]);
+										prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
 										if (prev->next) {
 											prev = prev->next;
 										}
 									} else {
-										prev = var = ast_variable_new(attribute_name, &delim_value[pos]);
+										prev = var = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
 									}
 									/* Remembering to free memory */
 									is_delimited = 0;
@@ -491,12 +491,12 @@
 								ast_debug(2, "LINE(%d) attribute_name: %s value: %s\n", __LINE__, attribute_name, value->bv_val);
 
 								if (prev) {
-									prev->next = ast_variable_new(attribute_name, value->bv_val);
+									prev->next = ast_variable_new(attribute_name, value->bv_val, table_config->table_name);
 									if (prev->next) {
 										prev = prev->next;
 									}
 								} else {
-									prev = var = ast_variable_new(attribute_name, value->bv_val);
+									prev = var = ast_variable_new(attribute_name, value->bv_val, table_config->table_name);
 								}
 							}
 						}
@@ -946,7 +946,7 @@
 
 			while (*p) {
 				struct ast_category *cat = NULL;
-				cat = ast_category_new("");
+				cat = ast_category_new("", table_name, -1);
 				if (!cat) {
 					ast_log(LOG_WARNING, "Out of memory!\n");
 					break;
@@ -1007,7 +1007,7 @@
 *	called on a reload
 */
 static struct ast_config *config_ldap(const char *basedn, const char *table_name,
-	const char *file, struct ast_config *cfg, int withcomments)
+	const char *file, struct ast_config *cfg, struct ast_flags config_flags, const char *sugg_incl)
 {
 	unsigned int vars_count = 0;
 	struct ast_variable **vars;
@@ -1084,14 +1084,15 @@
 
 	for (i = 0; i < vars_count; i++) {
 		if (!strcmp(categories[i].variable_name, "#include")) {
-			if (!ast_config_internal_load(categories[i].variable_value, cfg, 0))
+			struct ast_flags config_flags = { 0 };
+			if (!ast_config_internal_load(categories[i].variable_value, cfg, config_flags, ""))
 				break;
 			continue;
 		}
 
 		if (!last_category || strcmp(last_category, categories[i].name) ||
 			last_category_metric != categories[i].metric) {
-			cur_cat = ast_category_new(categories[i].name);
+			cur_cat = ast_category_new(categories[i].name, table_name, -1);
 			if (!cur_cat)
 				break;
 			last_category = categories[i].name;
@@ -1099,7 +1100,7 @@
 			ast_category_append(cfg, cur_cat);
 		}
 
-		if (!(new_v = ast_variable_new(categories[i].variable_name, categories[i].variable_value)))
+		if (!(new_v = ast_variable_new(categories[i].variable_name, categories[i].variable_value, table_name)))
 			break;
 
 		ast_variable_append(cur_cat, new_v);
@@ -1378,10 +1379,11 @@
 int parse_config(void)
 {
 	struct ast_config *config;
+	struct ast_flags config_flags = {0};
 	const char *s;
 	char *category_name = NULL;
 
-	config = ast_config_load(RES_CONFIG_LDAP_CONF);
+	config = ast_config_load(RES_CONFIG_LDAP_CONF, config_flags);
 
 	if (!config) {
 		ast_log(LOG_WARNING, "Cannot load configuration %s\n", RES_CONFIG_LDAP_CONF);




More information about the asterisk-commits mailing list