summaryrefslogtreecommitdiff
path: root/main/cli.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2012-03-22 19:51:16 +0000
committerKinsey Moore <kmoore@digium.com>2012-03-22 19:51:16 +0000
commitc5b3db1956a3db2446b0310b3a7d59961fe3e089 (patch)
tree530b55034f5adfb0c7106ae1194679a031afc888 /main/cli.c
parent1d1c28ac4b09df2b663123e55239e411b8f5ad26 (diff)
Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these whitespace-only changes didn't break anything (and shouldn't have). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/cli.c')
-rw-r--r--main/cli.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/main/cli.c b/main/cli.c
index 248094927..89bef8023 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -20,7 +20,7 @@
*
* \brief Standard Command Line Interface
*
- * \author Mark Spencer <markster@digium.com>
+ * \author Mark Spencer <markster@digium.com>
*/
#include "asterisk.h"
@@ -116,7 +116,7 @@ void ast_cli(int fd, const char *fmt, ...)
}
}
-unsigned int ast_debug_get_by_module(const char *module)
+unsigned int ast_debug_get_by_module(const char *module)
{
struct module_level *ml;
unsigned int res = 0;
@@ -133,7 +133,7 @@ unsigned int ast_debug_get_by_module(const char *module)
return res;
}
-unsigned int ast_verbose_get_by_module(const char *module)
+unsigned int ast_verbose_get_by_module(const char *module)
{
struct module_level *ml;
unsigned int res = 0;
@@ -231,14 +231,14 @@ static char *complete_fn(const char *word, int state)
snprintf(filename, sizeof(filename), "%s/%s", ast_config_AST_MODULE_DIR, word);
c = d = filename_completion_function(filename, state);
-
+
if (c && word[0] != '/')
c += (strlen(ast_config_AST_MODULE_DIR) + 1);
if (c)
c = ast_strdup(c);
free(d);
-
+
return c;
}
@@ -325,8 +325,8 @@ static char *handle_core_reload(struct ast_cli_entry *e, int cmd, struct ast_cli
return CLI_SUCCESS;
}
-/*!
- * \brief Find the debug or verbose file setting
+/*!
+ * \brief Find the debug or verbose file setting
* \arg debug 1 for debug, 0 for verbose
*/
static struct module_level *find_module_level(const char *module, unsigned int debug)
@@ -569,7 +569,7 @@ static char *handle_logger_mute(struct ast_cli_entry *e, int cmd, struct ast_cli
switch (cmd) {
case CLI_INIT:
e->command = "logger mute";
- e->usage =
+ e->usage =
"Usage: logger mute\n"
" Disables logging output to the current console, making it possible to\n"
" gather information without being disturbed by scrolling lines.\n";
@@ -650,7 +650,7 @@ static int modlist_modentry(const char *module, const char *description, int use
if (strcasestr(module, like) ) {
ast_cli(climodentryfd, MODLIST_FORMAT, module, description, usecnt);
return 1;
- }
+ }
return 0;
}
@@ -772,7 +772,7 @@ static char *handle_modlist(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
like = a->argv[e->args];
else
return CLI_SHOWUSAGE;
-
+
ast_mutex_lock(&climodentrylock);
climodentryfd = a->fd; /* global, protected by climodentrylock */
ast_cli(a->fd, MODLIST_FORMAT2, "Module", "Description", "Use Count");
@@ -829,7 +829,7 @@ static char *handle_showcalls(struct ast_cli_entry *e, int cmd, struct ast_cli_a
} else {
ast_cli(a->fd, "%d active call%s\n", ast_active_calls(), ESS(ast_active_calls()));
}
-
+
ast_cli(a->fd, "%d call%s processed\n", ast_processed_calls(), ESS(ast_processed_calls()));
if (ast_startuptime.tv_sec && showuptime) {
@@ -885,7 +885,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
if (!concise && !verbose)
ast_cli(a->fd, FORMAT_STRING2, "Channel", "Location", "State", "Application(Data)");
else if (verbose)
- ast_cli(a->fd, VERBOSE_FORMAT_STRING2, "Channel", "Context", "Extension", "Priority", "State", "Application", "Data",
+ ast_cli(a->fd, VERBOSE_FORMAT_STRING2, "Channel", "Context", "Extension", "Priority", "State", "Application", "Data",
"CallerID", "Duration", "Accountcode", "PeerAccount", "BridgedTo");
}
@@ -911,7 +911,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
snprintf(durbuf, sizeof(durbuf), "%02d:%02d:%02d", durh, durm, durs);
} else {
snprintf(durbuf, sizeof(durbuf), "%d", duration);
- }
+ }
}
if (concise) {
ast_cli(a->fd, CONCISE_FORMAT_STRING, ast_channel_name(c), ast_channel_context(c), ast_channel_exten(c), ast_channel_priority(c), ast_state2str(ast_channel_state(c)),
@@ -920,7 +920,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
S_COR(ast_channel_caller(c)->id.number.valid, ast_channel_caller(c)->id.number.str, ""),
S_OR(ast_channel_accountcode(c), ""),
S_OR(ast_channel_peeraccount(c), ""),
- ast_channel_amaflags(c),
+ ast_channel_amaflags(c),
durbuf,
bc ? ast_channel_name(bc) : "(None)",
ast_channel_uniqueid(c));
@@ -936,8 +936,8 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
} else {
char locbuf[40] = "(None)";
char appdata[40] = "(None)";
-
- if (!ast_strlen_zero(ast_channel_context(c)) && !ast_strlen_zero(ast_channel_exten(c)))
+
+ if (!ast_strlen_zero(ast_channel_context(c)) && !ast_strlen_zero(ast_channel_exten(c)))
snprintf(locbuf, sizeof(locbuf), "%s@%s:%d", ast_channel_exten(c), ast_channel_context(c), ast_channel_priority(c));
if (ast_channel_appl(c))
snprintf(appdata, sizeof(appdata), "%s(%s)", ast_channel_appl(c), S_OR(ast_channel_data(c), ""));
@@ -965,7 +965,7 @@ static char *handle_chanlist(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
}
return CLI_SUCCESS;
-
+
#undef FORMAT_STRING
#undef FORMAT_STRING2
#undef CONCISE_FORMAT_STRING
@@ -1169,11 +1169,11 @@ static char *handle_commandmatchesarray(struct ast_cli_entry *e, int cmd, struct
int len = 0;
char **matches;
int x, matchlen;
-
+
switch (cmd) {
case CLI_INIT:
e->command = "_command matchesarray";
- e->usage =
+ e->usage =
"Usage: _command matchesarray \"<line>\" text \n"
" This function is used internally to help with command completion and should.\n"
" never be called by the user directly.\n";
@@ -1194,7 +1194,7 @@ static char *handle_commandmatchesarray(struct ast_cli_entry *e, int cmd, struct
if (len + matchlen >= buflen) {
buflen += matchlen * 3;
obuf = buf;
- if (!(buf = ast_realloc(obuf, buflen)))
+ if (!(buf = ast_realloc(obuf, buflen)))
/* Memory allocation failure... Just free old buffer and be done */
ast_free(obuf);
}
@@ -1224,7 +1224,7 @@ static char *handle_commandnummatches(struct ast_cli_entry *e, int cmd, struct a
switch (cmd) {
case CLI_INIT:
e->command = "_command nummatches";
- e->usage =
+ e->usage =
"Usage: _command nummatches \"<line>\" text \n"
" This function is used internally to help with command completion and should.\n"
" never be called by the user directly.\n";
@@ -1249,7 +1249,7 @@ static char *handle_commandcomplete(struct ast_cli_entry *e, int cmd, struct ast
switch (cmd) {
case CLI_INIT:
e->command = "_command complete";
- e->usage =
+ e->usage =
"Usage: _command complete \"<line>\" text state\n"
" This function is used internally to help with command completion and should.\n"
" never be called by the user directly.\n";
@@ -1380,7 +1380,7 @@ static char *handle_nodebugchan_deprecated(struct ast_cli_entry *e, int cmd, str
return res;
}
-
+
static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
struct ast_channel *c=NULL;
@@ -1400,14 +1400,14 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
switch (cmd) {
case CLI_INIT:
e->command = "core show channel";
- e->usage =
+ e->usage =
"Usage: core show channel <channel>\n"
" Shows lots of information about the specified channel.\n";
return NULL;
case CLI_GENERATE:
return ast_complete_channels(a->line, a->word, a->pos, a->n, 3);
}
-
+
if (a->argc != 4) {
return CLI_SHOWUSAGE;
}
@@ -1481,8 +1481,8 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
S_COR(ast_channel_connected(c)->id.number.valid, ast_channel_connected(c)->id.number.str, "(N/A)"),
S_COR(ast_channel_connected(c)->id.name.valid, ast_channel_connected(c)->id.name.str, "(N/A)"),
S_OR(ast_channel_dialed(c)->number.str, "(N/A)"),
- ast_channel_language(c),
- ast_state2str(ast_channel_state(c)), ast_channel_state(c), ast_channel_rings(c),
+ ast_channel_language(c),
+ ast_state2str(ast_channel_state(c)), ast_channel_state(c), ast_channel_rings(c),
ast_getformatname_multiple(nf, sizeof(nf), ast_channel_nativeformats(c)),
ast_getformatname(ast_channel_writeformat(c)),
ast_getformatname(ast_channel_readformat(c)),
@@ -1494,11 +1494,11 @@ static char *handle_showchan(struct ast_cli_entry *e, int cmd, struct ast_cli_ar
ast_channel_fin(c) & ~DEBUGCHAN_FLAG, (ast_channel_fin(c) & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "",
ast_channel_fout(c) & ~DEBUGCHAN_FLAG, (ast_channel_fout(c) & DEBUGCHAN_FLAG) ? " (DEBUGGED)" : "",
(long)ast_channel_whentohangup(c)->tv_sec,
- cdrtime, ast_channel_internal_bridged_channel(c) ? ast_channel_name(ast_channel_internal_bridged_channel(c)) : "<none>", ast_bridged_channel(c) ? ast_channel_name(ast_bridged_channel(c)) : "<none>",
+ cdrtime, ast_channel_internal_bridged_channel(c) ? ast_channel_name(ast_channel_internal_bridged_channel(c)) : "<none>", ast_bridged_channel(c) ? ast_channel_name(ast_bridged_channel(c)) : "<none>",
ast_channel_context(c), ast_channel_exten(c), ast_channel_priority(c), ast_channel_callgroup(c), ast_channel_pickupgroup(c), (ast_channel_appl(c) ? ast_channel_appl(c) : "(N/A)" ),
(ast_channel_data(c) ? S_OR(ast_channel_data(c), "(Empty)") : "(None)"),
(ast_test_flag(ast_channel_flags(c), AST_FLAG_BLOCKING) ? ast_channel_blockproc(c) : "(Not Blocking)"));
-
+
if (pbx_builtin_serialize_variables(c, &obuf)) {
ast_str_append(&output, 0, " Variables:\n%s\n", ast_str_buffer(obuf));
}
@@ -1588,7 +1588,7 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
switch (cmd) {
case CLI_INIT:
e->command = "group show channels";
- e->usage =
+ e->usage =
"Usage: group show channels [pattern]\n"
" Lists all currently active channels with channel group(s) specified.\n"
" Optional regular expression pattern is matched to group names for each\n"
@@ -1600,7 +1600,7 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
if (a->argc < 3 || a->argc > 4)
return CLI_SHOWUSAGE;
-
+
if (a->argc == 4) {
if (regcomp(&regexbuf, a->argv[3], REG_EXTENDED | REG_NOSUB))
return CLI_SHOWUSAGE;
@@ -1610,7 +1610,7 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
ast_cli(a->fd, FORMAT_STRING, "Channel", "Group", "Category");
ast_app_group_list_rdlock();
-
+
gi = ast_app_group_list_head();
while (gi) {
if (!havepattern || !regexec(&regexbuf, gi->group, 0, NULL, 0)) {
@@ -1619,9 +1619,9 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
}
gi = AST_LIST_NEXT(gi, group_list);
}
-
+
ast_app_group_list_unlock();
-
+
if (havepattern)
regfree(&regexbuf);
@@ -1806,7 +1806,7 @@ int ast_cli_perms_init(int reload)
AST_RWLIST_WRLOCK(&cli_perms);
AST_LIST_TRAVERSE(&cli_perms, cp_entry, list) {
if ((pw && cp_entry->uid == pw->pw_uid) || (gr && cp_entry->gid == gr->gr_gid)) {
- /* if it is duplicated, just added this new settings, to
+ /* if it is duplicated, just added this new settings, to
the current list. */
user_group = cp_entry;
break;
@@ -2080,9 +2080,9 @@ static int __ast_cli_register(struct ast_cli_entry *e, struct ast_cli_entry *ed)
s = ast_skip_blanks(s);
}
*dst++ = NULL;
-
+
AST_RWLIST_WRLOCK(&helpers);
-
+
if (find_cli(e->cmda, 1)) {
ast_log(LOG_WARNING, "Command '%s' already registered (or something close enough)\n", S_OR(e->_full_cmd, e->command));
goto done;
@@ -2096,14 +2096,14 @@ static int __ast_cli_register(struct ast_cli_entry *e, struct ast_cli_entry *ed)
if (lf < len)
len = lf;
if (strncasecmp(e->_full_cmd, cur->_full_cmd, len) < 0) {
- AST_RWLIST_INSERT_BEFORE_CURRENT(e, list);
+ AST_RWLIST_INSERT_BEFORE_CURRENT(e, list);
break;
}
}
AST_RWLIST_TRAVERSE_SAFE_END;
if (!cur)
- AST_RWLIST_INSERT_TAIL(&helpers, e, list);
+ AST_RWLIST_INSERT_TAIL(&helpers, e, list);
ret = 0; /* success */
done:
@@ -2342,7 +2342,7 @@ char **ast_cli_completion_matches(const char *text, const char *word)
if (!(retstr = ast_malloc(max_equal + 1)))
return NULL;
-
+
ast_copy_string(retstr, match_list[1], max_equal + 1);
match_list[0] = retstr;
@@ -2366,7 +2366,7 @@ static int more_words (const char * const *dst)
}
return 0;
}
-
+
/*
* generate the entry at position 'state'
*/