[Asterisk-cvs] asterisk file.c,1.72,1.73

kpfleming kpfleming
Tue Aug 23 11:41:46 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv16041

Modified Files:
	file.c 
Log Message:
add counter to 'show formats' (issue #5001)


Index: file.c
===================================================================
RCS file: /usr/cvsroot/asterisk/file.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- file.c	15 Jul 2005 16:13:26 -0000	1.72
+++ file.c	23 Aug 2005 15:43:47 -0000	1.73
@@ -1207,6 +1207,8 @@
 #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 @@
 	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




More information about the svn-commits mailing list