00001 /* 00002 * Asterisk -- An open source telephony toolkit. 00003 * 00004 * Copyright (C) 1999 - 2005, 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 Configuration File Parser 00021 */ 00022 00023 #ifndef _ASTERISK_CONFIG_H 00024 #define _ASTERISK_CONFIG_H 00025 00026 #if defined(__cplusplus) || defined(c_plusplus) 00027 extern "C" { 00028 #endif 00029 00030 #include "asterisk/utils.h" 00031 #include "asterisk/inline_api.h" 00032 00033 struct ast_config; 00034 00035 struct ast_category; 00036 00037 /*! Options for ast_config_load() 00038 */ 00039 enum { 00040 /*! Load the configuration, including comments */ 00041 CONFIG_FLAG_WITHCOMMENTS = (1 << 0), 00042 /*! On a reload, give us a -1 if the file hasn't changed. */ 00043 CONFIG_FLAG_FILEUNCHANGED = (1 << 1), 00044 /*! Don't attempt to cache mtime on this config file. */ 00045 CONFIG_FLAG_NOCACHE = (1 << 2), 00046 }; 00047 00048 #define CONFIG_STATUS_FILEUNCHANGED (void *)-1 00049 00050 /*! 00051 * \brief Types used in ast_realtime_require_field 00052 */ 00053 typedef enum { 00054 RQ_INTEGER1, 00055 RQ_UINTEGER1, 00056 RQ_INTEGER2, 00057 RQ_UINTEGER2, 00058 RQ_INTEGER3, 00059 RQ_UINTEGER3, 00060 RQ_INTEGER4, 00061 RQ_UINTEGER4, 00062 RQ_INTEGER8, 00063 RQ_UINTEGER8, 00064 RQ_CHAR, 00065 RQ_FLOAT, 00066 RQ_DATE, 00067 RQ_DATETIME, 00068 } require_type; 00069 00070 /*! \brief Structure for variables, used for configurations and for channel variables 00071 */ 00072 struct ast_variable { 00073 const char *name; 00074 const char *value; 00075 struct ast_variable *next; 00076 00077 char *file; 00078 00079 int lineno; 00080 int object; /*!< 0 for variable, 1 for object */ 00081 int blanklines; /*!< Number of blanklines following entry */ 00082 struct ast_comment *precomments; 00083 struct ast_comment *sameline; 00084 struct ast_comment *trailing; /*!< the last object in the list will get assigned any trailing comments when EOF is hit */ 00085 char stuff[0]; 00086 }; 00087 00088 typedef struct ast_config *config_load_func(const char *database, const char *table, const char *configfile, struct ast_config *config, struct ast_flags flags, const char *suggested_include_file, const char *who_asked); 00089 typedef struct ast_variable *realtime_var_get(const char *database, const char *table, va_list ap); 00090 typedef struct ast_config *realtime_multi_get(const char *database, const char *table, va_list ap); 00091 typedef int realtime_update(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap); 00092 typedef int realtime_store(const char *database, const char *table, va_list ap); 00093 typedef int realtime_destroy(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap); 00094 00095 /*! 00096 * \brief Function pointer called to ensure database schema is properly configured for realtime use 00097 * \since 1.6.1 00098 */ 00099 typedef int realtime_require(const char *database, const char *table, va_list ap); 00100 00101 /*! 00102 * \brief Function pointer called to clear the database cache and free resources used for such 00103 * \since 1.6.1 00104 */ 00105 typedef int realtime_unload(const char *database, const char *table); 00106 00107 /*! \brief Configuration engine structure, used to define realtime drivers */ 00108 struct ast_config_engine { 00109 char *name; 00110 config_load_func *load_func; 00111 realtime_var_get *realtime_func; 00112 realtime_multi_get *realtime_multi_func; 00113 realtime_update *update_func; 00114 realtime_store *store_func; 00115 realtime_destroy *destroy_func; 00116 realtime_require *require_func; 00117 realtime_unload *unload_func; 00118 struct ast_config_engine *next; 00119 }; 00120 00121 /*! \brief Load a config file 00122 * \param filename path of file to open. If no preceding '/' character, path is considered relative to AST_CONFIG_DIR 00123 * Create a config structure from a given configuration file. 00124 * \param who_asked The module which is making this request. 00125 * \param flags Optional flags: 00126 * CONFIG_FLAG_WITHCOMMENTS - load the file with comments intact; 00127 * CONFIG_FLAG_FILEUNCHANGED - check the file mtime and return CONFIG_STATUS_FILEUNCHANGED if the mtime is the same; or 00128 * CONFIG_FLAG_NOCACHE - don't cache file mtime (main purpose of this option is to save memory on temporary files). 00129 * 00130 * \return an ast_config data structure on success 00131 * \retval NULL on error 00132 */ 00133 struct ast_config *ast_config_load2(const char *filename, const char *who_asked, struct ast_flags flags); 00134 00135 #define ast_config_load(filename, flags) ast_config_load2(filename, AST_MODULE, flags) 00136 00137 /*! \brief Destroys a config 00138 * \param config pointer to config data structure 00139 * Free memory associated with a given config 00140 * 00141 */ 00142 void ast_config_destroy(struct ast_config *config); 00143 00144 /*! \brief returns the root ast_variable of a config 00145 * \param config pointer to an ast_config data structure 00146 * \param cat name of the category for which you want the root 00147 * 00148 * Returns the category specified 00149 */ 00150 struct ast_variable *ast_category_root(struct ast_config *config, char *cat); 00151 00152 /*! \brief Goes through categories 00153 * \param config Which config structure you wish to "browse" 00154 * \param prev A pointer to a previous category. 00155 * This function is kind of non-intuitive in it's use. To begin, one passes NULL as the second argument. It will return a pointer to the string of the first category in the file. From here on after, one must then pass the previous usage's return value as the second pointer, and it will return a pointer to the category name afterwards. 00156 * 00157 * \retval a category on success 00158 * \retval NULL on failure/no-more-categories 00159 */ 00160 char *ast_category_browse(struct ast_config *config, const char *prev); 00161 00162 /*! 00163 * \brief Goes through variables 00164 * Somewhat similar in intent as the ast_category_browse. 00165 * List variables of config file category 00166 * 00167 * \retval ast_variable list on success 00168 * \retval NULL on failure 00169 */ 00170 struct ast_variable *ast_variable_browse(const struct ast_config *config, const char *category); 00171 00172 /*! 00173 * \brief given a pointer to a category, return the root variable. 00174 * This is equivalent to ast_variable_browse(), but more efficient if we 00175 * already have the struct ast_category * (e.g. from ast_category_get()) 00176 */ 00177 struct ast_variable *ast_category_first(struct ast_category *cat); 00178 00179 /*! 00180 * \brief Gets a variable 00181 * \param config which (opened) config to use 00182 * \param category category under which the variable lies 00183 * \param variable which variable you wish to get the data for 00184 * Goes through a given config file in the given category and searches for the given variable 00185 * 00186 * \retval The variable value on success 00187 * \retval NULL if unable to find it. 00188 */ 00189 const char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable); 00190 00191 /*! 00192 * \brief Retrieve a category if it exists 00193 * \param config which config to use 00194 * \param category_name name of the category you're looking for 00195 * This will search through the categories within a given config file for a match. 00196 * 00197 * \retval pointer to category if found 00198 * \retval NULL if not. 00199 */ 00200 struct ast_category *ast_category_get(const struct ast_config *config, const char *category_name); 00201 00202 /*! 00203 * \brief Check for category duplicates 00204 * \param config which config to use 00205 * \param category_name name of the category you're looking for 00206 * This will search through the categories within a given config file for a match. 00207 * 00208 * \return non-zero if found 00209 */ 00210 int ast_category_exist(const struct ast_config *config, const char *category_name); 00211 00212 /*! 00213 * \brief Retrieve realtime configuration 00214 * \param family which family/config to lookup 00215 * This will use builtin configuration backends to look up a particular 00216 * entity in realtime and return a variable list of its parameters. Note 00217 * that unlike the variables in ast_config, the resulting list of variables 00218 * MUST be freed with ast_variables_destroy() as there is no container. 00219 * 00220 * The difference between these two calls is that ast_load_realtime excludes 00221 * fields whose values are NULL, while ast_load_realtime_all loads all columns. 00222 * 00223 * Note that you should use the constant SENTINEL to terminate arguments, in 00224 * order to preserve cross-platform compatibility. 00225 */ 00226 struct ast_variable *ast_load_realtime(const char *family, ...) attribute_sentinel; 00227 struct ast_variable *ast_load_realtime_all(const char *family, ...) attribute_sentinel; 00228 00229 /*! 00230 * \brief Release any resources cached for a realtime family 00231 * \param family which family/config to destroy 00232 * Various backends may cache attributes about a realtime data storage 00233 * facility; on reload, a front end resource may request to purge that cache. 00234 * \retval 0 If any cache was purged 00235 * \retval -1 If no cache was found 00236 * \since 1.6.1 00237 */ 00238 int ast_unload_realtime(const char *family); 00239 00240 /*! 00241 * \brief Inform realtime what fields that may be stored 00242 * \param family which family/config is referenced 00243 * This will inform builtin configuration backends that particular fields 00244 * may be updated during the use of that configuration section. This is 00245 * mainly to be used during startup routines, to ensure that various fields 00246 * exist in the backend. The backends may take various actions, such as 00247 * creating new fields in the data store or warning the administrator that 00248 * new fields may need to be created, in order to ensure proper function. 00249 * 00250 * The arguments are specified in groups of 3: column name, column type, 00251 * and column size. The column types are specified as integer constants, 00252 * defined by the enum require_type. Note that the size is specified as 00253 * the number of equivalent character fields that a field may take up, even 00254 * if a field is otherwise specified as an integer type. This is due to 00255 * the fact that some fields have historically been specified as character 00256 * types, even if they contained integer values. 00257 * 00258 * A family should always specify its fields to the minimum necessary 00259 * requirements to fulfill all possible values (within reason; for example, 00260 * a timeout value may reasonably be specified as an INTEGER2, with size 5. 00261 * Even though values above 32767 seconds are possible, they are unlikely 00262 * to be useful, and we should not complain about that size). 00263 * 00264 * \retval 0 Required fields met specified standards 00265 * \retval -1 One or more fields was missing or insufficient 00266 * 00267 * Note that you should use the constant SENTINEL to terminate arguments, in 00268 * order to preserve cross-platform compatibility. 00269 * 00270 * \since 1.6.1 00271 */ 00272 int ast_realtime_require_field(const char *family, ...) attribute_sentinel; 00273 00274 /*! 00275 * \brief Retrieve realtime configuration 00276 * \param family which family/config to lookup 00277 * This will use builtin configuration backends to look up a particular 00278 * entity in realtime and return a variable list of its parameters. Unlike 00279 * the ast_load_realtime, this function can return more than one entry and 00280 * is thus stored inside a traditional ast_config structure rather than 00281 * just returning a linked list of variables. 00282 */ 00283 struct ast_config *ast_load_realtime_multientry(const char *family, ...) attribute_sentinel; 00284 00285 /*! 00286 * \brief Update realtime configuration 00287 * \param family which family/config to be updated 00288 * \param keyfield which field to use as the key 00289 * \param lookup which value to look for in the key field to match the entry. 00290 * This function is used to update a parameter in realtime configuration space. 00291 * \return Number of rows affected, or -1 on error. 00292 * 00293 */ 00294 int ast_update_realtime(const char *family, const char *keyfield, const char *lookup, ...) attribute_sentinel; 00295 00296 /*! 00297 * \brief Create realtime configuration 00298 * \param family which family/config to be created 00299 * This function is used to create a parameter in realtime configuration space. 00300 * \return Number of rows affected, or -1 on error. 00301 * On the MySQL engine only, for reasons of backwards compatibility, the return 00302 * value is the insert ID. This value is nonportable and may be changed in a 00303 * future version to match the other engines. 00304 * 00305 */ 00306 int ast_store_realtime(const char *family, ...) attribute_sentinel; 00307 00308 /*! 00309 * \brief Destroy realtime configuration 00310 * \param family which family/config to be destroyed 00311 * \param keyfield which field to use as the key 00312 * \param lookup which value to look for in the key field to match the entry. 00313 * This function is used to destroy an entry in realtime configuration space. 00314 * Additional params are used as keys. 00315 * \return Number of rows affected, or -1 on error. 00316 * 00317 */ 00318 int ast_destroy_realtime(const char *family, const char *keyfield, const char *lookup, ...) attribute_sentinel; 00319 00320 /*! 00321 * \brief Check if realtime engine is configured for family 00322 * \param family which family/config to be checked 00323 * \return 1 if family is configured in realtime and engine exists 00324 */ 00325 int ast_check_realtime(const char *family); 00326 00327 /*! \brief Check if there's any realtime engines loaded */ 00328 int ast_realtime_enabled(void); 00329 00330 /*! \brief Free variable list 00331 * \param var the linked list of variables to free 00332 * This function frees a list of variables. 00333 */ 00334 void ast_variables_destroy(struct ast_variable *var); 00335 00336 /*! \brief Register config engine 00337 * \retval 1 Always 00338 */ 00339 int ast_config_engine_register(struct ast_config_engine *newconfig); 00340 00341 /*! \brief Deregister config engine 00342 * \retval 0 Always 00343 */ 00344 int ast_config_engine_deregister(struct ast_config_engine *del); 00345 00346 /*!\brief Exposed initialization method for core process 00347 * This method is intended for use only with the core initialization and is 00348 * not designed to be called from any user applications. 00349 */ 00350 int register_config_cli(void); 00351 00352 /*!\brief Exposed re-initialization method for core process 00353 * This method is intended for use only with the core re-initialization and is 00354 * not designed to be called from any user applications. 00355 */ 00356 int read_config_maps(void); 00357 00358 /*!\brief Create a new base configuration structure */ 00359 struct ast_config *ast_config_new(void); 00360 00361 /*!\brief Retrieve the current category name being built. 00362 * API for backend configuration engines while building a configuration set. 00363 */ 00364 struct ast_category *ast_config_get_current_category(const struct ast_config *cfg); 00365 00366 /*!\brief Set the category within the configuration as being current. 00367 * API for backend configuration engines while building a configuration set. 00368 */ 00369 void ast_config_set_current_category(struct ast_config *cfg, const struct ast_category *cat); 00370 00371 /*!\brief Retrieve a configuration variable within the configuration set. 00372 * Retrieves the named variable \p var within category \p cat of configuration 00373 * set \p cfg. If not found, attempts to retrieve the named variable \p var 00374 * from within category \em general. 00375 * \return Value of \p var, or NULL if not found. 00376 */ 00377 const char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var); 00378 00379 /*!\brief Create a category structure */ 00380 struct ast_category *ast_category_new(const char *name, const char *in_file, int lineno); 00381 void ast_category_append(struct ast_config *config, struct ast_category *cat); 00382 00383 /*! 00384 * \brief Inserts new category 00385 * \param config which config to use 00386 * \param cat newly created category to insert 00387 * \param match which category to insert above 00388 * This function is used to insert a new category above another category 00389 * matching the match parameter. 00390 */ 00391 void ast_category_insert(struct ast_config *config, struct ast_category *cat, const char *match); 00392 int ast_category_delete(struct ast_config *cfg, const char *category); 00393 00394 /*!\brief Removes and destroys all variables within a category 00395 * \retval 0 if the category was found and emptied 00396 * \retval -1 if the category was not found 00397 */ 00398 int ast_category_empty(struct ast_config *cfg, const char *category); 00399 void ast_category_destroy(struct ast_category *cat); 00400 struct ast_variable *ast_category_detach_variables(struct ast_category *cat); 00401 void ast_category_rename(struct ast_category *cat, const char *name); 00402 00403 #ifdef MALLOC_DEBUG 00404 struct ast_variable *_ast_variable_new(const char *name, const char *value, const char *filename, const char *file, const char *function, int lineno); 00405 #define ast_variable_new(a, b, c) _ast_variable_new(a, b, c, __FILE__, __PRETTY_FUNCTION__, __LINE__) 00406 #else 00407 struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename); 00408 #endif 00409 struct ast_config_include *ast_include_new(struct ast_config *conf, const char *from_file, const char *included_file, int is_exec, const char *exec_file, int from_lineno, char *real_included_file_name, int real_included_file_name_size); 00410 struct ast_config_include *ast_include_find(struct ast_config *conf, const char *included_file); 00411 void ast_include_rename(struct ast_config *conf, const char *from_file, const char *to_file); 00412 void ast_variable_append(struct ast_category *category, struct ast_variable *variable); 00413 void ast_variable_insert(struct ast_category *category, struct ast_variable *variable, const char *line); 00414 int ast_variable_delete(struct ast_category *category, const char *variable, const char *match, const char *line); 00415 00416 /*! \brief Update variable value within a config 00417 * \param category Category element within the config 00418 * \param variable Name of the variable to change 00419 * \param value New value of the variable 00420 * \param match If set, previous value of the variable (if NULL or zero-length, no matching will be done) 00421 * \param object Boolean of whether to make the new variable an object 00422 * \return 0 on success or -1 on failure. 00423 */ 00424 int ast_variable_update(struct ast_category *category, const char *variable, 00425 const char *value, const char *match, unsigned int object); 00426 00427 int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator); 00428 00429 struct ast_config *ast_config_internal_load(const char *configfile, struct ast_config *cfg, struct ast_flags flags, const char *suggested_incl_file, const char *who_asked); 00430 00431 /*! \brief Support code to parse config file arguments 00432 * 00433 * The function ast_parse_arg() provides a generic interface to parse 00434 * strings (e.g. numbers, network addresses and so on) in a flexible 00435 * way, e.g. by doing proper error and bound checks, provide default 00436 * values, and so on. 00437 * The function (described later) takes a string as an argument, 00438 * a set of flags to specify the result format and checks to perform, 00439 * a pointer to the result, and optionally some additional arguments. 00440 * It returns 0 on success, != 0 otherwise. 00441 * 00442 */ 00443 enum ast_parse_flags { 00444 /* low 4 bits of flags are used for the operand type */ 00445 PARSE_TYPE = 0x000f, 00446 /* numeric types, with optional default value and bound checks. 00447 * Additional arguments are passed by value. 00448 */ 00449 PARSE_INT32 = 0x0001, 00450 PARSE_UINT32 = 0x0002, 00451 PARSE_DOUBLE = 0x0003, 00452 #if 0 /* not supported yet */ 00453 PARSE_INT16 = 0x0004, 00454 PARSE_UINT16 = 0x0005, 00455 #endif 00456 /* Returns a struct sockaddr_in, with optional default value 00457 * (passed by reference) and port handling (accept, ignore, 00458 * require, forbid). The format is 'host.name[:port]' 00459 */ 00460 PARSE_INADDR = 0x000f, 00461 00462 /* Other data types can be added as needed */ 00463 00464 /* If PARSE_DEFAULT is set, next argument is a default value 00465 * which is returned in case of error. The argument is passed 00466 * by value in case of numeric types, by reference in other cases. 00467 */ 00468 PARSE_DEFAULT = 0x0010, /* assign default on error */ 00469 00470 /* Request a range check, applicable to numbers. Two additional 00471 * arguments are passed by value, specifying the low-high end of 00472 * the range (inclusive). An error is returned if the value 00473 * is outside or inside the range, respectively. 00474 */ 00475 PARSE_IN_RANGE = 0x0020, /* accept values inside a range */ 00476 PARSE_OUT_RANGE = 0x0040, /* accept values outside a range */ 00477 00478 /* Port handling, for sockaddr_in. accept/ignore/require/forbid 00479 * port number after the hostname or address. 00480 */ 00481 PARSE_PORT_MASK = 0x0300, /* 0x000: accept port if present */ 00482 PARSE_PORT_IGNORE = 0x0100, /* 0x100: ignore port if present */ 00483 PARSE_PORT_REQUIRE = 0x0200, /* 0x200: require port number */ 00484 PARSE_PORT_FORBID = 0x0300, /* 0x100: forbid port number */ 00485 }; 00486 00487 /*! \brief The argument parsing routine. 00488 * \param arg the string to parse. It is not modified. 00489 * \param flags combination of ast_parse_flags to specify the 00490 * return type and additional checks. 00491 * \param result pointer to the result. NULL is valid here, and can 00492 * be used to perform only the validity checks. 00493 * \param ... extra arguments are required according to flags. 00494 * \retval 0 in case of success, != 0 otherwise. 00495 * \retval result returns the parsed value in case of success, 00496 * the default value in case of error, or it is left unchanged 00497 * in case of error and no default specified. Note that in certain 00498 * cases (e.g. sockaddr_in, with multi-field return values) some 00499 * of the fields in result may be changed even if an error occurs. 00500 * 00501 * Examples of use: 00502 * ast_parse_arg("223", PARSE_INT32|PARSE_IN_RANGE, 00503 * &a, -1000, 1000); 00504 * returns 0, a = 223 00505 * ast_parse_arg("22345", PARSE_INT32|PARSE_IN_RANGE|PARSE_DEFAULT, 00506 * &a, 9999, 10, 100); 00507 * returns 1, a = 9999 00508 * ast_parse_arg("22345ssf", PARSE_UINT32|PARSE_IN_RANGE, &b, 10, 100); 00509 * returns 1, b unchanged 00510 * ast_parse_arg("www.foo.biz:44", PARSE_INADDR, &sa); 00511 * returns 0, sa contains address and port 00512 * ast_parse_arg("www.foo.biz", PARSE_INADDR|PARSE_PORT_REQUIRE, &sa); 00513 * returns 1 because port is missing, sa contains address 00514 */ 00515 int ast_parse_arg(const char *arg, enum ast_parse_flags flags, 00516 void *result, ...); 00517 00518 /* 00519 * Parsing config file options in C is slightly annoying because we cannot use 00520 * string in a switch() statement, yet we need a similar behaviour, with many 00521 * branches and a break on a matching one. 00522 * The following somehow simplifies the job: we create a block using 00523 * the CV_START and CV_END macros, and then within the block we can run 00524 * actions such as "if (condition) { body; break; }" 00525 * Additional macros are present to run simple functions (e.g. ast_copy_string) 00526 * or to pass arguments to ast_parse_arg() 00527 * 00528 * As an example: 00529 00530 CV_START(v->name, v->value); // start the block 00531 CV_STR("foo", x_foo); // static string 00532 CV_DSTR("bar", y_bar); // malloc'ed string 00533 CV_F("bar", ...); // call a generic function 00534 CV_END; // end the block 00535 */ 00536 00537 /*! \brief the macro to open a block for variable parsing */ 00538 #define CV_START(__in_var, __in_val) \ 00539 do { \ 00540 const char *__var = __in_var; \ 00541 const char *__val = __in_val; 00542 00543 /*! \brief close a variable parsing block */ 00544 #define CV_END } while (0) 00545 00546 /*! \brief call a generic function if the name matches. */ 00547 #define CV_F(__pattern, __body) if (!strcasecmp((__var), __pattern)) { __body; break; } 00548 00549 /*! \brief helper macros to assign the value to a BOOL, UINT, static string and 00550 * dynamic string 00551 */ 00552 #define CV_BOOL(__x, __dst) CV_F(__x, (__dst) = ast_true(__val) ) 00553 #define CV_UINT(__x, __dst) CV_F(__x, (__dst) = strtoul(__val, NULL, 0) ) 00554 #define CV_STR(__x, __dst) CV_F(__x, ast_copy_string(__dst, __val, sizeof(__dst))) 00555 #define CV_DSTR(__x, __dst) CV_F(__x, if (__dst) ast_free(__dst); __dst = ast_strdup(__val)) 00556 #define CV_STRFIELD(__x, __obj, __field) CV_F(__x, ast_string_field_set(__obj, __field, __val)) 00557 00558 /*!\brief Check if require type is an integer type */ 00559 AST_INLINE_API( 00560 int ast_rq_is_int(require_type type), 00561 { 00562 switch (type) { 00563 case RQ_INTEGER1: 00564 case RQ_UINTEGER1: 00565 case RQ_INTEGER2: 00566 case RQ_UINTEGER2: 00567 case RQ_INTEGER3: 00568 case RQ_UINTEGER3: 00569 case RQ_INTEGER4: 00570 case RQ_UINTEGER4: 00571 case RQ_INTEGER8: 00572 case RQ_UINTEGER8: 00573 return 1; 00574 default: 00575 return 0; 00576 } 00577 } 00578 ) 00579 00580 #if defined(__cplusplus) || defined(c_plusplus) 00581 } 00582 #endif 00583 00584 #endif /* _ASTERISK_CONFIG_H */