Fri May 26 01:45:29 2006

Asterisk developer's documentation


asterisk.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- A telephony toolkit for Linux.
00003  *
00004  * General Definitions for Asterisk top level program
00005  * 
00006  * Copyright (C) 1999-2005, Mark Spencer
00007  *
00008  * Mark Spencer <markster@digium.com>
00009  *
00010  * This program is free software, distributed under the terms of
00011  * the GNU General Public License
00012  */
00013 
00014 /*! \file
00015  * \brief Asterisk main include file. File version handling, generic pbx functions.
00016  */
00017 
00018 #ifndef _ASTERISK_H
00019 #define _ASTERISK_H
00020 
00021 #define DEFAULT_LANGUAGE "en"
00022 
00023 #define AST_CONFIG_MAX_PATH 255
00024 
00025 /* provided in asterisk.c */
00026 extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
00027 extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
00028 extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
00029 extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
00030 extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
00031 extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
00032 extern char ast_config_AST_DATA_DIR[AST_CONFIG_MAX_PATH];
00033 extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
00034 extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
00035 extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
00036 extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
00037 extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
00038 extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
00039 extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
00040 extern char ast_config_AST_CTL_PERMISSIONS[AST_CONFIG_MAX_PATH];
00041 extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH];
00042 extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH];
00043 extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH];
00044 
00045 /* Provided by asterisk.c */
00046 int ast_set_priority(int);
00047 /* Provided by module.c */
00048 int load_modules(const int preload_only);
00049 /* Provided by pbx.c */
00050 int load_pbx(void);
00051 /* Provided by logger.c */
00052 int init_logger(void);
00053 void close_logger(void);
00054 /* Provided by frame.c */
00055 int init_framer(void);
00056 /* Provided by logger.c */
00057 int reload_logger(int);
00058 /* Provided by term.c */
00059 int term_init(void);
00060 /* Provided by db.c */
00061 int astdb_init(void);
00062 /* Provided by channel.c */
00063 void ast_channels_init(void);
00064 /* Provided by dnsmgr.c */
00065 int dnsmgr_init(void);
00066 void dnsmgr_start_refresh(void);
00067 void dnsmgr_reload(void);
00068 
00069 /*!
00070  * \brief Register the version of a source code file with the core.
00071  * \param file the source file name
00072  * \param version the version string (typically a CVS revision keyword string)
00073  * \return nothing
00074  *
00075  * This function should not be called directly, but instead the
00076  * ASTERISK_FILE_VERSION macro should be used to register a file with the core.
00077  */
00078 void ast_register_file_version(const char *file, const char *version);
00079 
00080 /*!
00081  * \brief Unregister a source code file from the core.
00082  * \param file the source file name
00083  * \return nothing
00084  *
00085  * This function should not be called directly, but instead the
00086  * ASTERISK_FILE_VERSION macro should be used to automatically unregister
00087  * the file when the module is unloaded.
00088  */
00089 void ast_unregister_file_version(const char *file);
00090 
00091 /*!
00092  * \brief Register/unregister a source code file with the core.
00093  * \param file the source file name
00094  * \param version the version string (typically a CVS revision keyword string)
00095  *
00096  * This macro will place a file-scope constructor and destructor into the
00097  * source of the module using it; this will cause the version of this file
00098  * to registered with the Asterisk core (and unregistered) at the appropriate
00099  * times.
00100  *
00101  * Example:
00102  *
00103  * \code
00104  * ASTERISK_FILE_VERSION(__FILE__, "\$Revision\$")
00105  * \endcode
00106  *
00107  * \note The dollar signs above have been protected with backslashes to keep
00108  * SVN from modifying them in this file; under normal circumstances they would
00109  * not be present and SVN would expand the Revision keyword into the file's
00110  * revision number.
00111  */
00112 #if defined(__GNUC__) && !defined(LOW_MEMORY)
00113 #define ASTERISK_FILE_VERSION(file, version) \
00114    static void __attribute__((constructor)) __register_file_version(void) \
00115    { \
00116       ast_register_file_version(file, version); \
00117    } \
00118    static void __attribute__((destructor)) __unregister_file_version(void) \
00119    { \
00120       ast_unregister_file_version(file); \
00121    }
00122 #elif !defined(LOW_MEMORY) /* ! __GNUC__  && ! LOW_MEMORY*/
00123 #define ASTERISK_FILE_VERSION(file, x) static const char __file_version[] = x;
00124 #else /* LOW_MEMORY */
00125 #define ASTERISK_FILE_VERSION(file, x)
00126 #endif /* __GNUC__ */
00127 
00128 #endif /* _ASTERISK_H */

Generated on Fri May 26 01:45:29 2006 for Asterisk - the Open Source PBX by  doxygen 1.4.6