Main Page | Alphabetical List | Data Structures | Directories | 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 1752 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().

01753 {
01754    struct parser_control karoto;
01755 
01756    char *kota;
01757    char *pirouni;
01758    
01759    kota=strdup(arg);
01760    karoto.result = NULL;
01761    karoto.firsttoken=1;
01762    karoto.argv=kota;
01763    karoto.arg_orig = arg;
01764    /* ast_yydebug = 1; */
01765    
01766    ast_yyparse ((void *)&karoto);
01767 
01768    free(kota);
01769 
01770    if (karoto.result==NULL) {
01771       pirouni=strdup("0");
01772       return(pirouni);
01773    } else {
01774       if (karoto.result->type == integer) {
01775          pirouni=malloc(256);
01776          sprintf (pirouni,"%lld", (long long)karoto.result->u.i);
01777       }
01778       else {
01779          pirouni=strdup(karoto.result->u.s);
01780       }
01781       free(karoto.result);
01782    }
01783    return(pirouni);
01784 }


Generated on Wed Aug 10 11:36:33 2005 for Asterisk by  doxygen 1.4.4