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
This commit is contained in:
Kevin P. Fleming
2005-05-15 03:03:48 +00:00
parent b5272684ee
commit 0356b70224
4 changed files with 81 additions and 120 deletions

19
cli.c
View File

@@ -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] = "";