aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-23 15:43:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-23 15:43:47 +0000
commitbc0f2a866d85011012f8bdcfdb9dedc3d201e78c (patch)
tree0adf5926b53755f4f970c5996ac8905cba5176c2 /file.c
parent0cfbe27d2faccf806f4f206f2d15ed84b8669b89 (diff)
add counter to 'show formats' (issue #5001)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6384 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'file.c')
-rwxr-xr-xfile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/file.c b/file.c
index 07c88d158..6fcd31173 100755
--- a/file.c
+++ b/file.c
@@ -1207,6 +1207,8 @@ static int show_file_formats(int fd, int argc, char *argv[])
#define FORMAT "%-10s %-10s %-20s\n"
#define FORMAT2 "%-10s %-10s %-20s\n"
struct ast_format *f;
+ int count_fmt = 0;
+
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT, "Format", "Name", "Extensions");
@@ -1220,8 +1222,10 @@ static int show_file_formats(int fd, int argc, char *argv[])
while(f) {
ast_cli(fd, FORMAT2, ast_getformatname(f->format), f->name, f->exts);
f = f->next;
+ count_fmt++;
};
ast_mutex_unlock(&formatlock);
+ ast_cli(fd, "%d file formats registered.\n", count_fmt);
return RESULT_SUCCESS;
#undef FORMAT
#undef FORMAT2