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 1540 of file ast_expr.c.

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

Referenced by pbx_substitute_variables_helper().

01540 {
01541    struct parser_control karoto;
01542 
01543    char *kota;
01544    char *pirouni;
01545    
01546    kota=strdup(arg);
01547    karoto.result = NULL;
01548    karoto.firsttoken=1;
01549    karoto.argv=kota;
01550 
01551    ast_yyparse ((void *)&karoto);
01552 
01553    free(kota);
01554 
01555    if (karoto.result==NULL) {
01556       pirouni=strdup("0");
01557       return(pirouni);
01558    } else {
01559       if (karoto.result->type == integer) {
01560          pirouni=malloc(256);
01561          sprintf (pirouni,"%lld", (long long)karoto.result->u.i);
01562       }
01563       else {
01564          pirouni=strdup(karoto.result->u.s);
01565       }
01566       free(karoto.result);
01567    }
01568    return(pirouni);
01569 }
01570 


Generated on Sun Apr 18 23:33:56 2004 for Asterisk by doxygen 1.3.6-20040222