[asterisk-commits] oej: branch 1.6.1 r242916 - in /branches/1.6.1: ./ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 25 14:49:49 CST 2010
Author: oej
Date: Mon Jan 25 14:49:45 2010
New Revision: 242916
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242916
Log:
Merged revisions 242904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r242904 | oej | 2010-01-25 21:27:59 +0100 (Mån, 25 Jan 2010) | 10 lines
Merged revisions 242850 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r242850 | oej | 2010-01-25 21:03:38 +0100 (Mån, 25 Jan 2010) | 2 lines
Report error when writing to functions returns error in AMI setvar action
........
................
Modified:
branches/1.6.1/ (props changed)
branches/1.6.1/main/ast_expr2.h
branches/1.6.1/main/ast_expr2f.c
branches/1.6.1/main/manager.c
Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.1/main/ast_expr2.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/main/ast_expr2.h?view=diff&rev=242916&r1=242915&r2=242916
==============================================================================
--- branches/1.6.1/main/ast_expr2.h (original)
+++ branches/1.6.1/main/ast_expr2.h Mon Jan 25 14:49:45 2010
@@ -94,13 +94,13 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 345 "/home/murf/asterisk/1.6.1/main/ast_expr2.y"
+#line 345 "ast_expr2.y"
{
struct val *val;
struct expr_node *arglist;
}
/* Line 1489 of yacc.c. */
-#line 104 "/home/murf/asterisk/1.6.1/main/ast_expr2.h"
+#line 104 "ast_expr2.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
Modified: branches/1.6.1/main/ast_expr2f.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/main/ast_expr2f.c?view=diff&rev=242916&r1=242915&r2=242916
==============================================================================
--- branches/1.6.1/main/ast_expr2f.c (original)
+++ branches/1.6.1/main/ast_expr2f.c Mon Jan 25 14:49:45 2010
@@ -11,7 +11,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 33
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -33,7 +33,7 @@
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
* if you want the limit (max/min) macros for int types.
@@ -56,6 +56,7 @@
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -86,8 +87,6 @@
#define UINT32_MAX (4294967295U)
#endif
-#endif /* ! C99 */
-
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -97,12 +96,11 @@
#else /* ! __cplusplus */
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
+#if __STDC__
#define YY_USE_CONST
-#endif /* defined (__STDC__) */
+#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef YY_USE_CONST
@@ -137,6 +135,8 @@
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r
+
+int ast_yylex_init (yyscan_t* scanner);
/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
@@ -195,9 +195,14 @@
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
+typedef unsigned int yy_size_t;
#endif
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -596,7 +601,7 @@
static int curlycount = 0;
static char *expr2_token_subst(const char *mess);
-#line 598 "ast_expr2f.c"
+#line 603 "ast_expr2f.c"
#define INITIAL 0
#define var 1
@@ -660,10 +665,6 @@
# define yylloc yyg->yylloc_r
-int ast_yylex_init (yyscan_t* scanner);
-
-int ast_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
-
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
@@ -743,7 +744,7 @@
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -808,11 +809,9 @@
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int ast_yylex \
- (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
-
-#define YY_DECL int ast_yylex \
- (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
+extern int ast_yylex (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
+
+#define YY_DECL int ast_yylex (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
#endif /* !YY_DECL */
/* Code executed at the beginning of each rule, after yytext and yyleng
@@ -842,7 +841,7 @@
#line 125 "ast_expr2.fl"
-#line 844 "ast_expr2f.c"
+#line 843 "ast_expr2f.c"
yylval = yylval_param;
@@ -1188,7 +1187,7 @@
#line 233 "ast_expr2.fl"
ECHO;
YY_BREAK
-#line 1190 "ast_expr2f.c"
+#line 1189 "ast_expr2f.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(var):
yyterminate();
@@ -1422,7 +1421,7 @@
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- yyg->yy_n_chars, (size_t) num_to_read );
+ yyg->yy_n_chars, num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -1445,14 +1444,6 @@
else
ret_val = EOB_ACT_CONTINUE_SCAN;
-
- if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
- /* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ast_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
- }
yyg->yy_n_chars += number_to_move;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
@@ -1882,9 +1873,7 @@
yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
- if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
-
+
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
yyg->yy_buffer_stack_max = num_to_alloc;
@@ -1902,8 +1891,6 @@
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
- if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -1948,7 +1935,7 @@
/** Setup the input buffer state to scan a string. The next call to ast_yylex() will
* scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
+ * @param str a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
@@ -2222,42 +2209,6 @@
return yy_init_globals ( *ptr_yy_globals );
}
-/* ast_yylex_init_extra has the same functionality as ast_yylex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to ast_yyalloc in
- * the yyextra field.
- */
-
-int ast_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
-{
- struct yyguts_t dummy_yyguts;
-
- ast_yyset_extra (yy_user_defined, &dummy_yyguts);
-
- if (ptr_yy_globals == NULL){
- errno = EINVAL;
- return 1;
- }
-
- *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
- if (*ptr_yy_globals == NULL){
- errno = ENOMEM;
- return 1;
- }
-
- /* By setting to 0xAA, we expose bugs in
- yy_init_globals. Leave at 0x00 for releases. */
- memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
- ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
-
- return yy_init_globals ( *ptr_yy_globals );
-}
-
static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2379,10 +2330,10 @@
void ast_yyfree(void *ptr, yyscan_t yyscanner)
{
- /* the normal generated ast_yyfree func just frees its first arg;
- this get complaints on some systems, as sometimes this
- arg is a nil ptr! It's usually not fatal, but is irritating! */
- free( (char *) ptr );
+ /* the normal generated ast_yyfree func just frees its first arg;
+ this get complaints on some systems, as sometimes this
+ arg is a nil ptr! It's usually not fatal, but is irritating! */
+ free( (char *) ptr );
}
int ast_expr(char *expr, char *buf, int length, struct ast_channel *chan)
Modified: branches/1.6.1/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/main/manager.c?view=diff&rev=242916&r1=242915&r2=242916
==============================================================================
--- branches/1.6.1/main/manager.c (original)
+++ branches/1.6.1/main/manager.c Mon Jan 25 14:49:45 2010
@@ -1788,7 +1788,8 @@
const char *name = astman_get_header(m, "Channel");
const char *varname = astman_get_header(m, "Variable");
const char *varval = astman_get_header(m, "Value");
-
+ int res = 0;
+
if (ast_strlen_zero(varname)) {
astman_send_error(s, m, "No variable specified");
return 0;
@@ -1801,14 +1802,20 @@
return 0;
}
}
-
- pbx_builtin_setvar_helper(c, varname, S_OR(varval, ""));
+ if (varname[strlen(varname)-1] == ')') {
+ char *function = ast_strdupa(varname);
+ res = ast_func_write(c, function, varval);
+ } else {
+ pbx_builtin_setvar_helper(c, varname, S_OR(varval, ""));
+ }
if (c)
ast_channel_unlock(c);
-
- astman_send_ack(s, m, "Variable Set");
-
+ if (res == 0) {
+ astman_send_ack(s, m, "Variable Set");
+ } else {
+ astman_send_error(s, m, "Variable not set");
+ }
return 0;
}
More information about the asterisk-commits
mailing list