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];
44 /* Provided by asterisk.c */
45 int ast_set_priority(int);
46 /* Provided by module.c */
47 int load_modules(const int preload_only);
48 /* Provided by pbx.c */
50 /* Provided by logger.c */
51 int init_logger(void);
52 void close_logger(void);
53 /* Provided by frame.c */
54 int init_framer(void);
55 /* Provided by logger.c */
56 int reload_logger(int);
57 /* Provided by term.c */
59 /* Provided by db.c */
61 /* Provided by channel.c */
62 void ast_channels_init(void);
63 /* Provided by dnsmgr.c */
64 int dnsmgr_init(void);
65 void dnsmgr_start_refresh(void);
66 void dnsmgr_reload(void);
69 * \brief Register the version of a source code file with the core.
70 * \param file the source file name
71 * \param version the version string (typically a CVS revision keyword string)
74 * This function should not be called directly, but instead the
75 * ASTERISK_FILE_VERSION macro should be used to register a file with the core.
77 void ast_register_file_version(const char *file, const char *version);
80 * \brief Unregister a source code file from the core.
81 * \param file the source file name
84 * This function should not be called directly, but instead the
85 * ASTERISK_FILE_VERSION macro should be used to automatically unregister
86 * the file when the module is unloaded.
88 void ast_unregister_file_version(const char *file);
91 * \brief Register/unregister a source code file with the core.
92 * \param file the source file name
93 * \param version the version string (typically a CVS revision keyword string)
95 * This macro will place a file-scope constructor and destructor into the
96 * source of the module using it; this will cause the version of this file
97 * to registered with the Asterisk core (and unregistered) at the appropriate
103 * ASTERISK_FILE_VERSION(__FILE__, "\$Revision\$")
106 * \note The dollar signs above have been protected with backslashes to keep
107 * CVS from modifying them in this file; under normal circumstances they would
108 * not be present and CVS would expand the Revision keyword into the file's
111 #if defined(__GNUC__) && !defined(LOW_MEMORY)
112 #define ASTERISK_FILE_VERSION(file, version) \
113 static void __attribute__((constructor)) __register_file_version(void) \
115 ast_register_file_version(file, version); \
117 static void __attribute__((destructor)) __unregister_file_version(void) \
119 ast_unregister_file_version(file); \
121 #elif !defined(LOW_MEMORY) /* ! __GNUC__ && ! LOW_MEMORY*/
122 #define ASTERISK_FILE_VERSION(file, x) static const char __file_version[] = x;
123 #else /* LOW_MEMORY */
124 #define ASTERISK_FILE_VERSION(file, x)
125 #endif /* __GNUC__ */
127 #endif /* _ASTERISK_H */