aboutsummaryrefslogtreecommitdiffstats
path: root/main/ast_expr2.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-27 16:36:39 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-27 16:36:39 +0000
commit3d0c27970e149ee3d6091f0af18ba79ee10d51c3 (patch)
tree2f1227fdee497a2c12e434f0f60dcddb0b00bf7f /main/ast_expr2.c
parent312c2ae1ebd7309cc68bb576a7471dac0edffa47 (diff)
Merged revisions 144949-144951 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r144949 | kpfleming | 2008-09-27 10:52:56 -0500 (Sat, 27 Sep 2008) | 17 lines Merged revisions 144924-144925 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r144924 | kpfleming | 2008-09-27 10:00:48 -0500 (Sat, 27 Sep 2008) | 6 lines improve header inclusion process in a few small ways: - it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled - simplify the usage of some of these headers in the AEL-related stuff in the utils directory ........ r144925 | kpfleming | 2008-09-27 10:13:30 -0500 (Sat, 27 Sep 2008) | 2 lines fix some minor issues with rev 144924 ........ ................ r144950 | kpfleming | 2008-09-27 11:10:33 -0500 (Sat, 27 Sep 2008) | 2 lines fix bugs caused by r144949 when MALLOC_DEBUG is defined ................ r144951 | kpfleming | 2008-09-27 11:17:43 -0500 (Sat, 27 Sep 2008) | 1 line remove incorrect comment ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@144991 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/ast_expr2.c')
-rw-r--r--main/ast_expr2.c66
1 files changed, 7 insertions, 59 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index 693a7896a..2534938b2 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -131,11 +131,14 @@
* $FreeBSD: src/bin/expr/expr.y,v 1.16 2000/07/22 10:59:36 se Exp $
*/
+#include "asterisk.h"
+
#include <sys/types.h>
#include <stdio.h>
-#include "asterisk.h"
+
+#if !defined(STANDALONE)
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-#ifdef STANDALONE
+#else
#ifndef __USE_ISOC99
#define __USE_ISOC99 1
#endif
@@ -423,7 +426,6 @@ static int to_number __P((struct val *));
static void to_string __P((struct val *));
static struct expr_node *alloc_expr_node(enum node_type);
static void destroy_arglist(struct expr_node *arglist);
-static int is_really_num(char *str);
/* uh, if I want to predeclare yylex with a YYLTYPE, I have to predeclare the yyltype... sigh */
typedef struct yyltype
@@ -2473,61 +2475,6 @@ is_zero_or_null (struct val *vp)
/* NOTREACHED */
}
-#ifdef STANDALONE
-
-void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
-{
- va_list vars;
- va_start(vars,fmt);
-
- printf("LOG: lev:%d file:%s line:%d func: %s ",
- level, file, line, function);
- vprintf(fmt, vars);
- fflush(stdout);
- va_end(vars);
-}
-
-
-int main(int argc,char **argv) {
- char s[4096];
- char out[4096];
- FILE *infile;
-
- if( !argv[1] )
- exit(20);
-
- if( access(argv[1],F_OK)== 0 )
- {
- int ret;
-
- infile = fopen(argv[1],"r");
- if( !infile )
- {
- printf("Sorry, couldn't open %s for reading!\n", argv[1]);
- exit(10);
- }
- while( fgets(s,sizeof(s),infile) )
- {
- if( s[strlen(s)-1] == '\n' )
- s[strlen(s)-1] = 0;
-
- ret = ast_expr(s, out, sizeof(out),NULL);
- printf("Expression: %s Result: [%d] '%s'\n",
- s, ret, out);
- }
- fclose(infile);
- }
- else
- {
- if (ast_expr(argv[1], s, sizeof(s), NULL))
- printf("=====%s======\n",s);
- else
- printf("No result\n");
- }
-}
-
-#endif
-
#undef ast_yyerror
#define ast_yyerror(x) ast_yyerror(x, YYLTYPE *yylloc, struct parse_io *parseio)
@@ -2552,6 +2499,7 @@ static void destroy_arglist(struct expr_node *arglist)
}
}
+#if !defined(STANDALONE)
static char *compose_func_args(struct expr_node *arglist)
{
struct expr_node *t = arglist;
@@ -2601,7 +2549,7 @@ static int is_really_num(char *str)
else
return 0;
}
-
+#endif
static struct val *op_func(struct val *funcname, struct expr_node *arglist, struct ast_channel *chan)
{