utils: Remove trailing whitespace
authorRodrigo Ramírez Norambuena <decipher.hk@gmail.com>
Sun, 3 May 2015 09:09:57 +0000 (05:09 -0400)
committerRodrigo Ramírez Norambuena <decipher.hk@gmail.com>
Sun, 3 May 2015 09:28:07 +0000 (05:28 -0400)
Change-Id: I4644f43a6a1ca9b5130cd2a6746772b888eb4f7a

utils/ael_main.c
utils/astman.c
utils/check_expr.c
utils/extconf.c
utils/frame.c
utils/frame.h
utils/muted.c
utils/smsq.c
utils/streamplayer.c

index 06ba8e6..d2c815b 100644 (file)
@@ -48,7 +48,7 @@ struct namelist
        struct namelist *next;
 };
 
-struct ast_context 
+struct ast_context
 {
        int extension_count;
        char name[100];
@@ -136,7 +136,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
 {
                va_list vars;
                        va_start(vars,fmt);
-                       
+
                                printf("LOG: lev:%d file:%s  line:%d func: %s  ",
                                                                   level, file, line, function);
                                        vprintf(fmt, vars);
@@ -147,21 +147,21 @@ void ast_log(int level, const char *file, int line, const char *function, const
 struct ast_exten *pbx_find_extension(struct ast_channel *chan,
                                                                         struct ast_context *bypass,
                                                                         struct pbx_find_info *q,
-                                                                        const char *context, 
-                                                                        const char *exten, 
+                                                                        const char *context,
+                                                                        const char *exten,
                                                                         int priority,
-                                                                        const char *label, 
-                                                                        const char *callerid, 
+                                                                        const char *label,
+                                                                        const char *callerid,
                                                                         enum ext_match_t action);
 
 struct ast_exten *pbx_find_extension(struct ast_channel *chan,
                                                                         struct ast_context *bypass,
                                                                         struct pbx_find_info *q,
-                                                                        const char *context, 
-                                                                        const char *exten, 
+                                                                        const char *context,
+                                                                        const char *exten,
                                                                         int priority,
-                                                                        const char *label, 
-                                                                        const char *callerid, 
+                                                                        const char *label,
+                                                                        const char *callerid,
                                                                         enum ext_match_t action)
 {
        return localized_find_extension(bypass, q, context, exten, priority, label, callerid, action);
@@ -218,7 +218,7 @@ void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char
 void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char *cp2,int count)
 {
        if (cp1 && *cp1)
-               strncpy(cp2,cp1,AST_MAX_EXTENSION); /* Right now, this routine is ONLY being called for 
+               strncpy(cp2,cp1,AST_MAX_EXTENSION); /* Right now, this routine is ONLY being called for
                                                                                           a possible var substitution on extension names,
                                                                                           so....! */
        else
@@ -255,15 +255,15 @@ int ast_add_extension2(struct ast_context *con,
 
                if( FIRST_TIME ) {
                        FIRST_TIME = 0;
-                       
+
                        if( globalvars )
                                fprintf(dumpfile,"[globals]\n");
-                       
+
                        for(n=globalvars;n;n=n->next) {
                                fprintf(dumpfile, "%s\n", n->name);
                        }
                }
-               
+
                /* print out each extension , possibly the context header also */
                if( con != last_context ) {
                        fprintf(dumpfile,"\n\n[%s]\n", con->name);
@@ -280,7 +280,7 @@ int ast_add_extension2(struct ast_context *con,
                        for(n=con->eswitches;n;n=n->next) {
                                fprintf(dumpfile, "eswitch => %s/%s\n", n->name, n->name2);
                        }
-                       
+
                }
                if( data ) {
                        filter_newlines((char*)data);
@@ -303,7 +303,7 @@ int ast_add_extension2(struct ast_context *con,
                                fprintf(dumpfile,"exten => %s,%d,%s\n", extension, priority, application);
                }
        }
-       
+
        /* since add_extension2 is responsible for the malloc'd data stuff */
        free(data);
        return 0;
@@ -320,7 +320,7 @@ void pbx_builtin_setvar(void *chan, void *data)
                ADD_LAST(globalvars,x);
        }
 }
-       
+
 
 struct ast_context * ast_context_create(void **extcontexts, const char *name, const char *registrar)
 {
@@ -458,7 +458,7 @@ void filter_leading_space_from_exprs(char *str)
 {
        /*  Mainly for aesthetics */
        char *t, *v, *u = str;
-       
+
        while ( u && *u ) {
 
                if( *u == '$' && *(u+1) == '[' ) {
@@ -471,7 +471,7 @@ void filter_leading_space_from_exprs(char *str)
                                }
                        }
                }
-               
+
                u++;
        }
 }
@@ -500,7 +500,7 @@ int main(int argc, char **argv)
        int i;
        struct namelist *n;
        struct ast_context *lp,*lp2;
-       
+
        for(i=1;i<argc;i++) {
                if( argv[i][0] == '-' && argv[i][1] == 'n' )
                        no_comp =1;
@@ -513,7 +513,7 @@ int main(int argc, char **argv)
                if( argv[i][0] == '-' && argv[i][1] == 'w' )
                        dump_extensions =1;
        }
-       
+
        if( !quiet ) {
                printf("\n(If you find progress and other non-error messages irritating, you can use -q to suppress them)\n");
                if( !no_comp )
@@ -533,30 +533,30 @@ int main(int argc, char **argv)
                localized_use_conf_dir();
        }
        strcpy(var_dir, "/var/lib/asterisk");
-       
+
        if( dump_extensions ) {
                dumpfile = fopen("extensions.conf.aeldump","w");
                if( !dumpfile ) {
                        printf("\n\nSorry, cannot open extensions.conf.aeldump for writing! Correct the situation and try again!\n\n");
                        exit(10);
                }
-               
+
        }
 
        FIRST_TIME = 1;
-       
+
        ael_external_load_module();
-       
+
        ast_log(4, "ael2_parse", __LINE__, "main", "%d contexts, %d extensions, %d priorities\n", conts, extens, priors);
 
        if( dump_extensions && dumpfile ) {
-       
+
                for( lp = context_list; lp; lp = lp->next ) { /* print out any contexts that didn't have any
                                                                                                                 extensions in them */
                        if( lp->extension_count == 0 ) {
-                               
+
                                fprintf(dumpfile,"\n\n[%s]\n", lp->name);
-                               
+
                                for(n=lp->ignorepats;n;n=n->next) {
                                        fprintf(dumpfile, "ignorepat => %s\n", n->name);
                                }
@@ -572,10 +572,10 @@ int main(int argc, char **argv)
                        }
                }
        }
-       
+
        if( dump_extensions && dumpfile )
                fclose(dumpfile);
-       
+
        for( lp = context_list; lp; lp = lp2 ) { /* free the ast_context structs */
                lp2 = lp->next;
                lp->next = 0;
@@ -587,7 +587,7 @@ int main(int argc, char **argv)
 
                free(lp);
        }
-       
+
     return 0;
 }
 
index 0099a13..50e6a89 100644 (file)
@@ -55,8 +55,8 @@ ASTERISK_REGISTER_FILE()
 
 /*
  * 2005.05.27 - different versions of newt define the type of the buffer
- * for the 5th argument to newtEntry() as char ** or const char ** . To 
- * let the code compile cleanly with -Werror, we cast it to void * through 
+ * for the 5th argument to newtEntry() as char ** or const char ** . To
+ * let the code compile cleanly with -Werror, we cast it to void * through
  * _NEWT_CAST.
  */
 #define _NEWT_CAST (void *)
@@ -280,7 +280,7 @@ static int process_message(struct ast_mansession *s, struct message *m)
        for (x=0;x<m->hdrcount;x++) {
                printf("Header: %s\n", m->headers[x]);
        }
-#endif 
+#endif
        return 0;
 }
 
@@ -295,8 +295,8 @@ static void rebuild_channels(newtComponent c)
        newtListboxClear(c);
        AST_LIST_TRAVERSE(&chans, chan, list) {
                snprintf(tmpn, sizeof(tmpn), "%s (%s)", chan->name, chan->callerid);
-               if (strlen(chan->exten)) 
-                       snprintf(tmp, sizeof(tmp), "%-30s %8s -> %s@%s:%s", 
+               if (strlen(chan->exten))
+                       snprintf(tmp, sizeof(tmp), "%-30s %8s -> %s@%s:%s",
                                tmpn, chan->state,
                                chan->exten, chan->context, chan->priority);
                else
@@ -313,8 +313,8 @@ static void rebuild_channels(newtComponent c)
 static int has_input(struct ast_mansession *s)
 {
        int x;
-       for (x=1;x<s->inlen;x++) 
-               if ((s->inbuf[x] == '\n') && (s->inbuf[x-1] == '\r')) 
+       for (x=1;x<s->inlen;x++)
+               if ((s->inbuf[x] == '\n') && (s->inbuf[x-1] == '\r'))
                        return 1;
        return 0;
 }
@@ -337,7 +337,7 @@ static int get_input(struct ast_mansession *s, char *output)
                        s->inlen -= (x + 1);
                        return 1;
                }
-       } 
+       }
        if (s->inlen >= sizeof(s->inbuf) - 1) {
                fprintf(stderr, "Dumping long line with no return from %s: %s\n", inet_ntoa(s->sin.sin_addr), s->inbuf);
                s->inlen = 0;
@@ -489,7 +489,7 @@ static void try_status(void)
                show_message("Status Failed Failed", get_header(m, "Message"));
        }
 }
-       
+
 
 static void try_hangup(newtComponent c)
 {
@@ -506,7 +506,7 @@ static void try_hangup(newtComponent c)
                        show_message("Hangup Failed", get_header(m, "Message"));
                }
        }
-       
+
 }
 
 static int get_user_input(char *msg, char *buf, int buflen)
@@ -528,7 +528,7 @@ static int get_user_input(char *msg, char *buf, int buflen)
        newtFormAddComponents(form, inpfield, ok, cancel, NULL);
        newtFormRun(form, &es);
        strncpy(buf, input, buflen - 1);
-       if (es.u.co == ok) 
+       if (es.u.co == ok)
                res = 0;
        else
                res = -1;
@@ -550,7 +550,7 @@ static void try_redirect(newtComponent c)
        if (chan) {
                strncpy(channame, chan->name, sizeof(channame) - 1);
                snprintf(tmp, sizeof(tmp), "Enter new extension for %s", channame);
-               if (get_user_input(tmp, dest, sizeof(dest))) 
+               if (get_user_input(tmp, dest, sizeof(dest)))
                        return;
                if ((context = strchr(dest, '@'))) {
                        *context = '\0';
@@ -566,7 +566,7 @@ static void try_redirect(newtComponent c)
                        show_message("Hangup Failed", get_header(m, "Message"));
                }
        }
-       
+
 }
 
 static int manage_calls(char *host)
@@ -581,23 +581,23 @@ static int manage_calls(char *host)
 
        /* Mark: If there's one thing you learn from this code, it is this...
           Never, ever fly Air France.  Their customer service is absolutely
-          the worst.  I've never heard the words "That's not my problem" as 
+          the worst.  I've never heard the words "That's not my problem" as
           many times as I have from their staff -- It should, without doubt
-          be their corporate motto if it isn't already.  Don't bother giving 
+          be their corporate motto if it isn't already.  Don't bother giving
           them business because you're just a pain in their side and they
           will be sure to let you know the first time you speak to them.
-          
+
           If you ever want to make me happy just tell me that you, too, will
           never fly Air France again either (in spite of their excellent
-          cuisine). 
-       
+          cuisine).
+
           Update by oej: The merger with KLM has transferred this
-          behaviour to KLM as well. 
+          behaviour to KLM as well.
           Don't bother giving them business either...
 
           Only if you want to travel randomly without luggage, you
           might pick either of them.
-          
+
        */
        snprintf(tmp, sizeof(tmp), "Asterisk Manager at %s", host);
        newtCenteredWindow(74, 20, tmp);
@@ -610,7 +610,7 @@ static int manage_calls(char *host)
        channels = newtListbox(1,1,14, NEWT_FLAG_SCROLL);
        newtFormAddComponents(form, channels, redirect, hangup, quit, NULL);
        newtListboxSetWidth(channels, 72);
-       
+
        show_doing("Getting Status", "Retrieving system status...");
        try_status();
        hide_doing();
@@ -654,18 +654,18 @@ static int manager_login(char *hostname)
        char tmp[55];
        struct hostent *hp;
        int res = -1;
-       
+
        session.fd = socket(AF_INET, SOCK_STREAM, 0);
        if (session.fd < 0) {
                snprintf(tmp, sizeof(tmp), "socket() failed: %s\n", strerror(errno));
                show_message("Socket failed", tmp);
                return -1;
        }
-       
+
        snprintf(tmp, sizeof(tmp), "Looking up %s\n", hostname);
        show_doing("Connecting....", tmp);
-       
-       
+
+
        hp = gethostbyname(hostname);
        if (!hp) {
                snprintf(tmp, sizeof(tmp), "No such address: %s\n", hostname);
@@ -685,21 +685,21 @@ static int manager_login(char *hostname)
                show_message("Connect Failed", tmp);
                return -1;
        }
-       
+
        hide_doing();
-       
+
        login = newtButton(5, 6, "Login");
        cancel = newtButton(25, 6, "Cancel");
        newtCenteredWindow(40, 10, "Asterisk Manager Login");
        snprintf(tmp, sizeof(tmp), "Host:     %s", hostname);
        label = newtLabel(4,1, tmp);
-       
+
        ulabel = newtLabel(4,2,"Username:");
        plabel = newtLabel(4,3,"Password:");
-       
+
        username = newtEntry(14, 2, "", 20, _NEWT_CAST &user, 0);
        password = newtEntry(14, 3, "", 20, _NEWT_CAST &pass, NEWT_FLAG_HIDDEN);
-       
+
        form = newtForm(NULL, NULL, 0);
        newtFormAddComponents(form, username, password, login, cancel, label, ulabel, plabel,NULL);
        newtFormRun(form, &es);
@@ -736,7 +736,7 @@ static int manager_login(char *hostname)
                                        show_message("Login Failed", get_header(m, "Message"));
                                }
                        } else {
-                               manager_action("Login", 
+                               manager_action("Login",
                                        "Username: %s\r\n"
                                        "Secret: %s\r\n",
                                                user, pass);
index de668f6..f29363c 100644 (file)
@@ -145,7 +145,7 @@ void ast_log(int level, const char *file, int line, const char *function, const
 {
        va_list vars;
        va_start(vars,fmt);
-       
+
        printf("LOG: lev:%d file:%s  line:%d func: %s  ",
                   level, file, line, function);
        vprintf(fmt, vars);
@@ -162,7 +162,7 @@ void parse_file(const char *fname);
 void __ast_register_file(const char *file);
 void __ast_register_file(const char *file) { }
 #if !defined(LOW_MEMORY)
-int ast_add_profile(const char *x, uint64_t scale) { return 0;} 
+int ast_add_profile(const char *x, uint64_t scale) { return 0;}
 #endif
 int ast_atomic_fetchadd_int_slow(volatile int *p, int v)
 {
@@ -207,7 +207,7 @@ unsigned int check_expr(char* buffer, char* error_report)
        unsigned int warn_found = 0;
 
        error_report[0] = 0;
-       
+
        for (cp = buffer; *cp; ++cp)
        {
                switch (*cp)
@@ -223,7 +223,7 @@ unsigned int check_expr(char* buffer, char* error_report)
                                                global_lineno);
                                }
                                break;
-                               
+
                        case '>':
                        case '<':
                        case '!':
@@ -240,7 +240,7 @@ unsigned int check_expr(char* buffer, char* error_report)
                                        ++warn_found;
                                }
                                break;
-                               
+
                        case '|':
                        case '&':
                        case '=':
@@ -292,13 +292,13 @@ int check_eval(char *buffer, char *error_report)
                if (*cp == '$' && *(cp+1) == '{') {
                        int brack_lev = 1;
                        char *xp= cp+2;
-                       
+
                        while (*xp) {
                                if (*xp == '{')
                                        brack_lev++;
                                else if (*xp == '}')
                                        brack_lev--;
-                               
+
                                if (brack_lev == 0)
                                        break;
                                xp++;
@@ -306,7 +306,7 @@ int check_eval(char *buffer, char *error_report)
                        if (*xp == '}') {
                                char varname[200];
                                char *val;
-                               
+
                                strncpy(varname,cp+2, xp-cp-2);
                                varname[xp-cp-2] = 0;
                                cp = xp;
@@ -358,7 +358,7 @@ void parse_file(const char *fname)
        int c1;
        char last_char= 0;
        char buffer[30000]; /* I sure hope no expr gets this big! */
-       
+
        if (!f) {
                fprintf(stderr,"Couldn't open %s for reading... need an extensions.conf file to parse!\n",fname);
                exit(20);
@@ -367,9 +367,9 @@ void parse_file(const char *fname)
                fprintf(stderr,"Couldn't open 'expr2_log' file for writing... please fix and re-run!\n");
                exit(21);
        }
-       
+
        global_lineno = 1;
-       
+
        while ((c1 = fgetc(f)) != EOF) {
                if (c1 == '\n')
                        global_lineno++;
@@ -380,7 +380,7 @@ void parse_file(const char *fname)
                                int bufcount = 0;
                                int retval;
                                char error_report[30000];
-                               
+
                                while ((c1 = fgetc(f)) != EOF) {
                                        if (c1 == '[')
                                                bracklev++;
@@ -392,7 +392,7 @@ void parse_file(const char *fname)
                                                fclose(l);
                                                printf("--- ERROR --- A newline in the middle of an expression at line %d!\n", global_lineno);
                                        }
-                                       
+
                                        if (bracklev == 0)
                                                break;
                                        buffer[bufcount++] = c1;
@@ -404,18 +404,18 @@ void parse_file(const char *fname)
                                        printf("--- ERROR --- EOF reached in middle of an expression at line %d!\n", global_lineno);
                                        exit(22);
                                }
-                               
+
                                buffer[bufcount] = 0;
                                /* update stats */
                                global_expr_tot_size += bufcount;
                                global_expr_count++;
                                if (bufcount > global_expr_max_size)
                                        global_expr_max_size = bufcount;
-                               
+
                                retval = check_expr(buffer, error_report); /* check_expr should bump the warning counter */
                                if (retval != 0) {
                                        /* print error report */
-                                       printf("Warning(s) at line %d, expression: $[%s]; see expr2_log file for details\n", 
+                                       printf("Warning(s) at line %d, expression: $[%s]; see expr2_log file for details\n",
                                                   global_lineno, buffer);
                                        fprintf(l, "%s", error_report);
                                }
@@ -436,7 +436,7 @@ void parse_file(const char *fname)
                   global_warn_count,
                   global_expr_max_size,
                   (global_expr_count) ? global_expr_tot_size/global_expr_count : 0);
-       
+
        fclose(f);
        fclose(l);
 }
@@ -446,7 +446,7 @@ int main(int argc,char **argv)
 {
        int argc1;
        char *eq;
-       
+
        if (argc < 2) {
                printf("check_expr -- a program to look thru extensions.conf files for $[...] expressions,\n");
                printf("              and run them thru the parser, looking for problems\n");
@@ -458,7 +458,7 @@ int main(int argc,char **argv)
                printf(" Note that messages about operators not being surrounded by spaces is merely to alert\n");
                printf("  you to possible problems where you might be expecting those operators as part of a string.\n");
         printf("  (to include operators in a string, wrap with double quotes!)\n");
-               
+
                exit(19);
        }
        global_varlist = 0;
@@ -470,7 +470,7 @@ int main(int argc,char **argv)
        }
 
        /* parse command args for x=y and set varz */
-       
+
        parse_file(argv[1]);
        return 0;
 }
index 53347b4..8729801 100644 (file)
@@ -1,4 +1,4 @@
-/*  
+/*
  * Asterisk -- An open source telephony toolkit.
  *
  * Copyright (C) 2006, Digium, Inc.
@@ -86,7 +86,7 @@ void ast_verbose(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
 #endif
 
 #define AST_API_MODULE  1 /* gimme the inline defs! */
-struct ast_channel 
+struct ast_channel
 {
        char x; /* basically empty! */
 };
@@ -245,7 +245,7 @@ static void __attribute__((constructor)) init_empty_mutex(void)
 
 static inline int __ast_pthread_mutex_init_attr(const char *filename, int lineno, const char *func,
                                                const char *mutex_name, ast_mutex_t *t,
-                                               pthread_mutexattr_t *attr) 
+                                               pthread_mutexattr_t *attr)
 {
 #ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
        int canlog = strcmp(filename, "logger.c");
@@ -464,7 +464,7 @@ static inline int __ast_pthread_mutex_unlock(const char *filename, int lineno, c
        }
 
        if ((res = pthread_mutex_unlock(&t->mutex))) {
-               __ast_mutex_logger("%s line %d (%s): Error releasing mutex: %s\n", 
+               __ast_mutex_logger("%s line %d (%s): Error releasing mutex: %s\n",
                                   filename, lineno, func, strerror(res));
                DO_THREAD_CRASH;
        }
@@ -505,7 +505,7 @@ static void  __attribute__((constructor)) init_##mutex(void) \
        ast_mutex_init(&mutex); \
 }
 #else /* !AST_MUTEX_INIT_W_CONSTRUCTORS */
-/* By default, use static initialization of mutexes. */ 
+/* By default, use static initialization of mutexes. */
 #define __AST_MUTEX_DEFINE(scope, mutex) \
        scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE
 #endif /* AST_MUTEX_INIT_W_CONSTRUCTORS */
@@ -618,7 +618,7 @@ AST_INLINE_API(int ast_atomic_fetchadd_int(volatile int *p, int v),
 {
        __asm __volatile (
        "       lock   xaddl   %0, %1 ;        "
-       : "+r" (v),                     /* 0 (result) */   
+       : "+r" (v),                     /* 0 (result) */
          "=m" (*p)                     /* 1 */
        : "m" (*p));                    /* 2 */
        return (v);
@@ -864,7 +864,7 @@ char * attribute_malloc _ast_strdup(const char *str, const char *file, int linen
  * message in the case that the allocation fails.
  *
  * ast_strndup(), unlike strndup(), can safely accept a NULL argument for the
- * string to duplicate. If a NULL argument is provided, ast_strdup will return  
+ * string to duplicate. If a NULL argument is provided, ast_strdup will return
  * NULL without generating any kind of error log message.
  *
  * The arguments and return value are the same as strndup()
@@ -1033,19 +1033,19 @@ static void  LLB_ADD(char *str)
        int siz = strlen(str);
        if (rem < siz+1) {
                lline_buffer = ast_realloc(lline_buffer, lline_buffer_size + CB_INCR + siz + 1);
-               if (!lline_buffer) 
+               if (!lline_buffer)
                        return;
                lline_buffer_size += CB_INCR + siz + 1;
        }
        strcat(lline_buffer,str);
 }
 
-static void CB_RESET(void )  
-{ 
-       comment_buffer[0] = 0; 
+static void CB_RESET(void )
+{
+       comment_buffer[0] = 0;
        lline_buffer[0] = 0;
 }
-               
+
 /*! \brief Keep track of how many threads are currently trying to wait*() on
  *  a child process */
 static unsigned int safe_system_level = 0;
@@ -1108,7 +1108,7 @@ int ast_safe_system(const char *s)
        pid = fork();
 #else
        pid = vfork();
-#endif 
+#endif
 
        if (pid == 0) {
 #ifdef HAVE_WORKING_FORK
@@ -1124,7 +1124,7 @@ int ast_safe_system(const char *s)
                        if (res > -1) {
                                res = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
                                break;
-                       } else if (errno != EINTR) 
+                       } else if (errno != EINTR)
                                break;
                }
        } else {
@@ -1141,7 +1141,7 @@ int ast_safe_system(const char *s)
 }
 
 static struct ast_comment *ALLOC_COMMENT(const char *buffer)
-{ 
+{
        struct ast_comment *x = ast_calloc(1,sizeof(struct ast_comment)+strlen(buffer)+1);
        strcpy(x->cmt, buffer);
        return x;
@@ -1164,7 +1164,7 @@ static struct ast_config_engine *config_engine_list;
 struct ast_category {
        char name[80];
        int ignored;                    /*!< do not let user of the config see this category */
-       int include_level;      
+       int include_level;
     char *file;                /*!< the file name from whence this declaration was read */
     int lineno;
        struct ast_comment *precomments;
@@ -1257,7 +1257,7 @@ char *ast_trim_blanks(char *str),
 
        if (work) {
                work += strlen(work) - 1;
-               /* It's tempting to only want to erase after we exit this loop, 
+               /* It's tempting to only want to erase after we exit this loop,
                   but since ast_trim_blanks *could* receive a constant string
                   (which we presumably wouldn't have to touch), we shouldn't
                   actually set anything unless we must, and it's easier just
@@ -1286,7 +1286,7 @@ char *ast_strip(char *s),
        if (s)
                ast_trim_blanks(s);
        return s;
-} 
+}
 )
 
 
@@ -1319,15 +1319,15 @@ void localized_ast_include_rename(struct ast_config *conf, const char *from_file
 
 static struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename);
 
-static struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename) 
+static struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename)
 {
        struct ast_variable *variable;
-       int name_len = strlen(name) + 1;        
+       int name_len = strlen(name) + 1;
 
        if ((variable = ast_calloc(1, name_len + strlen(value) + 1 + strlen(filename) + 1 + sizeof(*variable)))) {
                variable->name = variable->stuff;
-               variable->value = variable->stuff + name_len;           
-               variable->file = variable->value + strlen(value) + 1;           
+               variable->value = variable->stuff + name_len;
+               variable->file = variable->value + strlen(value) + 1;
                strcpy(variable->name,name);
                strcpy(variable->value,value);
                strcpy(variable->file,filename);
@@ -1339,11 +1339,11 @@ static struct ast_variable *ast_variable_new(const char *name, const char *value
 static struct ast_config_include *ast_include_new(struct ast_config *conf, const char *from_file, const char *included_file, int is_exec, const char *exec_file, int from_lineno, char *real_included_file_name, int real_included_file_name_size)
 {
        /* a file should be included ONCE. Otherwise, if one of the instances is changed,
-       then all be changed. -- how do we know to include it? -- Handling modified 
+       then all be changed. -- how do we know to include it? -- Handling modified
        instances is possible, I'd have
        to create a new master for each instance. */
        struct ast_config_include *inc;
-    
+
        inc = ast_include_find(conf, included_file);
        if (inc)
        {
@@ -1352,7 +1352,7 @@ static struct ast_config_include *ast_include_new(struct ast_config *conf, const
                ast_log(LOG_WARNING,"'%s', line %d:  Same File included more than once! This data will be saved in %s if saved back to disk.\n", from_file, from_lineno, real_included_file_name);
        } else
                *real_included_file_name = 0;
-       
+
        inc = ast_calloc(1,sizeof(struct ast_config_include));
        inc->include_location_file = ast_strdup(from_file);
        inc->include_location_lineno = from_lineno;
@@ -1360,15 +1360,15 @@ static struct ast_config_include *ast_include_new(struct ast_config *conf, const
                inc->included_file = ast_strdup(real_included_file_name);
        else
                inc->included_file = ast_strdup(included_file);
-       
+
        inc->exec = is_exec;
        if (is_exec)
                inc->exec_file = ast_strdup(exec_file);
-       
+
        /* attach this new struct to the conf struct */
        inc->next = conf->includes;
        conf->includes = inc;
-    
+
        return inc;
 }
 
@@ -1377,13 +1377,13 @@ void localized_ast_include_rename(struct ast_config *conf, const char *from_file
        struct ast_config_include *incl;
        struct ast_category *cat;
        struct ast_variable *v;
-    
+
        int from_len = strlen(from_file);
        int to_len = strlen(to_file);
-    
+
        if (strcmp(from_file, to_file) == 0) /* no use wasting time if the name is the same */
                return;
-       
+
        /* the manager code allows you to read in one config file, then
        write it back out under a different name. But, the new arrangement
           ties output lines to the file name. So, before you try to write
@@ -1392,7 +1392,7 @@ void localized_ast_include_rename(struct ast_config *conf, const char *from_file
        */
        /* file names are on categories, includes (of course), and on variables. So,
           traverse all this and swap names */
-       
+
        for (incl = conf->includes; incl; incl=incl->next) {
                if (strcmp(incl->include_location_file,from_file) == 0) {
                        if (from_len >= to_len)
@@ -1523,7 +1523,7 @@ static struct ast_variable *variable_clone(const struct ast_variable *old)
 
        return new;
 }
+
 static void ast_variables_destroy(struct ast_variable *v)
 {
        struct ast_variable *vn;
@@ -1538,7 +1538,7 @@ static void ast_variables_destroy(struct ast_variable *v)
 static void ast_includes_destroy(struct ast_config_include *incls)
 {
        struct ast_config_include *incl,*inclnext;
-    
+
        for (incl=incls; incl; incl = inclnext) {
                inclnext = incl->next;
                if (incl->include_location_file)
@@ -1559,7 +1559,7 @@ static void ast_config_destroy(struct ast_config *cfg)
                return;
 
        ast_includes_destroy(cfg->includes);
-       
+
        cat = cfg->root;
        while (cat) {
                ast_variables_destroy(cat->root);
@@ -1695,7 +1695,7 @@ extern int ast_language_is_prefix;
 */
 #define AST_RWLIST_RDLOCK(head)                                         \
         ast_rwlock_rdlock(&(head)->lock)
-       
+
 /*!
   \brief Attempts to unlock a read/write based list.
   \param head This is a pointer to the list head structure
@@ -1969,7 +1969,7 @@ struct {                                                          \
 }
 
 #define AST_RWLIST_ENTRY AST_LIST_ENTRY
+
 /*!
   \brief Returns the first entry contained in a list.
   \param head This is a pointer to the list head structure
@@ -2381,7 +2381,7 @@ struct ast_switch {
        AST_LIST_ENTRY(ast_switch) list;
        const char *name;                       /*!< Name of the switch */
        const char *description;                /*!< Description of the switch */
-       
+
        ast_switch_f *exists;
        ast_switch_f *canmatch;
        ast_switch_f *exec;
@@ -2455,7 +2455,7 @@ static const char *ast_var_name(const struct ast_var_t *var)
 }
 
 /* experiment 1: see if it's easier just to use existing config code
- *               to read in the extensions.conf file. In this scenario, 
+ *               to read in the extensions.conf file. In this scenario,
                  I have to rip/copy code from other modules, because they
                  are staticly declared as-is. A solution would be to move
                  the ripped code to another location and make them available
@@ -2467,7 +2467,7 @@ static void ast_log(int level, const char *file, int line, const char *function,
 {
        va_list vars;
        va_start(vars,fmt);
-       
+
        printf("LOG: lev:%d file:%s  line:%d func: %s  ",
                   level, file, line, function);
        vprintf(fmt, vars);
@@ -2479,7 +2479,7 @@ void __attribute__((format(printf, 1, 2))) ast_verbose(const char *fmt, ...)
 {
        va_list vars;
        va_start(vars,fmt);
-       
+
        printf("VERBOSE: ");
        vprintf(fmt, vars);
        fflush(stdout);
@@ -2697,7 +2697,7 @@ struct ast_state_cb {
 /*! \brief Structure for dial plan hints
 
   \note Hints are pointers from an extension in the dialplan to one or
-  more devices (tech/name) 
+  more devices (tech/name)
        - See \ref AstExtState
 */
 struct ast_hint {
@@ -2725,7 +2725,7 @@ AST_LIST_HEAD(store_hints, store_hint);
 #define STATUS_SUCCESS         5
 
 static struct ast_var_t *ast_var_assign(const char *name, const char *value)
-{      
+{
        struct ast_var_t *var;
        int name_len = strlen(name) + 1;
        int value_len = strlen(value) + 1;
@@ -2737,10 +2737,10 @@ static struct ast_var_t *ast_var_assign(const char *name, const char *value)
        ast_copy_string(var->name, name, name_len);
        var->value = var->name + name_len;
        ast_copy_string(var->value, value, value_len);
-       
+
        return var;
-}      
-       
+}
+
 static void ast_var_delete(struct ast_var_t *var)
 {
        free(var);
@@ -3017,7 +3017,7 @@ static void null_datad(void *foo)
 }
 
 /*! \brief Find realtime engine for realtime family */
-static struct ast_config_engine *find_engine(const char *family, char *database, int dbsiz, char *table, int tabsiz) 
+static struct ast_config_engine *find_engine(const char *family, char *database, int dbsiz, char *table, int tabsiz)
 {
        struct ast_config_engine *eng, *ret = NULL;
        struct ast_config_map *map;
@@ -3040,12 +3040,12 @@ static struct ast_config_engine *find_engine(const char *family, char *database,
                                ret = eng;
                }
        }
-       
-       
+
+
        /* if we found a mapping, but the engine is not available, then issue a warning */
        if (map && !ret)
                ast_log(LOG_WARNING, "Realtime mapping for '%s' found to engine '%s', but the engine is not available\n", map->name, map->driver);
-       
+
        return ret;
 }
 
@@ -3120,7 +3120,7 @@ static void ast_category_destroy(struct ast_category *cat)
        ast_variables_destroy(cat->root);
        if (cat->file)
                free(cat->file);
-       
+
        free(cat);
 }
 
@@ -3137,7 +3137,7 @@ static struct ast_config *ast_config_internal_load(const char *filename, struct
        char db[256];
        char table[256];
        struct ast_config_engine *loader = &text_file_engine;
-       struct ast_config *result; 
+       struct ast_config *result;
 
        if (cfg->include_level == cfg->max_include_level) {
                ast_log(LOG_WARNING, "Maximum Include level (%d) exceeded\n", cfg->max_include_level);
@@ -3165,7 +3165,7 @@ static struct ast_config *ast_config_internal_load(const char *filename, struct
        }
 
        result = loader->load_func(db, table, filename, cfg, withcomments, suggested_incl_file);
-       /* silence is golden 
+       /* silence is golden
           ast_log(LOG_WARNING, "finished internal loading file %s level=%d\n", filename, cfg->include_level);
        */
 
@@ -3204,7 +3204,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                        return -1;
                }
                (*cat)->lineno = lineno;
-        
+
                /* add comments */
                if (withcomments && comment_buffer && comment_buffer[0] ) {
                        newcat->precomments = ALLOC_COMMENT(comment_buffer);
@@ -3214,7 +3214,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                }
                if( withcomments )
                        CB_RESET();
-               
+
                /* If there are options or categories to inherit from, process them now */
                if (c) {
                        if (!(cur = strchr(c, ')'))) {
@@ -3241,7 +3241,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                                        }
                                } else {
                                        struct ast_category *base;
-                               
+
                                        base = category_get(cfg, cur, 1);
                                        if (!base) {
                                                ast_log(LOG_WARNING, "Inheritance requested, but category '%s' does not exist, line %d of %s\n", cur, lineno, configfile);
@@ -3264,7 +3264,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                        c = ast_skip_blanks(c + 1);
                        if (!*c)
                                c = NULL;
-               } else 
+               } else
                        c = NULL;
                do_include = !strcasecmp(cur, "include");
                if(!do_include)
@@ -3279,7 +3279,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                        if (c) {
                                char *cur2;
                                char real_inclusion_name[256];
-                
+
                                /* Strip off leading and trailing "'s and <>'s */
                                while((*c == '<') || (*c == '>') || (*c == '\"')) c++;
                                /* Get rid of leading mess */
@@ -3294,7 +3294,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                                }
                                /* #exec </path/to/executable>
                                   We create a tmp file, then we #include it, then we delete it. */
-                               if (do_exec) { 
+                               if (do_exec) {
                                        snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%d.%ld", (int)time(NULL), (long)pthread_self());
                                        snprintf(cmd, sizeof(cmd), "%s > %s 2>&1", cur, exec_file);
                                        ast_safe_system(cmd);
@@ -3303,26 +3303,26 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                                        exec_file[0] = '\0';
                                /* A #include */
                                /* ast_log(LOG_WARNING, "Reading in included file %s withcomments=%d\n", cur, withcomments); */
-                               
+
                                /* record this inclusion */
                                ast_include_new(cfg, configfile, cur, do_exec, cur2, lineno, real_inclusion_name, sizeof(real_inclusion_name));
-                               
+
                                do_include = ast_config_internal_load(cur, cfg, withcomments, real_inclusion_name) ? 1 : 0;
                                if(!ast_strlen_zero(exec_file))
                                        unlink(exec_file);
                                if(!do_include)
                                        return 0;
                                /* ast_log(LOG_WARNING, "Done reading in included file %s withcomments=%d\n", cur, withcomments); */
-                               
+
                        } else {
-                               ast_log(LOG_WARNING, "Directive '#%s' needs an argument (%s) at line %d of %s\n", 
+                               ast_log(LOG_WARNING, "Directive '#%s' needs an argument (%s) at line %d of %s\n",
                                                do_exec ? "exec" : "include",
                                                do_exec ? "/path/to/executable" : "filename",
                                                lineno,
                                                configfile);
                        }
                }
-               else 
+               else
                        ast_log(LOG_WARNING, "Unknown directive '%s' at line %d of %s\n", cur, lineno, configfile);
        } else {
                /* Just a line (variable = value) */
@@ -3356,7 +3356,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
                                }
                                if( withcomments )
                                        CB_RESET();
-                               
+
                        } else {
                                return -1;
                        }
@@ -3394,7 +3394,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
        struct ast_category *cat = NULL;
        int count = 0;
        struct stat statbuf;
-       
+
        cat = ast_config_get_current_category(cfg);
 
        if (filename[0] == '/') {
@@ -3409,7 +3409,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
        if (withcomments && cfg && cfg->include_level < 2 ) {
                CB_INIT();
        }
-       
+
 #ifdef AST_INCLUDE_GLOB
        {
                int glob_ret;
@@ -3460,17 +3460,17 @@ static struct ast_config *config_text_file_load(const char *database, const char
                while(!feof(f)) {
                        lineno++;
                        if (fgets(buf, sizeof(buf), f)) {
-                               if ( withcomments ) {    
+                               if ( withcomments ) {
                                        CB_ADD(lline_buffer);       /* add the current lline buffer to the comment buffer */
                                        lline_buffer[0] = 0;        /* erase the lline buffer */
                                }
-                               
+
                                new_buf = buf;
-                               if (comment) 
+                               if (comment)
                                        process_buf = NULL;
                                else
                                        process_buf = buf;
-                               
+
                                while ((comment_p = strchr(new_buf, COMMENT_META))) {
                                        if ((comment_p > new_buf) && (*(comment_p-1) == '\\')) {
                                                /* Yuck, gotta memmove */
@@ -3502,7 +3502,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
                                                                        CB_ADD(";");
                                                                        CB_ADD_LEN(oldptr+1,new_buf-oldptr-1);
                                                                }
-                                                               
+
                                                                memmove(oldptr, new_buf, strlen(new_buf) + 1);
                                                                new_buf = oldptr;
                                                        } else
@@ -3510,12 +3510,12 @@ static struct ast_config *config_text_file_load(const char *database, const char
                                                }
                                        } else {
                                                if (!comment) {
-                                                       /* If ; is found, and we are not nested in a comment, 
+                                                       /* If ; is found, and we are not nested in a comment,
                                                           we immediately stop all comment processing */
                                                        if ( withcomments ) {
                                                                LLB_ADD(comment_p);
                                                        }
-                                                       *comment_p = '\0'; 
+                                                       *comment_p = '\0';
                                                        new_buf = comment_p;
                                                } else
                                                        new_buf = comment_p + 1;
@@ -3525,7 +3525,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
                                {
                                        CB_ADD(buf);  /* the whole line is a comment, store it */
                                }
-                               
+
                                if (process_buf) {
                                        char *stripped_process_buf = ast_strip(process_buf);
                                        if (!ast_strlen_zero(stripped_process_buf)) {
@@ -3537,7 +3537,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
                                }
                        }
                }
-               fclose(f);              
+               fclose(f);
        } while(0);
        if (comment) {
                ast_log(LOG_WARNING,"Unterminated comment detected beginning on line %d\n", nest[comment]);
@@ -3551,12 +3551,12 @@ static struct ast_config *config_text_file_load(const char *database, const char
                }
 #endif
        if (cfg && cfg->include_level == 1 && withcomments && comment_buffer) {
-               if (comment_buffer) { 
+               if (comment_buffer) {
                        free(comment_buffer);
                        free(lline_buffer);
-                       comment_buffer=0; 
-                       lline_buffer=0; 
-                       comment_buffer_size=0; 
+                       comment_buffer=0;
+                       lline_buffer=0;
+                       comment_buffer_size=0;
                        lline_buffer_size=0;
                }
        }
@@ -3569,7 +3569,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
 
 static struct ast_config *ast_config_new(void) ;
 
-static struct ast_config *ast_config_new(void) 
+static struct ast_config *ast_config_new(void)
 {
        struct ast_config *config;
 
@@ -3622,7 +3622,7 @@ static struct ast_category *next_available_category(struct ast_category *cat)
 }
 
 static char *ast_category_browse(struct ast_config *config, const char *prev)
-{      
+{
        struct ast_category *cat = NULL;
 
        if (prev && config->last_browse && (config->last_browse->name == prev))
@@ -3645,7 +3645,7 @@ static char *ast_category_browse(struct ast_config *config, const char *prev)
                        }
                }
        }
-       
+
        if (cat)
                cat = next_available_category(cat);
 
@@ -3666,21 +3666,21 @@ void ast_config_set_current_category(struct ast_config *cfg, const struct ast_ca
 /* NOTE: categories and variables each have a file and lineno attribute. On a save operation, these are used to determine
    which file and line number to write out to. Thus, an entire hierarchy of config files (via #include statements) can be
    recreated. BUT, care must be taken to make sure that every cat and var has the proper file name stored, or you may
-   be shocked and mystified as to why things are not showing up in the files! 
-   
+   be shocked and mystified as to why things are not showing up in the files!
+
    Also, All #include/#exec statements are recorded in the "includes" LL in the ast_config structure. The file name
    and line number are stored for each include, plus the name of the file included, so that these statements may be
-   included in the output files on a file_save operation. 
-   
+   included in the output files on a file_save operation.
+
    The lineno's are really just for relative placement in the file. There is no attempt to make sure that blank lines
    are included to keep the lineno's the same between input and output. The lineno fields are used mainly to determine
    the position of the #include and #exec directives. So, blank lines tend to disappear from a read/rewrite operation,
    and a header gets added.
-   
+
    vars and category heads are output in the order they are stored in the config file. So, if the software
    shuffles these at all, then the placement of #include directives might get a little mixed up, because the
    file/lineno data probably won't get changed.
-   
+
 */
 
 static void gen_header(FILE *f1, const char *configfile, const char *fn, const char *generator)
@@ -3689,7 +3689,7 @@ static void gen_header(FILE *f1, const char *configfile, const char *fn, const c
        time_t t;
        time(&t);
        ast_copy_string(date, ctime(&t), sizeof(date));
-       
+
        fprintf(f1, ";!\n");
        fprintf(f1, ";! Automatically generated configuration file\n");
        if (strcmp(configfile, fn))
@@ -3708,7 +3708,7 @@ static void set_fn(char *fn, int fn_size, const char *file, const char *configfi
                        ast_copy_string(fn, configfile, fn_size);
                else
                        snprintf(fn, fn_size, "%s/%s", ast_config_AST_CONFIG_DIR, configfile);
-       } else if (file[0] == '/') 
+       } else if (file[0] == '/')
                ast_copy_string(fn, file, fn_size);
        else
                snprintf(fn, fn_size, "%s/%s", ast_config_AST_CONFIG_DIR, file);
@@ -3725,20 +3725,20 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
        struct ast_comment *cmt;
        struct ast_config_include *incl;
        int blanklines = 0;
-       
+
        /* reset all the output flags, in case this isn't our first time saving this data */
-       
+
        for (incl=cfg->includes; incl; incl = incl->next)
                incl->output = 0;
-       
+
        /* go thru all the inclusions and make sure all the files involved (configfile plus all its inclusions)
           are all truncated to zero bytes and have that nice header*/
-       
+
        for (incl=cfg->includes; incl; incl = incl->next)
        {
                if (!incl->exec) { /* leave the execs alone -- we'll write out the #exec directives, but won't zero out the include files or exec files*/
                        FILE *f1;
-                       
+
                        set_fn(fn, sizeof(fn), incl->included_file, configfile); /* normally, fn is just set to incl->included_file, prepended with config dir if relative */
                        f1 = fopen(fn,"w");
                        if (f1) {
@@ -3749,24 +3749,24 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                        }
                }
        }
-       
+
        set_fn(fn, sizeof(fn), 0, configfile); /* just set fn to absolute ver of configfile */
-#ifdef __CYGWIN__      
+#ifdef __CYGWIN__
        if ((f = fopen(fn, "w+"))) {
 #else
        if ((f = fopen(fn, "w"))) {
-#endif     
+#endif
                if (option_verbose > 1)
                        ast_verbose(VERBOSE_PREFIX_2 "Saving '%s': ", fn);
 
                gen_header(f, configfile, fn, generator);
                cat = cfg->root;
                fclose(f);
-        
+
                /* from here out, we open each involved file and concat the stuff we need to add to the end and immediately close... */
-               /* since each var, cat, and associated comments can come from any file, we have to be 
+               /* since each var, cat, and associated comments can come from any file, we have to be
                   mobile, and open each file, print, and close it on an entry-by-entry basis */
-               
+
                while(cat) {
                        set_fn(fn, sizeof(fn), cat->file, configfile);
                        f = fopen(fn, "a");
@@ -3775,7 +3775,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                                ast_verbose(VERBOSE_PREFIX_2 "Unable to write %s (%s)", fn, strerror(errno));
                                return -1;
                        }
-                       
+
                        /* dump any includes that happen before this category header */
                        for (incl=cfg->includes; incl; incl = incl->next) {
                                if (strcmp(incl->include_location_file, cat->file) == 0){
@@ -3788,7 +3788,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                                        }
                                }
                        }
-            
+
                        /* Dump section with any appropriate comment */
                        for (cmt = cat->precomments; cmt; cmt=cmt->next) {
                                if (cmt->cmt[0] != ';' || cmt->cmt[1] != '!')
@@ -3803,7 +3803,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                        if (!cat->sameline)
                                fprintf(f,"\n");
                        fclose(f);
-            
+
                        var = cat->root;
                        while(var) {
                                set_fn(fn, sizeof(fn), var->file, configfile);
@@ -3813,7 +3813,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                                        ast_verbose(VERBOSE_PREFIX_2 "Unable to write %s (%s)", fn, strerror(errno));
                                        return -1;
                                }
-                
+
                                /* dump any includes that happen before this category header */
                                for (incl=cfg->includes; incl; incl = incl->next) {
                                        if (strcmp(incl->include_location_file, var->file) == 0){
@@ -3826,24 +3826,24 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                                                }
                                        }
                                }
-                
+
                                for (cmt = var->precomments; cmt; cmt=cmt->next) {
                                        if (cmt->cmt[0] != ';' || cmt->cmt[1] != '!')
                                                fprintf(f,"%s", cmt->cmt);
                                }
-                               if (var->sameline) 
+                               if (var->sameline)
                                        fprintf(f, "%s %s %s  %s", var->name, (var->object ? "=>" : "="), var->value, var->sameline->cmt);
-                               else    
+                               else
                                        fprintf(f, "%s %s %s\n", var->name, (var->object ? "=>" : "="), var->value);
                                if (var->blanklines) {
                                        blanklines = var->blanklines;
                                        while (blanklines--)
                                                fprintf(f, "\n");
                                }
-                               
+
                                fclose(f);
-                
-                               
+
+
                                var = var->next;
                        }
                        cat = cat->next;
@@ -3860,7 +3860,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
 
        /* Now, for files with trailing #include/#exec statements,
           we have to make sure every entry is output */
-       
+
        for (incl=cfg->includes; incl; incl = incl->next) {
                if (!incl->output) {
                        /* open the respective file */
@@ -3871,7 +3871,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                                ast_verbose(VERBOSE_PREFIX_2 "Unable to write %s (%s)", fn, strerror(errno));
                                return -1;
                        }
-            
+
                        /* output the respective include */
                        if (incl->exec)
                                fprintf(f,"#exec \"%s\"\n", incl->exec_file);
@@ -3881,7 +3881,7 @@ int localized_config_text_file_save(const char *configfile, const struct ast_con
                        incl->output = 1;
                }
        }
-       
+
        return 0;
 }
 
@@ -4207,7 +4207,7 @@ static int ext_cmp1(const char **p)
                break;
        }
        /* locate end of set */
-       end = strchr(*p, ']');  
+       end = strchr(*p, ']');
 
        if (end == NULL) {
                ast_log(LOG_WARNING, "Wrong usage of [] in the extension\n");
@@ -4566,24 +4566,24 @@ static inline int include_valid(struct ast_include *i)
 
 
 static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
-                                                                                       struct ast_context *bypass, 
+                                                                                       struct ast_context *bypass,
                                                                                        struct pbx_find_info *q,
-                                                                                       const char *context, 
-                                                                                       const char *exten, 
+                                                                                       const char *context,
+                                                                                       const char *exten,
                                                                                        int priority,
-                                                                                       const char *label, 
-                                                                                       const char *callerid, 
+                                                                                       const char *label,
+                                                                                       const char *callerid,
                                                                                        enum ext_match_t action);
 
 
 static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
-                                                                                       struct ast_context *bypass, 
+                                                                                       struct ast_context *bypass,
                                                                                        struct pbx_find_info *q,
-                                                                                       const char *context, 
-                                                                                       const char *exten, 
+                                                                                       const char *context,
+                                                                                       const char *exten,
                                                                                        int priority,
-                                                                                       const char *label, 
-                                                                                       const char *callerid, 
+                                                                                       const char *label,
+                                                                                       const char *callerid,
                                                                                        enum ext_match_t action)
 {
        int x;
@@ -4667,7 +4667,7 @@ static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
                        continue;
                }
                /* No need to Substitute variables now; we shouldn't be here if there's any  */
-               
+
                /* equivalent of extension_match_core() at the switch level */
                if (action == E_CANMATCH)
                        aswf = asw->canmatch;
@@ -4701,20 +4701,20 @@ static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
 
 struct ast_exten *localized_find_extension(struct ast_context *bypass,
                                                                                  struct pbx_find_info *q,
-                                                                                 const char *context, 
-                                                                                 const char *exten, 
+                                                                                 const char *context,
+                                                                                 const char *exten,
                                                                                  int priority,
-                                                                                 const char *label, 
-                                                                                 const char *callerid, 
+                                                                                 const char *label,
+                                                                                 const char *callerid,
                                                                                  enum ext_match_t action);
 
 struct ast_exten *localized_find_extension(struct ast_context *bypass,
                                                                                  struct pbx_find_info *q,
-                                                                                 const char *context, 
-                                                                                 const char *exten, 
+                                                                                 const char *context,
+                                                                                 const char *exten,
                                                                                  int priority,
-                                                                                 const char *label, 
-                                                                                 const char *callerid, 
+                                                                                 const char *label,
+                                                                                 const char *callerid,
                                                                                   enum ext_match_t action)
 {
        return pbx_find_extension(NULL, bypass, q, context, exten, priority, label, callerid, action);
@@ -5328,7 +5328,7 @@ static void pbx_retrieve_variable(struct ast_channel *c, const char *var, char *
        int offset, length;
        int i, need_substring;
        struct varshead *places[2] = { headp, &globals };       /* list of places where we may look */
-       
+
        /*
         * Make a copy of var because parse_variable_name() modifies the string.
         * Then if called directly, we might need to run substring() on the result;
@@ -5336,7 +5336,7 @@ static void pbx_retrieve_variable(struct ast_channel *c, const char *var, char *
         */
        tmpvar = ast_strdupa(var);      /* parse_variable_name modifies the string */
        need_substring = parse_variable_name(tmpvar, &offset, &length, &i /* ignored */);
-       
+
        /*
         * Look first into predefined variables, then into variable lists.
         * Variable 's' points to the result, according to the following rules:
@@ -5357,7 +5357,7 @@ static void pbx_retrieve_variable(struct ast_channel *c, const char *var, char *
                if (!strcmp(var, "EPOCH")) {
                        snprintf(workspace, workspacelen, "%u",(int)time(NULL));
                }
-               
+
                s = workspace;
        }
        /* if not found, look into chanvars or global vars */
@@ -5600,11 +5600,11 @@ static int pbx_load_config(const char *config_file)
                autofallthrough_config = ast_true(aft);
        clearglobalvars_config = ast_true(ast_variable_retrieve(cfg, "general", "clearglobalvars"));
 
-       if ((cxt = ast_variable_retrieve(cfg, "general", "userscontext"))) 
+       if ((cxt = ast_variable_retrieve(cfg, "general", "userscontext")))
                ast_copy_string(userscontext, cxt, sizeof(userscontext));
        else
                ast_copy_string(userscontext, "default", sizeof(userscontext));
-                                                                   
+
        for (v = ast_variable_browse(cfg, "globals"); v; v = v->next) {
                memset(realvalue, 0, sizeof(realvalue));
                pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
@@ -5905,7 +5905,7 @@ int localized_pbx_load_module(void)
                printf("Context: %s\n", con->name);
        }
        printf("=========\n");
-       
+
        return 0;
 }
 
index 62dc5f9..6752f4a 100644 (file)
@@ -7,8 +7,8 @@
  * Name:    frame.c
  * Version: see static char *standardversion, below.
  * Author:  Mark Roberts <mark@manumark.de>
- *         Michael Labuschke <michael@labuschke.de> sys_errlist fixes 
- *             
+ *         Michael Labuschke <michael@labuschke.de> sys_errlist fixes
+ *
  ****************************************************************************/
 /****************************************************************************
  *  These are useful functions that all DSP programs might find handy
@@ -850,7 +850,7 @@ void parseargs( int argcount, char *args[], int fileswitch)
      }
 
    /*-------------------------------------------------*
-    * Set samplefrequency, width, wavout, 
+    * Set samplefrequency, width, wavout,
     *-------------------------------------------------*/
    parseintarg( argcount, args, "f", &samplefrequency);
    wavout = parseswitcharg( argcount, args, "h");
index a07c605..4bbc219 100644 (file)
@@ -102,7 +102,7 @@ extern int getremainingfilelength( FILE *anyin, long *result);
 void readpkheader( FILE *anyin);
 
 /* -----------------------------------------------------------------------
-   Read a .WAV header from 'anyin'. 
+   Read a .WAV header from 'anyin'.
    If it is recognised, the data is used.
    Otherwise, we assume it's PCM-data and ignore the header.
    The global variable 'iswav' is set on success, otherwise cleared.
index a78312e..ee1de7f 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Mark Spencer <markster@digium.com>
  *
- * Updated for Mac OSX CoreAudio 
+ * Updated for Mac OSX CoreAudio
  * by Josh Roberson <josh@asteriasgi.com>
  *
  * See http://www.asterisk.org for more information about
@@ -25,7 +25,7 @@
  *
  * \author Mark Spencer <markster@digium.com>
  *
- * Updated for Mac OSX CoreAudio 
+ * Updated for Mac OSX CoreAudio
  * \arg Josh Roberson <josh@asteriasgi.com>
  *
  * \note Specially written for Malcolm Davenport, but I think I'll use it too
@@ -51,7 +51,7 @@
 #include "asterisk/autoconfig.h"
 
 #ifdef __Darwin__
-#include <CoreAudio/AudioHardware.h> 
+#include <CoreAudio/AudioHardware.h>
 #include <sys/types.h>
 #include <pwd.h>
 #include <sys/stat.h>
@@ -117,7 +117,7 @@ static void add_channel(char *tech, char *location)
                chan->next = channels;
                channels = chan;
        }
-       
+
 }
 
 static int load_config(void)
@@ -176,7 +176,7 @@ static int load_config(void)
                        } else if (!strcasecmp(buf, "mutelevel")) {
                                if (val && (sscanf(val, "%3d", &x) == 1) && (x > -1) && (x < 101)) {
                                        mutelevel = x;
-                               } else 
+                               } else
                                        fprintf(stderr, "mutelevel must be a number from 0 (most muted) to 100 (no mute) at line %d\n", lineno);
                        } else if (!strcasecmp(buf, "channel")) {
                                if (val && strlen(val)) {
@@ -199,7 +199,7 @@ static int load_config(void)
                fprintf(stderr, "no 'host' specification in config file\n");
        else if (!strlen(user))
                fprintf(stderr, "no 'user' specification in config file\n");
-       else if (!channels) 
+       else if (!channels)
                fprintf(stderr, "no 'channel' specifications in config file\n");
        else
                return 0;
@@ -286,7 +286,7 @@ static int login_asterisk(void)
                fprintf(stderr, "disconnected (1)\n");
                return -1;
        }
-       fprintf(astf, 
+       fprintf(astf,
                "Action: Login\r\n"
                "Username: %s\r\n"
                "Secret: %s\r\n\r\n", user, pass);
@@ -304,7 +304,7 @@ static int login_asterisk(void)
                fprintf(stderr, "disconnected (3)\n");
                return -1;
        }
-       fprintf(astf, 
+       fprintf(astf,
                "Action: Status\r\n\r\n");
        if (!(welcome = get_line())) {
                fprintf(stderr, "disconnected (4)\n");
@@ -404,7 +404,7 @@ static int setvol(float vol)
 {
 #ifndef __Darwin__
        if (ioctl(mixfd, MIXER_WRITE(mixchan), &vol)) {
-#else  
+#else
        float volumeL = vol;
        float volumeR = vol;
        OSStatus err;
@@ -462,7 +462,7 @@ static float mutedlevel(float orig, float level)
        master = level * master / 100.0;
        return master;
 #endif
-       
+
 }
 
 static void mute(void)
@@ -479,7 +479,7 @@ static void mute(void)
        vol = getvol();
        oldvol = vol;
        if (smoothfade)
-#ifdef __Darwin__ 
+#ifdef __Darwin__
                start = mutelevel;
 #else
                start = 100;
@@ -587,7 +587,7 @@ static void append_sub(struct channel *chan, char *name)
        struct subchannel *sub;
        sub = chan->subs;
        while(sub) {
-               if (!strcasecmp(sub->name, name)) 
+               if (!strcasecmp(sub->name, name))
                        return;
                sub = sub->next;
        }
@@ -650,7 +650,7 @@ static int wait_event(void)
                                strncpy(oldname, resp + strlen("Oldname: "), sizeof(oldname) - 1);
                }
                if (strlen(channel)) {
-                       if (!strcasecmp(event, "Hangup")) 
+                       if (!strcasecmp(event, "Hangup"))
                                hangup_chan(channel);
                        else
                                offhook_chan(channel);
@@ -711,7 +711,7 @@ int main(int argc, char *argv[])
                exit(1);
        }
        if (login_asterisk()) {
-#ifndef __Darwin__             
+#ifndef __Darwin__
                close(mixfd);
 #endif
                fclose(astf);
index 21ab80d..0516097 100644 (file)
@@ -41,7 +41,7 @@
 /*!
  * \brief reads next USC character from null terminated UTF-8 string and advanced pointer
  * for non valid UTF-8 sequences.
- * \return character as is Does \b NOT advance pointer for null termination 
+ * \return character as is Does \b NOT advance pointer for null termination
 */
 static int utf8decode (unsigned char **pp)
 {
@@ -92,12 +92,12 @@ static int utf8decode (unsigned char **pp)
    return *p;                   /* not sensible */
 }
 
-/*! 
+/*!
  * \brief check for any queued messages in specific queue (queue="" means any queue)
  * \param dir,queue,subaddress,channel,callerid,wait,delay,retries,concurrent
  * \retval 0 if nothing queued
  * \retval 1 if queued and outgoing set up OK
- * \retval 2 of outgoing exists 
+ * \retval 2 of outgoing exists
 */
 static char txqcheck (char *dir, char *queue, char subaddress, char *channel, char *callerid, int wait, int delay, int retries, int concurrent)
 {
@@ -193,7 +193,7 @@ static char txqcheck (char *dir, char *queue, char subaddress, char *channel, ch
    return 2;
 }
 
-/*! 
+/*!
  * \brief Process received queue entries
  * Run through a process, setting environment variables
 */
index 6c70b08..809bd64 100644 (file)
@@ -19,7 +19,7 @@
 /*!
  * \file
  * \author Russell Bryant <russell@digium.com>
- * 
+ *
  * \brief A utility for reading from a raw TCP stream
  *
  * This application is intended for use when a raw TCP stream is desired to be
@@ -84,33 +84,33 @@ int main(int argc, char *argv[])
        }
 
        memset(&sin, 0, sizeof(sin));
-       
+
        sin.sin_family = AF_INET;
        sin.sin_port = htons(atoi(argv[2]));
        memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
-       
+
        s = socket(AF_INET, SOCK_STREAM, 0);
-       
+
        if (s < 0) {
                fprintf(stderr, "Unable to allocate socket!\n");
                exit(1);
-       }       
+       }
 
        res = connect(s, (struct sockaddr *)&sin, sizeof(sin));
-       
+
        if (res) {
                fprintf(stderr, "Unable to connect to host!\n");
                close(s);
-               exit(1);        
+               exit(1);
        }
 
        while (1) {
                res = read(s, buf, sizeof(buf));
 
                if (res < 1)
-                       break;          
-       
-               memset(&tv, 0, sizeof(tv));             
+                       break;
+
+               memset(&tv, 0, sizeof(tv));
                FD_ZERO(&wfds);
                FD_SET(1, &wfds);