aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-20 22:18:21 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-20 22:18:21 +0000
commit8d3385f5344604e2e8f31eee7bf565e88778500b (patch)
treeaf054294a844611a54aa36bfacfb7377d8074695
parente616a7a4e2434fe360530b21af62ea44c3700318 (diff)
move internal function declarations to include/asterisk/_private.h
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89465 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xbuild_tools/strip_nonapi2
-rw-r--r--include/asterisk.h34
-rw-r--r--include/asterisk/_private.h44
-rw-r--r--main/asterisk.c2
-rw-r--r--main/astobj2.c1
-rw-r--r--main/channel.c2
-rw-r--r--main/cli.c1
-rw-r--r--main/db.c1
-rw-r--r--main/devicestate.c1
-rw-r--r--main/dnsmgr.c1
-rw-r--r--main/event.c1
-rw-r--r--main/frame.c1
-rw-r--r--main/loader.c1
-rw-r--r--main/logger.c9
-rw-r--r--main/manager.c1
-rw-r--r--main/pbx.c1
-rw-r--r--main/term.c1
-rw-r--r--main/threadstorage.c15
18 files changed, 74 insertions, 45 deletions
diff --git a/build_tools/strip_nonapi b/build_tools/strip_nonapi
index c2262cafa..5a52eef1e 100755
--- a/build_tools/strip_nonapi
+++ b/build_tools/strip_nonapi
@@ -18,7 +18,7 @@
FILTER="${GREP} -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_"
case "${OSARCH}" in
- linux-gnu)
+ linux-gnu|FreeBSD)
nm ${1} | ${GREP} -e " T " | cut -d" " -f3 | ${FILTER} > striplist
sed -e "s/^/-N /" striplist | xargs ${STRIP} ${1}
rm -f striplist
diff --git a/include/asterisk.h b/include/asterisk.h
index da70e8a8c..5605d2f3b 100644
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -50,40 +50,6 @@
#define sched_setscheduler __PLEASE_USE_ast_set_priority_INSTEAD_OF_sched_setscheduler__
int ast_set_priority(int); /*!< Provided by asterisk.c */
-int load_modules(unsigned int); /*!< Provided by loader.c */
-int load_pbx(void); /*!< Provided by pbx.c */
-int init_logger(void); /*!< Provided by logger.c */
-void close_logger(void); /*!< Provided by logger.c */
-int reload_logger(int); /*!< Provided by logger.c */
-int init_framer(void); /*!< Provided by frame.c */
-int ast_term_init(void); /*!< Provided by term.c */
-int astdb_init(void); /*!< Provided by db.c */
-void ast_channels_init(void); /*!< Provided by channel.c */
-void ast_builtins_init(void); /*!< Provided by cli.c */
-int dnsmgr_init(void); /*!< Provided by dnsmgr.c */
-void dnsmgr_start_refresh(void); /*!< Provided by dnsmgr.c */
-int dnsmgr_reload(void); /*!< Provided by dnsmgr.c */
-void threadstorage_init(void); /*!< Provided by threadstorage.c */
-void ast_event_init(void); /*!< Provided by event.c */
-int ast_device_state_engine_init(void); /*!< Provided by devicestate.c */
-int astobj2_init(void); /*! Provided by astobj2.c */
-
-/*!
- * \brief Reload asterisk modules.
- * \param name the name of the module to reload
- *
- * This function reloads the specified module, or if no modules are specified,
- * it will reload all loaded modules.
- *
- * \note Modules are reloaded using their reload() functions, not unloading
- * them and loading them again.
- *
- * \return 0 if the specified module was not found.
- * \retval 1 if the module was found but cannot be reloaded.
- * \retval -1 if a reload operation is already in progress.
- * \retval 2 if the specfied module was found and reloaded.
- */
-int ast_module_reload(const char *name);
/*!
* \brief Register a function to be executed before Asterisk exits.
diff --git a/include/asterisk/_private.h b/include/asterisk/_private.h
new file mode 100644
index 000000000..ad4ca7214
--- /dev/null
+++ b/include/asterisk/_private.h
@@ -0,0 +1,44 @@
+/*
+ * Prototypes for public functions only of internal interest,
+ * normally not used by modules.
+ * What goes here are typically *_init() routines.
+ */
+
+#ifndef _ASTERISK__PRIVATE_H
+#define _ASTERISK__PRIVATE_H
+
+int load_modules(unsigned int); /*!< Provided by loader.c */
+int load_pbx(void); /*!< Provided by pbx.c */
+int init_logger(void); /*!< Provided by logger.c */
+void close_logger(void); /*!< Provided by logger.c */
+int init_framer(void); /*!< Provided by frame.c */
+int ast_term_init(void); /*!< Provided by term.c */
+int astdb_init(void); /*!< Provided by db.c */
+void ast_channels_init(void); /*!< Provided by channel.c */
+void ast_builtins_init(void); /*!< Provided by cli.c */
+int dnsmgr_init(void); /*!< Provided by dnsmgr.c */
+void dnsmgr_start_refresh(void); /*!< Provided by dnsmgr.c */
+int dnsmgr_reload(void); /*!< Provided by dnsmgr.c */
+void threadstorage_init(void); /*!< Provided by threadstorage.c */
+void ast_event_init(void); /*!< Provided by event.c */
+int ast_device_state_engine_init(void); /*!< Provided by devicestate.c */
+int astobj2_init(void); /*! Provided by astobj2.c */
+
+/*!
+ * \brief Reload asterisk modules.
+ * \param name the name of the module to reload
+ *
+ * This function reloads the specified module, or if no modules are specified,
+ * it will reload all loaded modules.
+ *
+ * \note Modules are reloaded using their reload() functions, not unloading
+ * them and loading them again.
+ *
+ * \return 0 if the specified module was not found.
+ * \retval 1 if the module was found but cannot be reloaded.
+ * \retval -1 if a reload operation is already in progress.
+ * \retval 2 if the specfied module was found and reloaded.
+ */
+int ast_module_reload(const char *name);
+
+#endif /* _ASTERISK__PRIVATE_H */
diff --git a/main/asterisk.c b/main/asterisk.c
index dc0133758..69e75abdf 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -61,6 +61,8 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
+
#undef sched_setscheduler
#undef setpriority
#include <sys/time.h>
diff --git a/main/astobj2.c b/main/astobj2.c
index 8404f036d..e7a091c80 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -21,6 +21,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include "asterisk/astobj2.h"
#include "asterisk/utils.h"
#include "asterisk/cli.h"
diff --git a/main/channel.c b/main/channel.c
index 94814e450..1fcc096bb 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -27,6 +27,8 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
+
#include <sys/time.h>
#include <signal.h>
#include <math.h>
diff --git a/main/cli.c b/main/cli.c
index aae8dfc04..b4c4b5fd2 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -27,6 +27,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <sys/signal.h>
#include <signal.h>
#include <ctype.h>
diff --git a/main/db.c b/main/db.c
index ea22f5674..aea825d1a 100644
--- a/main/db.c
+++ b/main/db.c
@@ -31,6 +31,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <sys/time.h>
#include <signal.h>
#include <dirent.h>
diff --git a/main/devicestate.c b/main/devicestate.c
index 91ef8ee5d..7f00425fe 100644
--- a/main/devicestate.c
+++ b/main/devicestate.c
@@ -112,6 +112,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include "asterisk/channel.h"
#include "asterisk/utils.h"
#include "asterisk/lock.h"
diff --git a/main/dnsmgr.c b/main/dnsmgr.c
index d5ab8e0ce..c6e3adffc 100644
--- a/main/dnsmgr.c
+++ b/main/dnsmgr.c
@@ -27,6 +27,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <regex.h>
#include <signal.h>
diff --git a/main/event.c b/main/event.c
index f9d9b657c..be0d3f286 100644
--- a/main/event.c
+++ b/main/event.c
@@ -27,6 +27,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include "asterisk/event.h"
#include "asterisk/linkedlists.h"
#include "asterisk/lock.h"
diff --git a/main/frame.c b/main/frame.c
index 85fa6a96a..13d81d4b4 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -27,6 +27,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include "asterisk/lock.h"
#include "asterisk/frame.h"
#include "asterisk/options.h"
diff --git a/main/loader.c b/main/loader.c
index 5e51c8401..3ffa68758 100644
--- a/main/loader.c
+++ b/main/loader.c
@@ -31,6 +31,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <dirent.h>
#include "asterisk/linkedlists.h"
diff --git a/main/logger.c b/main/logger.c
index 415019761..c94cf4b44 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -25,14 +25,17 @@
* \author Mark Spencer <markster@digium.com>
*/
-/* Prevent inclusion of logger.h - it redefines LOG_* which we need
- * to define syslog_level_map. Later, we force its inclusion again.
+/*
+ * define _ASTERISK_LOGGER_H to prevent the inclusion of logger.h;
+ * it redefines LOG_* which we need to define syslog_level_map.
+ * Later, we force the inclusion of logger.h again.
*/
#define _ASTERISK_LOGGER_H
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <signal.h>
#include <time.h>
#include <sys/stat.h>
@@ -511,7 +514,7 @@ static int rotate_file(const char *filename)
return res;
}
-int reload_logger(int rotate)
+static int reload_logger(int rotate)
{
char old[PATH_MAX] = "";
int event_rotate = rotate, queue_rotate = rotate;
diff --git a/main/manager.c b/main/manager.c
index f7f818c79..14a9d9881 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -45,6 +45,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <ctype.h>
#include <sys/time.h>
#include <signal.h>
diff --git a/main/pbx.c b/main/pbx.c
index cd8a23ca8..d1a0570c7 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -27,6 +27,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <ctype.h>
#include <time.h>
#include <sys/time.h>
diff --git a/main/term.c b/main/term.c
index d79c83c10..825a710da 100644
--- a/main/term.c
+++ b/main/term.c
@@ -27,6 +27,7 @@
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+#include "asterisk/_private.h"
#include <sys/time.h>
#include <signal.h>
#include <sys/stat.h>
diff --git a/main/threadstorage.c b/main/threadstorage.c
index 5a6f4b3e8..35d3eca55 100644
--- a/main/threadstorage.c
+++ b/main/threadstorage.c
@@ -24,8 +24,15 @@
*/
#include "asterisk.h"
+#include "asterisk/_private.h"
-#if defined(DEBUG_THREADLOCALS)
+#if !defined(DEBUG_THREADLOCALS)
+
+void threadstorage_init(void)
+{
+}
+
+#else /* !defined(DEBUG_THREADLOCALS) */
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
@@ -226,11 +233,5 @@ void threadstorage_init(void)
ast_cli_register_multiple(cli, sizeof(cli) / sizeof(cli[0]));
}
-#else /* !defined(DEBUG_THREADLOCALS) */
-
-void threadstorage_init(void)
-{
-}
-
#endif /* !defined(DEBUG_THREADLOCALS) */