[svn-commits] branch oej/res_config_ldap r30494 - /team/oej/res_config_ldap/res/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu May 25 20:39:33 MST 2006


Author: russell
Date: Thu May 25 22:39:33 2006
New Revision: 30494

URL: http://svn.digium.com/view/asterisk?rev=30494&view=rev
Log:
- use quotes around asterisk includes
- remove a bunch of unnecessary semicolons

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

Modified: team/oej/res_config_ldap/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/team/oej/res_config_ldap/res/res_config_ldap.c?rev=30494&r1=30493&r2=30494&view=diff
==============================================================================
--- team/oej/res_config_ldap/res/res_config_ldap.c (original)
+++ team/oej/res_config_ldap/res/res_config_ldap.c Thu May 25 22:39:33 2006
@@ -41,16 +41,17 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
-#include <asterisk/channel.h>
-#include <asterisk/logger.h>
-#include <asterisk/config.h>
-#include <asterisk/module.h>
-#include <asterisk/lock.h>
-#include <asterisk/options.h>
-#include <asterisk/cli.h>
-#include <asterisk/utils.h>
-#include <asterisk/strings.h>
-#include <asterisk/pbx.h>
+#include "asterisk/channel.h"
+#include "asterisk/logger.h"
+#include "asterisk/config.h"
+#include "asterisk/module.h"
+#include "asterisk/lock.h"
+#include "asterisk/options.h"
+#include "asterisk/cli.h"
+#include "asterisk/utils.h"
+#include "asterisk/strings.h"
+#include "asterisk/pbx.h"
+#include "asterisk/linkedlists.h"
 
 static char *res_config_ldap_desc = "LDAP RealTime Configuration Driver";
 AST_MUTEX_DEFINE_STATIC(ldap_lock);
@@ -91,7 +92,7 @@
 	char *table_name;			/*!< table name */
 	char *additional_filter;		/*!< additional filter        */
 	struct ast_variable *attributes;	/*!< attribute names conversion */
-	struct ldap_table_config *next;		/*!< next table */
+	struct ldap_table_config *next;		/*!< next entry */
 };
 
 /*! \brief Should be locked before using it */
@@ -105,7 +106,7 @@
 	if (table_name)
 		p->table_name = strdup(table_name);
 	return p;
-};
+}
 
 /*! \brief Find a table_config - Should be locked before using it */
 static struct ldap_table_config *table_config_for_table_name(const char *table_name)
@@ -175,7 +176,7 @@
 		}
 		free(string);
 	}
-};
+}
 
 /*! \brief Free table_config */
 static void table_configs_free(void)
@@ -190,10 +191,10 @@
 			free(c->additional_filter);
 		if (c->attributes) {
 			ast_variables_destroy(c->attributes);
-		};
+		}
 		free(c);
 		c = next;
-	};
+	}
 	table_configs = NULL;
 	base_table_config = NULL;
 }
@@ -211,15 +212,15 @@
 					return attribute->value;
 				else
 					attribute = attribute->next;
-			};
-		};
+			}
+		}
 		if (table_config == base_table_config)
 			break;
 		else
 			table_config = base_table_config;
-	};
+	}
 	return attribute_name;
-};
+}
 
 /*! \brief Convert ldap attribute name to variable name - Should be locked before using it */
 static const char *convert_attribute_name_from_ldap(struct ldap_table_config *table_config,
@@ -236,15 +237,15 @@
 					return attribute->name;
 				else
 					attribute = attribute->next;
-			};
-		};
+			}
+		}
 		if (table_config == base_table_config)
 			break;
 		else
 			table_config = base_table_config;
-	};
+	}
 	return attribute_name;
-};
+}
 
 /*! \brief Find variable by name */
 static struct ast_variable *variable_named(struct ast_variable *var,
@@ -293,7 +294,7 @@
 					if (option_debug > 1)
 						ast_log(LOG_DEBUG, "LDAP RealTime (%d): md5: %s\n",
 							__LINE__, value);
-				};
+				}
 				if (value) {
 					if (prev) {
 						prev->next = ast_variable_new(attribute_name, value);
@@ -304,7 +305,7 @@
 					}
 				}
 				v++;
-			};
+			}
 			ldap_value_free(values);
 		}
 		ldap_attribute_name = ldap_next_attribute(ldapConn, ldap_entry, ber);
@@ -350,7 +351,7 @@
 					if (ldapConn) {
 						ldap_unbind_s(ldapConn);
 						ldapConn = NULL;
-					};
+					}
 					if (!ldap_reconnect())
 						break;
 				}
@@ -426,7 +427,7 @@
 			if (*p == '|')
 				*p = ',';
 			p++;
-		};
+		}
 	}
 	if (option_debug > 1)
 		ast_log(LOG_DEBUG, "LDAP RealTime (%d): basedn: '%s' => '%s' \n",
@@ -444,7 +445,7 @@
 	if (strchr(filter, '$')) {
 		r_filter = substituted(NULL, filter);
 		filter = r_filter;
-	};
+	}
 	current_len = (*filter_ptr ? strlen(*filter_ptr) : 0);
 	needed_len = current_len + strlen(filter);
 	if (*filter_size_ptr < (needed_len + 1)) {
@@ -479,10 +480,10 @@
 				memcpy(p, by, by_len);
 			}
 			p = strstr(p + by_len, search);
-		};
-	};
+		}
+	}
 	return replaced;
-};
+}
 
 /*! \brief Append a name=value filter string. The filter string can grow. */
 /*! \brief convert name and value if "LIKE' is used (see http://bugs.digium.com/view.php?id=5765) */
@@ -573,12 +574,12 @@
 				if (table_config && table_config->additional_filter) {
 					append_string_to_filter(&filter, &filter_size,
 						table_config->additional_filter);
-				};
+				}
 				if (table_config != base_table_config && base_table_config
 					&& base_table_config->additional_filter) {
 						append_string_to_filter(&filter, &filter_size,
 							base_table_config->additional_filter);
-				};
+				}
 
 				/* Create the first part of the query using the first parameter/value pairs we just extracted */
 				/*   If there is only 1 set, then we have our query. Otherwise, loop thru the list and concat */
@@ -609,7 +610,7 @@
 							if (ldapConn) {
 								ldap_unbind_s(ldapConn);
 								ldapConn = NULL;
-							};
+							}
 							if (!ldap_reconnect())
 								break;
 						}
@@ -667,7 +668,7 @@
 												break;
 											} else
 												test_var = test_var->next;
-										};
+										}
 										if (base_var_found) {
 											base_var->next = NULL;
 											ast_variables_destroy (base_var);
@@ -687,7 +688,7 @@
 									tmp = NULL;
 								} else
 									tmp = tmp->next;
-							};
+							}
 							p++;
 						}
 					}
@@ -946,7 +947,7 @@
 	if (ldapConn) {
 		ldap_unbind_s(ldapConn);
 		ldapConn = NULL;
-	};
+	}
 	ast_cli_unregister(&cli_realtime_ldap_status);
 	ast_config_engine_deregister(&ldap_engine);
 	if (option_verbose)
@@ -968,7 +969,7 @@
 	if (ldapConn) {
 		ldap_unbind_s(ldapConn);
 		ldapConn = NULL;
-	};
+	}
 	parse_config();
 
 	if (!ldap_reconnect()) 
@@ -1039,7 +1040,7 @@
 					table_configs = table_config;
 					if (is_general)
 						base_table_config = table_config;
-				};
+				}
 				while (var) {
 					if (option_debug)
 						ast_log(LOG_DEBUG, "LDAP RealTime: found: category_name=%s var->name=%s var->value=%s\n",
@@ -1049,9 +1050,9 @@
 					else if (strcasecmp(var->name, "additionalFilter") == 0)
 						table_config->additional_filter = strdup(var->value);
 					var = var->next;
-				};
-			}
-		};
+				}
+			}
+		}
 	}
 	ast_config_destroy(config);
 	if (option_debug > 3) {



More information about the svn-commits mailing list