comparison libgaim/protocols/oscar/flap_connection.c @ 14348:80b05108652c

[gaim-migrate @ 17050] Use GSList in a few places instead of GList, and use g_list_prepend and then g_list_reverse in a few places instead of g_list_append committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 26 Aug 2006 19:12:05 +0000
parents baff095b146c
children 92eb7a040663
comparison
equal deleted inserted replaced
14347:a8140cbe08ce 14348:80b05108652c
122 conn->buffer_outgoing = gaim_circ_buffer_new(0); 122 conn->buffer_outgoing = gaim_circ_buffer_new(0);
123 conn->fd = -1; 123 conn->fd = -1;
124 conn->subtype = -1; 124 conn->subtype = -1;
125 conn->type = type; 125 conn->type = type;
126 126
127 od->oscar_connections = g_list_prepend(od->oscar_connections, conn); 127 od->oscar_connections = g_slist_prepend(od->oscar_connections, conn);
128 128
129 return conn; 129 return conn;
130 } 130 }
131 131
132 /** 132 /**
218 * Free conn->internal, if necessary 218 * Free conn->internal, if necessary
219 */ 219 */
220 if (conn->type == SNAC_FAMILY_CHAT) 220 if (conn->type == SNAC_FAMILY_CHAT)
221 flap_connection_destroy_chat(od, conn); 221 flap_connection_destroy_chat(od, conn);
222 222
223 g_list_free(conn->groups); 223 g_slist_free(conn->groups);
224 flap_connection_destroy_rates(conn->rates); 224 flap_connection_destroy_rates(conn->rates);
225 225
226 od->oscar_connections = g_list_remove(od->oscar_connections, conn); 226 od->oscar_connections = g_slist_remove(od->oscar_connections, conn);
227 227
228 account = gaim_connection_get_account(od->gc); 228 account = gaim_connection_get_account(od->gc);
229 229
230 /* 230 /*
231 * TODO: If we don't have a SNAC_FAMILY_LOCATE connection then 231 * TODO: If we don't have a SNAC_FAMILY_LOCATE connection then
349 * family. 349 * family.
350 */ 350 */
351 FlapConnection * 351 FlapConnection *
352 flap_connection_findbygroup(OscarData *od, guint16 group) 352 flap_connection_findbygroup(OscarData *od, guint16 group)
353 { 353 {
354 GList *cur; 354 GSList *cur;
355 355
356 for (cur = od->oscar_connections; cur != NULL; cur = cur->next) 356 for (cur = od->oscar_connections; cur != NULL; cur = cur->next)
357 { 357 {
358 FlapConnection *conn; 358 FlapConnection *conn;
359 GList *l; 359 GSList *l;
360 360
361 conn = cur->data; 361 conn = cur->data;
362 362
363 for (l = conn->groups; l != NULL; l = l->next) 363 for (l = conn->groups; l != NULL; l = l->next)
364 { 364 {
383 * or NULL if none could be found. 383 * or NULL if none could be found.
384 */ 384 */
385 FlapConnection * 385 FlapConnection *
386 flap_connection_getbytype(OscarData *od, int type) 386 flap_connection_getbytype(OscarData *od, int type)
387 { 387 {
388 GList *cur; 388 GSList *cur;
389 389
390 for (cur = od->oscar_connections; cur != NULL; cur = cur->next) 390 for (cur = od->oscar_connections; cur != NULL; cur = cur->next)
391 { 391 {
392 FlapConnection *conn; 392 FlapConnection *conn;
393 conn = cur->data; 393 conn = cur->data;
399 } 399 }
400 400
401 FlapConnection * 401 FlapConnection *
402 flap_connection_getbytype_all(OscarData *od, int type) 402 flap_connection_getbytype_all(OscarData *od, int type)
403 { 403 {
404 GList *cur; 404 GSList *cur;
405 405
406 for (cur = od->oscar_connections; cur; cur = cur->next) 406 for (cur = od->oscar_connections; cur; cur = cur->next)
407 { 407 {
408 FlapConnection *conn; 408 FlapConnection *conn;
409 conn = cur->data; 409 conn = cur->data;