Mercurial > pidgin.yaz
annotate plugins/perl/common/BuddyList_Group.xs @ 9285:7a8aa87164ae
[gaim-migrate @ 10088]
Ok I'm done. This started out as shx's patch to make add/remove
buddy/buddies take GaimBuddy and GaimGroup's in various places.
I think his diff was like 2000 lines and mine is like 5000. I
tried to clean up blist.c a bit and make it more uniform. There
are some more g_return_if_fail() checks. Removed some code that
was deprecated--it's probably been long enough. Removed some
#include <multi.h>'s. Make blist.xml saving happen on a timer,
like prefs.xml and accounts.xml.
Sorry if this doesn't merge cleanly with whatever you're doing.
People should really test this a lot.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 15 Jun 2004 02:37:27 +0000 |
parents | 1d994e9b81f9 |
children |
rev | line source |
---|---|
6542 | 1 #include "module.h" |
2 | |
3 MODULE = Gaim::BuddyList::Group PACKAGE = Gaim::BuddyList::Group PREFIX = gaim_group_ | |
4 PROTOTYPES: ENABLE | |
5 | |
6 Gaim::BuddyList::Group | |
7 new(name) | |
8 const char *name | |
9 CODE: | |
10 RETVAL = gaim_group_new(name); | |
11 OUTPUT: | |
12 RETVAL | |
13 | |
14 void | |
15 rename(group, new_name) | |
16 Gaim::BuddyList::Group group | |
17 const char *new_name | |
18 CODE: | |
19 gaim_blist_rename_group(group, new_name); | |
20 | |
21 void | |
22 get_accounts(group) | |
23 Gaim::BuddyList::Group group | |
24 PREINIT: | |
25 GSList *l; | |
26 PPCODE: | |
27 for (l = gaim_group_get_accounts(group); l != NULL; l = l->next) | |
28 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, "Gaim::Account"))); | |
29 | |
30 int | |
31 get_size(group, offline) | |
32 Gaim::BuddyList::Group group | |
33 gboolean offline | |
34 CODE: | |
35 RETVAL = gaim_blist_get_group_size(group, offline); | |
36 OUTPUT: | |
37 RETVAL | |
38 | |
39 const char * | |
40 get_name(group) | |
41 Gaim::BuddyList::Group group | |
42 CODE: | |
43 RETVAL = group->name; | |
44 OUTPUT: | |
45 RETVAL | |
46 | |
47 int | |
48 get_online_count(group) | |
49 Gaim::BuddyList::Group group | |
50 CODE: | |
51 RETVAL = gaim_blist_get_group_online_count(group); | |
52 OUTPUT: | |
53 RETVAL | |
54 | |
55 void | |
56 buddies(group) | |
57 Gaim::BuddyList::Group group | |
58 PREINIT: | |
59 GaimBlistNode *node; | |
6922
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
60 GaimBlistNode *contact; |
6542 | 61 GaimBlistNode *_group = (GaimBlistNode *)group; |
62 PPCODE: | |
6922
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
63 for (contact = _group->child; contact != NULL; contact = contact->next) |
6542 | 64 { |
6922
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
65 for (node = contact->child; node != NULL; node = node->next) |
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
66 { |
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
67 XPUSHs(sv_2mortal(gaim_perl_bless_object(node, |
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
68 "Gaim::BuddyList::Buddy"))); |
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
69 } |
6542 | 70 } |
6922
1d994e9b81f9
[gaim-migrate @ 7469]
Christian Hammond <chipx86@chipx86.com>
parents:
6542
diff
changeset
|
71 |