changeset 6540:eae61831e596

[gaim-migrate @ 7062] Improved the buddy list perl API a bit. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 21 Aug 2003 02:38:05 +0000
parents 1690791f0c70
children f31eb1fab20e
files plugins/perl/common/BuddyList.xs
diffstat 1 files changed, 56 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/perl/common/BuddyList.xs	Thu Aug 21 01:50:02 2003 +0000
+++ b/plugins/perl/common/BuddyList.xs	Thu Aug 21 02:38:05 2003 +0000
@@ -76,6 +76,17 @@
 	Gaim::Account account
 	const char *name
 
+void
+groups()
+PREINIT:
+	GaimBlistNode *node;
+CODE:
+	for (node = gaim_get_blist()->root; node != NULL; node = node->next)
+	{
+		XPUSHs(sv_2mortal(gaim_perl_bless_object(node,
+			"Gaim::BuddyList::Group")));
+	}
+
 
 ###########################################################################
 MODULE = Gaim::GroupList::Group  PACKAGE = Gaim::GroupList::Group  PREFIX = gaim_group_
@@ -115,6 +126,14 @@
 OUTPUT:
 	RETVAL
 
+const char *
+get_name(group)
+	Gaim::BuddyList::Group group
+CODE:
+	RETVAL = group->name;
+OUTPUT:
+	RETVAL
+
 int
 get_online_count(group)
 	Gaim::BuddyList::Group group
@@ -134,6 +153,19 @@
 	Gaim::BuddyList::Group group
 	const char *key
 
+void
+buddies(group)
+	Gaim::BuddyList::Group group
+PREINIT:
+	GaimBlistNode *node;
+	GaimBlistNode *_group = (GaimBlistNode *)group;
+PPCODE:
+	for (node = _group->child; node != NULL; node = node->next)
+	{
+		XPUSHs(sv_2mortal(gaim_perl_bless_object(node,
+			"Gaim::BuddyList::Buddy")));
+	}
+
 
 ###########################################################################
 MODULE = Gaim::BuddyList::Buddy  PACKAGE = Gaim::BuddyList::Buddy  PREFIX = gaim_buddy_
@@ -193,6 +225,22 @@
 	gaim_blist_server_alias_buddy(buddy, alias);
 
 const char *
+get_name(buddy)
+	Gaim::BuddyList::Buddy buddy
+CODE:
+	RETVAL = buddy->name;
+OUTPUT:
+	RETVAL
+
+Gaim::Account
+get_account(buddy)
+	Gaim::BuddyList::Buddy buddy
+CODE:
+	RETVAL = buddy->account;
+OUTPUT:
+	RETVAL
+
+const char *
 get_alias_only(buddy)
 	Gaim::BuddyList::Buddy buddy
 CODE:
@@ -262,3 +310,11 @@
 gaim_chat_get_setting(chat, key)
 	Gaim::BuddyList::Chat chat
 	const char *key
+
+Gaim::Account
+get_account(chat)
+	Gaim::BuddyList::Chat chat
+CODE:
+	RETVAL = chat->account;
+OUTPUT:
+	RETVAL