Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

ast_expr.h File Reference

Go to the source code of this file.

Functions

char * ast_expr (char *arg)


Function Documentation

char* ast_expr char *  arg  ) 
 

Definition at line 1674 of file ast_expr.c.

References parser_control::arg_orig, parser_control::argv, parser_control::firsttoken, free, integer, malloc, parser_control::result, and strdup.

Referenced by pbx_substitute_variables_helper().

01675 { 01676 struct parser_control karoto; 01677 01678 char *kota; 01679 char *pirouni; 01680 01681 kota=strdup(arg); 01682 karoto.result = NULL; 01683 karoto.firsttoken=1; 01684 karoto.argv=kota; 01685 karoto.arg_orig = arg; 01686 /* ast_yydebug = 1; */ 01687 01688 ast_yyparse ((void *)&karoto); 01689 01690 free(kota); 01691 01692 if (karoto.result==NULL) { 01693 pirouni=strdup("0"); 01694 return(pirouni); 01695 } else { 01696 if (karoto.result->type == integer) { 01697 pirouni=malloc(256); 01698 sprintf (pirouni,"%lld", (long long)karoto.result->u.i); 01699 } 01700 else { 01701 pirouni=strdup(karoto.result->u.s); 01702 } 01703 free(karoto.result); 01704 } 01705 return(pirouni); 01706 }


Generated on Fri Sep 24 21:03:49 2004 for Asterisk by doxygen 1.3.8