Redesigned 'optional API' support.

This patch provides a new implementation of the optional API support defined
in asterisk/optional_api.h; this new version provides solves compatibility
issues with the use of linker version scripts for suppressing global symbols.
In addition, there is now a functional (and tested!) implementation for Mac OS/X,
so module writers no longer need to use special tests before calling optional
API functions. All future implementations must provide these same semantics,
so that module writers can rely on them.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2009-06-15 16:07:23 +00:00
parent d224f78dd5
commit 6c5987811c
19 changed files with 289 additions and 297 deletions

View File

@@ -927,7 +927,7 @@ static agi_command *find_command(const char * const cmds[], int exact);
AST_THREADSTORAGE(agi_buf);
#define AGI_BUF_INITSIZE 256
int ast_agi_send(int fd, struct ast_channel *chan, char *fmt, ...)
int AST_OPTIONAL_API_NAME(ast_agi_send)(int fd, struct ast_channel *chan, char *fmt, ...)
{
int res = 0;
va_list ap;
@@ -2925,7 +2925,7 @@ static char *help_workhorse(int fd, const char * const match[])
return CLI_SUCCESS;
}
int ast_agi_register(struct ast_module *mod, agi_command *cmd)
int AST_OPTIONAL_API_NAME(ast_agi_register)(struct ast_module *mod, agi_command *cmd)
{
char fullcmd[MAX_CMD_LEN];
@@ -2956,7 +2956,7 @@ int ast_agi_register(struct ast_module *mod, agi_command *cmd)
}
}
int ast_agi_unregister(struct ast_module *mod, agi_command *cmd)
int AST_OPTIONAL_API_NAME(ast_agi_unregister)(struct ast_module *mod, agi_command *cmd)
{
struct agi_command *e;
int unregistered = 0;
@@ -2995,7 +2995,7 @@ int ast_agi_unregister(struct ast_module *mod, agi_command *cmd)
return unregistered;
}
int ast_agi_register_multiple(struct ast_module *mod, struct agi_command *cmd, unsigned int len)
int AST_OPTIONAL_API_NAME(ast_agi_register_multiple)(struct ast_module *mod, struct agi_command *cmd, unsigned int len)
{
unsigned int i, x = 0;
@@ -3025,7 +3025,7 @@ int ast_agi_register_multiple(struct ast_module *mod, struct agi_command *cmd, u
return 0;
}
int ast_agi_unregister_multiple(struct ast_module *mod, struct agi_command *cmd, unsigned int len)
int AST_OPTIONAL_API_NAME(ast_agi_unregister_multiple)(struct ast_module *mod, struct agi_command *cmd, unsigned int len)
{
unsigned int i;
int res = 0;