Thu Oct 11 06:47:02 2012

Asterisk developer's documentation


ael_structs.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2007, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  * \brief Structures for AEL - the Asterisk extension language
00021  *
00022  * \ref pbx_ael.c
00023  * \todo document this file (ael.h)
00024  */
00025 
00026 #ifndef _ASTERISK_AEL_STRUCTS_H
00027 #define _ASTERISK_AEL_STRUCTS_H
00028 
00029 /*
00030  * We include asterisk/paths.h here because it is a convenient place
00031  * that doesn't require us to rebuild ael files from .fl/.y
00032  */
00033 #include "asterisk/paths.h"
00034 
00035 #include "pval.h"
00036 
00037 #if !defined(SOLARIS) && !defined(__CYGWIN__)
00038 /* #include <err.h> */
00039 #else
00040 #define quad_t int64_t
00041 #endif
00042 
00043 #if defined(LONG_LONG_MIN) && !defined(QUAD_MIN)
00044 #define QUAD_MIN LONG_LONG_MIN
00045 #endif
00046 #if defined(LONG_LONG_MAX) && !defined(QUAD_MAX)
00047 #define QUAD_MAX LONG_LONG_MAX
00048 #endif
00049 
00050 #  if ! defined(QUAD_MIN)
00051 #   define QUAD_MIN     (-0x7fffffffffffffffLL-1)
00052 #  endif
00053 #  if ! defined(QUAD_MAX)
00054 #   define QUAD_MAX     (0x7fffffffffffffffLL)
00055 #  endif
00056 
00057 
00058 #if 0
00059 #endif
00060 void ael2_semantic_check(pval *item, int *errs, int *warns, int *notes);
00061 pval *npval(pvaltype type, int first_line, int last_line, int first_column, int last_column);
00062 pval *linku1(pval *head, pval *tail);
00063 void ael2_print(char *fname, pval *tree);
00064 struct pval *ael2_parse(char *fname, int *errs);   /* in ael.flex */
00065 void destroy_pval(pval *item);
00066  
00067 extern char *prev_word; /* in ael.flex */
00068 
00069 #ifndef YY_TYPEDEF_YY_SCANNER_T
00070 #define YY_TYPEDEF_YY_SCANNER_T
00071 typedef void* yyscan_t;
00072 #endif
00073 
00074 /* for passing info into and out of yyparse */
00075 struct parse_io
00076 {
00077    struct pval *pval; /* yyparse will set this to point to the parse tree */
00078    yyscan_t scanner;       /* yylex needs a scanner. Set it up, and pass it in */
00079    int syntax_error_count;  /* the count of syntax errors encountered */
00080 };
00081 
00082 /* for CODE GENERATION */
00083    
00084 typedef enum { AEL_APPCALL, AEL_CONTROL1, AEL_FOR_CONTROL, AEL_IF_CONTROL, AEL_IFTIME_CONTROL, AEL_RAND_CONTROL, AEL_LABEL, AEL_RETURN } ael_priority_type;
00085 
00086 
00087 struct ael_priority
00088 {
00089    int priority_num;
00090    ael_priority_type type;
00091    
00092    char *app;
00093    char *appargs;
00094    
00095    struct pval *origin;
00096    struct ael_extension *exten;
00097    
00098    struct ael_priority *goto_true;
00099    struct ael_priority *goto_false;
00100    struct ael_priority *next;
00101 };
00102 
00103 struct ael_extension
00104 {
00105    char *name;
00106    char *cidmatch;
00107    char *hints;
00108    int regexten;
00109    int is_switch;
00110    int has_switch; /* set if a switch exists in the extension */
00111    int checked_switch; /* set if we checked for a switch in the extension -- so we don't have to do it again */
00112    
00113    struct ast_context *context;
00114    
00115    struct ael_priority *plist;
00116    struct ael_priority *plist_last;
00117    struct ael_extension *next_exten;
00118 
00119    struct ael_priority *loop_break;  /*!< set by latest loop for breaks */
00120    struct ael_priority *loop_continue; /*!< set by lastest loop for continuing */
00121    struct ael_priority *return_target;
00122    int return_needed;
00123 };
00124 
00125 #endif /* _ASTERISK_AEL_STRUCTS_H */

Generated on Thu Oct 11 06:47:02 2012 for Asterisk - the Open Source PBX by  doxygen 1.5.6