[asterisk-commits] russell: branch group/asterisk-cpp r168417 - in /team/group/asterisk-cpp: inc...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 10 19:57:17 CST 2009


Author: russell
Date: Sat Jan 10 19:57:16 2009
New Revision: 168417

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168417
Log:
Make AST_CLI_DEFINE() use the ast_cli_entry() constructor to avoid having to change code

Modified:
    team/group/asterisk-cpp/include/asterisk/cli.h
    team/group/asterisk-cpp/main/asterisk.c
    team/group/asterisk-cpp/main/astmm.c
    team/group/asterisk-cpp/main/astobj2.c
    team/group/asterisk-cpp/main/channel.c
    team/group/asterisk-cpp/main/udptl.c

Modified: team/group/asterisk-cpp/include/asterisk/cli.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/cli.h?view=diff&rev=168417&r1=168416&r2=168417
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/cli.h (original)
+++ team/group/asterisk-cpp/include/asterisk/cli.h Sat Jan 10 19:57:16 2009
@@ -168,9 +168,7 @@
 	AST_LIST_ENTRY(ast_cli_entry) list;
 };
 
-/* XXX the parser in gcc 2.95 gets confused if you don't put a space
- * between the last arg before VA_ARGS and the comma */
-#define AST_CLI_DEFINE(fn, txt , ... )	{ .handler = fn, .summary = txt, ## __VA_ARGS__ }
+#define AST_CLI_DEFINE(a, b) ast_cli_entry(a, b)
 
 /*!
  * Helper function to generate cli entries from a NULL-terminated array.

Modified: team/group/asterisk-cpp/main/asterisk.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/asterisk.c?view=diff&rev=168417&r1=168416&r2=168417
==============================================================================
--- team/group/asterisk-cpp/main/asterisk.c (original)
+++ team/group/asterisk-cpp/main/asterisk.c Sat Jan 10 19:57:16 2009
@@ -2004,26 +2004,26 @@
 #define ASTERISK_PROMPT2 "%s*CLI> "
 
 static struct ast_cli_entry cli_asterisk[] = {
-	ast_cli_entry(handle_abort_shutdown, "Cancel a running shutdown"),
-	ast_cli_entry(handle_stop_now, "Shut down Asterisk immediately"),
-	ast_cli_entry(handle_stop_gracefully, "Gracefully shut down Asterisk"),
-	ast_cli_entry(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
-	ast_cli_entry(handle_restart_now, "Restart Asterisk immediately"), 
-	ast_cli_entry(handle_restart_gracefully, "Restart Asterisk gracefully"),
-	ast_cli_entry(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
-	ast_cli_entry(show_warranty, "Show the warranty (if any) for this copy of Asterisk"),
-	ast_cli_entry(show_license, "Show the license(s) for this copy of Asterisk"),
-	ast_cli_entry(handle_version, "Display version info"),
-	ast_cli_entry(handle_bang, "Execute a shell command"),
+	AST_CLI_DEFINE(handle_abort_shutdown, "Cancel a running shutdown"),
+	AST_CLI_DEFINE(handle_stop_now, "Shut down Asterisk immediately"),
+	AST_CLI_DEFINE(handle_stop_gracefully, "Gracefully shut down Asterisk"),
+	AST_CLI_DEFINE(handle_stop_when_convenient, "Shut down Asterisk at empty call volume"),
+	AST_CLI_DEFINE(handle_restart_now, "Restart Asterisk immediately"), 
+	AST_CLI_DEFINE(handle_restart_gracefully, "Restart Asterisk gracefully"),
+	AST_CLI_DEFINE(handle_restart_when_convenient, "Restart Asterisk at empty call volume"),
+	AST_CLI_DEFINE(show_warranty, "Show the warranty (if any) for this copy of Asterisk"),
+	AST_CLI_DEFINE(show_license, "Show the license(s) for this copy of Asterisk"),
+	AST_CLI_DEFINE(handle_version, "Display version info"),
+	AST_CLI_DEFINE(handle_bang, "Execute a shell command"),
 #if !defined(LOW_MEMORY)
-	ast_cli_entry(handle_show_version_files, "List versions of files used to build Asterisk"),
-	ast_cli_entry(handle_show_threads, "Show running threads"),
+	AST_CLI_DEFINE(handle_show_version_files, "List versions of files used to build Asterisk"),
+	AST_CLI_DEFINE(handle_show_threads, "Show running threads"),
 #if defined(HAVE_SYSINFO) || defined(HAVE_SYSCTL)
-	ast_cli_entry(handle_show_sysinfo, "Show System Information"),
+	AST_CLI_DEFINE(handle_show_sysinfo, "Show System Information"),
 #endif
-	ast_cli_entry(handle_show_profile, "Display profiling info"),
-	ast_cli_entry(handle_show_settings, "Show some core settings"),
-	ast_cli_entry(handle_clear_profile, "Clear profiling info"),
+	AST_CLI_DEFINE(handle_show_profile, "Display profiling info"),
+	AST_CLI_DEFINE(handle_show_settings, "Show some core settings"),
+	AST_CLI_DEFINE(handle_clear_profile, "Clear profiling info"),
 #endif /* ! LOW_MEMORY */
 };
 

Modified: team/group/asterisk-cpp/main/astmm.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/astmm.c?view=diff&rev=168417&r1=168416&r2=168417
==============================================================================
--- team/group/asterisk-cpp/main/astmm.c (original)
+++ team/group/asterisk-cpp/main/astmm.c Sat Jan 10 19:57:16 2009
@@ -474,8 +474,8 @@
 }
 
 static struct ast_cli_entry cli_memory[] = {
-	ast_cli_entry(handle_memory_show, "Display outstanding memory allocations"),
-	ast_cli_entry(handle_memory_show_summary, "Summarize outstanding memory allocations"),
+	AST_CLI_DEFINE(handle_memory_show, "Display outstanding memory allocations"),
+	AST_CLI_DEFINE(handle_memory_show_summary, "Summarize outstanding memory allocations"),
 };
 
 void __ast_mm_init(void)

Modified: team/group/asterisk-cpp/main/astobj2.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/astobj2.c?view=diff&rev=168417&r1=168416&r2=168417
==============================================================================
--- team/group/asterisk-cpp/main/astobj2.c (original)
+++ team/group/asterisk-cpp/main/astobj2.c Sat Jan 10 19:57:16 2009
@@ -1039,8 +1039,8 @@
 }
 
 static struct ast_cli_entry cli_astobj2[] = {
-	ast_cli_entry(handle_astobj2_stats, "Print astobj2 statistics"),
-	ast_cli_entry(handle_astobj2_test, "Test astobj2"),
+	AST_CLI_DEFINE(handle_astobj2_stats, "Print astobj2 statistics"),
+	AST_CLI_DEFINE(handle_astobj2_test, "Test astobj2"),
 };
 #endif /* AO2_DEBUG */
 

Modified: team/group/asterisk-cpp/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/channel.c?view=diff&rev=168417&r1=168416&r2=168417
==============================================================================
--- team/group/asterisk-cpp/main/channel.c (original)
+++ team/group/asterisk-cpp/main/channel.c Sat Jan 10 19:57:16 2009
@@ -326,8 +326,8 @@
 }
 
 static struct ast_cli_entry cli_channel[] = {
-    ast_cli_entry(handle_cli_core_show_channeltypes, "List available channel types"),
-	ast_cli_entry(handle_cli_core_show_channeltype,  "Give more details on that channel type")
+    AST_CLI_DEFINE(handle_cli_core_show_channeltypes, "List available channel types"),
+	AST_CLI_DEFINE(handle_cli_core_show_channeltype,  "Give more details on that channel type")
 };
 
 #ifdef CHANNEL_TRACE

Modified: team/group/asterisk-cpp/main/udptl.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/udptl.c?view=diff&rev=168417&r1=168416&r2=168417
==============================================================================
--- team/group/asterisk-cpp/main/udptl.c (original)
+++ team/group/asterisk-cpp/main/udptl.c Sat Jan 10 19:57:16 2009
@@ -1153,7 +1153,7 @@
 
 
 static struct ast_cli_entry cli_udptl[] = {
-	ast_cli_entry(handle_cli_udptl_set_debug, "Enable/Disable UDPTL debugging")
+	AST_CLI_DEFINE(handle_cli_udptl_set_debug, "Enable/Disable UDPTL debugging")
 };
 
 static void __ast_udptl_reload(int reload)




More information about the asterisk-commits mailing list