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
17 #define DEFAULT_LANGUAGE "en"
19 #define AST_CONFIG_MAX_PATH 255
21 /* provided in asterisk.c */
22 extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
23 extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
24 extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
25 extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
26 extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
27 extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
28 extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
29 extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
30 extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
31 extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
32 extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
33 extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
34 extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
35 extern char ast_config_AST_CTL_PERMISSIONS[AST_CONFIG_MAX_PATH];
36 extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH];
37 extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH];
38 extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH];
40 /* Provided by module.c */
41 extern int load_modules(const int preload_only);
42 /* Provided by pbx.c */
43 extern int load_pbx(void);
44 /* Provided by logger.c */
45 extern int init_logger(void);
46 extern void close_logger(void);
47 /* Provided by frame.c */
48 extern int init_framer(void);
49 /* Provided by logger.c */
50 extern int reload_logger(int);
51 /* Provided by term.c */
52 extern int term_init(void);
53 /* Provided by db.c */
54 extern int astdb_init(void);
55 /* Provided by channel.c */
56 extern void ast_channels_init(void);
57 /* Provided by dnsmgr.c */
58 extern int dnsmgr_init(void);
59 extern void dnsmgr_reload(void);
62 * \brief Register the version of a source code file with the core.
63 * \param file the source file name
64 * \param version the version string (typically a CVS revision keyword string)
67 * This function should not be called directly, but instead the
68 * ASTERISK_FILE_VERSION macro should be used to register a file with the core.
70 void ast_register_file_version(const char *file, const char *version);
73 * \brief Unregister a source code file from the core.
74 * \param file the source file name
77 * This function should not be called directly, but instead the
78 * ASTERISK_FILE_VERSION macro should be used to automatically unregister
79 * the file when the module is unloaded.
81 void ast_unregister_file_version(const char *file);
84 * \brief Register/unregister a source code file with the core.
85 * \param file the source file name
86 * \param version the version string (typically a CVS revision keyword string)
88 * This macro will place a file-scope constructor and destructor into the
89 * source of the module using it; this will cause the version of this file
90 * to registered with the Asterisk core (and unregistered) at the appropriate
96 * ASTERISK_FILE_VERSION(__FILE__, "\$Revision\$")
99 * \note The dollar signs above have been protected with backslashes to keep
100 * CVS from modifying them in this file; under normal circumstances they would
101 * not be present and CVS would expand the Revision keyword into the file's
104 #if defined(__GNUC__) && !defined(LOW_MEMORY)
105 #define ASTERISK_FILE_VERSION(file, version) \
106 static void __attribute__((constructor)) __register_file_version(void) \
108 ast_register_file_version(file, version); \
110 static void __attribute__((destructor)) __unregister_file_version(void) \
112 ast_unregister_file_version(file); \
114 #elif !defined(LOW_MEMORY) /* ! __GNUC__ && ! LOW_MEMORY*/
115 #define ASTERISK_FILE_VERSION(file, x) static const char __file_version[] = x;
116 #else /* LOW_MEMORY */
117 #define ASTERISK_FILE_VERSION(file, x)
118 #endif /* __GNUC__ */
120 #endif /* _ASTERISK_H */