[Asterisk-cvs] asterisk utils.c,1.23,1.24

markster at lists.digium.com markster at lists.digium.com
Sun Jan 2 18:46:40 CST 2005


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

Modified Files:
	utils.c 
Log Message:
Merge OEJ's print groups feature (bug #3228, with changes)


Index: utils.c
===================================================================
RCS file: /usr/cvsroot/asterisk/utils.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- utils.c	14 Dec 2004 23:36:29 -0000	1.23
+++ utils.c	3 Jan 2005 00:51:56 -0000	1.24
@@ -430,3 +430,29 @@
 }
 #endif
 
+
+/*--- ast_print_group: Print call group and pickup group ---*/
+char *ast_print_group(char *buf, int buflen, unsigned int group) 
+{
+	unsigned int i;
+	int first=1;
+	char num[3];
+
+	buf[0] = '\0';
+	
+	if (!group)	/* Return empty string if no group */
+		return(buf);
+
+	for (i=0; i<=31; i++) {	/* Max group is 31 */
+		if (group & (1 << i)) {
+	   		if (!first) {
+				strncat(buf, ", ", buflen);
+			} else {
+				first=0;
+	  		}
+			snprintf(num, sizeof(num), "%u", i);
+			strncat(buf, num, buflen);
+		}
+    	}
+	return(buf);
+}




More information about the svn-commits mailing list