comparison src/perl.c @ 2397:520257562955

[gaim-migrate @ 2410] changing aim_users to GSList. this works better for me since in gaim-core i had them as a GSList. besides, it saves memory. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 30 Sep 2001 19:58:48 +0000
parents 25e7c2a68ed2
children e87e4a9e6566
comparison
equal deleted inserted replaced
2396:78fab38249a2 2397:520257562955
344 case 4: 344 case 4:
345 { 345 {
346 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); 346 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1));
347 debug_printf("%lu %lu\n", connections->data, gc); 347 debug_printf("%lu %lu\n", connections->data, gc);
348 if (g_slist_find(connections, gc)) 348 if (g_slist_find(connections, gc))
349 XST_mIV(i++, g_list_index(aim_users, gc->user)); 349 XST_mIV(i++, g_slist_index(aim_users, gc->user));
350 else 350 else
351 XST_mIV(i++, -1); 351 XST_mIV(i++, -1);
352 } 352 }
353 break; 353 break;
354 case 5: 354 case 5:
355 { 355 {
356 GList *a = aim_users; 356 GSList *a = aim_users;
357 while (a) { 357 while (a) {
358 struct aim_user *u = a->data; 358 struct aim_user *u = a->data;
359 XST_mPV(i++, u->username); 359 XST_mPV(i++, u->username);
360 a = a->next; 360 a = a->next;
361 } 361 }
362 } 362 }
363 break; 363 break;
364 case 6: 364 case 6:
365 { 365 {
366 GList *a = aim_users; 366 GSList *a = aim_users;
367 while (a) { 367 while (a) {
368 struct aim_user *u = a->data; 368 struct aim_user *u = a->data;
369 XST_mIV(i++, u->protocol); 369 XST_mIV(i++, u->protocol);
370 a = a->next; 370 a = a->next;
371 } 371 }
468 468
469 command = SvPV(ST(0), junk); 469 command = SvPV(ST(0), junk);
470 if (!command) XSRETURN(0); 470 if (!command) XSRETURN(0);
471 if (!strncasecmp(command, "signon", 6)) { 471 if (!strncasecmp(command, "signon", 6)) {
472 int index = SvIV(ST(1)); 472 int index = SvIV(ST(1));
473 if (g_list_nth_data(aim_users, index)) 473 if (g_slist_nth_data(aim_users, index))
474 serv_login(g_list_nth_data(aim_users, index)); 474 serv_login(g_slist_nth_data(aim_users, index));
475 } else if (!strncasecmp(command, "signoff", 7)) { 475 } else if (!strncasecmp(command, "signoff", 7)) {
476 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1)); 476 struct gaim_connection *gc = (struct gaim_connection *)SvIV(ST(1));
477 if (g_slist_find(connections, gc)) signoff(gc); 477 if (g_slist_find(connections, gc)) signoff(gc);
478 else signoff_all(NULL, NULL); 478 else signoff_all(NULL, NULL);
479 } else if (!strncasecmp(command, "info", 4)) { 479 } else if (!strncasecmp(command, "info", 4)) {