diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-12-22 09:14:07 -0500 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-12-22 09:14:07 -0500 |
commit | ce3d56920b15facbb64b3caf0d823a3f57c0dded (patch) | |
tree | 0ea4a13885afb281237b3747e85eb6315863ae0a /res | |
parent | 35a2e09c655f26067db0f51837704886d6ffff78 (diff) |
Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
Diffstat (limited to 'res')
49 files changed, 691 insertions, 708 deletions
diff --git a/res/Makefile b/res/Makefile index 2b688edc4..5a8f35a85 100644 --- a/res/Makefile +++ b/res/Makefile @@ -1,6 +1,6 @@ # # Asterisk -- An open source telephony toolkit. -# +# # Makefile for resource modules # # Copyright (C) 1999-2006, Digium, Inc. diff --git a/res/ael/ael.flex b/res/ael/ael.flex index 0b6ec32f1..8ea881512 100644 --- a/res/ael/ael.flex +++ b/res/ael/ael.flex @@ -269,11 +269,11 @@ includes { STORE_POS; return KW_INCLUDES;} [ ]+ { my_col += yyleng; } [\t]+ { my_col += (yyleng*8)-(my_col%8); } -({KEYWORD}?[-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]]|{HIBIT}|(\\.)|(\$\{)|(\$\[)) { - /* boy did I open a can of worms when I changed the lexical token "word". +({KEYWORD}?[-a-zA-Z0-9'"_/.\<\>\*\+!$#\[\]]|{HIBIT}|(\\.)|(\$\{)|(\$\[)) { + /* boy did I open a can of worms when I changed the lexical token "word". all the above keywords can be used as a beginning to a "word".- - before, a "word" would match a longer sequence than the above - keywords, and all would be well. But now "word" is a single char + before, a "word" would match a longer sequence than the above + keywords, and all would be well. But now "word" is a single char and feeds into a statemachine sort of sequence from there on. So... I added the {KEYWORD}? to the beginning of the word match sequence */ @@ -344,7 +344,7 @@ includes { STORE_POS; return KW_INCLUDES;} } } -<curlystate>{NOPARENS}[\(\[\{] { +<curlystate>{NOPARENS}[\(\[\{] { char c = yytext[yyleng-1]; if (c == '{') parencount2++; @@ -352,7 +352,7 @@ includes { STORE_POS; return KW_INCLUDES;} yymore(); } -<curlystate>{NOPARENS}[\]\)] { +<curlystate>{NOPARENS}[\]\)] { char c = yytext[yyleng-1]; if ( pbcpop2(c)) { /* error */ STORE_LOC; @@ -387,7 +387,7 @@ includes { STORE_POS; return KW_INCLUDES;} } } -<brackstate>{NOPARENS}[\(\[\{] { +<brackstate>{NOPARENS}[\(\[\{] { char c = yytext[yyleng-1]; if (c == '[') parencount3++; @@ -395,7 +395,7 @@ includes { STORE_POS; return KW_INCLUDES;} yymore(); } -<brackstate>{NOPARENS}[\}\)] { +<brackstate>{NOPARENS}[\}\)] { char c = yytext[yyleng-1]; if ( pbcpop3(c)) { /* error */ STORE_LOC; @@ -580,7 +580,7 @@ includes { STORE_POS; return KW_INCLUDES;} glob_t globbuf; /* the current globbuf */ int globbuf_pos = -1; /* where we are in the current globbuf */ globbuf.gl_offs = 0; /* initialize it to silence gcc */ - + p1 = strchr(yytext,'"'); p2 = strrchr(yytext,'"'); if ( include_stack_index >= MAX_INCLUDE_DEPTH ) { @@ -625,8 +625,8 @@ includes { STORE_POS; return KW_INCLUDES;} yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner ); include_stack[include_stack_index-1].globbuf_pos++; setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0); - /* finish this */ - + /* finish this */ + } else { if (include_stack[include_stack_index].fname) { free(include_stack[include_stack_index].fname); @@ -641,7 +641,7 @@ includes { STORE_POS; return KW_INCLUDES;} } else { globfree(&include_stack[include_stack_index].globbuf); include_stack[include_stack_index].globbuf_pos = -1; - + yy_delete_buffer( YY_CURRENT_BUFFER, yyscanner ); yy_switch_to_buffer(include_stack[include_stack_index].bufstate, yyscanner ); my_lineno = include_stack[include_stack_index].lineno; @@ -811,7 +811,7 @@ struct pval *ael2_parse(char *filename, int *errors) buffer = (char*)malloc(stats.st_size+2); if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) { ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno)); - } + } buffer[stats.st_size]=0; fclose(fin); @@ -883,7 +883,7 @@ static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf, buffer = (char*)malloc(stats.st_size+1); if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) { ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno)); - } + } buffer[stats.st_size] = 0; ast_debug(1, " --Read in included file %s, %d chars\n",fnamebuf2, (int)stats.st_size); fclose(in1); diff --git a/res/ael/ael.tab.c b/res/ael/ael.tab.c index c838d797c..87370a190 100644 --- a/res/ael/ael.tab.c +++ b/res/ael/ael.tab.c @@ -1,19 +1,19 @@ /* A Bison parser, made by GNU Bison 2.5. */ /* Bison implementation for Yacc-like parsers in C - + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -120,7 +120,7 @@ static void set_dads(pval *dad, pval *child_list); void reset_parencount(yyscan_t yyscanner); void reset_semicount(yyscan_t yyscanner); void reset_argcount(yyscan_t yyscanner ); - + #define YYLEX_PARAM ((struct parse_io *)parseio)->scanner #define YYERROR_VERBOSE 1 @@ -2897,7 +2897,7 @@ yyreduce: free((yyvsp[(1) - (2)].str)); free((yyvsp[(2) - (2)].str)); prev_word = (yyval.str); - } + } } break; @@ -4002,9 +4002,7 @@ static pval *nword(char *string, YYLTYPE *pos) static void set_dads(struct pval *dad, struct pval *child_list) { struct pval *t; - + for(t=child_list;t;t=t->next) /* simple stuff */ t->dad = dad; } - - diff --git a/res/ael/ael.tab.h b/res/ael/ael.tab.h index 93fc23d0c..1647649a8 100644 --- a/res/ael/ael.tab.h +++ b/res/ael/ael.tab.h @@ -1,19 +1,19 @@ /* A Bison parser, made by GNU Bison 2.5. */ /* Bison interface for Yacc-like parsers in C - + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -118,6 +118,3 @@ typedef struct YYLTYPE # define YYLTYPE_IS_DECLARED 1 # define YYLTYPE_IS_TRIVIAL 1 #endif - - - diff --git a/res/ael/ael.y b/res/ael/ael.y index 27e04c583..c157c6cb7 100644 --- a/res/ael/ael.y +++ b/res/ael/ael.y @@ -43,7 +43,7 @@ static void set_dads(pval *dad, pval *child_list); void reset_parencount(yyscan_t yyscanner); void reset_semicount(yyscan_t yyscanner); void reset_argcount(yyscan_t yyscanner ); - + #define YYLEX_PARAM ((struct parse_io *)parseio)->scanner #define YYERROR_VERBOSE 1 @@ -211,7 +211,7 @@ context : opt_abstract KW_CONTEXT context_name LC elements RC { $$->u1.str = $3; $$->u2.statements = $5; set_dads($$,$5); - $$->u3.abstract = $1;} + $$->u3.abstract = $1;} ; /* optional "abstract" keyword XXX there is no regression test for this */ @@ -422,7 +422,7 @@ word3_list : word { $$ = $1;} free($1); free($2); prev_word = $$; - } + } } | word word word { if (asprintf(&($$), "%s%s%s", $1, $2, $3) < 0) { @@ -545,7 +545,7 @@ statement : LC statements RC { opt_else : KW_ELSE statement { $$ = $2; } | { $$ = NULL ; } - + target : goto_word { $$ = nword($1, &@1); } | goto_word BAR goto_word { $$ = nword($1, &@1); @@ -884,8 +884,7 @@ static pval *nword(char *string, YYLTYPE *pos) static void set_dads(struct pval *dad, struct pval *child_list) { struct pval *t; - + for(t=child_list;t;t=t->next) /* simple stuff */ t->dad = dad; } - diff --git a/res/ael/ael_lex.c b/res/ael/ael_lex.c index 6aec03bee..ad79cf257 100644 --- a/res/ael/ael_lex.c +++ b/res/ael/ael_lex.c @@ -36,7 +36,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -53,7 +53,7 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; @@ -186,7 +186,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ @@ -248,7 +248,7 @@ struct yy_buffer_state int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - + /* Whether to try to fill the input buffer when we reach the * end of it. */ @@ -1027,9 +1027,9 @@ static int yy_init_globals (yyscan_t yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define yylval yyg->yylval_r - + # define yylloc yyg->yylloc_r - + int ael_yylex_init (yyscan_t* scanner); int ael_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); @@ -1068,9 +1068,9 @@ YYSTYPE * ael_yyget_lval (yyscan_t yyscanner ); void ael_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner ); - + void ael_yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); - + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -1084,7 +1084,7 @@ extern int ael_yywrap (yyscan_t yyscanner ); #endif static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); - + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif @@ -1562,11 +1562,11 @@ YY_RULE_SETUP case 51: YY_RULE_SETUP #line 272 "ael.flex" -{ - /* boy did I open a can of worms when I changed the lexical token "word". +{ + /* boy did I open a can of worms when I changed the lexical token "word". all the above keywords can be used as a beginning to a "word".- - before, a "word" would match a longer sequence than the above - keywords, and all would be well. But now "word" is a single char + before, a "word" would match a longer sequence than the above + keywords, and all would be well. But now "word" is a single char and feeds into a statemachine sort of sequence from there on. So... I added the {KEYWORD}? to the beginning of the word match sequence */ @@ -1668,7 +1668,7 @@ case 59: /* rule 59 can match eol */ YY_RULE_SETUP #line 347 "ael.flex" -{ +{ char c = yytext[yyleng-1]; if (c == '{') parencount2++; @@ -1680,7 +1680,7 @@ case 60: /* rule 60 can match eol */ YY_RULE_SETUP #line 355 "ael.flex" -{ +{ char c = yytext[yyleng-1]; if ( pbcpop2(c)) { /* error */ STORE_LOC; @@ -1722,7 +1722,7 @@ case 62: /* rule 62 can match eol */ YY_RULE_SETUP #line 390 "ael.flex" -{ +{ char c = yytext[yyleng-1]; if (c == '[') parencount3++; @@ -1734,7 +1734,7 @@ case 63: /* rule 63 can match eol */ YY_RULE_SETUP #line 398 "ael.flex" -{ +{ char c = yytext[yyleng-1]; if ( pbcpop3(c)) { /* error */ STORE_LOC; @@ -1961,7 +1961,7 @@ YY_RULE_SETUP glob_t globbuf; /* the current globbuf */ int globbuf_pos = -1; /* where we are in the current globbuf */ globbuf.gl_offs = 0; /* initialize it to silence gcc */ - + p1 = strchr(yytext,'"'); p2 = strrchr(yytext,'"'); if ( include_stack_index >= MAX_INCLUDE_DEPTH ) { @@ -2014,8 +2014,8 @@ case YY_STATE_EOF(brackstate): ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner ); include_stack[include_stack_index-1].globbuf_pos++; setup_filestack(fnamebuf, sizeof(fnamebuf), &include_stack[include_stack_index-1].globbuf, include_stack[include_stack_index-1].globbuf_pos, yyscanner, 0); - /* finish this */ - + /* finish this */ + } else { if (include_stack[include_stack_index].fname) { free(include_stack[include_stack_index].fname); @@ -2030,7 +2030,7 @@ case YY_STATE_EOF(brackstate): } else { globfree(&include_stack[include_stack_index].globbuf); include_stack[include_stack_index].globbuf_pos = -1; - + ael_yy_delete_buffer(YY_CURRENT_BUFFER,yyscanner ); ael_yy_switch_to_buffer(include_stack[include_stack_index].bufstate,yyscanner ); my_lineno = include_stack[include_stack_index].lineno; @@ -2568,7 +2568,7 @@ static void ael_yy_load_buffer_state (yyscan_t yyscanner) YY_BUFFER_STATE ael_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) ael_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in ael_yy_create_buffer()" ); @@ -2612,7 +2612,7 @@ static void ael_yy_load_buffer_state (yyscan_t yyscanner) #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ - + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a ael_yyrestart() or at EOF. @@ -2638,7 +2638,7 @@ extern int isatty (int ); } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - + errno = oerrno; } @@ -2744,9 +2744,9 @@ static void ael_yyensure_buffer_stack (yyscan_t yyscanner) , yyscanner); if ( ! yyg->yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in ael_yyensure_buffer_stack()" ); - + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - + yyg->yy_buffer_stack_max = num_to_alloc; yyg->yy_buffer_stack_top = 0; return; @@ -2775,12 +2775,12 @@ static void ael_yyensure_buffer_stack (yyscan_t yyscanner) * @param base the character buffer * @param size the size in bytes of the character buffer * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE ael_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) @@ -2816,7 +2816,7 @@ YY_BUFFER_STATE ael_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yys */ YY_BUFFER_STATE ael_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) { - + return ael_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); } @@ -2833,7 +2833,7 @@ YY_BUFFER_STATE ael_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) ael_yyalloc(n ,yyscanner ); @@ -2901,10 +2901,10 @@ YY_EXTRA_TYPE ael_yyget_extra (yyscan_t yyscanner) int ael_yyget_lineno (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yylineno; } @@ -2914,10 +2914,10 @@ int ael_yyget_lineno (yyscan_t yyscanner) int ael_yyget_column (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - + if (! YY_CURRENT_BUFFER) return 0; - + return yycolumn; } @@ -2978,8 +2978,8 @@ void ael_yyset_lineno (int line_number , yyscan_t yyscanner) /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "ael_yyset_lineno called with no buffer" , yyscanner); - + yy_fatal_error( "ael_yyset_lineno called with no buffer" , yyscanner); + yylineno = line_number; } @@ -2993,8 +2993,8 @@ void ael_yyset_column (int column_no , yyscan_t yyscanner) /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "ael_yyset_column called with no buffer" , yyscanner); - + yy_fatal_error( "ael_yyset_column called with no buffer" , yyscanner); + yycolumn = column_no; } @@ -3047,13 +3047,13 @@ YYLTYPE *ael_yyget_lloc (yyscan_t yyscanner) struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yylloc; } - + void ael_yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yylloc = yylloc_param; } - + /* User-visible API */ /* ael_yylex_init is special because it creates the scanner itself, so it is @@ -3101,20 +3101,20 @@ int ael_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals errno = EINVAL; return 1; } - + *ptr_yy_globals = (yyscan_t) ael_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - + if (*ptr_yy_globals == NULL){ errno = ENOMEM; return 1; } - + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - + ael_yyset_extra (yy_user_defined, *ptr_yy_globals); - + return yy_init_globals ( *ptr_yy_globals ); } @@ -3384,7 +3384,7 @@ struct pval *ael2_parse(char *filename, int *errors) buffer = (char*)malloc(stats.st_size+2); if (fread(buffer, 1, stats.st_size, fin) != stats.st_size) { ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno)); - } + } buffer[stats.st_size]=0; fclose(fin); @@ -3456,7 +3456,7 @@ static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf, buffer = (char*)malloc(stats.st_size+1); if (fread(buffer, 1, stats.st_size, in1) != stats.st_size) { ast_log(LOG_ERROR, "fread() failed: %s\n", strerror(errno)); - } + } buffer[stats.st_size] = 0; ast_debug(1, " --Read in included file %s, %d chars\n",fnamebuf2, (int)stats.st_size); fclose(in1); @@ -3486,4 +3486,3 @@ static void setup_filestack(char *fnamebuf2, int fnamebuf_siz, glob_t *globbuf, } } } - diff --git a/res/ael/pval.c b/res/ael/pval.c index 7c420d1c4..bbfeb2d76 100644 --- a/res/ael/pval.c +++ b/res/ael/pval.c @@ -20,7 +20,7 @@ /*! \file * * \brief Compile symbolic Asterisk Extension Logic into Asterisk extensions, version 2. - * + * */ /*** MODULEINFO @@ -117,16 +117,16 @@ static void print_pval(FILE *fin, pval *item, int depth) { int i; pval *lp; - + for (i=0; i<depth; i++) { fprintf(fin, "\t"); /* depth == indentation */ } - + switch ( item->type ) { case PV_WORD: fprintf(fin,"%s;\n", item->u1.str); /* usually, words are encapsulated in something else */ break; - + case PV_MACRO: fprintf(fin,"macro %s(", item->u1.str); for (lp=item->u2.arglist; lp; lp=lp->next) { @@ -141,7 +141,7 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"};\n\n"); break; - + case PV_CONTEXT: if ( item->u3.abstract ) fprintf(fin,"abstract context %s {\n", item->u1.str); @@ -153,7 +153,7 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"};\n\n"); break; - + case PV_MACRO_CALL: fprintf(fin,"&%s(", item->u1.str); for (lp=item->u2.arglist; lp; lp=lp->next) { @@ -163,7 +163,7 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,");\n"); break; - + case PV_APPLICATION_CALL: fprintf(fin,"%s(", item->u1.str); for (lp=item->u2.arglist; lp; lp=lp->next) { @@ -173,22 +173,22 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,");\n"); break; - + case PV_CASE: fprintf(fin,"case %s:\n", item->u1.str); print_pval_list(fin,item->u2.statements, depth+1); break; - + case PV_PATTERN: fprintf(fin,"pattern %s:\n", item->u1.str); print_pval_list(fin,item->u2.statements, depth+1); break; - + case PV_DEFAULT: fprintf(fin,"default:\n"); print_pval_list(fin,item->u2.statements, depth+1); break; - + case PV_CATCH: fprintf(fin,"catch %s {\n", item->u1.str); print_pval_list(fin,item->u2.statements, depth+1); @@ -197,7 +197,7 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"};\n"); break; - + case PV_SWITCHES: fprintf(fin,"switches {\n"); print_pval_list(fin,item->u1.list,depth+1); @@ -206,7 +206,7 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"};\n"); break; - + case PV_ESWITCHES: fprintf(fin,"eswitches {\n"); print_pval_list(fin,item->u1.list,depth+1); @@ -215,7 +215,7 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"};\n"); break; - + case PV_INCLUDES: fprintf(fin,"includes {\n"); for (lp=item->u1.list; lp; lp=lp->next) { @@ -224,7 +224,7 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"%s", lp->u1.str); /* usually, words are encapsulated in something else */ if (lp->u2.arglist) - fprintf(fin,"|%s|%s|%s|%s", + fprintf(fin,"|%s|%s|%s|%s", lp->u2.arglist->u1.str, lp->u2.arglist->next->u1.str, lp->u2.arglist->next->next->u1.str, @@ -232,13 +232,13 @@ static void print_pval(FILE *fin, pval *item, int depth) ); fprintf(fin,";\n"); /* usually, words are encapsulated in something else */ } - + for (i=0; i<depth; i++) { fprintf(fin,"\t"); /* depth == indentation */ } fprintf(fin,"};\n"); break; - + case PV_STATEMENTBLOCK: fprintf(fin,"{\n"); print_pval_list(fin,item->u1.list, depth+1); @@ -247,15 +247,15 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"}\n"); break; - + case PV_VARDEC: fprintf(fin,"%s=%s;\n", item->u1.str, item->u2.val); break; - + case PV_LOCALVARDEC: fprintf(fin,"local %s=%s;\n", item->u1.str, item->u2.val); break; - + case PV_GOTO: fprintf(fin,"goto %s", item->u1.list->u1.str); if ( item->u1.list->next ) @@ -264,42 +264,42 @@ static void print_pval(FILE *fin, pval *item, int depth) fprintf(fin,",%s", item->u1.list->next->next->u1.str); fprintf(fin,"\n"); break; - + case PV_LABEL: fprintf(fin,"%s:\n", item->u1.str); break; - + case PV_FOR: fprintf(fin,"for (%s; %s; %s)\n", item->u1.for_init, item->u2.for_test, item->u3.for_inc); print_pval_list(fin,item->u4.for_statements,depth+1); break; - + case PV_WHILE: fprintf(fin,"while (%s)\n", item->u1.str); print_pval_list(fin,item->u2.statements,depth+1); break; - + case PV_BREAK: fprintf(fin,"break;\n"); break; - + case PV_RETURN: fprintf(fin,"return;\n"); break; - + case PV_CONTINUE: fprintf(fin,"continue;\n"); break; - + case PV_RANDOM: case PV_IFTIME: case PV_IF: if ( item->type == PV_IFTIME ) { - - fprintf(fin,"ifTime ( %s|%s|%s|%s )\n", - item->u1.list->u1.str, - item->u1.list->next->u1.str, - item->u1.list->next->next->u1.str, + + fprintf(fin,"ifTime ( %s|%s|%s|%s )\n", + item->u1.list->u1.str, + item->u1.list->next->u1.str, + item->u1.list->next->next->u1.str, item->u1.list->next->next->next->u1.str ); } else if ( item->type == PV_RANDOM ) { @@ -335,7 +335,7 @@ static void print_pval(FILE *fin, pval *item, int depth) print_pval_list(fin,item->u3.else_statements, depth); } break; - + case PV_SWITCH: fprintf(fin,"switch( %s ) {\n", item->u1.str); print_pval_list(fin,item->u2.statements,depth+1); @@ -344,22 +344,22 @@ static void print_pval(FILE *fin, pval *item, int depth) } fprintf(fin,"}\n"); break; - + case PV_EXTENSION: if ( item->u4.regexten ) fprintf(fin, "regexten "); if ( item->u3.hints ) fprintf(fin,"hints(%s) ", item->u3.hints); - + fprintf(fin,"%s => ", item->u1.str); print_pval_list(fin,item->u2.statements,depth+1); fprintf(fin,"\n"); break; - + case PV_IGNOREPAT: fprintf(fin,"ignorepat => %s;\n", item->u1.str); break; - + case PV_GLOBALS: fprintf(fin,"globals {\n"); print_pval_list(fin,item->u1.statements,depth+1); @@ -374,7 +374,7 @@ static void print_pval(FILE *fin, pval *item, int depth) static void print_pval_list(FILE *fin, pval *item, int depth) { pval *i; - + for (i=item; i; i=i->next) { print_pval(fin, i, depth); } @@ -402,12 +402,12 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f but you may not need it */ { pval *lp; - + switch ( item->type ) { case PV_WORD: /* fields: item->u1.str == string associated with this (word). */ break; - + case PV_MACRO: /* fields: item->u1.str == name of macro item->u2.arglist == pval list of PV_WORD arguments of macro, as given by user @@ -417,11 +417,11 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f item->u3.macro_statements == pval list of statements in macro body. */ for (lp=item->u2.arglist; lp; lp=lp->next) { - + } traverse_pval_item_template(item->u3.macro_statements,depth+1); break; - + case PV_CONTEXT: /* fields: item->u1.str == name of context item->u2.statements == pval list of statements in context body @@ -429,7 +429,7 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_MACRO_CALL: /* fields: item->u1.str == name of macro to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -439,7 +439,7 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f for (lp=item->u2.arglist; lp; lp=lp->next) { } break; - + case PV_APPLICATION_CALL: /* fields: item->u1.str == name of application to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -449,47 +449,47 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f for (lp=item->u2.arglist; lp; lp=lp->next) { } break; - + case PV_CASE: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_PATTERN: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_DEFAULT: - /* fields: + /* fields: item->u2.statements == pval list of statements under the case */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_CATCH: /* fields: item->u1.str == name of extension to catch item->u2.statements == pval list of statements in context body */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_SWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ traverse_pval_item_template(item->u1.list,depth+1); break; - + case PV_ESWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ traverse_pval_item_template(item->u1.list,depth+1); break; - + case PV_INCLUDES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list item->u2.arglist == pval list of 4 PV_WORD elements for time values @@ -497,37 +497,37 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f traverse_pval_item_template(item->u1.list,depth+1); traverse_pval_item_template(item->u2.arglist,depth+1); break; - + case PV_STATEMENTBLOCK: /* fields: item->u1.list == pval list of statements in block, one per entry in the list */ traverse_pval_item_template(item->u1.list,depth+1); break; - + case PV_LOCALVARDEC: case PV_VARDEC: /* fields: item->u1.str == variable name item->u2.val == variable value to assign */ break; - + case PV_GOTO: /* fields: item->u1.list == pval list of PV_WORD target names, up to 3, in order as given by user. item->u1.list->u1.str == where the data on a PV_WORD will always be. */ - + if ( item->u1.list->next ) ; if ( item->u1.list->next && item->u1.list->next->next ) ; - + break; - + case PV_LABEL: /* fields: item->u1.str == label name */ break; - + case PV_FOR: /* fields: item->u1.for_init == a string containing the initalizer item->u2.for_test == a string containing the loop test @@ -537,7 +537,7 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f */ traverse_pval_item_template(item->u4.for_statements,depth+1); break; - + case PV_WHILE: /* fields: item->u1.str == the while conditional, as supplied by user @@ -545,22 +545,22 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_BREAK: /* fields: none */ break; - + case PV_RETURN: /* fields: none */ break; - + case PV_CONTINUE: /* fields: none */ break; - + case PV_IFTIME: /* fields: item->u1.list == there are 4 linked PV_WORDs here. @@ -573,7 +573,7 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f traverse_pval_item_template(item->u3.else_statements,depth+1); } break; - + case PV_RANDOM: /* fields: item->u1.str == the random number expression, as supplied by user @@ -586,7 +586,7 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f traverse_pval_item_template(item->u3.else_statements,depth+1); } break; - + case PV_IF: /* fields: item->u1.str == the if conditional, as supplied by user @@ -599,16 +599,16 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f traverse_pval_item_template(item->u3.else_statements,depth+1); } break; - + case PV_SWITCH: /* fields: item->u1.str == the switch expression - item->u2.statements == a pval list of statements in the switch, + item->u2.statements == a pval list of statements in the switch, (will be case statements, most likely!) */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_EXTENSION: /* fields: item->u1.str == the extension name, label, whatever it's called @@ -618,12 +618,12 @@ void traverse_pval_item_template(pval *item, int depth)/* depth comes in handy f */ traverse_pval_item_template(item->u2.statements,depth+1); break; - + case PV_IGNOREPAT: /* fields: item->u1.str == the ignorepat data */ break; - + case PV_GLOBALS: /* fields: item->u1.statements == pval list of statements, usually vardecs */ @@ -636,7 +636,7 @@ void traverse_pval_template(pval *item, int depth) /* depth comes in handy for a but you may not need it */ { pval *i; - + for (i=item; i; i=i->next) { traverse_pval_item_template(i, depth); } @@ -696,16 +696,16 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) { int err1; regex_t preg; - + /* simple case, they match exactly, the pattern and exten name */ if (strcmp(pattern,exten) == 0) return 1; - + if (pattern[0] == '_') { char reg1[2000]; const char *p; char *r = reg1; - + if ( strlen(pattern)*5 >= 2000 ) /* safety valve */ { ast_log(LOG_ERROR,"Error: The pattern %s is way too big. Pattern matching cancelled.\n", pattern); @@ -725,7 +725,7 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) *r++ = 'X'; *r++ = ']'; break; - + case 'Z': *r++ = '['; *r++ = '1'; @@ -734,7 +734,7 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) *r++ = 'Z'; *r++ = ']'; break; - + case 'N': *r++ = '['; *r++ = '2'; @@ -743,7 +743,7 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) *r++ = 'N'; *r++ = ']'; break; - + case '[': while ( *p && *p != ']' ) { *r++ = *p++; @@ -754,7 +754,7 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) here->filename, here->startline, here->endline, pattern); } break; - + case '.': case '!': *r++ = '.'; @@ -767,7 +767,7 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) default: *r++ = *p; break; - + } } *r++ = '$'; /* what if the extension is a pattern ?? */ @@ -783,7 +783,7 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) } err1 = regexec(&preg, exten, 0, 0, 0); regfree(&preg); - + if ( err1 ) { /* ast_log(LOG_NOTICE,"*****************************[%d]Extension %s did not match %s(%s)\n", err1,exten, pattern, reg1); */ @@ -793,8 +793,8 @@ static int extension_matches(pval *here, const char *exten, const char *pattern) exten, pattern); */ return 1; } - - + + } else { if ( strcmp(exten,pattern) == 0 ) { return 1; @@ -856,7 +856,7 @@ static void check_timerange(pval *p) } *e = '\0'; e++; - while (*e && !isdigit(*e)) + while (*e && !isdigit(*e)) e++; if (!*e) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The time range format (%s) is missing the end time!\n", @@ -907,7 +907,7 @@ static void check_dow(pval *DOW) char *c; /* The following line is coincidence, really! */ int s, e; - + dow = ast_strdupa(DOW->u1.str); /* Check for all days */ @@ -1013,7 +1013,7 @@ static void check_month(pval *MON) mon = ast_strdupa(MON->u1.str); /* Check for all days */ - if (ast_strlen_zero(mon) || !strcmp(mon, "*")) + if (ast_strlen_zero(mon) || !strcmp(mon, "*")) return ; /* Get start and ending days */ c = strchr(mon, '-'); @@ -1044,11 +1044,11 @@ static void check_month(pval *MON) static int check_break(pval *item) { pval *p = item; - + while( p && p->type != PV_MACRO && p->type != PV_CONTEXT ) /* early cutout, sort of */ { /* a break is allowed in WHILE, FOR, CASE, DEFAULT, PATTERN; otherwise, it don't make no sense */ - if( p->type == PV_CASE || p->type == PV_DEFAULT || p->type == PV_PATTERN + if( p->type == PV_CASE || p->type == PV_DEFAULT || p->type == PV_PATTERN || p->type == PV_WHILE || p->type == PV_FOR ) { return 1; } @@ -1057,14 +1057,14 @@ static int check_break(pval *item) ast_log(LOG_ERROR,"Error: file %s, line %d-%d: 'break' not in switch, for, or while statement!\n", item->filename, item->startline, item->endline); errs++; - + return 0; } static int check_continue(pval *item) { pval *p = item; - + while( p && p->type != PV_MACRO && p->type != PV_CONTEXT ) /* early cutout, sort of */ { /* a break is allowed in WHILE, FOR, CASE, DEFAULT, PATTERN; otherwise, it don't make no sense */ @@ -1076,14 +1076,14 @@ static int check_continue(pval *item) ast_log(LOG_ERROR,"Error: file %s, line %d-%d: 'continue' not in 'for' or 'while' statement!\n", item->filename, item->startline, item->endline); errs++; - + return 0; } static struct pval *in_macro(pval *item) { struct pval *curr; - curr = item; + curr = item; while( curr ) { if( curr->type == PV_MACRO ) { return curr; @@ -1096,7 +1096,7 @@ static struct pval *in_macro(pval *item) static struct pval *in_context(pval *item) { struct pval *curr; - curr = item; + curr = item; while( curr ) { if( curr->type == PV_MACRO || curr->type == PV_CONTEXT ) { return curr; @@ -1114,11 +1114,11 @@ static void check_label(pval *item) struct pval *curr; struct pval *x; int alright = 0; - + /* A label outside an extension just plain does not make sense! */ - + curr = item; - + while( curr ) { if( curr->type == PV_MACRO || curr->type == PV_EXTENSION ) { alright = 1; @@ -1130,21 +1130,21 @@ static void check_label(pval *item) { ast_log(LOG_ERROR,"Error: file %s, line %d-%d: Label %s is not within an extension or macro!\n", item->filename, item->startline, item->endline, item->u1.str); - errs++; + errs++; } - - + + /* basically, ensure that a label is not repeated in a context. Period. The method: well, for each label, find the first label in the context with the same name. If it's not the current label, then throw an error. */ - + /* printf("==== check_label: ====\n"); */ if( !current_extension ) curr = current_context; else curr = current_extension; - + x = find_first_label_in_current_context((char *)item->u1.str, curr); /* printf("Hey, check_label found with item = %x, and x is %x, and currcont is %x, label name is %s\n", item,x, current_context, (char *)item->u1.str); */ if( x && x != item ) @@ -1161,7 +1161,7 @@ static pval *get_goto_target(pval *item) /* just one item-- the label should be in the current extension */ pval *curr_ext = get_extension_or_contxt(item); /* containing exten, or macro */ pval *curr_cont; - + if (!item->u1.list) { return NULL; } @@ -1175,21 +1175,21 @@ static pval *get_goto_target(pval *item) /* TWO items */ if (item->u1.list->next && !item->u1.list->next->next) { - if (!strstr((item->u1.list)->u1.str,"${") + if (!strstr((item->u1.list)->u1.str,"${") && !strstr(item->u1.list->next->u1.str,"${") ) /* Don't try to match variables */ { struct pval *x = find_label_in_current_context((char *)item->u1.list->u1.str, (char *)item->u1.list->next->u1.str, curr_cont); return x; } } - + /* All 3 items! */ if (item->u1.list->next && item->u1.list->next->next) { /* all three */ pval *first = item->u1.list; pval *second = item->u1.list->next; pval *third = item->u1.list->next->next; - - if (!strstr((item->u1.list)->u1.str,"${") + + if (!strstr((item->u1.list)->u1.str,"${") && !strstr(item->u1.list->next->u1.str,"${") && !strstr(item->u1.list->next->next->u1.str,"${")) /* Don't try to match variables */ { struct pval *x = find_label_in_current_db((char*)first->u1.str, (char*)second->u1.str, (char*)third->u1.str); @@ -1197,7 +1197,7 @@ static pval *get_goto_target(pval *item) struct pval *p3; struct pval *that_context = find_context(item->u1.list->u1.str); - + /* the target of the goto could be in an included context!! Fancy that!! */ /* look for includes in the current context */ if (that_context) { @@ -1257,17 +1257,17 @@ static void check_goto(pval *item) else return; } - + /* TWO items */ if (item->u1.list->next && !item->u1.list->next->next) { /* two items */ /* printf("Calling find_label_in_current_context with args %s, %s\n", (char*)((item->u1.list)->u1.str), (char *)item->u1.list->next->u1.str); */ - if (!strstr((item->u1.list)->u1.str,"${") + if (!strstr((item->u1.list)->u1.str,"${") && !strstr(item->u1.list->next->u1.str,"${") ) /* Don't try to match variables */ { struct pval *z = get_contxt(item); struct pval *x = 0; - + if (z) x = find_label_in_current_context((char *)item->u1.list->u1.str, (char *)item->u1.list->next->u1.str, z); @@ -1280,17 +1280,17 @@ static void check_goto(pval *item) return; } } - + /* All 3 items! */ if (item->u1.list->next && item->u1.list->next->next) { /* all three */ pval *first = item->u1.list; pval *second = item->u1.list->next; pval *third = item->u1.list->next->next; - + /* printf("Calling find_label_in_current_db with args %s, %s, %s\n", (char*)first->u1.str, (char*)second->u1.str, (char*)third->u1.str); */ - if (!strstr((item->u1.list)->u1.str,"${") + if (!strstr((item->u1.list)->u1.str,"${") && !strstr(item->u1.list->next->u1.str,"${") && !strstr(item->u1.list->next->next->u1.str,"${")) /* Don't try to match variables */ { struct pval *x = find_label_in_current_db((char*)first->u1.str, (char*)second->u1.str, (char*)third->u1.str); @@ -1298,7 +1298,7 @@ static void check_goto(pval *item) struct pval *p3; struct pval *found = 0; struct pval *that_context = find_context(item->u1.list->u1.str); - + /* the target of the goto could be in an included context!! Fancy that!! */ /* look for includes in the current context */ if (that_context) { @@ -1334,7 +1334,7 @@ static void check_goto(pval *item) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: It's bad form to have a goto in a macro to a target outside the macro!\n", item->filename, item->startline, item->endline); - warns++; + warns++; } } } @@ -1343,7 +1343,7 @@ static void check_goto(pval *item) #ifdef STANDALONE struct pbx_find_info pfiq = {.stacklen = 0 }; extern int localized_pbx_load_module(void); - /* if this is a standalone, we will need to make sure the + /* if this is a standalone, we will need to make sure the localized load of extensions.conf is done */ if (!extensions_dot_conf_loaded) { localized_pbx_load_module(); @@ -1351,9 +1351,9 @@ static void check_goto(pval *item) } pbx_find_extension(NULL, NULL, &pfiq, first->u1.str, second->u1.str, atoi(third->u1.str), - atoi(third->u1.str) ? NULL : third->u1.str, NULL, + atoi(third->u1.str) ? NULL : third->u1.str, NULL, atoi(third->u1.str) ? E_MATCH : E_FINDLABEL); - + if (pfiq.status != STATUS_SUCCESS) { ast_log(LOG_WARNING,"Warning: file %s, line %d-%d: goto: Couldn't find goto target %s|%s|%s, not even in extensions.conf!\n", item->filename, item->startline, item->endline, first->u1.str, second->u1.str, third->u1.str); @@ -1373,24 +1373,24 @@ static void check_goto(pval *item) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: It's bad form to have a goto in a macro to a target outside the macro!\n", item->filename, item->startline, item->endline); - warns++; + warns++; } } } } } } - + static void find_pval_goto_item(pval *item, int lev) { struct pval *p4; - + if (lev>100) { ast_log(LOG_ERROR,"find_pval_goto in infinite loop! item_type: %u\n\n", item->type); return; } - + switch ( item->type ) { case PV_MACRO: /* fields: item->u1.str == name of macro @@ -1400,12 +1400,12 @@ static void find_pval_goto_item(pval *item, int lev) item->u3.macro_statements == pval list of statements in macro body. */ - + /* printf("Descending into macro %s at line %d\n", item->u1.str, item->startline); */ find_pval_gotos(item->u3.macro_statements,lev+1); /* if we're just searching for a context, don't bother descending into them */ - + break; - + case PV_CONTEXT: /* fields: item->u1.str == name of context item->u2.statements == pval list of statements in context body @@ -1420,7 +1420,7 @@ static void find_pval_goto_item(pval *item, int lev) /* printf("Descending into Case of %s\n", item->u1.str); */ find_pval_gotos(item->u2.statements,lev+1); break; - + case PV_PATTERN: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case @@ -1428,15 +1428,15 @@ static void find_pval_goto_item(pval *item, int lev) /* printf("Descending into Pattern of %s\n", item->u1.str); */ find_pval_gotos(item->u2.statements,lev+1); break; - + case PV_DEFAULT: - /* fields: + /* fields: item->u2.statements == pval list of statements under the case */ /* printf("Descending into default\n"); */ find_pval_gotos(item->u2.statements,lev+1); break; - + case PV_CATCH: /* fields: item->u1.str == name of extension to catch item->u2.statements == pval list of statements in context body @@ -1444,21 +1444,21 @@ static void find_pval_goto_item(pval *item, int lev) /* printf("Descending into catch of %s\n", item->u1.str); */ find_pval_gotos(item->u2.statements,lev+1); break; - + case PV_STATEMENTBLOCK: /* fields: item->u1.list == pval list of statements in block, one per entry in the list */ /* printf("Descending into statement block\n"); */ find_pval_gotos(item->u1.list,lev+1); break; - + case PV_GOTO: /* fields: item->u1.list == pval list of PV_WORD target names, up to 3, in order as given by user. item->u1.list->u1.str == where the data on a PV_WORD will always be. */ check_goto(item); /* THE WHOLE FUNCTION OF THIS ENTIRE ROUTINE!!!! */ break; - + case PV_INCLUDES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ @@ -1474,7 +1474,7 @@ static void find_pval_goto_item(pval *item, int lev) } } break; - + case PV_FOR: /* fields: item->u1.for_init == a string containing the initalizer item->u2.for_test == a string containing the loop test @@ -1485,7 +1485,7 @@ static void find_pval_goto_item(pval *item, int lev) /* printf("Descending into for at line %d\n", item->startline); */ find_pval_gotos(item->u4.for_statements,lev+1); break; - + case PV_WHILE: /* fields: item->u1.str == the while conditional, as supplied by user @@ -1494,7 +1494,7 @@ static void find_pval_goto_item(pval *item, int lev) /* printf("Descending into while at line %d\n", item->startline); */ find_pval_gotos(item->u2.statements,lev+1); break; - + case PV_RANDOM: /* fields: item->u1.str == the random number expression, as supplied by user @@ -1502,7 +1502,7 @@ static void find_pval_goto_item(pval *item, int lev) item->u3.else_statements == a pval list of statements in the else (could be zero) fall thru to PV_IF */ - + case PV_IFTIME: /* fields: item->u1.list == the time values, 4 of them, as PV_WORD structs in a list @@ -1525,17 +1525,17 @@ static void find_pval_goto_item(pval *item, int lev) find_pval_gotos(item->u3.else_statements,lev+1); } break; - + case PV_SWITCH: /* fields: item->u1.str == the switch expression - item->u2.statements == a pval list of statements in the switch, + item->u2.statements == a pval list of statements in the switch, (will be case statements, most likely!) */ /* printf("Descending into switch at line %d\n", item->startline); */ find_pval_gotos(item->u3.else_statements,lev+1); break; - + case PV_EXTENSION: /* fields: item->u1.str == the extension name, label, whatever it's called @@ -1556,7 +1556,7 @@ static void find_pval_goto_item(pval *item, int lev) static void find_pval_gotos(pval *item,int lev) { pval *i; - + for (i=item; i; i=i->next) { /* printf("About to call pval_goto_item, itemcount=%d, itemtype=%d\n", item_count, i->type); */ find_pval_goto_item(i, lev); @@ -1569,7 +1569,7 @@ static void find_pval_gotos(pval *item,int lev) static struct pval *match_pval_item(pval *item) { pval *x; - + switch ( item->type ) { case PV_MACRO: /* fields: item->u1.str == name of macro @@ -1581,15 +1581,15 @@ static struct pval *match_pval_item(pval *item) */ /* printf(" matching in MACRO %s, match_context=%s; retoncontmtch=%d; \n", item->u1.str, match_context, return_on_context_match); */ if (!strcmp(match_context,"*") || !strcmp(item->u1.str, match_context)) { - + /* printf("MACRO: match context is: %s\n", match_context); */ - + if (return_on_context_match && !strcmp(item->u1.str, match_context)) /* if we're just searching for a context, don't bother descending into them */ { /* printf("Returning on matching macro %s\n", match_context); */ return item; } - - + + if (!return_on_context_match) { /* printf("Descending into matching macro %s/%s\n", match_context, item->u1.str); */ if ((x=match_pval(item->u3.macro_statements))) { @@ -1600,9 +1600,9 @@ static struct pval *match_pval_item(pval *item) } else { /* printf("Skipping context/macro %s\n", item->u1.str); */ } - + break; - + case PV_CONTEXT: /* fields: item->u1.str == name of context item->u2.statements == pval list of statements in context body @@ -1615,7 +1615,7 @@ static struct pval *match_pval_item(pval *item) /* printf("non-CONTEXT: Responded with pval match %x\n", x); */ return item; } - + if (!return_on_context_match ) { /* printf("Descending into matching context %s\n", match_context); */ if ((x=match_pval(item->u2.statements))) /* if we're just searching for a context, don't bother descending into them */ { @@ -1638,7 +1638,7 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_PATTERN: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case @@ -1649,9 +1649,9 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_DEFAULT: - /* fields: + /* fields: item->u2.statements == pval list of statements under the case */ /* printf(" matching in DEFAULT\n"); */ @@ -1660,7 +1660,7 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_CATCH: /* fields: item->u1.str == name of extension to catch item->u2.statements == pval list of statements in context body @@ -1671,7 +1671,7 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_STATEMENTBLOCK: /* fields: item->u1.list == pval list of statements in block, one per entry in the list */ @@ -1681,19 +1681,19 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_LABEL: /* fields: item->u1.str == label name */ - /* printf("PV_LABEL %s (cont=%s, exten=%s\n", + /* printf("PV_LABEL %s (cont=%s, exten=%s\n", item->u1.str, current_context->u1.str, (current_extension?current_extension->u1.str:"<macro>"));*/ - + if (count_labels) { if (!strcmp(match_label, item->u1.str)) { label_count++; last_matched_label = item; } - + } else { if (!strcmp(match_label, item->u1.str)) { /* printf("LABEL: Responded with pval match %x\n", x); */ @@ -1701,7 +1701,7 @@ static struct pval *match_pval_item(pval *item) } } break; - + case PV_FOR: /* fields: item->u1.for_init == a string containing the initalizer item->u2.for_test == a string containing the loop test @@ -1715,7 +1715,7 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_WHILE: /* fields: item->u1.str == the while conditional, as supplied by user @@ -1727,7 +1727,7 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_RANDOM: /* fields: item->u1.str == the random number expression, as supplied by user @@ -1735,7 +1735,7 @@ static struct pval *match_pval_item(pval *item) item->u3.else_statements == a pval list of statements in the else (could be zero) fall thru to PV_IF */ - + case PV_IFTIME: /* fields: item->u1.list == the time values, 4 of them, as PV_WORD structs in a list @@ -1761,11 +1761,11 @@ static struct pval *match_pval_item(pval *item) } } break; - + case PV_SWITCH: /* fields: item->u1.str == the switch expression - item->u2.statements == a pval list of statements in the switch, + item->u2.statements == a pval list of statements in the switch, (will be case statements, most likely!) */ /* printf(" matching in SWITCH\n"); */ @@ -1774,7 +1774,7 @@ static struct pval *match_pval_item(pval *item) return x; } break; - + case PV_EXTENSION: /* fields: item->u1.str == the extension name, label, whatever it's called @@ -1821,7 +1821,7 @@ struct pval *match_pval(pval *item) for (i=item; i; i=i->next) { pval *x; /* printf(" -- match pval: item %d\n", i->type); */ - + if ((x = match_pval_item(i))) { /* printf("match_pval: returning x=%x\n", (int)x); */ return x; /* cut the search short */ @@ -1837,7 +1837,7 @@ int count_labels_in_current_context(char *label) count_labels = 1; return_on_context_match = 0; match_pval(current_context->u2.statements); - + return label_count; } #endif @@ -1847,17 +1847,17 @@ struct pval *find_first_label_in_current_context(char *label, pval *curr_cont) /* printf(" --- Got args %s, %s\n", exten, label); */ struct pval *ret; struct pval *p3; - + count_labels = 0; return_on_context_match = 0; match_context = "*"; match_exten = "*"; match_label = label; - + ret = match_pval(curr_cont); if (ret) return ret; - + /* the target of the goto could be in an included context!! Fancy that!! */ /* look for includes in the current context */ for (p3=curr_cont->u2.statements; p3; p3=p3->next) { @@ -1887,7 +1887,7 @@ struct pval *find_label_in_current_context(char *exten, char *label, pval *curr_ /* printf(" --- Got args %s, %s\n", exten, label); */ struct pval *ret; struct pval *p3; - + count_labels = 0; return_on_context_match = 0; match_context = "*"; @@ -1896,7 +1896,7 @@ struct pval *find_label_in_current_context(char *exten, char *label, pval *curr_ ret = match_pval(curr_cont->u2.statements); if (ret) return ret; - + /* the target of the goto could be in an included context!! Fancy that!! */ /* look for includes in the current context */ for (p3=curr_cont->u2.statements; p3; p3=p3->next) { @@ -1941,7 +1941,7 @@ static struct pval *find_label_in_current_db(const char *context, const char *ex match_context = context; match_exten = exten; match_label = label; - + return match_pval(current_db); } @@ -2003,12 +2003,12 @@ int option_matches_j( struct argdesc *should, pval *is, struct argapp *app) { struct argchoice *ac; char *opcop,*q,*p; - + switch (should->dtype) { case ARGD_OPTIONSET: if ( strstr(is->u1.str,"${") ) return 0; /* no checking anything if there's a var reference in there! */ - + opcop = ast_strdupa(is->u1.str); for (q=opcop;*q;q++) { /* erase the innards of X(innard) type arguments, so we don't get confused later */ @@ -2019,7 +2019,7 @@ int option_matches_j( struct argdesc *should, pval *is, struct argapp *app) q = p+1; } } - + for (ac=app->opts; ac; ac=ac->next) { if (strlen(ac->name)>1 && strchr(ac->name,'(') == 0 && strcmp(ac->name,is->u1.str) == 0) /* multichar option, no parens, and a match? */ return 0; @@ -2027,13 +2027,13 @@ int option_matches_j( struct argdesc *should, pval *is, struct argapp *app) for (ac=app->opts; ac; ac=ac->next) { if (strlen(ac->name)==1 || strchr(ac->name,'(')) { char *p = strchr(opcop,ac->name[0]); /* wipe out all matched options in the user-supplied string */ - + if (p && *p == 'j') { ast_log(LOG_ERROR, "Error: file %s, line %d-%d: The j option in the %s application call is not appropriate for AEL!\n", is->filename, is->startline, is->endline, app->name); errs++; } - + if (p) { *p = '+'; if (ac->name[1] == '(') { @@ -2058,14 +2058,14 @@ int option_matches_j( struct argdesc *should, pval *is, struct argapp *app) default: return 0; } - + } int option_matches( struct argdesc *should, pval *is, struct argapp *app) { struct argchoice *ac; char *opcop; - + switch (should->dtype) { case ARGD_STRING: if (is_empty(is->u1.str) && should->type == ARGD_REQUIRED) @@ -2073,21 +2073,21 @@ int option_matches( struct argdesc *should, pval *is, struct argapp *app) if (is->u1.str && strlen(is->u1.str) > 0) /* most will match */ return 1; break; - + case ARGD_INT: if (is_int(is->u1.str)) return 1; else return 0; break; - + case ARGD_FLOAT: if (is_float(is->u1.str)) return 1; else return 0; break; - + case ARGD_ENUM: if( !is->u1.str || strlen(is->u1.str) == 0 ) return 1; /* a null arg in the call will match an enum, I guess! */ @@ -2097,10 +2097,10 @@ int option_matches( struct argdesc *should, pval *is, struct argapp *app) } return 0; break; - + case ARGD_OPTIONSET: opcop = ast_strdupa(is->u1.str); - + for (ac=app->opts; ac; ac=ac->next) { if (strlen(ac->name)>1 && strchr(ac->name,'(') == 0 && strcmp(ac->name,is->u1.str) == 0) /* multichar option, no parens, and a match? */ return 1; @@ -2108,7 +2108,7 @@ int option_matches( struct argdesc *should, pval *is, struct argapp *app) for (ac=app->opts; ac; ac=ac->next) { if (strlen(ac->name)==1 || strchr(ac->name,'(')) { char *p = strchr(opcop,ac->name[0]); /* wipe out all matched options in the user-supplied string */ - + if (p) { *p = '+'; if (ac->name[1] == '(') { @@ -2139,7 +2139,7 @@ int check_app_args(pval* appcall, pval *arglist, struct argapp *app) struct argdesc *ad = app->args; pval *pa; int z; - + for (pa = arglist; pa; pa=pa->next) { if (!ad) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: Extra argument %s not in application call to %s !\n", @@ -2151,12 +2151,12 @@ int check_app_args(pval* appcall, pval *arglist, struct argapp *app) do { if ( ad->dtype == ARGD_VARARG ) /* once we hit the VARARG, all bets are off. Discontinue the comparisons */ break; - + z= option_matches( ad, pa, app); if (!z) { if ( !arglist ) arglist=appcall; - + if (ad->type == ARGD_REQUIRED) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: Required argument %s not in application call to %s !\n", arglist->filename, arglist->startline, arglist->endline, ad->dtype==ARGD_OPTIONSET?"options":ad->name, app->name); @@ -2173,7 +2173,7 @@ int check_app_args(pval* appcall, pval *arglist, struct argapp *app) /* any app nodes left, that are not optional? */ for ( ; ad; ad=ad->next) { if (ad->type == ARGD_REQUIRED && ad->dtype != ARGD_VARARG) { - if ( !arglist ) + if ( !arglist ) arglist=appcall; ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: Required argument %s not in application call to %s !\n", arglist->filename, arglist->startline, arglist->endline, ad->dtype==ARGD_OPTIONSET?"options":ad->name, app->name); @@ -2196,11 +2196,11 @@ void check_switch_expr(pval *item, struct argapp *apps) struct appsetvar *v,*v2; struct argchoice *c; pval *t; - + p = item->u1.str; while (p && *p && (*p == ' ' || *p == '\t' || *p == '$' || *p == '{' ) ) p++; - + buff1 = ast_strdupa(p); while (strlen(buff1) > 0 && ( buff1[strlen(buff1)-1] == '}' || buff1[strlen(buff1)-1] == ' ' || buff1[strlen(buff1)-1] == '\t')) @@ -2221,7 +2221,7 @@ void check_switch_expr(pval *item, struct argapp *apps) int def= 0; int pat = 0; int f1 = 0; - + /* first of all, does this switch have a default case ? */ for (t=item->u2.statements; t; t=t->next) { if (t->type == PV_DEFAULT) { @@ -2275,7 +2275,7 @@ void check_switch_expr(pval *item, struct argapp *apps) if (f1) break; } - + /* see if it sets the var */ if (!f1) { ast_log(LOG_WARNING,"Warning: file %s, line %d-%d: Couldn't find an application call in this extension that sets the expression (%s) value!\n", @@ -2286,7 +2286,7 @@ void check_switch_expr(pval *item, struct argapp *apps) #else pval *t,*tl=0,*p2; int def= 0; - + /* first of all, does this switch have a default case ? */ for (t=item->u2.statements; t; t=t->next) { if (t->type == PV_DEFAULT) { @@ -2299,7 +2299,7 @@ void check_switch_expr(pval *item, struct argapp *apps) return; /* if no default, warn and insert a default case at the end */ p2 = tl->next = calloc(1, sizeof(struct pval)); - + p2->type = PV_DEFAULT; p2->startline = tl->startline; p2->endline = tl->endline; @@ -2309,7 +2309,7 @@ void check_switch_expr(pval *item, struct argapp *apps) ast_log(LOG_WARNING,"Warning: file %s, line %d-%d: A default case was automatically added to the switch.\n", p2->filename, p2->startline, p2->endline); warns++; - + #endif } @@ -2336,7 +2336,7 @@ static void check_abstract_reference(pval *abstract_context) { pval *i,*j; /* find some context includes that reference this context */ - + /* otherwise, print out a warning */ for (i=current_db; i; i=i->next) { @@ -2371,13 +2371,13 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) char errmsg[4096]; char *strp; - + switch (item->type) { case PV_WORD: /* fields: item->u1.str == string associated with this (word). item->u2.arglist == pval list of 4 PV_WORD elements for time values (only in PV_INCLUDES) */ break; - + case PV_MACRO: /* fields: item->u1.str == name of macro item->u2.arglist == pval list of PV_WORD arguments of macro, as given by user @@ -2391,13 +2391,13 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) current_extension = 0; check_macro_returns(item); - + for (lp=item->u2.arglist; lp; lp=lp->next) { - + } check_pval(item->u3.macro_statements, apps,in_globals); break; - + case PV_CONTEXT: /* fields: item->u1.str == name of context item->u2.statements == pval list of statements in context body @@ -2412,7 +2412,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) in_abstract_context = 0; check_pval(item->u2.statements, apps,in_globals); break; - + case PV_MACRO_CALL: /* fields: item->u1.str == name of macro to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -2420,7 +2420,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) item->u2.arglist->next == next arg */ #ifdef STANDALONE - /* if this is a standalone, we will need to make sure the + /* if this is a standalone, we will need to make sure the localized load of extensions.conf is done */ if (!extensions_dot_conf_loaded) { localized_pbx_load_module(); @@ -2435,14 +2435,14 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) /* look for the macro in the extensions.conf world */ pbx_find_extension(NULL, NULL, &pfiq, item->u1.str, "s", 1, NULL, NULL, E_MATCH); - + if (pfiq.status != STATUS_SUCCESS) { char namebuf2[256]; snprintf(namebuf2, 256, "macro-%s", item->u1.str); - + /* look for the macro in the extensions.conf world */ pbx_find_extension(NULL, NULL, &pfiq2, namebuf2, "s", 1, NULL, NULL, E_MATCH); - + if (pfiq2.status == STATUS_SUCCESS) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: macro call to non-existent %s! (macro-%s was found in the extensions.conf stuff, but we are using gosubs!)\n", item->filename, item->startline, item->endline, item->u1.str, item->u1.str); @@ -2457,7 +2457,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: macro call to %s cannot be found in the AEL code!\n", item->filename, item->startline, item->endline, item->u1.str); warns++; - + #endif #ifdef THIS_IS_1DOT4 char namebuf2[256]; @@ -2465,13 +2465,13 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) /* look for the macro in the extensions.conf world */ pbx_find_extension(NULL, NULL, &pfiq, namebuf2, "s", 1, NULL, NULL, E_MATCH); - + if (pfiq.status != STATUS_SUCCESS) { ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: macro call to %s was not found in the AEL, nor the extensions.conf !\n", item->filename, item->startline, item->endline, item->u1.str); warns++; } - + #endif } else if (macro_def->type != PV_MACRO) { @@ -2482,7 +2482,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) /* macro_def is a MACRO, so do the args match in number? */ int hereargs = 0; int thereargs = 0; - + for (lp=item->u2.arglist; lp; lp=lp->next) { hereargs++; } @@ -2496,7 +2496,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) } } break; - + case PV_APPLICATION_CALL: /* fields: item->u1.str == name of application to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -2539,7 +2539,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) free(item->u1.str); item->u1.str = 0; } - + #ifdef AAL_ARGCHECK found = 0; for (app=apps; app; app=app->next) { @@ -2556,7 +2556,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_app_args(item, item->u2.arglist, app); #endif break; - + case PV_CASE: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case @@ -2565,44 +2565,44 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) /* find the last statement */ check_pval(item->u2.statements, apps,in_globals); break; - + case PV_PATTERN: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case */ /* Make sure sequence of statements under case is terminated with goto, return, or break */ /* find the last statement */ - + check_pval(item->u2.statements, apps,in_globals); break; - + case PV_DEFAULT: - /* fields: + /* fields: item->u2.statements == pval list of statements under the case */ check_pval(item->u2.statements, apps,in_globals); break; - + case PV_CATCH: /* fields: item->u1.str == name of extension to catch item->u2.statements == pval list of statements in context body */ check_pval(item->u2.statements, apps,in_globals); break; - + case PV_SWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ check_pval(item->u1.list, apps,in_globals); break; - + case PV_ESWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ check_pval(item->u1.list, apps,in_globals); break; - + case PV_INCLUDES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ @@ -2618,20 +2618,20 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_day(lp->u2.arglist->next->next); check_month(lp->u2.arglist->next->next->next); } - + if (that_context) { find_pval_gotos(that_context->u2.statements,0); - + } } break; - + case PV_STATEMENTBLOCK: /* fields: item->u1.list == pval list of statements in block, one per entry in the list */ check_pval(item->u1.list, apps,in_globals); break; - + case PV_VARDEC: /* fields: item->u1.str == variable name item->u2.val == variable value to assign @@ -2650,7 +2650,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_expr2_input(item,item->u2.val); } break; - + case PV_LOCALVARDEC: /* fields: item->u1.str == variable name item->u2.val == variable value to assign @@ -2667,7 +2667,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) } check_expr2_input(item,item->u2.val); break; - + case PV_GOTO: /* fields: item->u1.list == pval list of PV_WORD target names, up to 3, in order as given by user. item->u1.list->u1.str == where the data on a PV_WORD will always be. @@ -2675,10 +2675,10 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) /* don't check goto's in abstract contexts */ if ( in_abstract_context ) break; - + check_goto(item); break; - + case PV_LABEL: /* fields: item->u1.str == label name */ @@ -2690,7 +2690,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_label(item); break; - + case PV_FOR: /* fields: item->u1.for_init == a string containing the initalizer item->u2.for_test == a string containing the loop test @@ -2722,11 +2722,11 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) } check_expr2_input(item,item->u2.for_test); check_expr2_input(item,item->u3.for_inc); - + ast_expr_clear_extra_error_info(); check_pval(item->u4.for_statements, apps,in_globals); break; - + case PV_WHILE: /* fields: item->u1.str == the while conditional, as supplied by user @@ -2744,24 +2744,24 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_expr2_input(item,item->u1.str); check_pval(item->u2.statements, apps,in_globals); break; - + case PV_BREAK: /* fields: none */ check_break(item); break; - + case PV_RETURN: /* fields: none */ break; - + case PV_CONTINUE: /* fields: none */ check_continue(item); break; - + case PV_RANDOM: /* fields: item->u1.str == the random number expression, as supplied by user @@ -2786,7 +2786,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) break; case PV_IFTIME: - /* fields: item->u1.list == the if time values, 4 of them, each in PV_WORD, linked list + /* fields: item->u1.list == the if time values, 4 of them, each in PV_WORD, linked list item->u2.statements == a pval list of statements in the if () item->u3.else_statements == a pval list of statements in the else @@ -2804,7 +2804,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_pval(item->u3.else_statements, apps,in_globals); } break; - + case PV_IF: /* fields: item->u1.str == the if conditional, as supplied by user @@ -2827,11 +2827,11 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_pval(item->u3.else_statements, apps,in_globals); } break; - + case PV_SWITCH: /* fields: item->u1.str == the switch expression - item->u2.statements == a pval list of statements in the switch, + item->u2.statements == a pval list of statements in the switch, (will be case statements, most likely!) */ /* we can check the switch expression, see if it matches any of the app variables... @@ -2839,7 +2839,7 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) check_switch_expr(item, apps); check_pval(item->u2.statements, apps,in_globals); break; - + case PV_EXTENSION: /* fields: item->u1.str == the extension name, label, whatever it's called @@ -2848,15 +2848,15 @@ void check_pval_item(pval *item, struct argapp *apps, int in_globals) item->u4.regexten == an int boolean. non-zero says that regexten was specified */ current_extension = item ; - + check_pval(item->u2.statements, apps,in_globals); break; - + case PV_IGNOREPAT: /* fields: item->u1.str == the ignorepat data */ break; - + case PV_GLOBALS: /* fields: item->u1.statements == pval list of statements, usually vardecs */ @@ -2873,16 +2873,16 @@ void check_pval(pval *item, struct argapp *apps, int in_globals) pval *i; /* checks to do: - 1. Do goto's point to actual labels? + 1. Do goto's point to actual labels? 2. Do macro calls reference a macro? 3. Does the number of macro args match the definition? 4. Is a macro call missing its & at the front? 5. Application calls-- we could check syntax for existing applications, but I need some sort of universal description bnf for a general - sort of method for checking arguments, in number, maybe even type, at least. + sort of method for checking arguments, in number, maybe even type, at least. Don't want to hand code checks for hundreds of applications. */ - + for (i=item; i; i=i->next) { check_pval_item(i,apps,in_globals); } @@ -2890,7 +2890,7 @@ void check_pval(pval *item, struct argapp *apps, int in_globals) void ael2_semantic_check(pval *item, int *arg_errs, int *arg_warns, int *arg_notes) { - + #ifdef AAL_ARGCHECK int argapp_errs =0; char *rfilename; @@ -2902,7 +2902,7 @@ void ael2_semantic_check(pval *item, int *arg_errs, int *arg_warns, int *arg_not #ifdef AAL_ARGCHECK rfilename = ast_alloca(10 + strlen(ast_config_AST_VAR_DIR)); sprintf(rfilename, "%s/applist", ast_config_AST_VAR_DIR); - + apps = argdesc_parse(rfilename, &argapp_errs); /* giveth */ #endif current_db = item; @@ -2942,7 +2942,7 @@ struct ael_extension *new_exten(void) void linkprio(struct ael_extension *exten, struct ael_priority *prio, struct ael_extension *mother_exten) { char *p1, *p2; - + if (!exten->plist) { exten->plist = prio; exten->plist_last = prio; @@ -2952,7 +2952,7 @@ void linkprio(struct ael_extension *exten, struct ael_priority *prio, struct ael } if( !prio->exten ) prio->exten = exten; /* don't override the switch value */ - /* The following code will cause all priorities within an extension + /* The following code will cause all priorities within an extension to have ${EXTEN} or ${EXTEN: replaced with ~~EXTEN~~, which is set just before the first switch in an exten. The switches will muck up the original ${EXTEN} value, so we save it away @@ -2986,17 +2986,17 @@ void destroy_extensions(struct ael_extension *exten) struct ael_extension *ne, *nen; for (ne=exten; ne; ne=nen) { struct ael_priority *pe, *pen; - + if (ne->name) free(ne->name); - + /* cidmatch fields are allocated with name, and freed when the name field is freed. Don't do a free for this field, unless you LIKE to see a crash! */ if (ne->hints) free(ne->hints); - + for (pe=ne->plist; pe; pe=pen) { pen = pe->next; if (pe->app) @@ -3024,7 +3024,7 @@ void destroy_extensions(struct ael_extension *exten) static int label_inside_case(pval *label) { pval *p = label; - + while( p && p->type != PV_MACRO && p->type != PV_CONTEXT ) /* early cutout, sort of */ { if( p->type == PV_CASE || p->type == PV_DEFAULT || p->type == PV_PATTERN ) { return 1; @@ -3099,11 +3099,11 @@ int find_switch_item(pval *item) case PV_LOCALVARDEC: /* fields: item->u1.str == string associated with this (word). */ break; - + case PV_WORD: /* fields: item->u1.str == string associated with this (word). */ break; - + case PV_MACRO: /* fields: item->u1.str == name of macro item->u2.arglist == pval list of PV_WORD arguments of macro, as given by user @@ -3116,7 +3116,7 @@ int find_switch_item(pval *item) if (contains_switch(item->u3.macro_statements)) return 1; break; - + case PV_CONTEXT: /* fields: item->u1.str == name of context item->u2.statements == pval list of statements in context body @@ -3126,7 +3126,7 @@ int find_switch_item(pval *item) if (contains_switch(item->u2.statements)) return 1; break; - + case PV_MACRO_CALL: /* fields: item->u1.str == name of macro to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -3134,7 +3134,7 @@ int find_switch_item(pval *item) item->u2.arglist->next == next arg */ break; - + case PV_APPLICATION_CALL: /* fields: item->u1.str == name of application to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -3142,7 +3142,7 @@ int find_switch_item(pval *item) item->u2.arglist->next == next arg */ break; - + case PV_CASE: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case @@ -3151,7 +3151,7 @@ int find_switch_item(pval *item) if (contains_switch(item->u2.statements)) return 1; break; - + case PV_PATTERN: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case @@ -3160,16 +3160,16 @@ int find_switch_item(pval *item) if (contains_switch(item->u2.statements)) return 1; break; - + case PV_DEFAULT: - /* fields: + /* fields: item->u2.statements == pval list of statements under the case */ /* had better not see this */ if (contains_switch(item->u2.statements)) return 1; break; - + case PV_CATCH: /* fields: item->u1.str == name of extension to catch item->u2.statements == pval list of statements in context body @@ -3178,47 +3178,47 @@ int find_switch_item(pval *item) if (contains_switch(item->u2.statements)) return 1; break; - + case PV_SWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ break; - + case PV_ESWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ break; - + case PV_INCLUDES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list item->u2.arglist == pval list of 4 PV_WORD elements for time values */ break; - + case PV_STATEMENTBLOCK: /* fields: item->u1.list == pval list of statements in block, one per entry in the list */ if (contains_switch(item->u1.list) ) return 1; break; - + case PV_VARDEC: /* fields: item->u1.str == variable name item->u2.val == variable value to assign */ break; - + case PV_GOTO: /* fields: item->u1.list == pval list of PV_WORD target names, up to 3, in order as given by user. item->u1.list->u1.str == where the data on a PV_WORD will always be. */ break; - + case PV_LABEL: /* fields: item->u1.str == label name */ break; - + case PV_FOR: /* fields: item->u1.for_init == a string containing the initalizer item->u2.for_test == a string containing the loop test @@ -3229,7 +3229,7 @@ int find_switch_item(pval *item) if (contains_switch(item->u4.for_statements)) return 1; break; - + case PV_WHILE: /* fields: item->u1.str == the while conditional, as supplied by user @@ -3238,22 +3238,22 @@ int find_switch_item(pval *item) if (contains_switch(item->u2.statements)) return 1; break; - + case PV_BREAK: /* fields: none */ break; - + case PV_RETURN: /* fields: none */ break; - + case PV_CONTINUE: /* fields: none */ break; - + case PV_IFTIME: /* fields: item->u1.list == there are 4 linked PV_WORDs here. @@ -3268,7 +3268,7 @@ int find_switch_item(pval *item) return 1; } break; - + case PV_RANDOM: /* fields: item->u1.str == the random number expression, as supplied by user @@ -3283,7 +3283,7 @@ int find_switch_item(pval *item) return 1; } break; - + case PV_IF: /* fields: item->u1.str == the if conditional, as supplied by user @@ -3298,16 +3298,16 @@ int find_switch_item(pval *item) return 1; } break; - + case PV_SWITCH: /* fields: item->u1.str == the switch expression - item->u2.statements == a pval list of statements in the switch, + item->u2.statements == a pval list of statements in the switch, (will be case statements, most likely!) */ return 1; /* JACKPOT */ break; - + case PV_EXTENSION: /* fields: item->u1.str == the extension name, label, whatever it's called @@ -3318,12 +3318,12 @@ int find_switch_item(pval *item) if (contains_switch(item->u2.statements)) return 1; break; - + case PV_IGNOREPAT: /* fields: item->u1.str == the ignorepat data */ break; - + case PV_GLOBALS: /* fields: item->u1.statements == pval list of statements, usually vardecs */ @@ -3335,7 +3335,7 @@ int find_switch_item(pval *item) int contains_switch(pval *item) { pval *i; - + for (i=item; i; i=i->next) { if (find_switch_item(i)) return 1; @@ -3375,7 +3375,7 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, if (!(new_label = malloc(BUF_SIZE))) { return -1; } - + if ((mother_exten && !mother_exten->checked_switch) || (exten && !exten->checked_switch)) { if (contains_switch(statement)) { /* only run contains_switch if you haven't checked before */ if (mother_exten) { @@ -3461,7 +3461,7 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, pr->origin = p; linkprio(exten, pr, mother_exten); break; - + case PV_GOTO: pr = new_prio(); pr->type = AEL_APPCALL; @@ -3469,22 +3469,22 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, if( p->u2.goto_target ) { p->u3.goto_target_in_case = label_inside_case(p->u2.goto_target); } - + if (!p->u1.list->next) /* just one */ { pr->app = strdup("Goto"); if (!mother_exten) pr->appargs = strdup(p->u1.list->u1.str); - else { /* for the case of simple within-extension gotos in case/pattern/default statement blocks: */ + else { /* for the case of simple within-extension gotos in case/pattern/default statement blocks: */ snprintf(buf1, BUF_SIZE, "%s,%s", mother_exten->name, p->u1.list->u1.str); pr->appargs = strdup(buf1); } - + } else if (p->u1.list->next && !p->u1.list->next->next) /* two */ { snprintf(buf1, BUF_SIZE, "%s,%s", p->u1.list->u1.str, p->u1.list->next->u1.str); pr->app = strdup("Goto"); pr->appargs = strdup(buf1); } else if (p->u1.list->next && p->u1.list->next->next) { - snprintf(buf1, BUF_SIZE, "%s,%s,%s", p->u1.list->u1.str, + snprintf(buf1, BUF_SIZE, "%s,%s,%s", p->u1.list->u1.str, p->u1.list->next->u1.str, p->u1.list->next->next->u1.str); pr->app = strdup("Goto"); @@ -3519,7 +3519,7 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, for_loop->type = AEL_CONTROL1; /* simple goto */ for_end->type = AEL_APPCALL; for_init->app = strdup("MSet"); - + strcpy(buf2,p->u1.for_init); remove_spaces_before_equals(buf2); strp = strchr(buf2, '='); @@ -3624,20 +3624,20 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, /* link & load! */ linkprio(exten, for_init, mother_exten); linkprio(exten, for_test, mother_exten); - + /* now, put the body of the for loop here */ exten->loop_break = for_end; exten->loop_continue = for_inc; - + if (gen_prios(exten, new_label, p->u4.for_statements, mother_exten, this_context)) { /* this will link in all the statements here */ return -1; } - + linkprio(exten, for_inc, mother_exten); linkprio(exten, for_loop, mother_exten); linkprio(exten, for_end, mother_exten); - - + + exten->loop_break = loop_break_save; exten->loop_continue = loop_continue_save; for_loop->origin = p; @@ -3664,19 +3664,19 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, while_end->appargs = strdup(buf1); linkprio(exten, while_test, mother_exten); - + /* now, put the body of the for loop here */ exten->loop_break = while_end; exten->loop_continue = while_test; - + if (gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context)) { /* this will link in all the while body statements here */ return -1; } linkprio(exten, while_loop, mother_exten); linkprio(exten, while_end, mother_exten); - - + + exten->loop_break = loop_break_save; exten->loop_continue = loop_continue_save; while_loop->origin = p; @@ -3703,11 +3703,11 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, linkprio(exten, switch_test, mother_exten); linkprio(exten, switch_end, mother_exten); - + exten->loop_break = switch_end; exten->loop_continue = 0; default_exists = 0; - + for (p2=p->u2.statements; p2; p2=p2->next) { /* now, for each case/default put the body of the for loop here */ if (p2->type == PV_CASE) { @@ -3726,12 +3726,12 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, /* the break/continue locations are inherited from parent */ switch_case->loop_break = exten->loop_break; switch_case->loop_continue = exten->loop_continue; - + linkexten(exten,switch_case); snprintf(buf1, BUF_SIZE, "sw_%d_%s", local_control_statement_count, p2->u1.str); switch_case->name = strdup(buf1); snprintf(new_label, BUF_SIZE, "sw_%s_%s_%d", label, p2->u1.str, local_control_statement_count); - + if (gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context)) { /* this will link in all the case body statements here */ return -1; } @@ -3870,7 +3870,7 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, } switch_case->context = this_context; switch_case->is_switch = 1; - + /* new: the default case intros a pattern with ., which covers ALMOST everything. but it doesn't cover a NULL pattern. So, we'll define a null extension to match that goto's the default extension. */ @@ -3904,13 +3904,13 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, linkexten(exten,switch_case); snprintf(buf1, BUF_SIZE, "_sw_%d_.", local_control_statement_count); switch_case->name = strdup(buf1); - + snprintf(new_label, BUF_SIZE, "sw_%s_default_%d", label, local_control_statement_count); - + if (gen_prios(switch_case, new_label, p2->u2.statements, exten, this_context)) { /* this will link in all the default: body statements here */ return -1; } - + /* here is where we write code to "fall thru" to the next case... if there is one... */ for (p3=p2->u2.statements; p3; p3=p3->next) { if (!p3->next) @@ -3963,7 +3963,7 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, /* what could it be??? */ } } - + exten->loop_break = loop_break_save; exten->loop_continue = loop_continue_save; switch_test->origin = p; @@ -4038,13 +4038,13 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, case PV_IFTIME: control_statement_count++; snprintf(new_label, BUF_SIZE, "iftime_%s_%d", label, control_statement_count); - + if_test = new_prio(); if_test->type = AEL_IFTIME_CONTROL; snprintf(buf1, BUF_SIZE, "%s,%s,%s,%s", - p->u1.list->u1.str, - p->u1.list->next->u1.str, - p->u1.list->next->next->u1.str, + p->u1.list->u1.str, + p->u1.list->next->u1.str, + p->u1.list->next->next->u1.str, p->u1.list->next->next->next->u1.str); if_test->app = 0; if_test->appargs = strdup(buf1); @@ -4075,33 +4075,33 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, } else { if_false->goto_true = if_end; } - + /* link & load! */ linkprio(exten, if_test, mother_exten); linkprio(exten, if_false, mother_exten); - + /* now, put the body of the if here */ - + if (gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context)) { /* this will link in all the statements here */ return -1; } - + if (p->u3.else_statements) { linkprio(exten, if_skip, mother_exten); if (gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context)) { /* this will link in all the statements here */ return -1; } } - + linkprio(exten, if_end, mother_exten); - + break; case PV_RANDOM: case PV_IF: control_statement_count++; snprintf(new_label, BUF_SIZE, "if_%s_%d", label, control_statement_count); - + if_test = new_prio(); if_end = new_prio(); if_test->type = AEL_IF_CONTROL; @@ -4116,7 +4116,7 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, if_end->app = strdup("NoOp"); if_end->appargs = strdup(buf1); if_test->origin = p; - + if (p->u3.else_statements) { if_skip = new_prio(); if_skip->type = AEL_CONTROL1; /* simple goto */ @@ -4126,25 +4126,25 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, if_skip = 0; if_test->goto_false = if_end;; } - + /* link & load! */ linkprio(exten, if_test, mother_exten); - + /* now, put the body of the if here */ - + if (gen_prios(exten, new_label, p->u2.statements, mother_exten, this_context)) { /* this will link in all the statements here */ return -1; } - + if (p->u3.else_statements) { linkprio(exten, if_skip, mother_exten); if (gen_prios(exten, new_label, p->u3.else_statements, mother_exten, this_context)) { /* this will link in all the statements here */ return -1; } } - + linkprio(exten, if_end, mother_exten); - + break; case PV_STATEMENTBLOCK: @@ -4166,12 +4166,12 @@ static int gen_prios(struct ael_extension *exten, char *label, pval *statement, switch_case->has_switch = exten->has_switch; switch_case->checked_switch = exten->checked_switch; } - + switch_case->context = this_context; linkexten(exten,switch_case); switch_case->name = strdup(p->u1.str); snprintf(new_label, BUF_SIZE, "catch_%s_%d",p->u1.str, control_statement_count); - + if (gen_prios(switch_case, new_label, p->u2.statements, mother_exten,this_context)) { /* this will link in all the catch body statements here */ return -1; } @@ -4205,17 +4205,17 @@ void set_priorities(struct ael_extension *exten) i=2; else i=1; - + for (pr=exten->plist; pr; pr=pr->next) { pr->priority_num = i; - + if (!pr->origin || (pr->origin && pr->origin->type != PV_LABEL) ) /* Labels don't show up in the dialplan, but we want them to point to the right priority, which would be the next line after the label; */ i++; } - + exten = exten->next_exten; } while ( exten ); } @@ -4231,16 +4231,16 @@ void add_extensions(struct ael_extension *exten) } do { struct ael_priority *last = 0; - + pbx_substitute_variables_helper(NULL, exten->name, realext, sizeof(realext) - 1); if (exten->hints) { - if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, PRIORITY_HINT, NULL, exten->cidmatch, + if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, PRIORITY_HINT, NULL, exten->cidmatch, exten->hints, NULL, ast_free_ptr, registrar)) { ast_log(LOG_WARNING, "Unable to add step at priority 'hint' of extension '%s'\n", exten->name); } } - + for (pr=exten->plist; pr; pr=pr->next) { char app[2000]; char appargs[2000]; @@ -4252,7 +4252,7 @@ void add_extensions(struct ael_extension *exten) last = pr; continue; } - + if (pr->app) strcpy(app, pr->app); else @@ -4265,7 +4265,7 @@ void add_extensions(struct ael_extension *exten) case AEL_APPCALL: /* easy case. Everything is all set up */ break; - + case AEL_CONTROL1: /* FOR loop, WHILE loop, BREAK, CONTINUE, IF, IFTIME */ /* simple, unconditional goto. */ strcpy(app,"Goto"); @@ -4276,12 +4276,12 @@ void add_extensions(struct ael_extension *exten) } else snprintf(appargs,sizeof(appargs),"%d", pr->goto_true->priority_num); break; - + case AEL_FOR_CONTROL: /* WHILE loop test, FOR loop test */ strcpy(app,"GotoIf"); snprintf(appargs,sizeof(appargs),"%s?%d:%d", pr->appargs, pr->priority_num+1, pr->goto_false->priority_num); break; - + case AEL_IF_CONTROL: strcpy(app,"GotoIf"); if (pr->origin->u3.else_statements ) @@ -4304,7 +4304,7 @@ void add_extensions(struct ael_extension *exten) strcpy(app,"Return"); appargs[0] = 0; break; - + default: break; } @@ -4313,10 +4313,10 @@ void add_extensions(struct ael_extension *exten) } else label = 0; - - if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, pr->priority_num, (label?label:NULL), exten->cidmatch, + + if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, pr->priority_num, (label?label:NULL), exten->cidmatch, app, strdup(appargs), ast_free_ptr, registrar)) { - ast_log(LOG_WARNING, "Unable to add step at priority '%d' of extension '%s'\n", pr->priority_num, + ast_log(LOG_WARNING, "Unable to add step at priority '%d' of extension '%s'\n", pr->priority_num, exten->name); } last = pr; @@ -4334,7 +4334,7 @@ static void attach_exten(struct ael_extension **list, struct ael_extension *newm return; } lptr = *list; - + while( lptr->next_exten ) { lptr = lptr->next_exten; } @@ -4345,20 +4345,20 @@ static void attach_exten(struct ael_extension **list, struct ael_extension *newm static pval *get_extension_or_contxt(pval *p) { while( p && p->type != PV_EXTENSION && p->type != PV_CONTEXT && p->type != PV_MACRO ) { - + p = p->dad; } - + return p; } static pval *get_contxt(pval *p) { while( p && p->type != PV_CONTEXT && p->type != PV_MACRO ) { - + p = p->dad; } - + return p; } @@ -4369,9 +4369,9 @@ static void fix_gotos_in_extensions(struct ael_extension *exten) struct ael_priority *p; for(p=e->plist;p;p=p->next) { - + if( p->origin && p->origin->type == PV_GOTO && p->origin->u3.goto_target_in_case ) { - + /* fix the extension of the goto target to the actual extension in the post-compiled dialplan */ pval *target = p->origin->u2.goto_target; @@ -4379,24 +4379,24 @@ static void fix_gotos_in_extensions(struct ael_extension *exten) pval *pv2 = p->origin; char buf1[500]; char *apparg_save = p->appargs; - + p->appargs = 0; if (!pv2->u1.list->next) /* just one -- it won't hurt to repeat the extension */ { snprintf(buf1,sizeof(buf1),"%s,%s", z->name, pv2->u1.list->u1.str); p->appargs = strdup(buf1); - + } else if (pv2->u1.list->next && !pv2->u1.list->next->next) /* two */ { snprintf(buf1,sizeof(buf1),"%s,%s", z->name, pv2->u1.list->next->u1.str); p->appargs = strdup(buf1); } else if (pv2->u1.list->next && pv2->u1.list->next->next) { - snprintf(buf1,sizeof(buf1),"%s,%s,%s", pv2->u1.list->u1.str, + snprintf(buf1,sizeof(buf1),"%s,%s,%s", pv2->u1.list->u1.str, z->name, pv2->u1.list->next->next->u1.str); p->appargs = strdup(buf1); } else printf("WHAT? The goto doesn't fall into one of three cases for GOTO????\n"); - + if( apparg_save ) { free(apparg_save); } @@ -4447,12 +4447,12 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo for (p=root; p; p=p->next ) { pval *lp; int argc; - + switch (p->type) { case PV_MACRO: - + context = ast_context_find_or_create(local_contexts, local_table, p->u1.str, registrar); - + exten = new_exten(); exten->context = context; exten->name = strdup("~~s~~"); @@ -4467,7 +4467,7 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo np2->appargs = strdup(buf); linkprio(exten, np2, NULL); } - + /* CONTAINS APPCALLS, CATCH, just like extensions... */ if (gen_prios(exten, p->u1.str, p->u3.macro_statements, 0, context)) { return -1; @@ -4481,35 +4481,35 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo linkprio(exten, np2, NULL); exten-> return_target = np2; } - + set_priorities(exten); attach_exten(&exten_list, exten); break; - + case PV_GLOBALS: /* already done */ break; - + case PV_CONTEXT: context = ast_context_find_or_create(local_contexts, local_table, p->u1.str, registrar); - + /* contexts contain: ignorepat, includes, switches, eswitches, extensions, */ for (p2=p->u2.statements; p2; p2=p2->next) { pval *p3; char *s3; - + switch (p2->type) { case PV_EXTENSION: exten = new_exten(); exten->name = strdup(p2->u1.str); exten->context = context; - + if( (s3=strchr(exten->name, '/') ) != 0 ) { *s3 = 0; exten->cidmatch = s3+1; } - + if ( p2->u3.hints ) exten->hints = strdup(p2->u3.hints); exten->regexten = p2->u4.regexten; @@ -4538,15 +4538,15 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo set_priorities(exten); attach_exten(&exten_list, exten); break; - + case PV_IGNOREPAT: ast_context_add_ignorepat2(context, p2->u1.str, registrar); break; - + case PV_INCLUDES: for (p3 = p2->u1.list; p3 ;p3=p3->next) { if ( p3->u2.arglist ) { - snprintf(buf,sizeof(buf), "%s,%s,%s,%s,%s", + snprintf(buf,sizeof(buf), "%s,%s,%s,%s,%s", p3->u1.str, p3->u2.arglist->u1.str, p3->u2.arglist->next->u1.str, @@ -4557,7 +4557,7 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo ast_context_add_include2(context, p3->u1.str, registrar); } break; - + case PV_SWITCHES: for (p3 = p2->u1.list; p3 ;p3=p3->next) { char *c = strchr(p3->u1.str, '/'); @@ -4587,13 +4587,13 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo break; } } - + break; - + default: /* huh? what? */ break; - + } } @@ -4667,7 +4667,7 @@ int ast_compile_ael2(struct ast_context **local_contexts, struct ast_hashtab *lo fix_gotos_in_extensions(exten_list); /* find and fix extension ref in gotos to labels that are in case statements */ add_extensions(exten_list); /* actually makes calls to create priorities in ast_contexts -- feeds dialplan to asterisk */ destroy_extensions(exten_list); /* all that remains is an empty husk, discard of it as is proper */ - + return 0; } @@ -4685,7 +4685,7 @@ void destroy_pval_item(pval *item) if (item->filename) free(item->filename); - + switch (item->type) { case PV_WORD: /* fields: item->u1.str == string associated with this (word). */ @@ -4694,7 +4694,7 @@ void destroy_pval_item(pval *item) if ( item->u2.arglist ) destroy_pval(item->u2.arglist); break; - + case PV_MACRO: /* fields: item->u1.str == name of macro item->u2.arglist == pval list of PV_WORD arguments of macro, as given by user @@ -4708,7 +4708,7 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u3.macro_statements); break; - + case PV_CONTEXT: /* fields: item->u1.str == name of context item->u2.statements == pval list of statements in context body @@ -4718,7 +4718,7 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u2.statements); break; - + case PV_MACRO_CALL: /* fields: item->u1.str == name of macro to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -4729,7 +4729,7 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u2.arglist); break; - + case PV_APPLICATION_CALL: /* fields: item->u1.str == name of application to call item->u2.arglist == pval list of PV_WORD arguments of macro call, as given by user @@ -4740,7 +4740,7 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u2.arglist); break; - + case PV_CASE: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case @@ -4749,7 +4749,7 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u2.statements); break; - + case PV_PATTERN: /* fields: item->u1.str == value of case item->u2.statements == pval list of statements under the case @@ -4758,14 +4758,14 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u2.statements); break; - + case PV_DEFAULT: - /* fields: + /* fields: item->u2.statements == pval list of statements under the case */ destroy_pval(item->u2.statements); break; - + case PV_CATCH: /* fields: item->u1.str == name of extension to catch item->u2.statements == pval list of statements in context body @@ -4774,32 +4774,32 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u2.statements); break; - + case PV_SWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ destroy_pval(item->u1.list); break; - + case PV_ESWITCHES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list */ destroy_pval(item->u1.list); break; - + case PV_INCLUDES: /* fields: item->u1.list == pval list of PV_WORD elements, one per entry in the list item->u2.arglist == pval list of 4 PV_WORD elements for time values */ destroy_pval(item->u1.list); break; - + case PV_STATEMENTBLOCK: /* fields: item->u1.list == pval list of statements in block, one per entry in the list */ destroy_pval(item->u1.list); break; - + case PV_LOCALVARDEC: case PV_VARDEC: /* fields: item->u1.str == variable name @@ -4810,22 +4810,22 @@ void destroy_pval_item(pval *item) if (item->u2.val) free(item->u2.val); break; - + case PV_GOTO: /* fields: item->u1.list == pval list of PV_WORD target names, up to 3, in order as given by user. item->u1.list->u1.str == where the data on a PV_WORD will always be. */ - + destroy_pval(item->u1.list); break; - + case PV_LABEL: /* fields: item->u1.str == label name */ if (item->u1.str) free(item->u1.str); break; - + case PV_FOR: /* fields: item->u1.for_init == a string containing the initalizer item->u2.for_test == a string containing the loop test @@ -4841,7 +4841,7 @@ void destroy_pval_item(pval *item) free(item->u3.for_inc); destroy_pval(item->u4.for_statements); break; - + case PV_WHILE: /* fields: item->u1.str == the while conditional, as supplied by user @@ -4851,22 +4851,22 @@ void destroy_pval_item(pval *item) free(item->u1.str); destroy_pval(item->u2.statements); break; - + case PV_BREAK: /* fields: none */ break; - + case PV_RETURN: /* fields: none */ break; - + case PV_CONTINUE: /* fields: none */ break; - + case PV_IFTIME: /* fields: item->u1.list == the 4 time values, in PV_WORD structs, linked list @@ -4880,7 +4880,7 @@ void destroy_pval_item(pval *item) destroy_pval(item->u3.else_statements); } break; - + case PV_RANDOM: /* fields: item->u1.str == the random percentage, as supplied by user @@ -4902,18 +4902,18 @@ void destroy_pval_item(pval *item) destroy_pval(item->u3.else_statements); } break; - + case PV_SWITCH: /* fields: item->u1.str == the switch expression - item->u2.statements == a pval list of statements in the switch, + item->u2.statements == a pval list of statements in the switch, (will be case statements, most likely!) */ if (item->u1.str) free(item->u1.str); destroy_pval(item->u2.statements); break; - + case PV_EXTENSION: /* fields: item->u1.str == the extension name, label, whatever it's called @@ -4927,14 +4927,14 @@ void destroy_pval_item(pval *item) free(item->u3.hints); destroy_pval(item->u2.statements); break; - + case PV_IGNOREPAT: /* fields: item->u1.str == the ignorepat data */ if (item->u1.str) free(item->u1.str); break; - + case PV_GLOBALS: /* fields: item->u1.statements == pval list of statements, usually vardecs */ @@ -4944,13 +4944,13 @@ void destroy_pval_item(pval *item) free(item); } -void destroy_pval(pval *item) +void destroy_pval(pval *item) { pval *i,*nxt; - + for (i=item; i; i=nxt) { nxt = i->next; - + destroy_pval_item(i); } } @@ -5020,14 +5020,14 @@ int ael_is_funcname(char *name) int s,t; t = sizeof(ael_funclist)/sizeof(char*); s = 0; - while ((s < t) && strcasecmp(name, ael_funclist[s])) + while ((s < t) && strcasecmp(name, ael_funclist[s])) s++; if ( s < t ) return 1; else return 0; } -#endif +#endif /* PVAL PI */ @@ -5130,7 +5130,7 @@ void pvalMacroAddStatement( pval *p, pval *statement ) else linku1(p->u3.macro_statements, statement); - + } pval *pvalMacroWalkStatements( pval *p, pval **next_statement ) @@ -5534,35 +5534,35 @@ char* pvalVarDecGetValue( pval *p ) void pvalGotoSetTarget( pval *p, char *context, char *exten, char *label ) { pval *con, *ext, *pri; - + if (!pvalCheckType(p, "pvalGotoSetTarget", PV_GOTO)) return; if (context && strlen(context)) { con = pvalCreateNode(PV_WORD); ext = pvalCreateNode(PV_WORD); pri = pvalCreateNode(PV_WORD); - + con->u1.str = context; ext->u1.str = exten; pri->u1.str = label; - + con->next = ext; ext->next = pri; p->u1.list = con; } else if (exten && strlen(exten)) { ext = pvalCreateNode(PV_WORD); pri = pvalCreateNode(PV_WORD); - + ext->u1.str = exten; pri->u1.str = label; - + ext->next = pri; p->u1.list = ext; } else { pri = pvalCreateNode(PV_WORD); - + pri->u1.str = label; - + p->u1.list = pri; } } @@ -5575,7 +5575,7 @@ void pvalGotoGetTarget( pval *p, char **context, char **exten, char **label ) *context = p->u1.list->u1.str; *exten = p->u1.list->next->u1.str; *label = p->u1.list->next->next->u1.str; - + } else if (p->u1.list && p->u1.list->next ) { *exten = p->u1.list->u1.str; *label = p->u1.list->next->u1.str; @@ -5585,7 +5585,7 @@ void pvalGotoGetTarget( pval *p, char **context, char **exten, char **label ) *label = p->u1.list->u1.str; *context = 0; *exten = 0; - + } else { *context = 0; *exten = 0; @@ -5941,4 +5941,3 @@ pval * linku1(pval *head, pval *tail) } return head; } - diff --git a/res/ari/ari_model_validators.h b/res/ari/ari_model_validators.h index 403a5fb17..d40a8c9d6 100644 --- a/res/ari/ari_model_validators.h +++ b/res/ari/ari_model_validators.h @@ -148,7 +148,7 @@ int ast_ari_validate_list(struct ast_json *json, int (*fn)(struct ast_json *)); /*! @} */ /*! - * \brief Function type for validator functions. Allows for + * \brief Function type for validator functions. Allows for */ typedef int (*ari_validator)(struct ast_json *json); diff --git a/res/ari/ari_websockets.c b/res/ari/ari_websockets.c index 6a296dcf6..768e24e80 100644 --- a/res/ari/ari_websockets.c +++ b/res/ari/ari_websockets.c @@ -155,7 +155,7 @@ struct ast_json *ast_ari_websocket_session_read( "{" \ " \"error\": \"InvalidMessage\"," \ " \"message\": \"Message validation failed\"" \ - "}" + "}" int ast_ari_websocket_session_write(struct ast_ari_websocket_session *session, struct ast_json *message) diff --git a/res/ari/resource_events.c b/res/ari/resource_events.c index 028144676..fb996f798 100644 --- a/res/ari/resource_events.c +++ b/res/ari/resource_events.c @@ -128,7 +128,7 @@ static void app_handler(void *data, const char *app_name, if (!session) { return; } - + /* Determine if we've been replaced */ if (strcmp(msg_type, "ApplicationReplaced") == 0 && strcmp(msg_application, app_name) == 0) { @@ -339,4 +339,3 @@ void ast_ari_events_user_event(struct ast_variable *headers, "Error processing request"); } } - diff --git a/res/res_ael_share.c b/res/res_ael_share.c index bbe870b10..0918f53b3 100644 --- a/res/res_ael_share.c +++ b/res/res_ael_share.c @@ -21,7 +21,7 @@ * \brief Shareable AEL code -- mainly between internal and external modules * * \author Steve Murphy <murf@digium.com> - * + * * \ingroup applications */ diff --git a/res/res_calendar.c b/res/res_calendar.c index 16a326563..e8ad49910 100644 --- a/res/res_calendar.c +++ b/res/res_calendar.c @@ -18,7 +18,7 @@ /*! \file * \brief Calendaring API - * + * * \todo Support responding to a meeting invite * \todo Support writing attendees */ @@ -27,7 +27,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page calendar.conf calendar.conf * \verbinclude calendar.conf.sample */ @@ -1859,8 +1859,8 @@ static int unload_module(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_calendar_caldav.c b/res/res_calendar_caldav.c index 02a44c72f..0d938d295 100644 --- a/res/res_calendar_caldav.c +++ b/res/res_calendar_caldav.c @@ -322,7 +322,7 @@ static struct ast_str *caldav_get_events_between(struct caldav_pvt *pvt, time_t return response; } -static time_t icalfloat_to_timet(icaltimetype time) +static time_t icalfloat_to_timet(icaltimetype time) { struct ast_tm tm = {0,}; struct timeval tv; diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c index 4e335dd97..e5d80b4b8 100644 --- a/res/res_calendar_icalendar.c +++ b/res/res_calendar_icalendar.c @@ -161,7 +161,7 @@ static icalcomponent *fetch_icalendar(struct icalendar_pvt *pvt) return comp; } -static time_t icalfloat_to_timet(icaltimetype time) +static time_t icalfloat_to_timet(icaltimetype time) { struct ast_tm tm = {0,}; struct timeval tv; diff --git a/res/res_clialiases.c b/res/res_clialiases.c index 4d932aecc..355d437ab 100644 --- a/res/res_clialiases.c +++ b/res/res_clialiases.c @@ -21,7 +21,7 @@ * \brief CLI Aliases * * \author\verbatim Joshua Colp <jcolp@digium.com> \endverbatim - * + * * This module provides the capability to create aliases to other * CLI commands. */ @@ -30,7 +30,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page cli_aliases.conf cli_aliases.conf * \verbinclude cli_aliases.conf.sample */ @@ -278,8 +278,8 @@ static int unload_module(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_config_curl.c b/res/res_config_curl.c index bc1a3fb35..61b62452d 100644 --- a/res/res_config_curl.c +++ b/res/res_config_curl.c @@ -23,7 +23,7 @@ * \author Tilghman Lesher <res_config_curl_v1@the-tilghman.com> * * Depends on the CURL library - http://curl.haxx.se/ - * + * */ /*** MODULEINFO diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c index c03b84967..78f1fa80e 100644 --- a/res/res_config_ldap.c +++ b/res/res_config_ldap.c @@ -35,7 +35,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page res_ldap.conf res_ldap.conf * \verbinclude res_ldap.conf.sample */ @@ -92,7 +92,7 @@ struct category_and_metric { int var_metric; /*!< For organizing variables (particularly includes and switch statments) within a context */ }; -/*! \brief Table configuration +/*! \brief Table configuration */ struct ldap_table_config { char *table_name; /*!< table name */ @@ -103,7 +103,7 @@ struct ldap_table_config { /* TODO: Make proxies work */ }; -/*! \brief Should be locked before using it +/*! \brief Should be locked before using it */ static AST_LIST_HEAD_NOLOCK_STATIC(table_configs, ldap_table_config); static struct ldap_table_config *base_table_config; @@ -134,7 +134,7 @@ static struct ldap_table_config *table_config_new(const char *table_name) /*! \brief Find a table_config * - * Should be locked before using it + * Should be locked before using it * * \note This function assumes ldap_lock to be locked. */ @@ -180,7 +180,7 @@ static int semicolon_count_str(const char *somestr) } /* \brief Count semicolons in variables - * + * * takes a linked list of \a ast_variable variables, finds the one with the name variable_value * and returns the number of semicolons in the value for that \a ast_variable */ @@ -273,7 +273,7 @@ static const char *convert_attribute_name_to_ldap(struct ldap_table_config *tabl return attribute_name; } -/*! \brief Convert ldap attribute name to variable name +/*! \brief Convert ldap attribute name to variable name * * \note Should be locked before using it */ @@ -301,7 +301,7 @@ static const char *convert_attribute_name_from_ldap(struct ldap_table_config *ta return attribute_name; } -/*! \brief Get variables from ldap entry attributes +/*! \brief Get variables from ldap entry attributes * \note Should be locked before using it * \return a linked list of ast_variable variables. */ @@ -388,7 +388,7 @@ static struct ast_variable *realtime_ldap_entry_to_var(struct ldap_table_config /*! \brief Get variables from ldap entry attributes - Should be locked before using it * * The results are freed outside this function so is the \a vars array. - * + * * \return \a vars - an array of ast_variable variables terminated with a null. */ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_config *table_config, @@ -411,7 +411,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf */ ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg); - for (tot_count = 0; ldap_entry; tot_count++) { + for (tot_count = 0; ldap_entry; tot_count++) { struct ast_variable *tmp = realtime_ldap_entry_to_var(table_config, ldap_entry); tot_count += semicolon_count_var(tmp); ldap_entry = ldap_next_entry(ldapConn, ldap_entry); @@ -586,7 +586,7 @@ static int is_ldap_connect_error(int err) /*! \brief Get LDAP entry by dn and return attributes as variables * - * Should be locked before using it + * Should be locked before using it * * This is used for setting the default values of an object * i.e., with accountBaseDN @@ -708,7 +708,7 @@ static char *cleaned_basedn(struct ast_channel *channel, const char *basedn) return cbasedn; } -/*! \brief Replace \<search\> by \<by\> in string. +/*! \brief Replace \<search\> by \<by\> in string. * \note No check is done on string allocated size ! */ static int replace_string_in_string(char *string, const char *search, const char *by) @@ -733,7 +733,7 @@ static int replace_string_in_string(char *string, const char *search, const char return replaced; } -/*! \brief Append a name=value filter string. The filter string can grow. +/*! \brief Append a name=value filter string. The filter string can grow. */ static void append_var_and_value_to_filter(struct ast_str **filter, struct ldap_table_config *table_config, @@ -801,7 +801,7 @@ static struct ast_str *create_lookup_filter(struct ldap_table_config *config, co return filter; } -/*! \brief LDAP base function +/*! \brief LDAP base function * \return a null terminated array of ast_variable (one per entry) or NULL if no entry is found or if an error occured * caller should free the returned array and ast_variables * \param entries_count_ptr is a pointer to found entries count (can be NULL) @@ -825,7 +825,7 @@ static struct ast_variable **realtime_ldap_base_ap(unsigned int *entries_count_p ast_log(LOG_ERROR, "No table_name specified.\n"); ast_free(clean_basedn); return NULL; - } + } if (!field) { ast_log(LOG_ERROR, "Realtime retrieval requires at least 1 parameter" @@ -882,7 +882,7 @@ static struct ast_variable **realtime_ldap_base_ap(unsigned int *entries_count_p ast_log(LOG_WARNING, "Failed to query directory. Error: %s.\n", ldap_err2string(result)); ast_log(LOG_WARNING, "Query: %s\n", ast_str_buffer(filter)); } else { - /* this is where we create the variables from the search result + /* this is where we create the variables from the search result * freeing this \a vars outside this function */ if (ldap_count_entries(ldapConn, ldap_result_msg) > 0) { /* is this a static var or some other? they are handled different for delimited values */ @@ -904,7 +904,7 @@ static struct ast_variable **realtime_ldap_base_ap(unsigned int *entries_count_p if (strcasecmp(tmp->name, "accountBaseDN") == 0) { /* Get the variable to compare with for the defaults */ struct ast_variable *base_var = ldap_loadentry(table_config, tmp->value); - + while (base_var) { struct ast_variable *next = base_var->next; struct ast_variable *test_var = *p; @@ -1107,7 +1107,7 @@ static int compare_categories(const void *a, const void *b) return 1; } else if (as->metric == bs->metric && strcmp(as->name, bs->name) != 0) { return strcmp(as->name, bs->name); - } + } /* if the metric and the category name is the same, we check the variable metric */ if (as->var_metric < bs->var_metric) { return -1; @@ -1121,7 +1121,7 @@ static int compare_categories(const void *a, const void *b) /*! \brief See Asterisk Realtime Documentation * * This is for Static Realtime - * + * * load the configuration stuff for the .conf files * called on a reload */ @@ -1707,8 +1707,8 @@ static struct ast_config_engine ldap_engine = { * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. * * \todo Don't error or warn on a default install. If the config is @@ -1776,7 +1776,7 @@ static int reload(void) ast_log(LOG_NOTICE, "Cannot reload LDAP RealTime driver.\n"); ast_mutex_unlock(&ldap_lock); return 0; - } + } if (!ldap_reconnect()) { ast_log(LOG_WARNING, "Couldn't establish connection to your directory server. Check debug.\n"); @@ -1863,7 +1863,7 @@ static int parse_config(void) if (!(s = ast_variable_retrieve(config, "_general", "basedn"))) { ast_log(LOG_ERROR, "No LDAP base dn found, using '%s' as default.\n", RES_CONFIG_LDAP_DEFAULT_BASEDN); ast_copy_string(base_distinguished_name, RES_CONFIG_LDAP_DEFAULT_BASEDN, sizeof(base_distinguished_name)); - } else + } else ast_copy_string(base_distinguished_name, s, sizeof(base_distinguished_name)); if (!(s = ast_variable_retrieve(config, "_general", "version")) && !(s = ast_variable_retrieve(config, "_general", "protocol"))) { @@ -1879,7 +1879,7 @@ static int parse_config(void) int is_general = (strcasecmp(category_name, "_general") == 0); int is_config = (strcasecmp(category_name, "config") == 0); /*!< using the [config] context for Static RealTime */ struct ast_variable *var = ast_variable_browse(config, category_name); - + if (var) { struct ldap_table_config *table_config = table_config_for_table_name(category_name); @@ -1978,7 +1978,7 @@ static char *realtime_ldap_status(struct ast_cli_entry *e, int cmd, struct ast_c if (!ldapConn) return CLI_FAILURE; - if (!ast_strlen_zero(url)) + if (!ast_strlen_zero(url)) snprintf(status, sizeof(status), "Connected to '%s', baseDN %s", url, base_distinguished_name); if (!ast_strlen_zero(user)) diff --git a/res/res_config_odbc.c b/res/res_config_odbc.c index 583a84558..e86445088 100644 --- a/res/res_config_odbc.c +++ b/res/res_config_odbc.c @@ -145,7 +145,7 @@ static SQLHSTMT custom_prepare(struct odbc_obj *obj, void *data) ENCODE_CHUNK(encodebuf, newval); ast_string_field_set(cps, encoding[x], encodebuf); newval = cps->encoding[x]; - } + } SQLBindParameter(stmt, x++, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(newval), 0, (void *)newval, 0, NULL); } @@ -245,7 +245,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl for (x = 0; x < colcount; x++) { colsize = 0; collen = sizeof(coltitle); - res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen, + res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen, &datatype, &colsize, &decimaldigits, &nullable); if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { ast_log(LOG_WARNING, "SQL Describe Column error! [%s]\n", ast_str_buffer(sql)); @@ -315,7 +315,7 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl * \param ap list containing one or more field/operator/value set. * * Select database and preform query on table, prepare the sql statement - * Sub-in the values to the prepared statement and execute it. + * Sub-in the values to the prepared statement and execute it. * Execute this prepared query against several ODBC connected databases. * Return results as an ast_config variable. * @@ -416,7 +416,7 @@ static struct ast_config *realtime_multi_odbc(const char *database, const char * for (x=0;x<colcount;x++) { colsize = 0; collen = sizeof(coltitle); - res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen, + res = SQLDescribeCol(stmt, x + 1, (unsigned char *)coltitle, sizeof(coltitle), &collen, &datatype, &colsize, &decimaldigits, &nullable); if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) { ast_log(LOG_WARNING, "SQL Describe Column error! [%s]\n", ast_str_buffer(sql)); @@ -1015,7 +1015,7 @@ static struct ast_config *config_odbc(const char *database, const char *table, c return NULL; } continue; - } + } if (strcmp(last, q.category) || last_cat_metric != q.cat_metric) { cur_cat = ast_category_new_dynamic(q.category); if (!cur_cat) { diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c index fa45fec35..1834333a0 100644 --- a/res/res_config_sqlite.c +++ b/res/res_config_sqlite.c @@ -27,7 +27,7 @@ * res_config_sqlite is a module for the Asterisk Open Source PBX to * support SQLite 2 databases. It can be used to fetch configuration * from a database (static configuration files and/or using the Asterisk - * RealTime Architecture - ARA). It can also be used to log CDR entries. + * RealTime Architecture - ARA). It can also be used to log CDR entries. * Note that Asterisk already comes with a module named cdr_sqlite. * There are two reasons for including it in res_config_sqlite: * the first is that rewriting it was a training to learn how to write a @@ -75,7 +75,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page res_config_sqlite.conf res_config_sqlite.conf * \verbinclude res_config_sqlite.conf.sample */ @@ -431,7 +431,7 @@ static int realtime_destroy_handler(const char *database, const char *table, * \brief Asterisk callback function for the CLI status command. * * \param e CLI command - * \param cmd + * \param cmd * \param a CLI argument list * \return RESULT_SUCCESS */ @@ -1657,8 +1657,8 @@ static int unload_module(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_config_sqlite3.c b/res/res_config_sqlite3.c index 961d7949b..a03397034 100644 --- a/res/res_config_sqlite3.c +++ b/res/res_config_sqlite3.c @@ -33,7 +33,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page res_config_sqlite3.conf res_config_sqlite3.conf * \verbinclude res_config_sqlite3.conf.sample */ @@ -1352,8 +1352,8 @@ static void discover_sqlite3_caps(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_convert.c b/res/res_convert.c index c2966a85f..3fa9d515a 100644 --- a/res/res_convert.c +++ b/res/res_convert.c @@ -18,13 +18,13 @@ */ /*! \file - * + * * \brief file format conversion CLI command using Asterisk formats and translators * * \author redice li <redice_li@yahoo.com> * \author Russell Bryant <russell@digium.com> * - */ + */ /*** MODULEINFO <support_level>core</support_level> @@ -43,7 +43,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") static int split_ext(char *filename, char **name, char **ext) { *name = *ext = filename; - + if ((*ext = strrchr(filename, '.'))) { **ext = '\0'; (*ext)++; @@ -55,8 +55,8 @@ static int split_ext(char *filename, char **name, char **ext) return 0; } -/*! - * \brief Convert a file from one format to another +/*! + * \brief Convert a file from one format to another * \param e CLI entry * \param cmd command number * \param a list of cli arguments @@ -87,13 +87,13 @@ static char *handle_cli_file_convert(struct ast_cli_entry *e, int cmd, struct as case CLI_GENERATE: return NULL; } - + /* ugly, can be removed when CLI entries have ast_module pointers */ ast_module_ref(ast_module_info->self); if (a->argc != 4 || ast_strlen_zero(a->argv[2]) || ast_strlen_zero(a->argv[3])) { ret = CLI_SHOWUSAGE; - goto fail_out; + goto fail_out; } file_in = ast_strdupa(a->argv[2]); @@ -107,7 +107,7 @@ static char *handle_cli_file_convert(struct ast_cli_entry *e, int cmd, struct as ast_cli(a->fd, "Unable to open input file: %s\n", a->argv[2]); goto fail_out; } - + if (split_ext(file_out, &name_out, &ext_out)) { ast_cli(a->fd, "'%s' is an invalid filename!\n", a->argv[3]); goto fail_out; @@ -118,7 +118,7 @@ static char *handle_cli_file_convert(struct ast_cli_entry *e, int cmd, struct as } start = ast_tvnow(); - + while ((f = ast_readframe(fs_in))) { if (ast_writestream(fs_out, f)) { ast_frfree(f); @@ -139,7 +139,7 @@ fail_out: ast_filedelete(name_out, ext_out); } - if (fs_in) + if (fs_in) ast_closestream(fs_in); ast_module_unref(ast_module_info->self); diff --git a/res/res_corosync.c b/res/res_corosync.c index ce94e4151..af8afdb7f 100644 --- a/res/res_corosync.c +++ b/res/res_corosync.c @@ -1205,4 +1205,3 @@ static int unload_module(void) } AST_MODULE_INFO_STANDARD_EXTENDED(ASTERISK_GPL_KEY, "Corosync"); - diff --git a/res/res_curl.c b/res/res_curl.c index 4906dde77..e5eaa7d5f 100644 --- a/res/res_curl.c +++ b/res/res_curl.c @@ -23,14 +23,14 @@ * \author Tilghman Lesher <res_curl_v1@the-tilghman.com> * * Depends on the CURL library - http://curl.haxx.se/ - * + * */ /*! \li \ref res_curl.c uses the configuration file \ref res_curl.conf * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page res_curl.conf res_curl.conf * \verbinclude res_curl.conf.sample */ @@ -80,8 +80,8 @@ static int unload_module(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_fax_spandsp.c b/res/res_fax_spandsp.c index 0152b00dd..26f9ed372 100644 --- a/res/res_fax_spandsp.c +++ b/res/res_fax_spandsp.c @@ -859,7 +859,7 @@ static int spandsp_fax_gateway_start(struct ast_fax_session *s) t38_set_fill_bit_removal(p->t38_core_state, t38_param->fill_bit_removal); t38_set_mmr_transcoding(p->t38_core_state, t38_param->transcoding_mmr); t38_set_jbig_transcoding(p->t38_core_state, t38_param->transcoding_jbig); - t38_set_data_rate_management_method(p->t38_core_state, + t38_set_data_rate_management_method(p->t38_core_state, (t38_param->rate_management == AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF)? 1 : 2); t38_gateway_set_transmit_on_idle(&p->t38_gw_state, TRUE); @@ -868,7 +868,7 @@ static int spandsp_fax_gateway_start(struct ast_fax_session *s) t38_gateway_set_supported_modems(&p->t38_gw_state, spandsp_modems(s->details)); - /* engage udptl nat on other side of T38 line + /* engage udptl nat on other side of T38 line * (Asterisk changes media ports thus we send a few packets to reinitialize * pinholes in NATs and FWs */ diff --git a/res/res_format_attr_silk.c b/res/res_format_attr_silk.c index d52ec7410..fcbe7a846 100644 --- a/res/res_format_attr_silk.c +++ b/res/res_format_attr_silk.c @@ -111,7 +111,7 @@ static void silk_generate_sdp_fmtp(const struct ast_format *format, unsigned int return; } - if ((attr->maxbitrate > 5000) && (attr->maxbitrate < 40000)) { + if ((attr->maxbitrate > 5000) && (attr->maxbitrate < 40000)) { ast_str_append(str, 0, "a=fmtp:%u maxaveragebitrate=%u\r\n", payload, attr->maxbitrate); } diff --git a/res/res_http_post.c b/res/res_http_post.c index 4b864b5d8..f7c4d308f 100644 --- a/res/res_http_post.c +++ b/res/res_http_post.c @@ -17,7 +17,7 @@ */ /*! - * \file + * \file * \brief HTTP POST upload support for Asterisk HTTP server * * \author Terry Wilson <twilson@digium.com @@ -113,7 +113,7 @@ static GMimeMessage *parse_message(FILE *f) parser = g_mime_parser_new_with_stream(stream); g_mime_parser_set_respect_content_length(parser, 1); - + g_object_unref(stream); message = g_mime_parser_construct_message(parser diff --git a/res/res_limit.c b/res/res_limit.c index 5f61f1b09..29e0c9dc3 100644 --- a/res/res_limit.c +++ b/res/res_limit.c @@ -2,7 +2,7 @@ * Asterisk -- An open source telephony toolkit. * * Resource limits - * + * * Copyright (c) 2006 Tilghman Lesher. All rights reserved. * * Tilghman Lesher <res_limit_200607@the-tilghman.com> @@ -215,4 +215,3 @@ static int load_module(void) } AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "Resource limits"); - diff --git a/res/res_monitor.c b/res/res_monitor.c index b7ef2ea88..88fb2d5ba 100644 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -27,7 +27,7 @@ <depend type="module">func_periodic_hook</depend> <support_level>core</support_level> ***/ - + #include "asterisk.h" ASTERISK_FILE_VERSION(__FILE__, "$Revision$") @@ -273,9 +273,9 @@ AST_MUTEX_DEFINE_STATIC(monitorlock); static unsigned long seq = 0; -/*! - * \brief Change state of monitored channel - * \param chan +/*! + * \brief Change state of monitored channel + * \param chan * \param state monitor state * \retval 0 on success. * \retval -1 on failure. @@ -374,7 +374,7 @@ int AST_OPTIONAL_API_NAME(ast_monitor_start)(struct ast_channel *chan, const cha } else { monitor->format = ast_strdup("wav"); } - + /* open files */ if (stream_action & X_REC_IN) { if (ast_fileexists(monitor->read_filename, NULL, NULL) > 0) @@ -448,13 +448,13 @@ static const char *get_soxmix_format(const char *format) res = "ul"; if (!strcasecmp(format,"alaw")) res = "al"; - + return res; } -/*! - * \brief Stop monitoring channel - * \param chan +/*! + * \brief Stop monitoring channel + * \param chan * \param need_lock * Stop the recording, close any open streams, mix in/out channels if required * \return Always 0 @@ -514,7 +514,7 @@ int AST_OPTIONAL_API_NAME(ast_monitor_stop)(struct ast_channel *chan, int need_l #endif format = get_soxmix_format(format); delfiles = 1; - } + } execute_args = pbx_builtin_getvar_helper(chan, "MONITOR_EXEC_ARGS"); if (ast_strlen_zero(execute_args)) { execute_args = ""; @@ -580,8 +580,8 @@ static int unpause_monitor_exec(struct ast_channel *chan, const char *data) return ast_monitor_unpause(chan); } -/*! - * \brief Change monitored filename of channel +/*! + * \brief Change monitored filename of channel * \param chan * \param fname_base new filename * \param need_lock @@ -626,7 +626,7 @@ int AST_OPTIONAL_API_NAME(ast_monitor_change_fname)(struct ast_channel *chan, co * and we aren't interfering with the recording itself. */ ast_debug(2, "comparing tmpstring %s to filename_base %s\n", tmpstring, ast_channel_monitor(chan)->filename_base); - + if ((fd[0] = open(tmpstring, O_CREAT | O_WRONLY, 0644)) < 0 || (fd[1] = open(ast_channel_monitor(chan)->filename_base, O_CREAT | O_EXCL | O_WRONLY, 0644)) < 0) { if (fd[0] < 0) { @@ -710,7 +710,7 @@ static int start_monitor_exec(struct ast_channel *chan, const char *data) AST_APP_ARG(fname_base); AST_APP_ARG(options); ); - + /* Parse arguments. */ if (ast_strlen_zero(data)) { ast_log(LOG_ERROR, "Monitor requires an argument\n"); diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 57d12789e..0afacf53c 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -19,7 +19,7 @@ /*! \file * * \brief Routines implementing music on hold - * + * * \author Mark Spencer <markster@digium.com> */ @@ -27,7 +27,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page musiconhold.conf musiconhold.conf * \verbinclude musiconhold.conf.sample */ @@ -312,7 +312,7 @@ static void moh_files_release(struct ast_channel *chan, void *data) state->class = mohclass_unref(state->class, "Unreffing channel's music class upon deactivation of generator"); } -static int ast_moh_files_next(struct ast_channel *chan) +static int ast_moh_files_next(struct ast_channel *chan) { struct moh_files_state *state = ast_channel_music_state(chan); int tries; @@ -559,7 +559,7 @@ static int spawn_mp3(struct mohclass *class) DIR *dir = NULL; struct dirent *de; - + if (!strcasecmp(class->dir, "nodir")) { files = 1; } else { @@ -577,19 +577,19 @@ static int spawn_mp3(struct mohclass *class) argv[argc++] = "--mono"; argv[argc++] = "-r"; argv[argc++] = "8000"; - + if (!ast_test_flag(class, MOH_SINGLE)) { argv[argc++] = "-b"; argv[argc++] = "2048"; } - + argv[argc++] = "-f"; - + if (ast_test_flag(class, MOH_QUIET)) argv[argc++] = "4096"; else argv[argc++] = "8192"; - + /* Look for extra arguments and add them to the list */ ast_copy_string(xargs, class->args, sizeof(xargs)); argptr = xargs; @@ -613,9 +613,9 @@ static int spawn_mp3(struct mohclass *class) files++; } else if (dir) { while ((de = readdir(dir)) && (files < MAX_MP3S)) { - if ((strlen(de->d_name) > 3) && - ((ast_test_flag(class, MOH_CUSTOM) && - (!strcasecmp(de->d_name + strlen(de->d_name) - 4, ".raw") || + if ((strlen(de->d_name) > 3) && + ((ast_test_flag(class, MOH_CUSTOM) && + (!strcasecmp(de->d_name + strlen(de->d_name) - 4, ".raw") || !strcasecmp(de->d_name + strlen(de->d_name) - 4, ".sln"))) || !strcasecmp(de->d_name + strlen(de->d_name) - 4, ".mp3"))) { ast_copy_string(fns[files], de->d_name, sizeof(fns[files])); @@ -628,7 +628,7 @@ static int spawn_mp3(struct mohclass *class) if (dir) { closedir(dir); } - if (pipe(fds)) { + if (pipe(fds)) { ast_log(LOG_WARNING, "Pipe failed\n"); return -1; } @@ -884,7 +884,7 @@ static int start_moh_exec(struct ast_channel *chan, const char *data) AST_STANDARD_APP_ARGS(args, parse); class = S_OR(args.class, NULL); - if (ast_moh_start(chan, class, NULL)) + if (ast_moh_start(chan, class, NULL)) ast_log(LOG_WARNING, "Unable to start music on hold class '%s' on channel %s\n", class, ast_channel_name(chan)); return 0; @@ -948,7 +948,7 @@ static struct mohdata *mohalloc(struct mohclass *cl) ao2_lock(cl); AST_LIST_INSERT_HEAD(&cl->members, moh, list); ao2_unlock(cl); - + return moh; } @@ -959,9 +959,9 @@ static void moh_release(struct ast_channel *chan, void *data) struct ast_format *oldwfmt; ao2_lock(class); - AST_LIST_REMOVE(&moh->parent->members, moh, list); + AST_LIST_REMOVE(&moh->parent->members, moh, list); ao2_unlock(class); - + close(moh->pipe[0]); close(moh->pipe[1]); @@ -1292,8 +1292,8 @@ static int _moh_register(struct mohclass *moh, int reload, int unref, const char } return -1; } - } else if (!strcasecmp(moh->mode, "mp3") || !strcasecmp(moh->mode, "mp3nb") || - !strcasecmp(moh->mode, "quietmp3") || !strcasecmp(moh->mode, "quietmp3nb") || + } else if (!strcasecmp(moh->mode, "mp3") || !strcasecmp(moh->mode, "mp3nb") || + !strcasecmp(moh->mode, "quietmp3") || !strcasecmp(moh->mode, "quietmp3nb") || !strcasecmp(moh->mode, "httpmp3") || !strcasecmp(moh->mode, "custom")) { if (init_app_class(moh)) { if (unref) { @@ -1435,7 +1435,7 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con if (!strcasecmp(tmp->name, "name")) ast_copy_string(mohclass->name, tmp->value, sizeof(mohclass->name)); else if (!strcasecmp(tmp->name, "mode")) - ast_copy_string(mohclass->mode, tmp->value, sizeof(mohclass->mode)); + ast_copy_string(mohclass->mode, tmp->value, sizeof(mohclass->mode)); else if (!strcasecmp(tmp->name, "directory")) ast_copy_string(mohclass->dir, tmp->value, sizeof(mohclass->dir)); else if (!strcasecmp(tmp->name, "application")) @@ -1446,7 +1446,7 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con ast_set2_flag(mohclass, ast_true(tmp->value), MOH_RANDOMIZE); else if (!strcasecmp(tmp->name, "sort") && !strcasecmp(tmp->value, "random")) ast_set_flag(mohclass, MOH_RANDOMIZE); - else if (!strcasecmp(tmp->name, "sort") && !strcasecmp(tmp->value, "alpha")) + else if (!strcasecmp(tmp->name, "sort") && !strcasecmp(tmp->value, "alpha")) ast_set_flag(mohclass, MOH_SORTALPHA); else if (!strcasecmp(tmp->name, "format")) { ao2_cleanup(mohclass->format); @@ -1639,7 +1639,7 @@ static void moh_class_destructor(void *obj) stime = time(NULL) + 2; killpid(class->pid, class->kill_delay, class->kill_method); - while ((ast_wait_for_input(class->srcfd, 100) > 0) && + while ((ast_wait_for_input(class->srcfd, 100) > 0) && (bytes = read(class->srcfd, buff, 8192)) && time(NULL) < stime) { tbytes = tbytes + bytes; } @@ -1740,7 +1740,7 @@ static int load_moh_classes(int reload) } } /* These names were deprecated in 1.4 and should not be used until after the next major release. */ - if (!strcasecmp(cat, "classes") || !strcasecmp(cat, "moh_files") || + if (!strcasecmp(cat, "classes") || !strcasecmp(cat, "moh_files") || !strcasecmp(cat, "general")) { continue; } @@ -1822,7 +1822,7 @@ static int load_moh_classes(int reload) ast_config_destroy(cfg); - ao2_t_callback(mohclasses, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, + ao2_t_callback(mohclasses, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, moh_classes_delete_marked, NULL, "Purge marked classes"); return numclasses; @@ -1969,8 +1969,8 @@ static int moh_class_cmp(void *obj, void *arg, int flags) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_mwi_external_ami.c b/res/res_mwi_external_ami.c index 0479f8bcf..92eafb893 100644 --- a/res/res_mwi_external_ami.c +++ b/res/res_mwi_external_ami.c @@ -373,4 +373,3 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "AMI support for external .load = load_module, .unload = unload_module, ); - diff --git a/res/res_odbc.c b/res/res_odbc.c index 48273c4ac..73af22057 100644 --- a/res/res_odbc.c +++ b/res/res_odbc.c @@ -22,7 +22,7 @@ /*! \file * * \brief ODBC resource manager - * + * * \author Mark Spencer <markster@digium.com> * \author Anthony Minessale II <anthmct@yahoo.com> * \author Tilghman Lesher <tilghman@digium.com> @@ -34,7 +34,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page res_odbc.conf res_odbc.conf * \verbinclude res_odbc.conf.sample */ @@ -1074,8 +1074,8 @@ static int unload_module(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_odbc_transaction.c b/res/res_odbc_transaction.c index 7e48b72cf..b6b303929 100644 --- a/res/res_odbc_transaction.c +++ b/res/res_odbc_transaction.c @@ -222,7 +222,7 @@ static struct odbc_txn_frame *find_transaction(struct ast_channel *chan, const c /* No datastore? Definitely no transaction then */ return NULL; } - + oldlist = txn_store->data; AST_LIST_LOCK(oldlist); diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c index 71f875753..89fb29c2d 100644 --- a/res/res_phoneprov.c +++ b/res/res_phoneprov.c @@ -33,7 +33,7 @@ * \addtogroup configuration_file Configuration Files */ -/*! +/*! * \page phoneprov.conf phoneprov.conf * \verbinclude phoneprov.conf.sample */ diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index 2bd40e84f..40490b255 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -1347,4 +1347,3 @@ int ast_sip_destroy_sorcery_location(void) return 0; } - diff --git a/res/res_pjsip/pjsip_global_headers.c b/res/res_pjsip/pjsip_global_headers.c index 501f5f523..4de28b586 100644 --- a/res/res_pjsip/pjsip_global_headers.c +++ b/res/res_pjsip/pjsip_global_headers.c @@ -55,7 +55,7 @@ struct header { static struct header *alloc_header(const char *name, const char *value) { struct header *alloc; - + alloc = ast_calloc_with_stringfields(1, struct header, 32); if (!alloc) { @@ -139,7 +139,7 @@ static int add_header(struct header_list *headers, const char *name, const char } AST_RWLIST_WRLOCK(headers); - if (replace) { + if (replace) { remove_header(headers, name); } if (to_add) { diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c index 1eafb4a7e..a0352a6fb 100644 --- a/res/res_pjsip/pjsip_options.c +++ b/res/res_pjsip/pjsip_options.c @@ -1281,7 +1281,7 @@ int ast_sip_format_contact_ami(void *obj, void *arg, int flags) astman_append(ami->s, "%s\r\n", ast_str_buffer(buf)); ami->count++; - + ast_free(buf); ao2_cleanup(status); return 0; diff --git a/res/res_pjsip/pjsip_session.c b/res/res_pjsip/pjsip_session.c index 7460e0a2b..074ec4e0b 100644 --- a/res/res_pjsip/pjsip_session.c +++ b/res/res_pjsip/pjsip_session.c @@ -118,4 +118,3 @@ int ast_sip_session_add_supplements(struct ast_sip_session *session) return 0; } - diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index e9e832456..d921aa388 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -525,7 +525,7 @@ static void pubsub_on_rx_notify(pjsip_evsub *sub, pjsip_rx_data *rdata, int *p_s pj_str_t **p_st_text, pjsip_hdr *res_hdr, pjsip_msg_body **p_body); static void pubsub_on_client_refresh(pjsip_evsub *sub); static void pubsub_on_server_timeout(pjsip_evsub *sub); - + static pjsip_evsub_user pubsub_cb = { .on_evsub_state = pubsub_on_evsub_state, .on_rx_refresh = pubsub_on_rx_refresh, diff --git a/res/res_pktccops.c b/res/res_pktccops.c index 8a4c3a5c0..512d706d3 100644 --- a/res/res_pktccops.c +++ b/res/res_pktccops.c @@ -19,10 +19,10 @@ /*!\file * * \brief PacketCable COPS - * + * * \author Attila Domjan <attila.domjan.hu@gmail.com> * - * \note + * \note * This module is an add-on to chan_mgcp. It adds support for the * PacketCable MGCP variation called NCS. Res_pktccops implements COPS * (RFC 2748), a protocol used to manage dynamic bandwith allocation in @@ -96,7 +96,7 @@ struct pktcobj { unsigned char cnum; unsigned char ctype; char *contents; - struct pktcobj *next; + struct pktcobj *next; }; struct copsmsg { @@ -136,7 +136,7 @@ struct cops_cmts { char name[80]; char host[80]; char port[80]; - uint16_t t1; + uint16_t t1; uint16_t t7; uint16_t t8; uint32_t keepalive; @@ -186,7 +186,7 @@ static uint16_t cops_constructgatespec(struct gatespec *gs, char *res) if (res == NULL) { return 0; } - + *res = (char) gs->direction; *(res + 1) = (char) gs->protocolid; *(res + 2) = (char) gs->flags; @@ -226,7 +226,7 @@ static uint16_t cops_construct_gate (int cmd, char *p, uint16_t trid, { struct gatespec gs; int offset = 0; - + ast_debug(3, "CMD: %d\n", cmd); /* Transaction Identifier 8 octets */ @@ -246,7 +246,7 @@ static uint16_t cops_construct_gate (int cmd, char *p, uint16_t trid, *(p + offset++) = 1; /* stype */ *((uint32_t *) (p + offset)) = htonl(mtahost); offset += 4; - + if (cmd == GATE_INFO || cmd == GATE_SET_HAVE_GATEID || cmd == GATE_DEL) { /* Gate ID 8 Octets */ *(p + offset++) = 0; @@ -258,7 +258,7 @@ static uint16_t cops_construct_gate (int cmd, char *p, uint16_t trid, if (cmd == GATE_INFO || cmd == GATE_DEL) { return offset; } - + } /* Activity Count 8 octets */ @@ -392,7 +392,7 @@ static int cops_sendmsg (int sfd, struct copsmsg * sendmsg) char *buf; int bufpos; struct pktcobj *pobject; - + if (sfd < 0) { return -1; } @@ -435,7 +435,7 @@ static int cops_sendmsg (int sfd, struct copsmsg * sendmsg) pobject = pobject->next; } } - + errno = 0; #ifdef HAVE_MSG_NOSIGNAL #define SENDFLAGS MSG_NOSIGNAL | MSG_DONTWAIT @@ -481,15 +481,15 @@ struct cops_gate * AST_OPTIONAL_API_NAME(ast_pktccops_gate_alloc)(int cmd, ast_debug(3, "------- gate modify gateid 0x%x ssip: 0x%x\n", gate->gateid, ssip); /* TODO implement it */ ast_log(LOG_WARNING, "Modify GateID not implemented\n"); - } - + } + if ((gate = cops_gate_cmd(cmd, NULL, cops_trid++, mta, actcount, bitrate, psize, ssip, ssport, gate))) { ast_debug(3, "COPS: Allocating gate for mta: 0x%x\n", mta); gate->got_dq_gi = got_dq_gi; gate->gate_remove = gate_remove; return(gate); } else { - ast_debug(3, "COPS: Couldn't allocate gate for mta: 0x%x\n", mta); + ast_debug(3, "COPS: Couldn't allocate gate for mta: 0x%x\n", mta); return NULL; } } @@ -552,7 +552,7 @@ static struct cops_gate *cops_gate_cmd(int cmd, struct cops_cmts *cmts, gate->trid = trid; } } - + gate->in_transaction = time(NULL); if (!(gateset = malloc(sizeof(struct copsmsg)))) { @@ -563,7 +563,7 @@ static struct cops_gate *cops_gate_cmd(int cmd, struct cops_cmts *cmts, gateset->verflag = 0x10; gateset->opcode = 2; /* Decision */ gateset->clienttype = 0x8008; /* =PacketCable */ - + /* Handle object */ gateset->object = malloc(sizeof(struct pktcobj)); if (!gateset->object) { @@ -629,7 +629,7 @@ static struct cops_gate *cops_gate_cmd(int cmd, struct cops_cmts *cmts, return NULL; } gateset->object->next->next->next->next = NULL; - + gateset->length = COPS_HEADER_SIZE + gateset->object->length + gateset->object->next->length + gateset->object->next->next->length + gateset->object->next->next->next->length; if ((cmd == GATE_INFO || cmd == GATE_SET_HAVE_GATEID || cmd == GATE_DEL) && gate) { @@ -660,7 +660,7 @@ static int cops_connect(char *host, char *port) memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = AF_UNSPEC; + hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = 0; hints.ai_protocol = 0; @@ -826,7 +826,7 @@ static void *do_pktccops(void *data) ast_debug(3, " S-Num S-type: 0x%.4x len: %i\n", (unsigned)snst, sobjlen); if (snst == 0x0101 ) { recvtrid = ntohs(*((uint16_t *) (sobjp + 4))); - scommand = ntohs(*((uint16_t *) (sobjp + 6))); + scommand = ntohs(*((uint16_t *) (sobjp + 6))); ast_debug(3, " Transaction Identifier command: %i trid %i\n", scommand, recvtrid); } else if (snst == 0x0201) { subscrid = ntohl(*((uint32_t *) (sobjp + 4))); @@ -872,7 +872,7 @@ static void *do_pktccops(void *data) gate->gate_open = NULL; } break; - } + } } } AST_LIST_TRAVERSE_SAFE_END; @@ -943,7 +943,7 @@ static void *do_pktccops(void *data) cmts->state = 2; cmts->katimer = time(NULL); } - } + } if (len <= 0) { ast_debug(3, "COPS: lost connection to %s\n", cmts->name); close(cmts->sfd); @@ -953,7 +953,7 @@ static void *do_pktccops(void *data) cops_freemsg(recmsg); } } - AST_LIST_UNLOCK(&cmts_list); + AST_LIST_UNLOCK(&cmts_list); } if (pktcreload) { ast_debug(3, "Reloading pktccops...\n"); @@ -1058,7 +1058,7 @@ static int load_pktccops_config(void) } else { ast_log(LOG_WARNING, "Unkown option %s in general section of res_ptkccops.conf\n", v->name); } - } + } } else { /* Defaults */ host = NULL; @@ -1070,7 +1070,7 @@ static int load_pktccops_config(void) for (v = ast_variable_browse(config, cat); v; v = v->next) { if (!strcasecmp(v->name, "host")) { - host = v->value; + host = v->value; } else if (!strcasecmp(v->name, "port")) { port = v->value; } else if (!strcasecmp(v->name, "t1")) { @@ -1154,11 +1154,11 @@ static char *pktccops_show_cmtses(struct ast_cli_entry *e, int cmd, struct ast_c struct cops_cmts *cmts; char statedesc[16]; int katimer; - + switch(cmd) { case CLI_INIT: e->command = "pktccops show cmtses"; - e->usage = + e->usage = "Usage: pktccops show cmtses\n" " List PacketCable COPS CMTSes.\n"; @@ -1194,7 +1194,7 @@ static char *pktccops_show_gates(struct ast_cli_entry *e, int cmd, struct ast_cl switch(cmd) { case CLI_INIT: e->command = "pktccops show gates"; - e->usage = + e->usage = "Usage: pktccops show gates\n" " List PacketCable COPS GATEs.\n"; @@ -1225,8 +1225,8 @@ static char *pktccops_show_gates(struct ast_cli_entry *e, int cmd, struct ast_cl } else { ast_copy_string(state_desc, "N/A", sizeof(state_desc)); } - - ast_cli(a->fd, "%-16s 0x%.8x 0x%08x %-10s %10i %10i %u\n", (gate->cmts) ? gate->cmts->name : "null" , gate->gateid, gate->mta, + + ast_cli(a->fd, "%-16s 0x%.8x 0x%08x %-10s %10i %10i %u\n", (gate->cmts) ? gate->cmts->name : "null" , gate->gateid, gate->mta, state_desc, (int) (time(NULL) - gate->allocated), (gate->checked) ? (int) (time(NULL) - gate->checked) : 0, (unsigned int) gate->in_transaction); } AST_LIST_UNLOCK(&cmts_list); @@ -1243,7 +1243,7 @@ static char *pktccops_show_pools(struct ast_cli_entry *e, int cmd, struct ast_cl switch(cmd) { case CLI_INIT: e->command = "pktccops show pools"; - e->usage = + e->usage = "Usage: pktccops show pools\n" " List PacketCable COPS ip pools of MTAs.\n"; @@ -1276,7 +1276,7 @@ static char *pktccops_gatedel(struct ast_cli_entry *e, int cmd, struct ast_cli_a switch (cmd) { case CLI_INIT: e->command = "pktccops gatedel"; - e->usage = + e->usage = "Usage: pktccops gatedel <cmts> <gateid>\n" " Send Gate-Del to cmts.\n"; return NULL; @@ -1296,13 +1296,13 @@ static char *pktccops_gatedel(struct ast_cli_entry *e, int cmd, struct ast_cli_a } } AST_LIST_UNLOCK(&cmts_list); - + if (!found) return CLI_SHOWUSAGE; trid = cops_trid++; if (!sscanf(a->argv[3], "%x", &gateid)) { - ast_cli(a->fd, "bad gate specification (%s)\n", a->argv[3]); + ast_cli(a->fd, "bad gate specification (%s)\n", a->argv[3]); return CLI_SHOWUSAGE; } @@ -1314,7 +1314,7 @@ static char *pktccops_gatedel(struct ast_cli_entry *e, int cmd, struct ast_cli_a break; } } - + if (!found) { ast_cli(a->fd, "gate not found: %s\n", a->argv[3]); return CLI_SHOWUSAGE; @@ -1336,7 +1336,7 @@ static char *pktccops_gateset(struct ast_cli_entry *e, int cmd, struct ast_cli_a switch (cmd) { case CLI_INIT: e->command = "pktccops gateset"; - e->usage = + e->usage = "Usage: pktccops gateset <cmts> <mta> <acctcount> <bitrate> <packet size> <switch ip> <switch port>\n" " Send Gate-Set to cmts.\n"; return NULL; @@ -1387,7 +1387,7 @@ static char *pktccops_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_arg switch (cmd) { case CLI_INIT: e->command = "pktccops set debug {on|off}"; - e->usage = + e->usage = "Usage: pktccops set debug {on|off}\n" " Turn on/off debuging\n"; return NULL; @@ -1519,4 +1519,3 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "PktcCOPS manager .unload = unload_module, .reload = reload_module, ); - diff --git a/res/res_realtime.c b/res/res_realtime.c index b26cde5b3..4291b519c 100644 --- a/res/res_realtime.c +++ b/res/res_realtime.c @@ -23,7 +23,7 @@ * * \author Anthony Minessale <anthmct@yahoo.com> * \author Mark Spencer <markster@digium.com> - * + * * \ingroup applications */ @@ -44,7 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/cli.h" -static char *cli_realtime_load(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +static char *cli_realtime_load(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { #define CRL_HEADER_FORMAT "%30s %-30s\n" struct ast_variable *var = NULL, *orig_var = NULL; @@ -62,7 +62,7 @@ static char *cli_realtime_load(struct ast_cli_entry *e, int cmd, struct ast_cli_ } - if (a->argc < 5) + if (a->argc < 5) return CLI_SHOWUSAGE; var = ast_load_realtime_all(a->argv[2], a->argv[3], a->argv[4], SENTINEL); @@ -100,7 +100,7 @@ static char *cli_realtime_update(struct ast_cli_entry *e, int cmd, struct ast_cl return NULL; } - if (a->argc < 7) + if (a->argc < 7) return CLI_SHOWUSAGE; res = ast_update_realtime(a->argv[2], a->argv[3], a->argv[4], a->argv[5], a->argv[6], SENTINEL); @@ -135,7 +135,7 @@ static char *cli_realtime_update2(struct ast_cli_entry *e, int cmd, struct ast_c return NULL; } - if (a->argc < 7) + if (a->argc < 7) return CLI_SHOWUSAGE; if (a->argc == 7) { diff --git a/res/res_rtp_multicast.c b/res/res_rtp_multicast.c index fd3ae21ef..70d9f3de4 100644 --- a/res/res_rtp_multicast.c +++ b/res/res_rtp_multicast.c @@ -96,7 +96,7 @@ struct multicast_rtp { unsigned int ssrc; /*! Sequence number, used when creating/sending the RTP packet */ uint16_t seqno; - unsigned int lastts; + unsigned int lastts; struct timeval txcore; struct ast_smoother *smoother; }; diff --git a/res/res_smdi.c b/res/res_smdi.c index 5288bbee5..8622da4a0 100644 --- a/res/res_smdi.c +++ b/res/res_smdi.c @@ -251,7 +251,7 @@ static void smdi_interface_destroy(void *obj) ast_module_unref(ast_module_info->self); } -/*! +/*! * \internal * \brief Push an SMDI message to the back of an interface's message queue. * \param iface a pointer to the interface to use. @@ -326,10 +326,10 @@ static inline int lock_msg_q(struct ast_smdi_interface *iface, enum smdi_message switch (type) { case SMDI_MWI: return ast_mutex_lock(&iface->mwi_q_lock); - case SMDI_MD: + case SMDI_MD: return ast_mutex_lock(&iface->md_q_lock); } - + return -1; } @@ -377,7 +377,7 @@ static void purge_old_messages(struct ast_smdi_interface *iface, enum smdi_messa struct timeval now = ast_tvnow(); long elapsed = 0; void *msg; - + lock_msg_q(iface, type); msg = unlink_from_msg_q(iface, type); unlock_msg_q(iface, type); @@ -391,7 +391,7 @@ static void purge_old_messages(struct ast_smdi_interface *iface, enum smdi_messa ao2_ref(msg, -1); ast_log(LOG_NOTICE, "Purged expired message from %s SMDI %s message queue. " "Message was %ld milliseconds too old.\n", - iface->name, (type == SMDI_MD) ? "MD" : "MWI", + iface->name, (type == SMDI_MD) ? "MD" : "MWI", elapsed - iface->msg_expiry); lock_msg_q(iface, type); @@ -475,7 +475,7 @@ static void *smdi_msg_find(struct ast_smdi_interface *iface, return msg; } -static void *smdi_message_wait(struct ast_smdi_interface *iface, int timeout, +static void *smdi_message_wait(struct ast_smdi_interface *iface, int timeout, enum smdi_message_type type, const char *search_key, struct ast_flags options) { struct timeval start; @@ -574,7 +574,7 @@ struct ast_smdi_interface * AST_OPTIONAL_API_NAME(ast_smdi_interface_find)(const return iface; } -/*! +/*! * \internal * \brief Read an SMDI message. * @@ -971,7 +971,7 @@ static int smdi_load(int reload) tcflag_t paritybit = PARENB; /* even parity checking */ tcflag_t charsize = CS7; /* seven bit characters */ int stopbits = 0; /* One stop bit */ - + int msdstrip = 0; /* strip zero digits */ long msg_expiry = SMDI_MSG_EXPIRY_TIME; @@ -1054,7 +1054,7 @@ static int smdi_load(int reload) continue; } } - + if (!(iface = alloc_smdi_interface())) continue; @@ -1082,19 +1082,19 @@ static int smdi_load(int reload) ast_log(LOG_ERROR, "Error setting baud rate on %s (%s)\n", iface->name, strerror(errno)); continue; } - + /* set the stop bits */ if (stopbits) iface->mode.c_cflag = iface->mode.c_cflag | CSTOPB; /* set two stop bits */ else iface->mode.c_cflag = iface->mode.c_cflag & ~CSTOPB; /* set one stop bit */ - + /* set the parity */ iface->mode.c_cflag = (iface->mode.c_cflag & ~PARENB & ~PARODD) | paritybit; - + /* set the character size */ iface->mode.c_cflag = (iface->mode.c_cflag & ~CSIZE) | charsize; - + /* commit the desired attributes */ if (tcsetattr(iface->fd, TCSAFLUSH, &iface->mode)) { ast_log(LOG_ERROR, "Error setting attributes on %s (%s)\n", iface->name, strerror(errno)); @@ -1160,7 +1160,7 @@ static int smdi_load(int reload) if (ao2_container_count(new_ifaces)) { res = 1; } - + return res; } @@ -1331,7 +1331,7 @@ static int smdi_msg_read(struct ast_channel *chan, const char *cmd, char *data, ast_channel_lock(chan); datastore = ast_channel_datastore_find(chan, &smdi_msg_datastore_info, args.id); ast_channel_unlock(chan); - + if (!datastore) { ast_log(LOG_WARNING, "No SMDI message found for message ID '%s'\n", args.id); goto return_error; @@ -1381,8 +1381,8 @@ static int _unload_module(int fromload); * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_snmp.c b/res/res_snmp.c index c7cfa3174..79ff4b1e5 100644 --- a/res/res_snmp.c +++ b/res/res_snmp.c @@ -109,8 +109,8 @@ static int load_config(void) * Module loading including tests for configuration or dependencies. * This function can return AST_MODULE_LOAD_FAILURE, AST_MODULE_LOAD_DECLINE, * or AST_MODULE_LOAD_SUCCESS. If a dependency or environment variable fails - * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the - * configuration file or other non-critical problem return + * tests return AST_MODULE_LOAD_FAILURE. If the module can not load the + * configuration file or other non-critical problem return * AST_MODULE_LOAD_DECLINE. On success return AST_MODULE_LOAD_SUCCESS. */ static int load_module(void) diff --git a/res/res_sorcery_realtime.c b/res/res_sorcery_realtime.c index 1c52eb90f..9b0b25fb1 100644 --- a/res/res_sorcery_realtime.c +++ b/res/res_sorcery_realtime.c @@ -97,7 +97,7 @@ static int sorcery_realtime_create(const struct ast_sorcery *sorcery, void *data return (ast_store_realtime_fields(config->family, fields) <= 0) ? -1 : 0; } -/*! \brief Internal helper function which returns a filtered objectset. +/*! \brief Internal helper function which returns a filtered objectset. * * The following are filtered out of the objectset: * \li The id field. This is returned to the caller in an out parameter. diff --git a/res/res_srtp.c b/res/res_srtp.c index 74587d55d..773d53316 100644 --- a/res/res_srtp.c +++ b/res/res_srtp.c @@ -196,7 +196,7 @@ static struct ast_srtp *res_srtp_new(void) ast_free(srtp); return NULL; } - + srtp->warned = 1; return srtp; @@ -453,7 +453,7 @@ static int ast_srtp_protect(struct ast_srtp *srtp, void **buf, int *len, int rtc if ((*len + SRTP_MAX_TRAILER_LEN) > sizeof(srtp->buf)) { return -1; } - + localbuf = rtcp ? srtp->rtcpbuf : srtp->buf; memcpy(localbuf, *buf, *len); diff --git a/res/res_timing_dahdi.c b/res/res_timing_dahdi.c index 1ef5117c7..72983fa06 100644 --- a/res/res_timing_dahdi.c +++ b/res/res_timing_dahdi.c @@ -16,11 +16,11 @@ * at the top of the source tree. */ -/*! +/*! * \file * \author Russell Bryant <russell@digium.com> * - * \brief DAHDI timing interface + * \brief DAHDI timing interface */ /*** MODULEINFO @@ -156,7 +156,7 @@ static enum ast_timer_event dahdi_timer_get_event(void *data) return AST_TIMING_EVENT_CONTINUOUS; case DAHDI_EVENT_TIMER_EXPIRED: default: - return AST_TIMING_EVENT_EXPIRED; + return AST_TIMING_EVENT_EXPIRED; } } @@ -178,7 +178,7 @@ static int dahdi_test_timer(void) { int fd; int x = 160; - + fd = open("/dev/dahdi/timer", O_RDWR); if (fd < 0) { diff --git a/res/res_timing_pthread.c b/res/res_timing_pthread.c index 0654059f9..f57c737f6 100644 --- a/res/res_timing_pthread.c +++ b/res/res_timing_pthread.c @@ -134,7 +134,7 @@ static void *pthread_timer_open(void) for (i = 0; i < ARRAY_LEN(timer->pipe); ++i) { ast_fd_set_flags(timer->pipe[i], O_NONBLOCK); } - + ao2_lock(pthread_timers); if (!ao2_container_count(pthread_timers)) { ast_mutex_lock(&timing_thread.lock); diff --git a/res/snmp/agent.c b/res/snmp/agent.c index 7cd895559..ffec44406 100644 --- a/res/snmp/agent.c +++ b/res/snmp/agent.c @@ -555,7 +555,7 @@ static u_char *ast_var_channel_types_table(struct variable *vp, oid *name, size_ ast_variables_destroy(channel_types); if (next == NULL || tech == NULL) return NULL; - + switch (vp->magic) { case ASTCHANTYPEINDEX: long_ret = name[*length - 1]; diff --git a/res/stasis/app.c b/res/stasis/app.c index 1e885c6f8..5366819b6 100644 --- a/res/stasis/app.c +++ b/res/stasis/app.c @@ -1565,5 +1565,3 @@ void stasis_app_unregister_event_sources(void) stasis_app_unregister_event_source(&bridge_event_source); stasis_app_unregister_event_source(&channel_event_source); } - - |