2 * Asterisk -- A telephony toolkit for Linux.
4 * General Definitions for Asterisk top level program
6 * Copyright (C) 1999-2005, Mark Spencer
8 * Mark Spencer <markster@digium.com>
10 * This program is free software, distributed under the terms of
11 * the GNU General Public License
15 * \brief Asterisk main include file. File version handling, generic pbx functions.
21 #define DEFAULT_LANGUAGE "en"
23 #define AST_CONFIG_MAX_PATH 255
25 /* provided in asterisk.c */
26 extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
27 extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
28 extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
29 extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
30 extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
31 extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
32 extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
33 extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
34 extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
35 extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
36 extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
37 extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
38 extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
39 extern char ast_config_AST_CTL_PERMISSIONS[AST_CONFIG_MAX_PATH];
40 extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH];
41 extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH];
42 extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH];
43 extern char ast_config_AST_SYSTEM_NAME[20];
45 /* Provided by asterisk.c */
46 int ast_set_priority(int);
47 /* Provided by module.c */
48 int load_modules(const int preload_only);
49 /* Provided by pbx.c */
51 /* Provided by logger.c */
52 int init_logger(void);
53 void close_logger(void);
54 /* Provided by frame.c */
55 int init_framer(void);
56 /* Provided by logger.c */
57 int reload_logger(int);
58 /* Provided by term.c */
60 /* Provided by db.c */
62 /* Provided by channel.c */
63 void ast_channels_init(void);
64 /* Provided by dnsmgr.c */
65 int dnsmgr_init(void);
66 void dnsmgr_start_refresh(void);
67 int dnsmgr_reload(void);
70 * \brief Register the version of a source code file with the core.
71 * \param file the source file name
72 * \param version the version string (typically a CVS revision keyword string)
75 * This function should not be called directly, but instead the
76 * ASTERISK_FILE_VERSION macro should be used to register a file with the core.
78 void ast_register_file_version(const char *file, const char *version);
81 * \brief Unregister a source code file from the core.
82 * \param file the source file name
85 * This function should not be called directly, but instead the
86 * ASTERISK_FILE_VERSION macro should be used to automatically unregister
87 * the file when the module is unloaded.
89 void ast_unregister_file_version(const char *file);
92 * \brief Register/unregister a source code file with the core.
93 * \param file the source file name
94 * \param version the version string (typically a CVS revision keyword string)
96 * This macro will place a file-scope constructor and destructor into the
97 * source of the module using it; this will cause the version of this file
98 * to registered with the Asterisk core (and unregistered) at the appropriate
104 * ASTERISK_FILE_VERSION(__FILE__, "\$Revision\$")
107 * \note The dollar signs above have been protected with backslashes to keep
108 * CVS from modifying them in this file; under normal circumstances they would
109 * not be present and CVS would expand the Revision keyword into the file's
112 #if defined(__GNUC__) && !defined(LOW_MEMORY)
113 #define ASTERISK_FILE_VERSION(file, version) \
114 static void __attribute__((constructor)) __register_file_version(void) \
116 ast_register_file_version(file, version); \
118 static void __attribute__((destructor)) __unregister_file_version(void) \
120 ast_unregister_file_version(file); \
122 #elif !defined(LOW_MEMORY) /* ! __GNUC__ && ! LOW_MEMORY*/
123 #define ASTERISK_FILE_VERSION(file, x) static const char __file_version[] = x;
124 #else /* LOW_MEMORY */
125 #define ASTERISK_FILE_VERSION(file, x)
126 #endif /* __GNUC__ */
128 #endif /* _ASTERISK_H */