Go to the source code of this file.
Functions | |
char * | ast_expr (char *arg) |
|
Definition at line 1712 of file ast_expr.c. References parser_control::arg_orig, parser_control::argv, parser_control::firsttoken, free, val::i, integer, malloc, parser_control::result, val::s, strdup, val::type, and val::u. Referenced by pbx_substitute_variables_helper(). 01713 { 01714 struct parser_control karoto; 01715 01716 char *kota; 01717 char *pirouni; 01718 01719 kota=strdup(arg); 01720 karoto.result = NULL; 01721 karoto.firsttoken=1; 01722 karoto.argv=kota; 01723 karoto.arg_orig = arg; 01724 /* ast_yydebug = 1; */ 01725 01726 ast_yyparse ((void *)&karoto); 01727 01728 free(kota); 01729 01730 if (karoto.result==NULL) { 01731 pirouni=strdup("0"); 01732 return(pirouni); 01733 } else { 01734 if (karoto.result->type == integer) { 01735 pirouni=malloc(256); 01736 sprintf (pirouni,"%lld", (long long)karoto.result->u.i); 01737 } 01738 else { 01739 pirouni=strdup(karoto.result->u.s); 01740 } 01741 free(karoto.result); 01742 } 01743 return(pirouni); 01744 }
|