[asterisk-commits] snuffy: branch snuffy/ao2_jabber r151900 - /team/snuffy/ao2_jabber/res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Oct 25 00:03:34 CDT 2008


Author: snuffy
Date: Sat Oct 25 00:03:34 2008
New Revision: 151900

URL: http://svn.digium.com/view/asterisk?view=rev&rev=151900
Log:
update for little more readability

Modified:
    team/snuffy/ao2_jabber/res/res_jabber.c

Modified: team/snuffy/ao2_jabber/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/team/snuffy/ao2_jabber/res/res_jabber.c?view=diff&rev=151900&r1=151899&r2=151900
==============================================================================
--- team/snuffy/ao2_jabber/res/res_jabber.c (original)
+++ team/snuffy/ao2_jabber/res/res_jabber.c Sat Oct 25 00:03:34 2008
@@ -292,11 +292,11 @@
 	struct aji_client *c = obj;
 	struct aji_message *tmp;
 	struct aji_buddy *b;
-	struct ao2_iterator iter;
+	struct ao2_iterator biter;
 	
-	iter = ao2_iterator_init(c->buddies, 0);
-
-	while( (b = ao2_t_iterator_next(&iter, "iterate thru buddies")) ) {
+	biter = ao2_iterator_init(c->buddies, 0);
+
+	while( (b = ao2_t_iterator_next(&biter, "iterate thru buddies")) ) {
 		ao2_t_unlink(c->buddies, b, "Remove buddy from list");
 		buddy_unref(b, "unref buddy");
 	}
@@ -2245,7 +2245,7 @@
 static void aji_pruneregister(struct aji_client *client)
 {
 	int res = 0;
-	struct ao2_iterator iter;
+	struct ao2_iterator biter;
 	struct aji_buddy *b = NULL;
 
 	iks *removeiq = iks_new("iq");
@@ -2259,9 +2259,9 @@
 
 	iks_insert_node(removeiq, removequery);
 	iks_insert_node(removequery, removeitem);
-	iter = ao2_iterator_init(client->buddies, 0);
-
-	while ((b = ao2_t_iterator_next(&iter, "Iter through buddies"))) {
+	biter = ao2_iterator_init(client->buddies, 0);
+
+	while ((b = ao2_t_iterator_next(&biter, "Iter through buddies"))) {
 		ao2_lock(b);
 		/* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
 		 * be called at the same time */
@@ -2305,14 +2305,14 @@
 {
 	struct aji_client *client = (struct aji_client *) data;
 	struct aji_buddy *buddy = NULL, *b = NULL;
-	struct ao2_iterator iter;
+	struct ao2_iterator biter;
 	int flag = 0;
 	iks *x = NULL;
 
 	client_ref(client, "filter_ros");
 	client->state = AJI_CONNECTED;
-	iter= ao2_iterator_init(client->buddies, 0);
-	while ((b = ao2_t_iterator_next(&iter, "iterate through buddies"))) {
+	biter= ao2_iterator_init(client->buddies, 0);
+	while ((b = ao2_t_iterator_next(&biter, "iterate through buddies"))) {
 		ao2_lock(b);
 		x = iks_child(pak->query);
 		flag = 0;
@@ -2337,8 +2337,8 @@
 	while (x) {
 		flag = 0;
 		if (iks_strcmp(iks_name(x), "item") == 0) {
-			iter = ao2_iterator_init(client->buddies, 0);
-			while ((b = ao2_t_iterator_next(&iter,"iter through buddies"))) {
+			biter = ao2_iterator_init(client->buddies, 0);
+			while ((b = ao2_t_iterator_next(&biter,"iter through buddies"))) {
 				if (!strcasecmp(b->name, iks_find_attrib(x, "jid")))
 					flag = 1;
 				buddy_unref(b, "filter_ros");
@@ -2547,7 +2547,7 @@
  */
 static char *aji_do_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-	struct ao2_iterator iter;
+	struct ao2_iterator citer;
 	struct aji_client *c = NULL;
 
 	switch (cmd) {
@@ -2565,8 +2565,8 @@
 		return CLI_SHOWUSAGE;
 
 	if (!strncasecmp(a->argv[e->args - 1], "on", 2)) {
-		iter = ao2_iterator_init(clients, 0);
-		while((c = ao2_t_iterator_next(&iter,"Go through list"))) {
+		citer = ao2_iterator_init(clients, 0);
+		while((c = ao2_t_iterator_next(&citer,"Go through list"))) {
 			ao2_lock(c); 
 			c->debug = 1;
 			ao2_unlock(c);
@@ -2575,8 +2575,8 @@
 		ast_cli(a->fd, "Jabber Debugging Enabled.\n");
 		return CLI_SUCCESS;
 	} else if (!strncasecmp(a->argv[e->args - 1], "off", 3)) {
-		iter = ao2_iterator_init(clients, 0);
-		while((c = ao2_t_iterator_next(&iter,"Go through list"))) {
+		citer = ao2_iterator_init(clients, 0);
+		while((c = ao2_t_iterator_next(&citer,"Go through list"))) {
 			ao2_lock(c); 
 			c->debug = 0;
 			ao2_unlock(c);
@@ -2594,7 +2594,7 @@
  */
 static char *aji_do_debug_deprecated(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-	struct ao2_iterator iter;
+	struct ao2_iterator citer;
 	struct aji_client *c;
 
 	switch (cmd) {
@@ -2609,8 +2609,8 @@
 	}
 
 	if (a->argc == 2) {
-		iter = ao2_iterator_init(clients, 0);
-		while((c = ao2_t_iterator_next(&iter,"Go through list"))) {
+		citer = ao2_iterator_init(clients, 0);
+		while((c = ao2_t_iterator_next(&citer,"Go through list"))) {
 			ao2_lock(c); 
 			c->debug = 1;
 			ao2_unlock(c);
@@ -2620,8 +2620,8 @@
 		return CLI_SUCCESS;
 	} else if (a->argc == 3) {
 		if (!strncasecmp(a->argv[2], "off", 3)) {
-			iter = ao2_iterator_init(clients, 0);
-			while((c = ao2_t_iterator_next(&iter,"Go through list"))) {
+			citer = ao2_iterator_init(clients, 0);
+			while((c = ao2_t_iterator_next(&citer,"Go through list"))) {
 				ao2_lock(c); 
 				c->debug = 0;
 				ao2_unlock(c);
@@ -2663,7 +2663,7 @@
 static char *aji_show_clients(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	char *status;
-	struct ao2_iterator iter;
+	struct ao2_iterator citer;
 	struct aji_client *c = NULL;
 	int count = 0;
 	
@@ -2679,8 +2679,8 @@
 	}
 
 	ast_cli(a->fd, "Jabber Users and their status:\n");
-	iter = ao2_iterator_init(clients, 0);
-	while((c = ao2_t_iterator_next(&iter,"Go through list"))) {
+	citer = ao2_iterator_init(clients, 0);
+	while((c = ao2_t_iterator_next(&citer,"Go through list"))) {
 		ao2_lock(c); 
 		count++;
 		switch (c->state) {
@@ -2769,7 +2769,7 @@
 	struct aji_resource *resource;
 	const char *name = "asterisk";
 	struct aji_message *tmp;
-	struct ao2_iterator iter;
+	struct ao2_iterator biter;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -2796,8 +2796,8 @@
 
 	/* XXX Does Matt really want everyone to use his personal address for tests? */ /* XXX yes he does */
 	ast_aji_send_chat(client, "mogorman at astjab.org", "blahblah");
-	iter = ao2_iterator_init(client->buddies, 0);
-	while ((b = ao2_t_iterator_next(&iter, "Look through buddies"))) {
+	biter = ao2_iterator_init(client->buddies, 0);
+	while ((b = ao2_t_iterator_next(&biter, "Look through buddies"))) {
 		ao2_lock(b);
 		ast_verbose("User: %s\n", b->name);
 		for (resource = b->resources; resource; resource = resource->next) {
@@ -2838,7 +2838,7 @@
 	struct aji_client *client = NULL;
 	struct aji_client tmp_client;
 	struct aji_buddy *b = NULL;
-	struct ao2_iterator iter;
+	struct ao2_iterator biter;
 	int flag = 0;
 
 	ast_copy_string(tmp_client.name, label, sizeof(tmp_client.name));
@@ -2859,8 +2859,8 @@
 		/*ASTOBJ_UNMARK(client);*/
 	}
 	/*ASTOBJ_CONTAINER_MARKALL(&client->buddies); */
-	iter = ao2_iterator_init(client->buddies, 0);
-	while (( b = ao2_t_iterator_next(&iter, ""))) {
+	biter = ao2_iterator_init(client->buddies, 0);
+	while (( b = ao2_t_iterator_next(&biter, "Iter buddies"))) {
 		ao2_lock(b);
 		b->mark = 1;
 		ao2_unlock(b);
@@ -3161,14 +3161,14 @@
 {
 	struct aji_client *client, *c = NULL;
 	struct aji_client tmp_client;
-	struct ao2_iterator iter;
+	struct ao2_iterator citer;
 	char *aux = NULL;
 
 	ast_copy_string(tmp_client.name, name, sizeof(tmp_client.name));
 	client = ao2_t_find(clients, &tmp_client, OBJ_POINTER, "Find client");
 	if (!client && strchr(name, '@')) {
-		iter = ao2_iterator_init(clients, 0);
-	   	while (( c = ao2_t_iterator_next(&iter, "iter through clients"))) {
+		citer = ao2_iterator_init(clients, 0);
+	   	while (( c = ao2_t_iterator_next(&citer, "iter through clients"))) {
 			aux = ast_strdupa(c->user);
 			if (strchr(aux, '/')) {
 				/* strip resource for comparison */
@@ -3248,12 +3248,12 @@
 static int aji_reload(int reload)
 {
 	int res;
-	struct ao2_iterator iter;
+	struct ao2_iterator citer;
 	struct aji_client *c = NULL;
 
 	/* ASTOBJ_CONTAINER_MARKALL(&clients); */
-	iter = ao2_iterator_init(clients, 0);
-   	while ((c = ao2_t_iterator_next(&iter, "iter through clients"))) {
+	citer = ao2_iterator_init(clients, 0);
+   	while ((c = ao2_t_iterator_next(&citer, "iter through clients"))) {
 		ao2_lock(c);
 		c->mark=1;
 		ao2_unlock(c);
@@ -3269,17 +3269,17 @@
 		return 1;
 
 	/*ASTOBJ_CONTAINER_PRUNE_MARKED(&clients, aji_client_destroy); */
-	iter = ao2_iterator_init(clients, 0);
-   	while ((c = ao2_t_iterator_next(&iter, "iter through clients"))) {
+	citer = ao2_iterator_init(clients, 0);
+   	while ((c = ao2_t_iterator_next(&citer, "iter through clients"))) {
 		if(c->mark == 1) {
-			struct ao2_iterator iterbuddy;
+			struct ao2_iterator biter;
 			struct aji_buddy *b;
 
 			ao2_lock(c);
 			ao2_t_unlink(clients, c, "Remove client from list");
 
-			iterbuddy = ao2_iterator_init(c->buddies, 0);
-			while ((b = ao2_t_iterator_next(&iterbuddy, "iter through buddies"))) {
+			biter = ao2_iterator_init(c->buddies, 0);
+			while ((b = ao2_t_iterator_next(&biter, "iter through buddies"))) {
 				ao2_t_unlink(c->buddies, b, "unlink buddy");
 				buddy_unref(b, "unref buddy");
 			}
@@ -3290,8 +3290,8 @@
 	}	
 	
 	
-	iter = ao2_iterator_init(clients, 0);
-   	while ((c = ao2_t_iterator_next(&iter, "iter through clients"))) {
+	citer = ao2_iterator_init(clients, 0);
+   	while ((c = ao2_t_iterator_next(&citer, "iter through clients"))) {
 		ao2_lock(c);
 		if(c->state == AJI_DISCONNECTED) {
 			if (!c->thread)




More information about the asterisk-commits mailing list