Wed Mar 4 19:58:22 2009

Asterisk developer's documentation


ast_expr2f.c File Reference

Dialplan Expression Lexical Scanner. More...

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "asterisk.h"
#include <sys/types.h>
#include <locale.h>
#include <ctype.h>
#include <regex.h>
#include <limits.h>
#include "asterisk/ast_expr.h"
#include "asterisk/logger.h"
#include "asterisk/strings.h"
#include "ast_expr2.h"
#include <unistd.h>

Go to the source code of this file.

Data Structures

struct  parse_io
struct  val
struct  yy_buffer_state
struct  yy_trans_info
struct  yyguts_t

Defines

#define ast_yywrap(n)   1
#define BEGIN   yyg->yy_start = 1 + 2 *
#define ECHO   do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#define EOB_ACT_CONTINUE_SCAN   0
#define EOB_ACT_END_OF_FILE   1
#define EOB_ACT_LAST_MATCH   2
#define FLEX_BETA
#define FLEX_SCANNER
#define INITIAL   0
#define INT16_MAX   (32767)
#define INT16_MIN   (-32767-1)
#define INT32_MAX   (2147483647)
#define INT32_MIN   (-2147483647-1)
#define INT8_MAX   (127)
#define INT8_MIN   (-128)
#define REJECT   reject_used_but_not_detected
#define SET_COLUMNS
#define SET_NUMERIC_STRING
#define SET_STRING
#define trail   2
#define UINT16_MAX   (65535U)
#define UINT32_MAX   (4294967295U)
#define UINT8_MAX   (255U)
#define unput(c)   yyunput( c, yyg->yytext_ptr , yyscanner )
#define var   1
#define YY_AT_BOL()   (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
#define YY_BREAK   break;
#define YY_BUF_SIZE   16384
#define YY_BUFFER_EOF_PENDING   2
#define YY_BUFFER_NEW   0
#define YY_BUFFER_NORMAL   1
#define YY_CURRENT_BUFFER
#define YY_CURRENT_BUFFER_LVALUE   yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
#define YY_DECL
#define YY_DECL_IS_OURS   1
#define YY_DO_BEFORE_ACTION
#define YY_END_OF_BUFFER   36
#define YY_END_OF_BUFFER_CHAR   0
#define YY_EXIT_FAILURE   2
#define YY_EXTRA_TYPE   void *
#define YY_FATAL_ERROR(msg)   yy_fatal_error( msg , yyscanner)
#define yy_flex_debug   yyg->yy_flex_debug_r
#define YY_FLEX_MAJOR_VERSION   2
#define YY_FLEX_MINOR_VERSION   5
#define YY_FLEX_SUBMINOR_VERSION   35
#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
#define YY_INPUT(buf, result, max_size)
#define YY_INT_ALIGNED   short int
#define YY_LESS_LINENO(n)
#define YY_MORE_ADJ   yyg->yy_more_len
#define yy_new_buffer   ast_yy_create_buffer
#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )
#define YY_NULL   0
#define YY_NUM_RULES   35
#define YY_READ_BUF_SIZE   8192
#define YY_RESTORE_YY_MORE_OFFSET
#define YY_RULE_SETUP   YY_USER_ACTION
#define YY_SC_TO_UI(c)   ((unsigned int) (unsigned char) c)
#define yy_set_bol(at_bol)
#define yy_set_interactive(is_interactive)
#define YY_SKIP_YYWRAP
#define YY_START   ((yyg->yy_start - 1) / 2)
#define YY_START_STACK_INCR   25
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
#define YY_STATE_EOF(state)   (YY_END_OF_BUFFER + state + 1)
#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yyconst
#define yyextra   yyg->yyextra_r
#define yyin   yyg->yyin_r
#define yyleng   yyg->yyleng_r
#define yyless(n)
#define yyless(n)
#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yylloc   yyg->yylloc_r
#define yylval   yyg->yylval_r
#define yymore()   (yyg->yy_more_flag = 1)
#define yyout   yyg->yyout_r
#define YYSTATE   YY_START
#define YYTABLES_NAME   "yytables"
#define yyterminate()   return YY_NULL
#define yytext   yyg->yytext_r
#define yytext_ptr   yytext_r

Typedefs

typedef short int flex_int16_t
typedef int flex_int32_t
typedef signed char flex_int8_t
typedef unsigned short int flex_uint16_t
typedef unsigned int flex_uint32_t
typedef unsigned char flex_uint8_t
typedef yy_buffer_stateYY_BUFFER_STATE
typedef char YY_CHAR
typedef size_t yy_size_t
typedef int yy_state_type
typedef void * yyscan_t

Enumerations

enum  valtype { AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string }

Functions

int ast_expr (char *expr, char *buf, int length)
void ast_expr_clear_extra_error_info (void)
void ast_expr_register_extra_error_info (char *message)
YY_BUFFER_STATE ast_yy_create_buffer (FILE *file, int size, yyscan_t yyscanner)
void ast_yy_delete_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
void ast_yy_flush_buffer (YY_BUFFER_STATE b, yyscan_t yyscanner)
static void ast_yy_init_buffer (YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
static void ast_yy_load_buffer_state (yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_buffer (char *base, yy_size_t size, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_bytes (yyconst char *bytes, int len, yyscan_t yyscanner)
YY_BUFFER_STATE ast_yy_scan_string (yyconst char *yy_str, yyscan_t yyscanner)
void ast_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
void * ast_yyalloc (yy_size_t, yyscan_t yyscanner)
static void ast_yyensure_buffer_stack (yyscan_t yyscanner)
int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio)
int ast_yyerror (const char *, YYLTYPE *, struct parse_io *)
void ast_yyfree (void *, yyscan_t yyscanner)
int ast_yyget_column (yyscan_t yyscanner)
int ast_yyget_debug (yyscan_t yyscanner)
YY_EXTRA_TYPE ast_yyget_extra (yyscan_t yyscanner)
FILE * ast_yyget_in (yyscan_t yyscanner)
int ast_yyget_leng (yyscan_t yyscanner)
int ast_yyget_lineno (yyscan_t yyscanner)
YYLTYPEast_yyget_lloc (yyscan_t yyscanner)
YYSTYPEast_yyget_lval (yyscan_t yyscanner)
FILE * ast_yyget_out (yyscan_t yyscanner)
char * ast_yyget_text (yyscan_t yyscanner)
int ast_yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
int ast_yylex_destroy (yyscan_t yyscanner)
int ast_yylex_init (yyscan_t *scanner)
int ast_yylex_init_extra (YY_EXTRA_TYPE user_defined, yyscan_t *scanner)
int ast_yyparse (void *)
void ast_yypop_buffer_state (yyscan_t yyscanner)
void ast_yypush_buffer_state (YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
void * ast_yyrealloc (void *, yy_size_t, yyscan_t yyscanner)
void ast_yyrestart (FILE *input_file, yyscan_t yyscanner)
void ast_yyset_column (int column_no, yyscan_t yyscanner)
void ast_yyset_debug (int debug_flag, yyscan_t yyscanner)
void ast_yyset_extra (YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
void ast_yyset_in (FILE *in_str, yyscan_t yyscanner)
void ast_yyset_lineno (int line_number, yyscan_t yyscanner)
void ast_yyset_lloc (YYLTYPE *yylloc_param, yyscan_t yyscanner)
void ast_yyset_lval (YYSTYPE *yylval_param, yyscan_t yyscanner)
void ast_yyset_out (FILE *out_str, yyscan_t yyscanner)
static char * expr2_token_subst (const char *mess)
static int input (yyscan_t yyscanner)
static void yy_fatal_error (yyconst char *msg, yyscan_t yyscanner)
static void yy_fatal_error (yyconst char msg[], yyscan_t yyscanner)
static int yy_get_next_buffer (yyscan_t yyscanner)
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
static int yy_init_globals (yyscan_t yyscanner)
static yy_state_type yy_try_NUL_trans (yy_state_type current_state, yyscan_t yyscanner)
static void yyunput (int c, char *buf_ptr, yyscan_t yyscanner)

Variables

static int curlycount = 0
static char * expr2_token_equivs1 []
static char * expr2_token_equivs2 []
char extra_error_message [4095]
int extra_error_message_supplied = 0
static yyconst flex_int16_t yy_accept [54]
static yyconst yy_state_type yy_NUL_trans [54]
static yyconst flex_int16_t yy_nxt [][128]


Detailed Description

Dialplan Expression Lexical Scanner.

Definition in file ast_expr2f.c.


Define Documentation

#define ast_yywrap (  )     1

Definition at line 329 of file ast_expr2f.c.

#define BEGIN   yyg->yy_start = 1 + 2 *

Definition at line 143 of file ast_expr2f.c.

#define ECHO   do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)

Definition at line 1568 of file ast_expr2f.c.

Referenced by ast_hide_password(), ast_restore_tty(), and openserial().

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 174 of file ast_expr2f.c.

#define EOB_ACT_END_OF_FILE   1

Definition at line 175 of file ast_expr2f.c.

#define EOB_ACT_LAST_MATCH   2

Definition at line 176 of file ast_expr2f.c.

#define FLEX_BETA

Definition at line 14 of file ast_expr2f.c.

#define FLEX_SCANNER

Definition at line 9 of file ast_expr2f.c.

#define INITIAL   0

Definition at line 1423 of file ast_expr2f.c.

#define INT16_MAX   (32767)

Definition at line 72 of file ast_expr2f.c.

Referenced by fsaturate().

#define INT16_MIN   (-32767-1)

Definition at line 63 of file ast_expr2f.c.

Referenced by fsaturate().

#define INT32_MAX   (2147483647)

Definition at line 75 of file ast_expr2f.c.

#define INT32_MIN   (-2147483647-1)

Definition at line 66 of file ast_expr2f.c.

#define INT8_MAX   (127)

Definition at line 69 of file ast_expr2f.c.

#define INT8_MIN   (-128)

Definition at line 60 of file ast_expr2f.c.

#define REJECT   reject_used_but_not_detected

Definition at line 1323 of file ast_expr2f.c.

#define SET_COLUMNS

Value:

do {     \
   yylloc_param->first_column = (int)(yyg->yytext_r - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf); \
   yylloc_param->last_column += yyleng - 1; \
   yylloc_param->first_line = yylloc_param->last_line = 1; \
   } while (0)

Definition at line 1391 of file ast_expr2f.c.

#define SET_NUMERIC_STRING

Value:

do {  \
   yylval_param->val = calloc(1, sizeof(struct val)); \
   yylval_param->val->type = AST_EXPR_numeric_string; \
   yylval_param->val->u.s = strdup(yytext);  \
   } while (0)

Definition at line 1403 of file ast_expr2f.c.

#define SET_STRING

Value:

do {     \
   yylval_param->val = calloc(1, sizeof(struct val)); \
   yylval_param->val->type = AST_EXPR_string;      \
   yylval_param->val->u.s = strdup(yytext);     \
   } while (0)

Definition at line 1397 of file ast_expr2f.c.

#define trail   2

Definition at line 1425 of file ast_expr2f.c.

#define UINT16_MAX   (65535U)

Definition at line 81 of file ast_expr2f.c.

#define UINT32_MAX   (4294967295U)

Definition at line 84 of file ast_expr2f.c.

#define UINT8_MAX   (255U)

Definition at line 78 of file ast_expr2f.c.

#define unput (  )     yyunput( c, yyg->yytext_ptr , yyscanner )

Definition at line 194 of file ast_expr2f.c.

#define var   1

Definition at line 1424 of file ast_expr2f.c.

Referenced by acf_sprintf(), aji_create_client(), aji_load_config(), append_mailbox_mapping(), apply_options(), apply_options_full(), apply_outgoing(), ast_cdr_copy_vars(), ast_cdr_serialize_variables(), ast_channeltype_list(), ast_var_assign(), ast_var_delete(), ast_var_full_name(), ast_var_name(), ast_var_value(), astman_get_variables(), cli_realtime_load(), conf_exec(), config_text_file_save(), find_conf(), find_conf_realtime(), find_user_realtime(), function_realtime_read(), global_read(), gtalk_create_member(), gtalk_load_config(), handle_updates(), handle_uri(), html_translate(), inherit_category(), init_logger_chain(), init_manager(), load_config(), load_moh_classes(), move_variables(), odbc_load_module(), parse_config(), parse_cookies(), pbx_builtin_serialize_variables(), pbx_substitute_variables_helper_full(), process_my_load_module(), queue_function_queuewaitingcount(), realtime_alias(), realtime_canmatch(), realtime_common(), realtime_directory(), realtime_exec(), realtime_exists(), realtime_matchmore(), realtime_multi_odbc(), realtime_multi_pgsql(), realtime_odbc(), realtime_peer(), realtime_pgsql(), realtime_switch_common(), realtime_user(), reload_followme(), reload_queues(), retrieve_astcfgint(), sip_notify(), sla_add_trunk_to_station(), sla_build_station(), sla_build_trunk(), tds_load_module(), update_realtime_member_field(), vm_change_password(), and xml_translate().

 
#define YY_AT_BOL (  )     (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 325 of file ast_expr2f.c.

#define YY_BREAK   break;

Definition at line 1633 of file ast_expr2f.c.

#define YY_BUF_SIZE   16384

Definition at line 162 of file ast_expr2f.c.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 261 of file ast_expr2f.c.

#define YY_BUFFER_NEW   0

Definition at line 249 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), and ast_yy_scan_buffer().

#define YY_BUFFER_NORMAL   1

Definition at line 250 of file ast_expr2f.c.

#define YY_CURRENT_BUFFER

Value:

( yyg->yy_buffer_stack \
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
                          : NULL)

Definition at line 272 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), ast_yy_init_buffer(), ast_yyget_column(), ast_yyget_lineno(), ast_yylex_destroy(), ast_yypop_buffer_state(), ast_yypush_buffer_state(), ast_yyset_column(), and ast_yyset_lineno().

#define YY_CURRENT_BUFFER_LVALUE   yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]

Definition at line 279 of file ast_expr2f.c.

Referenced by ast_yyerror(), ast_yylex_destroy(), ast_yypop_buffer_state(), and ast_yypush_buffer_state().

#define YY_DECL

Value:

int ast_yylex \
               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)

Definition at line 1620 of file ast_expr2f.c.

#define YY_DECL_IS_OURS   1

Definition at line 1615 of file ast_expr2f.c.

#define YY_DO_BEFORE_ACTION

Definition at line 1283 of file ast_expr2f.c.

#define YY_END_OF_BUFFER   36

Definition at line 1292 of file ast_expr2f.c.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 158 of file ast_expr2f.c.

Referenced by ast_yy_flush_buffer(), ast_yy_scan_buffer(), and ast_yy_scan_bytes().

#define YY_EXIT_FAILURE   2

Definition at line 2772 of file ast_expr2f.c.

Referenced by yy_fatal_error().

#define YY_EXTRA_TYPE   void *

Definition at line 1436 of file ast_expr2f.c.

#define YY_FATAL_ERROR ( msg   )     yy_fatal_error( msg , yyscanner)

Definition at line 1606 of file ast_expr2f.c.

Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), and ast_yyensure_buffer_stack().

#define yy_flex_debug   yyg->yy_flex_debug_r

Definition at line 137 of file ast_expr2f.c.

Referenced by ast_yyget_debug(), and ast_yyset_debug().

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 10 of file ast_expr2f.c.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 11 of file ast_expr2f.c.

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 12 of file ast_expr2f.c.

#define YY_FLUSH_BUFFER   ast_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

Definition at line 293 of file ast_expr2f.c.

#define YY_INPUT ( buf,
result,
max_size   ) 

Definition at line 1575 of file ast_expr2f.c.

#define YY_INT_ALIGNED   short int

Definition at line 5 of file ast_expr2f.c.

#define YY_LESS_LINENO (  ) 

Definition at line 178 of file ast_expr2f.c.

#define YY_MORE_ADJ   yyg->yy_more_len

Definition at line 1325 of file ast_expr2f.c.

#define yy_new_buffer   ast_yy_create_buffer

Definition at line 303 of file ast_expr2f.c.

#define YY_NEW_FILE   ast_yyrestart(yyin ,yyscanner )

Definition at line 156 of file ast_expr2f.c.

#define YY_NULL   0

Definition at line 113 of file ast_expr2f.c.

#define YY_NUM_RULES   35

Definition at line 1291 of file ast_expr2f.c.

#define YY_READ_BUF_SIZE   8192

Definition at line 1560 of file ast_expr2f.c.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 1326 of file ast_expr2f.c.

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 1636 of file ast_expr2f.c.

#define YY_SC_TO_UI (  )     ((unsigned int) (unsigned char) c)

Definition at line 120 of file ast_expr2f.c.

#define yy_set_bol ( at_bol   ) 

Definition at line 315 of file ast_expr2f.c.

#define yy_set_interactive ( is_interactive   ) 

Definition at line 305 of file ast_expr2f.c.

#define YY_SKIP_YYWRAP

Definition at line 330 of file ast_expr2f.c.

#define YY_START   ((yyg->yy_start - 1) / 2)

Definition at line 149 of file ast_expr2f.c.

#define YY_START_STACK_INCR   25

Definition at line 1601 of file ast_expr2f.c.

#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

Definition at line 167 of file ast_expr2f.c.

#define YY_STATE_EOF ( state   )     (YY_END_OF_BUFFER + state + 1)

Definition at line 153 of file ast_expr2f.c.

#define yycolumn   (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)

Definition at line 136 of file ast_expr2f.c.

Referenced by ast_yyget_column(), and ast_yyset_column().

#define yyconst

Definition at line 109 of file ast_expr2f.c.

#define yyextra   yyg->yyextra_r

Definition at line 132 of file ast_expr2f.c.

Referenced by ast_yyget_extra(), and ast_yyset_extra().

#define yyin   yyg->yyin_r

Definition at line 130 of file ast_expr2f.c.

Referenced by ast_yyget_in(), ast_yyset_in(), and yy_init_globals().

#define yyleng   yyg->yyleng_r

Definition at line 133 of file ast_expr2f.c.

Referenced by ast_yyget_leng().

#define yyless (  ) 

Definition at line 2784 of file ast_expr2f.c.

#define yyless (  ) 

Definition at line 2784 of file ast_expr2f.c.

#define yylineno   (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)

Definition at line 135 of file ast_expr2f.c.

Referenced by ast_yyget_lineno(), and ast_yyset_lineno().

#define yylloc   yyg->yylloc_r

Definition at line 1483 of file ast_expr2f.c.

#define yylval   yyg->yylval_r

Definition at line 1481 of file ast_expr2f.c.

 
#define yymore (  )     (yyg->yy_more_flag = 1)

Definition at line 1324 of file ast_expr2f.c.

#define yyout   yyg->yyout_r

Definition at line 131 of file ast_expr2f.c.

Referenced by ast_yyget_out(), ast_yyset_out(), and yy_init_globals().

#define YYSTATE   YY_START

Definition at line 150 of file ast_expr2f.c.

#define YYTABLES_NAME   "yytables"

Definition at line 3136 of file ast_expr2f.c.

 
#define yyterminate (  )     return YY_NULL

Definition at line 1596 of file ast_expr2f.c.

#define yytext   yyg->yytext_r

Definition at line 134 of file ast_expr2f.c.

Referenced by ast_yyerror(), and ast_yyget_text().

#define yytext_ptr   yytext_r

Definition at line 336 of file ast_expr2f.c.


Typedef Documentation

typedef short int flex_int16_t

Definition at line 52 of file ast_expr2f.c.

typedef int flex_int32_t

Definition at line 53 of file ast_expr2f.c.

typedef signed char flex_int8_t

Definition at line 51 of file ast_expr2f.c.

typedef unsigned short int flex_uint16_t

Definition at line 55 of file ast_expr2f.c.

typedef unsigned int flex_uint32_t

Definition at line 56 of file ast_expr2f.c.

typedef unsigned char flex_uint8_t

Definition at line 54 of file ast_expr2f.c.

typedef struct yy_buffer_state* YY_BUFFER_STATE

Definition at line 171 of file ast_expr2f.c.

typedef char YY_CHAR

Definition at line 332 of file ast_expr2f.c.

typedef size_t yy_size_t

Definition at line 198 of file ast_expr2f.c.

typedef int yy_state_type

Definition at line 334 of file ast_expr2f.c.

typedef void* yyscan_t

Definition at line 125 of file ast_expr2f.c.


Enumeration Type Documentation

enum valtype

Enumerator:
AST_EXPR_integer 
AST_EXPR_numeric_string 
AST_EXPR_string 

Definition at line 1377 of file ast_expr2f.c.


Function Documentation

int ast_expr ( char *  expr,
char *  buf,
int  length 
)

Definition at line 3159 of file ast_expr2f.c.

References ast_copy_string(), AST_EXPR_integer, ast_yy_scan_string(), ast_yylex_destroy(), ast_yylex_init(), ast_yyparse(), free, and io.

Referenced by check_pval_item(), and pbx_substitute_variables_helper_full().

03160 {
03161    struct parse_io io;
03162    int return_value = 0;
03163    
03164    memset(&io, 0, sizeof(io));
03165    io.string = expr;  /* to pass to the error routine */
03166    
03167    ast_yylex_init(&io.scanner);
03168    
03169    ast_yy_scan_string(expr, io.scanner);
03170    
03171    ast_yyparse ((void *) &io);
03172 
03173    ast_yylex_destroy(io.scanner);
03174 
03175    if (!io.val) {
03176       if (length > 1) {
03177          strcpy(buf, "0");
03178          return_value = 1;
03179       }
03180    } else {
03181       if (io.val->type == AST_EXPR_integer) {
03182          int res_length;
03183 
03184          res_length = snprintf(buf, length, "%ld", (long int) io.val->u.i);
03185          return_value = (res_length <= length) ? res_length : length;
03186       } else {
03187 #if defined(STANDALONE) || defined(LOW_MEMORY) || defined(STANDALONE_AEL)
03188          strncpy(buf, io.val->u.s, length - 1);
03189 #else /* !STANDALONE && !LOW_MEMORY */
03190          ast_copy_string(buf, io.val->u.s, length);
03191 #endif /* STANDALONE || LOW_MEMORY */
03192          return_value = strlen(buf);
03193          free(io.val->u.s);
03194       }
03195       free(io.val);
03196    }
03197    return return_value;
03198 }

void ast_expr_clear_extra_error_info ( void   ) 

Definition at line 3212 of file ast_expr2f.c.

Referenced by check_pval_item().

03213 {
03214        extra_error_message_supplied=0;
03215        extra_error_message[0] = 0;
03216 }

void ast_expr_register_extra_error_info ( char *  message  ) 

Definition at line 3206 of file ast_expr2f.c.

Referenced by check_pval_item().

03207 {
03208        extra_error_message_supplied=1;
03209        strcpy(extra_error_message, message);
03210 }

YY_BUFFER_STATE ast_yy_create_buffer ( FILE *  file,
int  size,
yyscan_t  yyscanner 
)

void ast_yy_delete_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Referenced by ast_yylex_destroy(), and ast_yypop_buffer_state().

void ast_yy_flush_buffer ( YY_BUFFER_STATE  b,
yyscan_t  yyscanner 
)

Discard all buffered characters. On the next scan, YY_INPUT will be called.

Parameters:
b the buffer state to be flushed, usually YY_CURRENT_BUFFER.
yyscanner The scanner object.

Definition at line 2560 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, and yy_buffer_state::yy_n_chars.

Referenced by ast_yy_init_buffer().

02561 {
02562     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02563    if ( ! b )
02564       return;
02565 
02566    b->yy_n_chars = 0;
02567 
02568    /* We always need two end-of-buffer characters.  The first causes
02569     * a transition to the end-of-buffer state.  The second causes
02570     * a jam in that state.
02571     */
02572    b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
02573    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
02574 
02575    b->yy_buf_pos = &b->yy_ch_buf[0];
02576 
02577    b->yy_at_bol = 1;
02578    b->yy_buffer_status = YY_BUFFER_NEW;
02579 
02580    if ( b == YY_CURRENT_BUFFER )
02581       ast_yy_load_buffer_state(yyscanner );
02582 }

static void ast_yy_init_buffer ( YY_BUFFER_STATE  b,
FILE *  file,
yyscan_t  yyscanner 
) [static]

The main scanner function which does all the work.

Definition at line 2531 of file ast_expr2f.c.

References ast_yy_flush_buffer(), errno, and YY_CURRENT_BUFFER.

02533 {
02534    int oerrno = errno;
02535     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02536 
02537    ast_yy_flush_buffer(b ,yyscanner);
02538 
02539    b->yy_input_file = file;
02540    b->yy_fill_buffer = 1;
02541 
02542     /* If b is the current buffer, then ast_yy_init_buffer was _probably_
02543      * called from ast_yyrestart() or through yy_get_next_buffer.
02544      * In that case, we don't want to reset the lineno or column.
02545      */
02546     if (b != YY_CURRENT_BUFFER){
02547         b->yy_bs_lineno = 1;
02548         b->yy_bs_column = 0;
02549     }
02550 
02551         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
02552     
02553    errno = oerrno;
02554 }

static void ast_yy_load_buffer_state ( yyscan_t  yyscanner  )  [static]

Referenced by ast_yy_flush_buffer(), ast_yypop_buffer_state(), and ast_yypush_buffer_state().

YY_BUFFER_STATE ast_yy_scan_buffer ( char *  base,
yy_size_t  size,
yyscan_t  yyscanner 
)

Setup the input buffer state to scan directly from a user-specified character buffer.

Parameters:
base the character buffer
size the size in bytes of the character buffer
yyscanner The scanner object.
Returns:
the newly allocated buffer state object.

Definition at line 2691 of file ast_expr2f.c.

References ast_yy_switch_to_buffer(), ast_yyalloc(), yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, yy_buffer_state::yy_buf_size, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_buffer_state::yy_fill_buffer, yy_buffer_state::yy_input_file, yy_buffer_state::yy_is_interactive, yy_buffer_state::yy_is_our_buffer, and yy_buffer_state::yy_n_chars.

Referenced by ast_yy_scan_bytes().

02692 {
02693    YY_BUFFER_STATE b;
02694     
02695    if ( size < 2 ||
02696         base[size-2] != YY_END_OF_BUFFER_CHAR ||
02697         base[size-1] != YY_END_OF_BUFFER_CHAR )
02698       /* They forgot to leave room for the EOB's. */
02699       return 0;
02700 
02701    b = (YY_BUFFER_STATE) ast_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
02702    if ( ! b )
02703       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_buffer()" );
02704 
02705    b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
02706    b->yy_buf_pos = b->yy_ch_buf = base;
02707    b->yy_is_our_buffer = 0;
02708    b->yy_input_file = 0;
02709    b->yy_n_chars = b->yy_buf_size;
02710    b->yy_is_interactive = 0;
02711    b->yy_at_bol = 1;
02712    b->yy_fill_buffer = 0;
02713    b->yy_buffer_status = YY_BUFFER_NEW;
02714 
02715    ast_yy_switch_to_buffer(b ,yyscanner );
02716 
02717    return b;
02718 }

YY_BUFFER_STATE ast_yy_scan_bytes ( yyconst char *  yybytes,
int  _yybytes_len,
yyscan_t  yyscanner 
)

Setup the input buffer state to scan the given bytes. The next call to ast_yylex() will scan from a copy of bytes.

Parameters:
bytes the byte buffer to scan
len the number of bytes in the buffer pointed to by bytes.
yyscanner The scanner object.
Returns:
the newly allocated buffer state object.

Definition at line 2741 of file ast_expr2f.c.

References ast_yy_scan_buffer(), ast_yyalloc(), YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, and yy_buffer_state::yy_is_our_buffer.

Referenced by ast_yy_scan_string().

02742 {
02743    YY_BUFFER_STATE b;
02744    char *buf;
02745    yy_size_t n;
02746    int i;
02747     
02748    /* Get memory for full buffer, including space for trailing EOB's. */
02749    n = _yybytes_len + 2;
02750    buf = (char *) ast_yyalloc(n ,yyscanner );
02751    if ( ! buf )
02752       YY_FATAL_ERROR( "out of dynamic memory in ast_yy_scan_bytes()" );
02753 
02754    for ( i = 0; i < _yybytes_len; ++i )
02755       buf[i] = yybytes[i];
02756 
02757    buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
02758 
02759    b = ast_yy_scan_buffer(buf,n ,yyscanner);
02760    if ( ! b )
02761       YY_FATAL_ERROR( "bad buffer in ast_yy_scan_bytes()" );
02762 
02763    /* It's okay to grow etc. this buffer, and we should throw it
02764     * away when we're done.
02765     */
02766    b->yy_is_our_buffer = 1;
02767 
02768    return b;
02769 }

YY_BUFFER_STATE ast_yy_scan_string ( yyconst char *  yystr,
yyscan_t  yyscanner 
)

Setup the input buffer state to scan a string. The next call to ast_yylex() will scan from a copy of str.

Parameters:
yystr a NUL-terminated string to scan
yyscanner The scanner object.
Returns:
the newly allocated buffer state object.
Note:
If you want to scan bytes that may contain NUL values, then use ast_yy_scan_bytes() instead.

Definition at line 2728 of file ast_expr2f.c.

References ast_yy_scan_bytes().

Referenced by ast_expr().

02729 {
02730     
02731    return ast_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
02732 }

void ast_yy_switch_to_buffer ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Referenced by ast_yy_scan_buffer().

void * ast_yyalloc ( yy_size_t  ,
yyscan_t  yyscanner 
)

Definition at line 3119 of file ast_expr2f.c.

References malloc.

Referenced by ast_yy_scan_buffer(), ast_yy_scan_bytes(), ast_yyensure_buffer_stack(), ast_yylex_init(), and ast_yylex_init_extra().

03120 {
03121    return (void *) malloc( size );
03122 }

static void ast_yyensure_buffer_stack ( yyscan_t  yyscanner  )  [static]

Definition at line 2641 of file ast_expr2f.c.

References ast_yyalloc(), ast_yyrealloc(), yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, and YY_FATAL_ERROR.

Referenced by ast_yypush_buffer_state().

02642 {
02643    int num_to_alloc;
02644     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02645 
02646    if (!yyg->yy_buffer_stack) {
02647 
02648       /* First allocation is just for 2 elements, since we don't know if this
02649        * scanner will even need a stack. We use 2 instead of 1 to avoid an
02650        * immediate realloc on the next call.
02651          */
02652       num_to_alloc = 1;
02653       yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyalloc
02654                         (num_to_alloc * sizeof(struct yy_buffer_state*)
02655                         , yyscanner);
02656       if ( ! yyg->yy_buffer_stack )
02657          YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
02658                           
02659       memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
02660             
02661       yyg->yy_buffer_stack_max = num_to_alloc;
02662       yyg->yy_buffer_stack_top = 0;
02663       return;
02664    }
02665 
02666    if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
02667 
02668       /* Increase the buffer to prepare for a possible push. */
02669       int grow_size = 8 /* arbitrary grow size */;
02670 
02671       num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
02672       yyg->yy_buffer_stack = (struct yy_buffer_state**)ast_yyrealloc
02673                         (yyg->yy_buffer_stack,
02674                         num_to_alloc * sizeof(struct yy_buffer_state*)
02675                         , yyscanner);
02676       if ( ! yyg->yy_buffer_stack )
02677          YY_FATAL_ERROR( "out of dynamic memory in ast_yyensure_buffer_stack()" );
02678 
02679       /* zero only the new slots.*/
02680       memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
02681       yyg->yy_buffer_stack_max = num_to_alloc;
02682    }
02683 }

int ast_yyerror ( const char *  s,
yyltype loc,
struct parse_io parseio 
)

Definition at line 3312 of file ast_expr2f.c.

References ast_log(), expr2_token_subst(), free, LOG_WARNING, parse_io::scanner, parse_io::string, YY_CURRENT_BUFFER_LVALUE, and yytext.

03313 {  
03314    struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
03315    char spacebuf[8000]; /* best safe than sorry */
03316    char spacebuf2[8000]; /* best safe than sorry */
03317    int i=0;
03318    char *s2 = expr2_token_subst(s);
03319    spacebuf[0] = 0;
03320    
03321    for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' ';  /* uh... assuming yyg is defined, then I can use the yycolumn macro,
03322                                                                         which is the same thing as... get this:
03323                                        yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
03324                                        I was tempted to just use yy_buf_pos in the STATE, but..., well:
03325                                           a. the yy_buf_pos is the current position in the buffer, which
03326                                              may not relate to the entire string/buffer because of the
03327                                              buffering.
03328                                           b. but, analysis of the situation is that when you use the
03329                                              ast_yy_scan_string func, it creates a single buffer the size of
03330                                              string, so the two would be the same... 
03331                                        so, in the end, the yycolumn macro is available, shorter, therefore easier. */
03332    spacebuf2[i++]='^';
03333    spacebuf2[i]= 0;
03334 
03335 #ifdef STANDALONE3
03336    /* easier to read in the standalone version */
03337    printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
03338          (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
03339 #else
03340    ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",  
03341          (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
03342 #endif
03343 #ifndef STANDALONE
03344    ast_log(LOG_WARNING,"If you have questions, please refer to doc/channelvariables.txt in the asterisk source.\n");
03345 #endif
03346    free(s2);
03347    return(0);
03348 }

int ast_yyerror ( const char *  ,
YYLTYPE ,
struct parse_io  
)

void ast_yyfree ( void *  ,
yyscan_t  yyscanner 
)

Definition at line 3151 of file ast_expr2f.c.

References free.

Referenced by ast_yylex_destroy().

03152 {
03153       if (ptr) /* the normal generated ast_yyfree func just frees its first arg;
03154                     this get complaints on some systems, as sometimes this
03155                     arg is a nil ptr! It's usually not fatal, but is irritating! */
03156               free( (char *) ptr );
03157 }

int ast_yyget_column ( yyscan_t  yyscanner  ) 

Get the current column number.

Parameters:
yyscanner The scanner object.

Definition at line 2825 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yycolumn.

02826 {
02827     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02828     
02829         if (! YY_CURRENT_BUFFER)
02830             return 0;
02831     
02832     return yycolumn;
02833 }

int ast_yyget_debug ( yyscan_t  yyscanner  ) 

Definition at line 2930 of file ast_expr2f.c.

References yy_flex_debug.

02931 {
02932     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02933     return yy_flex_debug;
02934 }

YY_EXTRA_TYPE ast_yyget_extra ( yyscan_t  yyscanner  ) 

Get the user-defined data for this scanner.

Parameters:
yyscanner The scanner object.

Definition at line 2803 of file ast_expr2f.c.

References yyextra.

02804 {
02805     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02806     return yyextra;
02807 }

FILE * ast_yyget_in ( yyscan_t  yyscanner  ) 

Get the input stream.

Parameters:
yyscanner The scanner object.

Definition at line 2838 of file ast_expr2f.c.

References yyin.

02839 {
02840     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02841     return yyin;
02842 }

int ast_yyget_leng ( yyscan_t  yyscanner  ) 

Get the length of the current token.

Parameters:
yyscanner The scanner object.

Definition at line 2856 of file ast_expr2f.c.

References yyleng.

02857 {
02858     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02859     return yyleng;
02860 }

int ast_yyget_lineno ( yyscan_t  yyscanner  ) 

Get the current line number.

Parameters:
yyscanner The scanner object.

Definition at line 2812 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, and yylineno.

02813 {
02814     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02815     
02816         if (! YY_CURRENT_BUFFER)
02817             return 0;
02818     
02819     return yylineno;
02820 }

YYLTYPE * ast_yyget_lloc ( yyscan_t  yyscanner  ) 

Definition at line 2956 of file ast_expr2f.c.

References yylloc.

02957 {
02958     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02959     return yylloc;
02960 }

YYSTYPE * ast_yyget_lval ( yyscan_t  yyscanner  ) 

Definition at line 2944 of file ast_expr2f.c.

References yylval.

02945 {
02946     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02947     return yylval;
02948 }

FILE * ast_yyget_out ( yyscan_t  yyscanner  ) 

Get the output stream.

Parameters:
yyscanner The scanner object.

Definition at line 2847 of file ast_expr2f.c.

References yyout.

02848 {
02849     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02850     return yyout;
02851 }

char * ast_yyget_text ( yyscan_t  yyscanner  ) 

Get the current token.

Parameters:
yyscanner The scanner object.

Definition at line 2866 of file ast_expr2f.c.

References yytext.

02867 {
02868     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02869     return yytext;
02870 }

int ast_yylex ( YYSTYPE yylval_param,
YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

int ast_yylex_destroy ( yyscan_t  yyscanner  ) 

Definition at line 3066 of file ast_expr2f.c.

References ast_yy_delete_buffer(), ast_yyfree(), ast_yypop_buffer_state(), yyguts_t::yy_buffer_stack, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_globals(), and yyguts_t::yy_start_stack.

Referenced by ast_expr().

03067 {
03068     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
03069 
03070     /* Pop the buffer stack, destroying each element. */
03071    while(YY_CURRENT_BUFFER){
03072       ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
03073       YY_CURRENT_BUFFER_LVALUE = NULL;
03074       ast_yypop_buffer_state(yyscanner);
03075    }
03076 
03077    /* Destroy the stack itself. */
03078    ast_yyfree(yyg->yy_buffer_stack ,yyscanner);
03079    yyg->yy_buffer_stack = NULL;
03080 
03081     /* Destroy the start condition stack. */
03082         ast_yyfree(yyg->yy_start_stack ,yyscanner );
03083         yyg->yy_start_stack = NULL;
03084 
03085     /* Reset the globals. This is important in a non-reentrant scanner so the next time
03086      * ast_yylex() is called, initialization will occur. */
03087     yy_init_globals( yyscanner);
03088 
03089     /* Destroy the main struct (reentrant only). */
03090     ast_yyfree ( yyscanner , yyscanner );
03091     yyscanner = NULL;
03092     return 0;
03093 }

int ast_yylex_init ( yyscan_t scanner  ) 

Definition at line 2975 of file ast_expr2f.c.

References ast_yyalloc(), errno, and yy_init_globals().

Referenced by ast_expr().

02977 {
02978     if (ptr_yy_globals == NULL){
02979         errno = EINVAL;
02980         return 1;
02981     }
02982 
02983     *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), NULL );
02984 
02985     if (*ptr_yy_globals == NULL){
02986         errno = ENOMEM;
02987         return 1;
02988     }
02989 
02990     /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
02991     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
02992 
02993     return yy_init_globals ( *ptr_yy_globals );
02994 }

int ast_yylex_init_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t scanner 
)

Definition at line 3004 of file ast_expr2f.c.

References ast_yyalloc(), ast_yyset_extra(), errno, and yy_init_globals().

03006 {
03007     struct yyguts_t dummy_yyguts;
03008 
03009     ast_yyset_extra (yy_user_defined, &dummy_yyguts);
03010 
03011     if (ptr_yy_globals == NULL){
03012         errno = EINVAL;
03013         return 1;
03014     }
03015    
03016     *ptr_yy_globals = (yyscan_t) ast_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
03017    
03018     if (*ptr_yy_globals == NULL){
03019         errno = ENOMEM;
03020         return 1;
03021     }
03022     
03023     /* By setting to 0xAA, we expose bugs in
03024     yy_init_globals. Leave at 0x00 for releases. */
03025     memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
03026     
03027     ast_yyset_extra (yy_user_defined, *ptr_yy_globals);
03028     
03029     return yy_init_globals ( *ptr_yy_globals );
03030 }

int ast_yyparse ( void *   ) 

Referenced by ast_expr().

void ast_yypop_buffer_state ( yyscan_t  yyscanner  ) 

Removes and deletes the top of the stack, if present. The next element becomes the new top.

Parameters:
yyscanner The scanner object.

Definition at line 2621 of file ast_expr2f.c.

References ast_yy_delete_buffer(), ast_yy_load_buffer_state(), yyguts_t::yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, and yyguts_t::yy_did_buffer_switch_on_eof.

Referenced by ast_yylex_destroy().

02622 {
02623     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02624    if (!YY_CURRENT_BUFFER)
02625       return;
02626 
02627    ast_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
02628    YY_CURRENT_BUFFER_LVALUE = NULL;
02629    if (yyg->yy_buffer_stack_top > 0)
02630       --yyg->yy_buffer_stack_top;
02631 
02632    if (YY_CURRENT_BUFFER) {
02633       ast_yy_load_buffer_state(yyscanner );
02634       yyg->yy_did_buffer_switch_on_eof = 1;
02635    }
02636 }

void ast_yypush_buffer_state ( YY_BUFFER_STATE  new_buffer,
yyscan_t  yyscanner 
)

Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.

Parameters:
new_buffer The new state.
yyscanner The scanner object.

Definition at line 2590 of file ast_expr2f.c.

References ast_yy_load_buffer_state(), ast_yyensure_buffer_stack(), yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yyguts_t::yy_did_buffer_switch_on_eof, yyguts_t::yy_hold_char, and yyguts_t::yy_n_chars.

02591 {
02592     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02593    if (new_buffer == NULL)
02594       return;
02595 
02596    ast_yyensure_buffer_stack(yyscanner);
02597 
02598    /* This block is copied from ast_yy_switch_to_buffer. */
02599    if ( YY_CURRENT_BUFFER )
02600       {
02601       /* Flush out information for old buffer. */
02602       *yyg->yy_c_buf_p = yyg->yy_hold_char;
02603       YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
02604       YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
02605       }
02606 
02607    /* Only push if top exists. Otherwise, replace top. */
02608    if (YY_CURRENT_BUFFER)
02609       yyg->yy_buffer_stack_top++;
02610    YY_CURRENT_BUFFER_LVALUE = new_buffer;
02611 
02612    /* copied from ast_yy_switch_to_buffer. */
02613    ast_yy_load_buffer_state(yyscanner );
02614    yyg->yy_did_buffer_switch_on_eof = 1;
02615 }

void * ast_yyrealloc ( void *  ,
yy_size_t  ,
yyscan_t  yyscanner 
)

Definition at line 3124 of file ast_expr2f.c.

References realloc.

Referenced by ast_yyensure_buffer_stack().

03125 {
03126    /* The cast to (char *) in the following accommodates both
03127     * implementations that use char* generic pointers, and those
03128     * that use void* generic pointers.  It works with the latter
03129     * because both ANSI C and C++ allow castless assignment from
03130     * any pointer type to void*, and deal with argument conversions
03131     * as though doing an assignment.
03132     */
03133    return (void *) realloc( (char *) ptr, size );
03134 }

void ast_yyrestart ( FILE *  input_file,
yyscan_t  yyscanner 
)

void ast_yyset_column ( int  column_no,
yyscan_t  yyscanner 
)

Set the current column.

Parameters:
line_number 
yyscanner The scanner object.

Definition at line 2901 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yycolumn.

02902 {
02903     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02904 
02905         /* column is only valid if an input buffer exists. */
02906         if (! YY_CURRENT_BUFFER )
02907            yy_fatal_error( "ast_yyset_column called with no buffer" , yyscanner); 
02908     
02909     yycolumn = column_no;
02910 }

void ast_yyset_debug ( int  debug_flag,
yyscan_t  yyscanner 
)

Definition at line 2936 of file ast_expr2f.c.

References yy_flex_debug.

02937 {
02938     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02939     yy_flex_debug = bdebug ;
02940 }

void ast_yyset_extra ( YY_EXTRA_TYPE  user_defined,
yyscan_t  yyscanner 
)

Set the user-defined data. This data is never touched by the scanner.

Parameters:
user_defined The data to be associated with this scanner.
yyscanner The scanner object.

Definition at line 2876 of file ast_expr2f.c.

References yyextra.

Referenced by ast_yylex_init_extra().

02877 {
02878     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02879     yyextra = user_defined ;
02880 }

void ast_yyset_in ( FILE *  in_str,
yyscan_t  yyscanner 
)

Set the input stream. This does not discard the current input buffer.

Parameters:
in_str A readable stream.
yyscanner The scanner object.
See also:
ast_yy_switch_to_buffer

Definition at line 2918 of file ast_expr2f.c.

References yyin.

02919 {
02920     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02921     yyin = in_str ;
02922 }

void ast_yyset_lineno ( int  line_number,
yyscan_t  yyscanner 
)

Set the current line number.

Parameters:
line_number 
yyscanner The scanner object.

Definition at line 2886 of file ast_expr2f.c.

References YY_CURRENT_BUFFER, yy_fatal_error(), and yylineno.

02887 {
02888     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02889 
02890         /* lineno is only valid if an input buffer exists. */
02891         if (! YY_CURRENT_BUFFER )
02892            yy_fatal_error( "ast_yyset_lineno called with no buffer" , yyscanner); 
02893     
02894     yylineno = line_number;
02895 }

void ast_yyset_lloc ( YYLTYPE yylloc_param,
yyscan_t  yyscanner 
)

Definition at line 2962 of file ast_expr2f.c.

References yylloc.

02963 {
02964     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02965     yylloc = yylloc_param;
02966 }

void ast_yyset_lval ( YYSTYPE yylval_param,
yyscan_t  yyscanner 
)

Definition at line 2950 of file ast_expr2f.c.

References yylval.

02951 {
02952     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02953     yylval = yylval_param;
02954 }

void ast_yyset_out ( FILE *  out_str,
yyscan_t  yyscanner 
)

Definition at line 2924 of file ast_expr2f.c.

References yyout.

02925 {
02926     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
02927     yyout = out_str ;
02928 }

static char * expr2_token_subst ( const char *  mess  )  [static]

Definition at line 3269 of file ast_expr2f.c.

References len(), malloc, and t.

Referenced by ast_yyerror().

03270 {
03271    /* calc a length, malloc, fill, and return; yyerror had better free it! */
03272    int len=0,i;
03273    const char *p;
03274    char *res, *s,*t;
03275    int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
03276 
03277    for (p=mess; *p; p++) {
03278       for (i=0; i<expr2_token_equivs_entries; i++) {
03279          if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
03280          {
03281             len+=strlen(expr2_token_equivs2[i])+2;
03282             p += strlen(expr2_token_equivs1[i])-1;
03283             break;
03284          }
03285       }
03286       len++;
03287    }
03288    res = (char*)malloc(len+1);
03289    res[0] = 0;
03290    s = res;
03291    for (p=mess; *p;) {
03292       int found = 0;
03293       for (i=0; i<expr2_token_equivs_entries; i++) {
03294          if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
03295             *s++ = '\'';
03296             for (t=expr2_token_equivs2[i]; *t;) {
03297                *s++ = *t++;
03298             }
03299             *s++ = '\'';
03300             p += strlen(expr2_token_equivs1[i]);
03301             found = 1;
03302             break;
03303          }
03304       }
03305       if( !found )
03306          *s++ = *p++;
03307    }
03308    *s++ = 0;
03309    return res;
03310 }

static int input ( yyscan_t  yyscanner  )  [static]

Referenced by app_exec(), conf_exec(), conf_run(), and hasvoicemail_exec().

static void yy_fatal_error ( yyconst char *  msg,
yyscan_t  yyscanner 
) [static]

Definition at line 2775 of file ast_expr2f.c.

References YY_EXIT_FAILURE.

02776 {
02777       (void) fprintf( stderr, "%s\n", msg );
02778    exit( YY_EXIT_FAILURE );
02779 }

static void yy_fatal_error ( yyconst char  msg[],
yyscan_t  yyscanner 
) [static]

Referenced by ast_yyset_column(), and ast_yyset_lineno().

static int yy_get_next_buffer ( yyscan_t  yyscanner  )  [static]

static yy_state_type yy_get_previous_state ( yyscan_t  yyscanner  )  [static]

static int yy_init_globals ( yyscan_t  yyscanner  )  [static]

Definition at line 3032 of file ast_expr2f.c.

References yyguts_t::yy_buffer_stack, yyguts_t::yy_buffer_stack_max, yyguts_t::yy_buffer_stack_top, yyguts_t::yy_c_buf_p, yyguts_t::yy_init, yyguts_t::yy_start, yyguts_t::yy_start_stack, yyguts_t::yy_start_stack_depth, yyguts_t::yy_start_stack_ptr, yyin, and yyout.

Referenced by ast_yylex_destroy(), ast_yylex_init(), and ast_yylex_init_extra().

03033 {
03034     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
03035     /* Initialization is the same as for the non-reentrant scanner.
03036      * This function is called from ast_yylex_destroy(), so don't allocate here.
03037      */
03038 
03039     yyg->yy_buffer_stack = 0;
03040     yyg->yy_buffer_stack_top = 0;
03041     yyg->yy_buffer_stack_max = 0;
03042     yyg->yy_c_buf_p = (char *) 0;
03043     yyg->yy_init = 0;
03044     yyg->yy_start = 0;
03045 
03046     yyg->yy_start_stack_ptr = 0;
03047     yyg->yy_start_stack_depth = 0;
03048     yyg->yy_start_stack =  NULL;
03049 
03050 /* Defined in main.c */
03051 #ifdef YY_STDINIT
03052     yyin = stdin;
03053     yyout = stdout;
03054 #else
03055     yyin = (FILE *) 0;
03056     yyout = (FILE *) 0;
03057 #endif
03058 
03059     /* For future reference: Set errno on error, since we are called by
03060      * ast_yylex_init()
03061      */
03062     return 0;
03063 }

static yy_state_type yy_try_NUL_trans ( yy_state_type  current_state,
yyscan_t  yyscanner 
) [static]

static void yyunput ( int  c,
char *  buf_ptr,
yyscan_t  yyscanner 
) [static]


Variable Documentation

int curlycount = 0 [static]

Definition at line 1418 of file ast_expr2f.c.

char* expr2_token_equivs1[] [static]

Definition at line 3218 of file ast_expr2f.c.

char* expr2_token_equivs2[] [static]

Definition at line 3243 of file ast_expr2f.c.

char extra_error_message[4095]

Definition at line 3201 of file ast_expr2f.c.

int extra_error_message_supplied = 0

Definition at line 3202 of file ast_expr2f.c.

yyconst flex_int16_t yy_accept[54] [static]

Definition at line 1300 of file ast_expr2f.c.

yyconst yy_state_type yy_NUL_trans[54] [static]

Definition at line 1310 of file ast_expr2f.c.

yyconst flex_int16_t yy_nxt[][128] [static]

Definition at line 337 of file ast_expr2f.c.


Generated on Wed Mar 4 19:58:23 2009 for Asterisk - the Open Source PBX by  doxygen 1.4.7