Improve the build system to *properly* remove unnecessary symbols from the runtime global namespace. Along the way, change the prefixes on some internal-only API calls to use a common prefix.

With these changes, for a module to export symbols into the global namespace, it must have *both* the AST_MODFLAG_GLOBAL_SYMBOLS flag and a linker script that allows the linker to leave the symbols exposed in the module's .so file (see res_odbc.exports for an example).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@182802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2009-03-18 01:28:42 +00:00
parent 62fbf19157
commit f1f417a9d8
33 changed files with 511 additions and 247 deletions

View File

@@ -188,15 +188,15 @@ int ao2_ref(void *o, int delta);
#ifndef DEBUG_THREADS
int ao2_lock(void *a);
#else
#define ao2_lock(a) _ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
int _ao2_lock(void *a, const char *file, const char *func, int line, const char *var);
#define ao2_lock(a) __ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
int __ao2_lock(void *a, const char *file, const char *func, int line, const char *var);
#endif
#ifndef DEBUG_THREADS
int ao2_trylock(void *a);
#else
#define ao2_trylock(a) _ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
int _ao2_trylock(void *a, const char *file, const char *func, int line, const char *var);
#define ao2_trylock(a) __ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
int __ao2_trylock(void *a, const char *file, const char *func, int line, const char *var);
#endif
/*!
@@ -208,8 +208,8 @@ int _ao2_trylock(void *a, const char *file, const char *func, int line, const ch
#ifndef DEBUG_THREADS
int ao2_unlock(void *a);
#else
#define ao2_unlock(a) _ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
int _ao2_unlock(void *a, const char *file, const char *func, int line, const char *var);
#define ao2_unlock(a) __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
int __ao2_unlock(void *a, const char *file, const char *func, int line, const char *var);
#endif
/*!

View File

@@ -399,9 +399,9 @@ struct ast_frame *ast_fralloc(char *source, int len);
#endif
/*!
* \brief Frees a frame
* \brief Frees a frame or list of frames
*
* \param fr Frame to free
* \param fr Frame to free, or head of list to free
* \param cache Whether to consider this frame for frame caching
*/
void ast_frame_free(struct ast_frame *fr, int cache);
@@ -415,6 +415,11 @@ void ast_frame_free(struct ast_frame *fr, int cache);
* data malloc'd. If you need to store frames, say for queueing, then
* you should call this function.
* \return Returns a frame on success, NULL on error
* \note This function may modify the frame passed to it, so you must
* not assume the frame will be intact after the isolated frame has
* been produced. In other words, calling this function on a frame
* should be the last operation you do with that frame before freeing
* it (or exiting the block, if the frame is on the stack.)
*/
struct ast_frame *ast_frisolate(struct ast_frame *fr);

View File

@@ -685,7 +685,7 @@ struct { \
\param head This is a pointer to the list head structure
\param list This is a pointer to the list to be appended.
\param field This is the name of the field (declared using AST_LIST_ENTRY())
used to link entries of this list together.
used to link entries of the lists together.
Note: The source list (the \a list parameter) will be empty after
calling this macro (the list entries are \b moved to the target list).
@@ -704,6 +704,30 @@ struct { \
#define AST_RWLIST_APPEND_LIST AST_LIST_APPEND_LIST
/*!
\brief Inserts a whole list after a specific entry in a list
\param head This is a pointer to the list head structure
\param list This is a pointer to the list to be inserted.
\param elm This is a pointer to the entry after which the new list should
be inserted.
\param field This is the name of the field (declared using AST_LIST_ENTRY())
used to link entries of the lists together.
Note: The source list (the \a list parameter) will be empty after
calling this macro (the list entries are \b moved to the target list).
*/
#define AST_LIST_INSERT_LIST_AFTER(head, list, elm, field) do { \
(list)->last->field.next = (elm)->field.next; \
(elm)->field.next = (list)->first; \
if ((head)->last == elm) { \
(head)->last = (list)->last; \
} \
(list)->first = NULL; \
(list)->last = NULL; \
} while(0)
#define AST_RWLIST_INSERT_LIST_AFTER AST_LIST_INSERT_LIST_AFTER
/*!
\brief Removes and returns the head entry from a list.
\param head This is a pointer to the list head structure