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];
36 /* Provided by module.c */
37 extern int load_modules(void);
38 /* Provided by pbx.c */
39 extern int load_pbx(void);
40 /* Provided by logger.c */
41 extern int init_logger(void);
42 extern void close_logger(void);
43 /* Provided by frame.c */
44 extern int init_framer(void);
45 /* Provided by logger.c */
46 extern int reload_logger(int);
47 /* Provided by term.c */
48 extern int term_init(void);
49 /* Provided by db.c */
50 extern int astdb_init(void);
51 /* Provided by channel.c */
52 extern void ast_channels_init(void);
53 /* Provided by dnsmgr.c */
54 extern int dnsmgr_init(void);
55 extern void dnsmgr_reload(void);
58 * \brief Register the version of a source code file with the core.
59 * \param file the source file name
60 * \param version the version string (typically a CVS revision keyword string)
63 * This function should not be called directly, but instead the
64 * ASTERISK_FILE_VERSION macro should be used to register a file with the core.
66 void ast_register_file_version(const char *file, const char *version);
69 * \brief Unregister a source code file from the core.
70 * \param file the source file name
73 * This function should not be called directly, but instead the
74 * ASTERISK_FILE_VERSION macro should be used to automatically unregister
75 * the file when the module is unloaded.
77 void ast_unregister_file_version(const char *file);
80 * \brief Register/unregister a source code file with the core.
81 * \param file the source file name
82 * \param version the version string (typically a CVS revision keyword string)
84 * This macro will place a file-scope constructor and destructor into the
85 * source of the module using it; this will cause the version of this file
86 * to registered with the Asterisk core (and unregistered) at the appropriate
92 * ASTERISK_FILE_VERSION(__FILE__, "\$Revision\$")
95 * \note The dollar signs above have been protected with backslashes to keep
96 * CVS from modifying them in this file; under normal circumstances they would
97 * not be present and CVS would expand the Revision keyword into the file's
100 #if defined(__GNUC__) && !defined(LOW_MEMORY)
101 #define ASTERISK_FILE_VERSION(file, version) \
102 static void __attribute__((constructor)) __register_file_version(void) \
104 ast_register_file_version(file, version); \
106 static void __attribute__((destructor)) __unregister_file_version(void) \
108 ast_unregister_file_version(file); \
110 #elif !defined(LOW_MEMORY) /* ! __GNUC__ && ! LOW_MEMORY*/
111 #define ASTERISK_FILE_VERSION(file, x) static const char __file_version[] = x;
112 #else /* LOW_MEMORY */
113 #define ASTERISK_FILE_VERSION(file, x)
114 #endif /* __GNUC__ */
116 #endif /* _ASTERISK_H */