diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2005-08-23 15:43:47 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2005-08-23 15:43:47 +0000 |
commit | 8a52a7cf100aaea516952701f9efaf957f4c81ae (patch) | |
tree | 0adf5926b53755f4f970c5996ac8905cba5176c2 | |
parent | 4c6693f39ddf817b7886acf65c9b312b5a482214 (diff) |
add counter to 'show formats' (issue #5001)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-x | file.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |