From b0f3e6097e7e40affba1f893c42be66a8d26bd23 Mon Sep 17 00:00:00 2001 From: Jason Parker Date: Fri, 19 Oct 2007 18:29:40 +0000 Subject: Convert NEW_CLI to AST_CLI. Closes issue #11039, as suggested by seanbright. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/asterisk.c | 34 +++++++++++++++++----------------- main/astmm.c | 4 ++-- main/astobj2.c | 4 ++-- main/cdr.c | 4 ++-- main/channel.c | 4 ++-- main/cli.c | 42 +++++++++++++++++++++--------------------- main/config.c | 2 +- main/db.c | 12 ++++++------ main/dnsmgr.c | 6 +++--- main/file.c | 2 +- main/frame.c | 6 +++--- main/http.c | 2 +- main/image.c | 2 +- main/logger.c | 6 +++--- main/manager.c | 14 +++++++------- main/pbx.c | 18 +++++++++--------- main/rtp.c | 8 ++++---- main/threadstorage.c | 4 ++-- main/translate.c | 2 +- main/udptl.c | 6 +++--- main/utils.c | 2 +- 21 files changed, 92 insertions(+), 92 deletions(-) (limited to 'main') diff --git a/main/asterisk.c b/main/asterisk.c index f725c522b..913859d56 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -1734,26 +1734,26 @@ static char *show_license(struct ast_cli_entry *e, int cmd, struct ast_cli_args #define ASTERISK_PROMPT2 "%s*CLI> " static struct ast_cli_entry cli_asterisk[] = { - NEW_CLI(handle_abort_shutdown, "Cancel a running shutdown"), - NEW_CLI(handle_stop_now, "Shut down Asterisk immediately"), - NEW_CLI(handle_stop_gracefully, "Gracefully shut down Asterisk"), - NEW_CLI(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"), - NEW_CLI(handle_restart_now, "Restart Asterisk immediately"), - NEW_CLI(handle_restart_gracefully, "Restart Asterisk gracefully"), - NEW_CLI(handle_restart_when_convenient, "Restart Asterisk at empty call volume"), - NEW_CLI(show_warranty, "Show the warranty (if any) for this copy of Asterisk"), - NEW_CLI(show_license, "Show the license(s) for this copy of Asterisk"), - NEW_CLI(handle_version, "Display version info"), - NEW_CLI(handle_bang, "Execute a shell command"), + AST_CLI(handle_abort_shutdown, "Cancel a running shutdown"), + AST_CLI(handle_stop_now, "Shut down Asterisk immediately"), + AST_CLI(handle_stop_gracefully, "Gracefully shut down Asterisk"), + AST_CLI(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"), + AST_CLI(handle_restart_now, "Restart Asterisk immediately"), + AST_CLI(handle_restart_gracefully, "Restart Asterisk gracefully"), + AST_CLI(handle_restart_when_convenient, "Restart Asterisk at empty call volume"), + AST_CLI(show_warranty, "Show the warranty (if any) for this copy of Asterisk"), + AST_CLI(show_license, "Show the license(s) for this copy of Asterisk"), + AST_CLI(handle_version, "Display version info"), + AST_CLI(handle_bang, "Execute a shell command"), #if !defined(LOW_MEMORY) - NEW_CLI(handle_show_version_files, "List versions of files used to build Asterisk"), - NEW_CLI(handle_show_threads, "Show running threads"), + AST_CLI(handle_show_version_files, "List versions of files used to build Asterisk"), + AST_CLI(handle_show_threads, "Show running threads"), #if defined(HAVE_SYSINFO) - NEW_CLI(handle_show_sysinfo, "Show System Information"), + AST_CLI(handle_show_sysinfo, "Show System Information"), #endif - NEW_CLI(handle_show_profile, "Display profiling info"), - NEW_CLI(handle_show_settings, "Show some core settings"), - NEW_CLI(handle_clear_profile, "Clear profiling info"), + AST_CLI(handle_show_profile, "Display profiling info"), + AST_CLI(handle_show_settings, "Show some core settings"), + AST_CLI(handle_clear_profile, "Clear profiling info"), #endif /* ! LOW_MEMORY */ }; diff --git a/main/astmm.c b/main/astmm.c index 1c6cc90c4..2cf5325fb 100644 --- a/main/astmm.c +++ b/main/astmm.c @@ -459,8 +459,8 @@ static char *handle_memory_show_summary(struct ast_cli_entry *e, int cmd, struct } static struct ast_cli_entry cli_memory[] = { - NEW_CLI(handle_memory_show, "Display outstanding memory allocations"), - NEW_CLI(handle_memory_show_summary, "Summarize outstanding memory allocations"), + AST_CLI(handle_memory_show, "Display outstanding memory allocations"), + AST_CLI(handle_memory_show_summary, "Summarize outstanding memory allocations"), }; void __ast_mm_init(void) diff --git a/main/astobj2.c b/main/astobj2.c index 7e1bdb021..8fbdf016c 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -715,8 +715,8 @@ static char *handle_astobj2_test(struct ast_cli_entry *e, int cmd, struct ast_cl } static struct ast_cli_entry cli_astobj2[] = { - NEW_CLI(handle_astobj2_stats, "Print astobj2 statistics"), - NEW_CLI(handle_astobj2_test, "Test astobj2"), + AST_CLI(handle_astobj2_stats, "Print astobj2 statistics"), + AST_CLI(handle_astobj2_test, "Test astobj2"), }; #endif /* AO2_DEBUG */ diff --git a/main/cdr.c b/main/cdr.c index 3c28b1cbd..a6cdaeaad 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -1291,8 +1291,8 @@ static char *handle_cli_submit(struct ast_cli_entry *e, int cmd, struct ast_cli_ return CLI_SUCCESS; } -static struct ast_cli_entry cli_submit = NEW_CLI(handle_cli_submit, "Posts all pending batched CDR data"); -static struct ast_cli_entry cli_status = NEW_CLI(handle_cli_status, "Display the CDR status"); +static struct ast_cli_entry cli_submit = AST_CLI(handle_cli_submit, "Posts all pending batched CDR data"); +static struct ast_cli_entry cli_status = AST_CLI(handle_cli_status, "Display the CDR status"); static int do_reload(int reload) { diff --git a/main/channel.c b/main/channel.c index 063fc8100..2edeebbf7 100644 --- a/main/channel.c +++ b/main/channel.c @@ -316,8 +316,8 @@ static char *handle_cli_core_show_channeltype(struct ast_cli_entry *e, int cmd, } static struct ast_cli_entry cli_channel[] = { - NEW_CLI(handle_cli_core_show_channeltypes, "List available channel types"), - NEW_CLI(handle_cli_core_show_channeltype, "Give more details on that channel type") + AST_CLI(handle_cli_core_show_channeltypes, "List available channel types"), + AST_CLI(handle_cli_core_show_channeltype, "Give more details on that channel type") }; /*! \brief Checks to see if a channel is needing hang up */ diff --git a/main/cli.c b/main/cli.c index 5888a8fc5..432869c1a 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1108,47 +1108,47 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl #undef FORMAT_STRING } -static struct ast_cli_entry cli_debug_channel_deprecated = NEW_CLI(handle_debugchan_deprecated, "Enable debugging on channel"); -static struct ast_cli_entry cli_module_load_deprecated = NEW_CLI(handle_load_deprecated, "Load a module"); -static struct ast_cli_entry cli_module_reload_deprecated = NEW_CLI(handle_reload_deprecated, "reload modules by name"); -static struct ast_cli_entry cli_module_unload_deprecated = NEW_CLI(handle_unload_deprecated, "unload modules by name"); +static struct ast_cli_entry cli_debug_channel_deprecated = AST_CLI(handle_debugchan_deprecated, "Enable debugging on channel"); +static struct ast_cli_entry cli_module_load_deprecated = AST_CLI(handle_load_deprecated, "Load a module"); +static struct ast_cli_entry cli_module_reload_deprecated = AST_CLI(handle_reload_deprecated, "reload modules by name"); +static struct ast_cli_entry cli_module_unload_deprecated = AST_CLI(handle_unload_deprecated, "unload modules by name"); static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); static struct ast_cli_entry cli_cli[] = { /* Deprecated, but preferred command is now consolidated (and already has a deprecated command for it). */ - NEW_CLI(handle_commandcomplete, "Command complete"), - NEW_CLI(handle_commandnummatches, "Returns number of command matches"), - NEW_CLI(handle_commandmatchesarray, "Returns command matches array"), + AST_CLI(handle_commandcomplete, "Command complete"), + AST_CLI(handle_commandnummatches, "Returns number of command matches"), + AST_CLI(handle_commandmatchesarray, "Returns command matches array"), - NEW_CLI(handle_nodebugchan_deprecated, "Disable debugging on channel(s)"), + AST_CLI(handle_nodebugchan_deprecated, "Disable debugging on channel(s)"), - NEW_CLI(handle_chanlist, "Display information on channels"), + AST_CLI(handle_chanlist, "Display information on channels"), - NEW_CLI(handle_showchan, "Display information on a specific channel"), + AST_CLI(handle_showchan, "Display information on a specific channel"), - NEW_CLI(handle_core_set_debug_channel, "Enable/disable debugging on a channel", + AST_CLI(handle_core_set_debug_channel, "Enable/disable debugging on a channel", .deprecate_cmd = &cli_debug_channel_deprecated), - NEW_CLI(handle_verbose, "Set level of debug/verbose chattiness"), + AST_CLI(handle_verbose, "Set level of debug/verbose chattiness"), - NEW_CLI(group_show_channels, "Display active channels with group(s)"), + AST_CLI(group_show_channels, "Display active channels with group(s)"), - NEW_CLI(handle_help, "Display help list, or specific help on a command"), + AST_CLI(handle_help, "Display help list, or specific help on a command"), - NEW_CLI(handle_logger_mute, "Toggle logging output to a console"), + AST_CLI(handle_logger_mute, "Toggle logging output to a console"), - NEW_CLI(handle_modlist, "List modules and info"), + AST_CLI(handle_modlist, "List modules and info"), - NEW_CLI(handle_load, "Load a module by name", .deprecate_cmd = &cli_module_load_deprecated), + AST_CLI(handle_load, "Load a module by name", .deprecate_cmd = &cli_module_load_deprecated), - NEW_CLI(handle_reload, "Reload configuration", .deprecate_cmd = &cli_module_reload_deprecated), + AST_CLI(handle_reload, "Reload configuration", .deprecate_cmd = &cli_module_reload_deprecated), - NEW_CLI(handle_unload, "Unload a module by name", .deprecate_cmd = &cli_module_unload_deprecated ), + AST_CLI(handle_unload, "Unload a module by name", .deprecate_cmd = &cli_module_unload_deprecated ), - NEW_CLI(handle_showuptime, "Show uptime information"), + AST_CLI(handle_showuptime, "Show uptime information"), - NEW_CLI(handle_softhangup, "Request a hangup on a given channel"), + AST_CLI(handle_softhangup, "Request a hangup on a given channel"), }; /*! diff --git a/main/config.c b/main/config.c index d8fb6df85..29f0f9d08 100644 --- a/main/config.c +++ b/main/config.c @@ -2178,7 +2178,7 @@ static char *handle_cli_core_show_config_mappings(struct ast_cli_entry *e, int c } static struct ast_cli_entry cli_config[] = { - NEW_CLI(handle_cli_core_show_config_mappings, "Display config mappings (file names to config engines)"), + AST_CLI(handle_cli_core_show_config_mappings, "Display config mappings (file names to config engines)"), }; int register_config_cli() diff --git a/main/db.c b/main/db.c index 58245c255..ba322d2a4 100644 --- a/main/db.c +++ b/main/db.c @@ -549,12 +549,12 @@ void ast_db_freetree(struct ast_db_entry *dbe) } struct ast_cli_entry cli_database[] = { - NEW_CLI(handle_cli_database_show, "Shows database contents"), - NEW_CLI(handle_cli_database_showkey, "Shows database contents"), - NEW_CLI(handle_cli_database_get, "Gets database value"), - NEW_CLI(handle_cli_database_put, "Adds/updates database value"), - NEW_CLI(handle_cli_database_del, "Removes database key/value"), - NEW_CLI(handle_cli_database_deltree, "Removes database keytree/values") + AST_CLI(handle_cli_database_show, "Shows database contents"), + AST_CLI(handle_cli_database_showkey, "Shows database contents"), + AST_CLI(handle_cli_database_get, "Gets database value"), + AST_CLI(handle_cli_database_put, "Adds/updates database value"), + AST_CLI(handle_cli_database_del, "Removes database key/value"), + AST_CLI(handle_cli_database_deltree, "Removes database keytree/values") }; static int manager_dbput(struct mansession *s, const struct message *m) diff --git a/main/dnsmgr.c b/main/dnsmgr.c index 2761a97b2..f6372e62b 100644 --- a/main/dnsmgr.c +++ b/main/dnsmgr.c @@ -338,9 +338,9 @@ static char *handle_cli_status(struct ast_cli_entry *e, int cmd, struct ast_cli_ return CLI_SUCCESS; } -static struct ast_cli_entry cli_reload = NEW_CLI(handle_cli_reload, "Reloads the DNS manager configuration"); -static struct ast_cli_entry cli_refresh = NEW_CLI(handle_cli_refresh, "Performs an immediate refresh"); -static struct ast_cli_entry cli_status = NEW_CLI(handle_cli_status, "Display the DNS manager status"); +static struct ast_cli_entry cli_reload = AST_CLI(handle_cli_reload, "Reloads the DNS manager configuration"); +static struct ast_cli_entry cli_refresh = AST_CLI(handle_cli_refresh, "Performs an immediate refresh"); +static struct ast_cli_entry cli_status = AST_CLI(handle_cli_status, "Display the DNS manager status"); int dnsmgr_init(void) { diff --git a/main/file.c b/main/file.c index 93763c872..ed7541bf6 100644 --- a/main/file.c +++ b/main/file.c @@ -1239,7 +1239,7 @@ static char *handle_cli_core_show_file_formats(struct ast_cli_entry *e, int cmd, } struct ast_cli_entry cli_file[] = { - NEW_CLI(handle_cli_core_show_file_formats, "Displays file formats") + AST_CLI(handle_cli_core_show_file_formats, "Displays file formats") }; int ast_file_init(void) diff --git a/main/frame.c b/main/frame.c index a20435208..24170997c 100644 --- a/main/frame.c +++ b/main/frame.c @@ -913,10 +913,10 @@ static char *show_frame_stats(struct ast_cli_entry *e, int cmd, struct ast_cli_a /* Builtin Asterisk CLI-commands for debugging */ static struct ast_cli_entry my_clis[] = { - NEW_CLI(show_codecs, "Displays a list of codecs"), - NEW_CLI(show_codec_n, "Shows a specific codec"), + AST_CLI(show_codecs, "Displays a list of codecs"), + AST_CLI(show_codec_n, "Shows a specific codec"), #ifdef TRACE_FRAMES - NEW_CLI(show_frame_stats, "Shows frame statistics"), + AST_CLI(show_frame_stats, "Shows frame statistics"), #endif }; diff --git a/main/http.c b/main/http.c index 9413fa9a4..b2310f481 100644 --- a/main/http.c +++ b/main/http.c @@ -1299,7 +1299,7 @@ int ast_http_reload(void) } static struct ast_cli_entry cli_http[] = { - NEW_CLI(handle_show_http, "Display HTTP server status"), + AST_CLI(handle_show_http, "Display HTTP server status"), }; int ast_http_init(void) diff --git a/main/image.c b/main/image.c index 0530ec5a4..df6b194cb 100644 --- a/main/image.c +++ b/main/image.c @@ -211,7 +211,7 @@ static char *handle_core_show_image_formats(struct ast_cli_entry *e, int cmd, st } struct ast_cli_entry cli_image[] = { - NEW_CLI(handle_core_show_image_formats, "Displays image formats") + AST_CLI(handle_core_show_image_formats, "Displays image formats") }; int ast_image_init(void) diff --git a/main/logger.c b/main/logger.c index fae61d454..618a855c9 100644 --- a/main/logger.c +++ b/main/logger.c @@ -708,9 +708,9 @@ struct verb { static AST_RWLIST_HEAD_STATIC(verbosers, verb); static struct ast_cli_entry cli_logger[] = { - NEW_CLI(handle_logger_show_channels, "List configured log channels"), - NEW_CLI(handle_logger_reload, "Reopens the log files"), - NEW_CLI(handle_logger_rotate, "Rotates and reopens the log files") + AST_CLI(handle_logger_show_channels, "List configured log channels"), + AST_CLI(handle_logger_reload, "Reopens the log files"), + AST_CLI(handle_logger_rotate, "Rotates and reopens the log files") }; static int handle_SIGXFSZ(int sig) diff --git a/main/manager.c b/main/manager.c index 800dbe43c..4077d0606 100644 --- a/main/manager.c +++ b/main/manager.c @@ -717,13 +717,13 @@ static char *handle_showmaneventq(struct ast_cli_entry *e, int cmd, struct ast_c } static struct ast_cli_entry cli_manager[] = { - NEW_CLI(handle_showmancmd, "Show a manager interface command"), - NEW_CLI(handle_showmancmds, "List manager interface commands"), - NEW_CLI(handle_showmanconn, "List connected manager interface users"), - NEW_CLI(handle_showmaneventq, "List manager interface queued events"), - NEW_CLI(handle_showmanagers, "List configured manager users"), - NEW_CLI(handle_showmanager, "Display information on a specific manager user"), - NEW_CLI(handle_mandebug, "Show, enable, disable debugging of the manager code"), + AST_CLI(handle_showmancmd, "Show a manager interface command"), + AST_CLI(handle_showmancmds, "List manager interface commands"), + AST_CLI(handle_showmanconn, "List connected manager interface users"), + AST_CLI(handle_showmaneventq, "List manager interface queued events"), + AST_CLI(handle_showmanagers, "List configured manager users"), + AST_CLI(handle_showmanager, "Display information on a specific manager user"), + AST_CLI(handle_mandebug, "Show, enable, disable debugging of the manager code"), }; /* diff --git a/main/pbx.c b/main/pbx.c index 2782b57c6..1de2f09b0 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -3967,15 +3967,15 @@ static char *handle_set_global(struct ast_cli_entry *e, int cmd, struct ast_cli_ * CLI entries for upper commands ... */ static struct ast_cli_entry pbx_cli[] = { - NEW_CLI(handle_show_applications, "Shows registered dialplan applications"), - NEW_CLI(handle_show_functions, "Shows registered dialplan functions"), - NEW_CLI(handle_show_switches, "Show alternative switches"), - NEW_CLI(handle_show_hints, "Show dialplan hints"), - NEW_CLI(handle_show_globals, "Show global dialplan variables"), - NEW_CLI(handle_show_function, "Describe a specific dialplan function"), - NEW_CLI(handle_show_application, "Describe a specific dialplan application"), - NEW_CLI(handle_set_global, "Set global dialplan variable"), - NEW_CLI(handle_show_dialplan, "Show dialplan"), + AST_CLI(handle_show_applications, "Shows registered dialplan applications"), + AST_CLI(handle_show_functions, "Shows registered dialplan functions"), + AST_CLI(handle_show_switches, "Show alternative switches"), + AST_CLI(handle_show_hints, "Show dialplan hints"), + AST_CLI(handle_show_globals, "Show global dialplan variables"), + AST_CLI(handle_show_function, "Describe a specific dialplan function"), + AST_CLI(handle_show_application, "Describe a specific dialplan application"), + AST_CLI(handle_set_global, "Set global dialplan variable"), + AST_CLI(handle_show_dialplan, "Show dialplan"), }; static void unreference_cached_app(struct ast_app *app) diff --git a/main/rtp.c b/main/rtp.c index 1ae68ef93..ccb846d3d 100644 --- a/main/rtp.c +++ b/main/rtp.c @@ -3979,10 +3979,10 @@ static char *handle_cli_stun_debug(struct ast_cli_entry *e, int cmd, struct ast_ } static struct ast_cli_entry cli_rtp[] = { - NEW_CLI(handle_cli_rtp_debug, "Enable/Disable RTP debugging"), - NEW_CLI(handle_cli_rtcp_debug, "Enable/Disable RTCP debugging"), - NEW_CLI(handle_cli_rtcp_stats, "Enable/Disable RTCP stats"), - NEW_CLI(handle_cli_stun_debug, "Enable/Disable STUN debugging"), + AST_CLI(handle_cli_rtp_debug, "Enable/Disable RTP debugging"), + AST_CLI(handle_cli_rtcp_debug, "Enable/Disable RTCP debugging"), + AST_CLI(handle_cli_rtcp_stats, "Enable/Disable RTCP stats"), + AST_CLI(handle_cli_stun_debug, "Enable/Disable STUN debugging"), }; static int __ast_rtp_reload(int reload) diff --git a/main/threadstorage.c b/main/threadstorage.c index 6f483e519..e5bfc484a 100644 --- a/main/threadstorage.c +++ b/main/threadstorage.c @@ -222,8 +222,8 @@ static char *handle_cli_threadstorage_show_summary(struct ast_cli_entry *e, int } static struct ast_cli_entry cli[] = { - NEW_CLI(handle_cli_threadstorage_show_allocations, "Display outstanding thread local storage allocations"), - NEW_CLI(handle_cli_threadstorage_show_summary, "Summarize outstanding memory allocations") + AST_CLI(handle_cli_threadstorage_show_allocations, "Display outstanding thread local storage allocations"), + AST_CLI(handle_cli_threadstorage_show_summary, "Summarize outstanding memory allocations") }; void threadstorage_init(void) diff --git a/main/translate.c b/main/translate.c index 88811ddc8..0da2c4be9 100644 --- a/main/translate.c +++ b/main/translate.c @@ -575,7 +575,7 @@ static char *handle_cli_core_show_translation(struct ast_cli_entry *e, int cmd, } static struct ast_cli_entry cli_translate[] = { - NEW_CLI(handle_cli_core_show_translation, "Display translation matrix") + AST_CLI(handle_cli_core_show_translation, "Display translation matrix") }; /*! \brief register codec translator */ diff --git a/main/udptl.c b/main/udptl.c index a140cc4fe..d906d0549 100644 --- a/main/udptl.c +++ b/main/udptl.c @@ -1197,9 +1197,9 @@ static char *handle_cli_udptl_debug_off(struct ast_cli_entry *e, int cmd, struct } static struct ast_cli_entry cli_udptl[] = { - NEW_CLI(handle_cli_udptl_debug, "Enable UDPTL debugging"), - NEW_CLI(handle_cli_udptl_debug_ip, "Enable UDPTL debugging on IP"), - NEW_CLI(handle_cli_udptl_debug_off, "Disable UDPTL debugging") + AST_CLI(handle_cli_udptl_debug, "Enable UDPTL debugging"), + AST_CLI(handle_cli_udptl_debug_ip, "Enable UDPTL debugging on IP"), + AST_CLI(handle_cli_udptl_debug_off, "Disable UDPTL debugging") }; static void __ast_udptl_reload(int reload) diff --git a/main/utils.c b/main/utils.c index 653c31312..ed3c47b2d 100644 --- a/main/utils.c +++ b/main/utils.c @@ -786,7 +786,7 @@ static char *handle_show_locks(struct ast_cli_entry *e, int cmd, struct ast_cli_ } static struct ast_cli_entry utils_cli[] = { - NEW_CLI(handle_show_locks, "Show which locks are held by which thread"), + AST_CLI(handle_show_locks, "Show which locks are held by which thread"), }; #endif /* DEBUG_THREADS */ -- cgit v1.2.3