Mercurial > pidgin.yaz
annotate plugins/perl/common/BuddyList.xs @ 6542:fe0294504602
[gaim-migrate @ 7064]
Learn as you go, I guess... Split off the Chat, Group, and Buddy classes
into their own files and bootstrapped them so they'll actually work (I hope
at least).
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Thu, 21 Aug 2003 03:23:18 +0000 |
parents | f31eb1fab20e |
children | 4d45f1eb0a7b |
rev | line source |
---|---|
6531 | 1 #include "module.h" |
2 | |
3 MODULE = Gaim::BuddyList PACKAGE = Gaim::BuddyList PREFIX = gaim_blist_ | |
4 PROTOTYPES: ENABLE | |
5 | |
6 void | |
7 gaim_blist_set_visible(show) | |
8 gboolean show | |
9 | |
10 void | |
11 add_buddy(buddy, group) | |
12 Gaim::BuddyList::Buddy buddy | |
13 Gaim::BuddyList::Group group | |
14 CODE: | |
15 gaim_blist_add_buddy(buddy, group, NULL); | |
16 | |
17 void | |
18 add_group(group) | |
19 Gaim::BuddyList::Group group | |
20 CODE: | |
21 gaim_blist_add_group(group, NULL); | |
22 | |
23 void | |
24 add_chat(chat, group) | |
25 Gaim::BuddyList::Chat chat | |
26 Gaim::BuddyList::Group group | |
27 CODE: | |
28 gaim_blist_add_chat(chat, group, NULL); | |
29 | |
30 void | |
31 gaim_blist_remove_buddy(buddy) | |
32 Gaim::BuddyList::Buddy buddy | |
33 | |
34 void | |
35 gaim_blist_remove_group(group) | |
36 Gaim::BuddyList::Group group | |
37 | |
38 void | |
39 gaim_blist_remove_chat(chat) | |
40 Gaim::BuddyList::Chat chat | |
41 | |
42 Gaim::BuddyList::Buddy | |
43 find_buddy(account, name) | |
44 Gaim::Account account | |
45 const char *name | |
46 CODE: | |
47 RETVAL = gaim_find_buddy(account, name); | |
48 OUTPUT: | |
49 RETVAL | |
50 | |
51 void | |
52 find_buddies(account, name) | |
53 Gaim::Account account | |
54 const char *name | |
55 PREINIT: | |
56 GSList *l; | |
57 PPCODE: | |
58 for (l = gaim_find_buddies(account, name); l != NULL; l = l->next) | |
59 { | |
60 XPUSHs(sv_2mortal(gaim_perl_bless_object(l->data, | |
61 "Gaim::BuddyList::Buddy"))); | |
62 } | |
63 | |
64 g_slist_free(l); | |
65 | |
66 Gaim::BuddyList::Group | |
67 find_group(name) | |
68 const char *name | |
69 CODE: | |
70 RETVAL = gaim_find_group(name); | |
71 OUTPUT: | |
72 RETVAL | |
73 | |
74 Gaim::BuddyList::Chat | |
75 gaim_blist_find_chat(account, name) | |
76 Gaim::Account account | |
77 const char *name | |
78 | |
6540
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
79 void |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
80 groups() |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
81 PREINIT: |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
82 GaimBlistNode *node; |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
83 CODE: |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
84 for (node = gaim_get_blist()->root; node != NULL; node = node->next) |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
85 { |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
86 XPUSHs(sv_2mortal(gaim_perl_bless_object(node, |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
87 "Gaim::BuddyList::Group"))); |
eae61831e596
[gaim-migrate @ 7062]
Christian Hammond <chipx86@chipx86.com>
parents:
6531
diff
changeset
|
88 } |