Add the ability to dynamically specify weights for responses to DUNDi queries.
[asterisk/asterisk.git] / main / enum.c
index 498ca81..5db6adb 100644 (file)
@@ -48,9 +48,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/nameser.h>
+#ifdef __APPLE__
 #if __APPLE_CC__ >= 1495
 #include <arpa/nameser_compat.h>
 #endif
+#endif
 #include <resolv.h>
 #include <stdlib.h>
 #include <string.h>
@@ -85,7 +87,7 @@ static struct enum_search {
        struct enum_search *next;
 } *toplevs;
 
-static int enumver = 0;
+static int enumver;
 
 AST_MUTEX_DEFINE_STATIC(enumlock);
 
@@ -445,7 +447,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds
                        tmp[newpos++] = '.';
                }
                if (*p2) {
-                       while(*p2 && newpos < 128){
+                       while (*p2 && newpos < 128){
                                tmp[newpos++] = *p2;
                                p2++;
                        }
@@ -634,7 +636,7 @@ int ast_enum_init(void)
        /* Destroy existing list */
        ast_mutex_lock(&enumlock);
        s = toplevs;
-       while(s) {
+       while (s) {
                sl = s;
                s = s->next;
                free(sl);
@@ -644,7 +646,7 @@ int ast_enum_init(void)
        if (cfg) {
                sl = NULL;
                v = ast_variable_browse(cfg, "general");
-               while(v) {
+               while (v) {
                        if (!strcasecmp(v->name, "search")) {
                                s = enum_newtoplev(v->value);
                                if (s) {