# HG changeset patch # User Christian Hammond # Date 1061433485 0 # Node ID eae61831e596ede1e7bec16edc45cd27d2708d51 # Parent 1690791f0c7013f3de693e6280f89b0c3f5c1772 [gaim-migrate @ 7062] Improved the buddy list perl API a bit. committer: Tailor Script diff -r 1690791f0c70 -r eae61831e596 plugins/perl/common/BuddyList.xs --- 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