diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-08-21 02:11:39 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2006-08-21 02:11:39 +0000 |
commit | 0a27d8bfe5fa36d8cb600b5b520f9b5c7fbf0ed6 (patch) | |
tree | 270b9c46c1e644483d6d2a35b509f43218ba3252 /res/res_convert.c | |
parent | f60ada0be22cd646454278e102d384a5dbaf7d59 (diff) |
merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
- support for embedded modules
- support for static builds
- simpler cross-compilation support
- simpler module/loader interface (no exported symbols)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_convert.c')
-rw-r--r-- | res/res_convert.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/res/res_convert.c b/res/res_convert.c index c62aba4d5..0f46cf14d 100644 --- a/res/res_convert.c +++ b/res/res_convert.c @@ -1,7 +1,7 @@ /* * Asterisk -- An open source telephony toolkit. * - * Copyright (C) 2005, Digium, Inc. + * Copyright (C) 2005, 2006, Digium, Inc. * * redice li <redice_li@yahoo.com> * Russell Bryant <russell@digium.com> @@ -40,8 +40,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/cli.h" #include "asterisk/file.h" -struct module_symbols *me; - /*! \brief Split the filename to basename and extension */ static int split_ext(char *filename, char **name, char **ext) { @@ -66,8 +64,9 @@ static int cli_audio_convert(int fd, int argc, char *argv[]) char *file_in = NULL, *file_out = NULL; char *name_in, *ext_in, *name_out, *ext_out; - ast_atomic_fetchadd_int(&me->usecnt, +1); - + /* ugly, can be removed when CLI entries have ast_module pointers */ + ast_module_ref(ast_module_info->self); + if (argc != 3 || ast_strlen_zero(argv[1]) || ast_strlen_zero(argv[2])) { ret = RESULT_SHOWUSAGE; goto fail_out; @@ -117,8 +116,8 @@ fail_out: if (fs_in) ast_closestream(fs_in); - ast_atomic_fetchadd_int(&me->usecnt, -1); - + ast_module_unref(ast_module_info->self); + return ret; } @@ -133,25 +132,14 @@ static struct ast_cli_entry audio_convert_cli={ { "convert" , NULL }, cli_audio_convert, "Convert audio files", usage_audio_convert }; -static int unload_module(void *mod) +static int unload_module(void) { return ast_cli_unregister(&audio_convert_cli); } -static int load_module(void *mod) +static int load_module(void) { - me = mod; return ast_cli_register(&audio_convert_cli); } -static const char *description(void) -{ - return "File format conversion CLI command"; -} - -static const char *key(void) -{ - return ASTERISK_GPL_KEY; -} - -STD_MOD1; +AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "File format conversion CLI command"); |