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 1712 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().

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 }


Generated on Sat Nov 25 19:09:52 2006 for Asterisk by  doxygen 1.4.2