summaryrefslogtreecommitdiff
path: root/cli.c
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2005-05-15 03:03:48 +0000
committerKevin P. Fleming <kpfleming@digium.com>2005-05-15 03:03:48 +0000
commit0356b70224db6f40cab8d069bbab6f22714ffa46 (patch)
tree8b39f6d3ade5b8cc43941163e2fb95ddfb83cbf9 /cli.c
parentb5272684eef7a84ed0d6e893877668c0716d866b (diff)
add functions to register/unregister multiple CLI commands in a single operation (bug #4255, with minor mods)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cli.c')
-rwxr-xr-xcli.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/cli.c b/cli.c
index f5865cc1e..141ac09ae 100755
--- a/cli.c
+++ b/cli.c
@@ -992,6 +992,25 @@ int ast_cli_register(struct ast_cli_entry *e)
return 0;
}
+/*
+ * register/unregister an array of entries.
+ */
+void ast_cli_register_multiple(struct ast_cli_entry *e, int len)
+{
+ int i;
+
+ for (i=0; i < len; i++)
+ ast_cli_register(e + i);
+}
+
+void ast_cli_unregister_multiple(struct ast_cli_entry *e, int len)
+{
+ int i;
+
+ for (i=0; i < len; i++)
+ ast_cli_unregister(e + i);
+}
+
static int help_workhorse(int fd, char *match[])
{
char fullcmd1[80] = "";