Perl protocol plugins?

tinytown.au at gmail.com tinytown.au at gmail.com
Thu Aug 28 00:22:28 EDT 2008


Hi,
I'm wondering if its possible to create a libpurple
'PURPLE_PLUGIN_PROTOCOL' with perl?

If so, how would I create the perl equivalent of the C prpl_info and
PurplePluginInfo info

this is from the toc.c source code.
As an example of howto (if possible ). How would these be created with
perl?


static PurplePluginProtocolInfo prpl_info =
{
	0,
	NULL,					/* user_splits */
	NULL,					/* protocol_options */
	NO_BUDDY_ICONS,			/* icon_spec */
	toc_list_icon,			/* list_icon */
	toc_list_emblem,		/* list_emblems */
	NULL,					/* status_text */
	NULL,					/* tooltip_text */
	toc_away_states,		/* away_states */
	toc_blist_node_menu,	/* blist_node_menu */
	toc_chat_info,			/* chat_info */
	toc_chat_info_defaults,	/* chat_info_defaults */
	toc_login,				/* login */
	toc_close,				/* close */
	toc_send_im,			/* send_im */
	toc_set_info,			/* set_info */
	NULL,					/* send_typing */
	toc_get_info,			/* get_info */
	toc_set_status,			/* set_away */
	toc_set_idle,			/* set_idle */
	toc_change_passwd,		/* change_passwd */
	toc_add_buddy,			/* add_buddy */
	toc_add_buddies,		/* add_buddies */
	toc_remove_buddy,		/* remove_buddy */
	toc_remove_buddies,		/* remove_buddies */
	toc_add_permit,			/* add_permit */
	toc_add_deny,			/* add_deny */
	toc_rem_permit,			/* rem_permit */
	toc_rem_deny,			/* rem_deny */
	toc_set_permit_deny,	/* set_permit_deny */
	toc_join_chat,			/* join_chat */
	NULL,					/* reject_chat */
	NULL,				/* get_chat_name */
	toc_chat_invite,		/* chat_invite */
	toc_chat_leave,			/* chat_leave */
	toc_chat_whisper,		/* chat_whisper */
	toc_chat_send,			/* chat_send */
	toc_keepalive,			/* keepalive */
	NULL,					/* register_user */
	NULL,					/* get_cb_info */
	NULL,					/* get_cb_away */
	NULL,					/* alias_buddy */
	NULL,					/* group_buddy */
	NULL,					/* rename_group */
	NULL,					/* buddy_free */
	NULL,					/* convo_closed */
	toc_normalize,			/* normalize */
	NULL,					/* set_buddy_icon */
	NULL,					/* remove_group */
	NULL,					/* get_cb_real_name */
	NULL,					/* set_chat_topic */
	NULL,					/* find_blist_chat */
	NULL,					/* roomlist_get_list */
	NULL,					/* roomlist_cancel */
	NULL,					/* roomlist_expand_category */
	NULL,					/* can_receive_file */
	NULL,					/* send_file */
	NULL,					/* new_xfer */
	NULL,					/* offline_message */
	NULL,					/* whiteboard_prpl_ops */
	toc_send_raw,				/* send_raw */
};

static PurplePluginInfo info =
{
	PURPLE_PLUGIN_MAGIC,
	PURPLE_MAJOR_VERSION,
	PURPLE_MINOR_VERSION,
	PURPLE_PLUGIN_PROTOCOL,                             /**<
type           */
	NULL,                                             /**< ui_requirement
*/
	0,                                                /**< flags
*/
	NULL,                                             /**< dependencies
*/
	PURPLE_PRIORITY_DEFAULT,                            /**<
priority       */

	"prpl-xtoc",                                       /**<
id             */
	"TOC",                                            /**< name
*/
	"0.01",                                  /**< version        */
	                                                  /**  summary
*/
	N_("TOC Protocol Plugin"),
	                                                  /**  description
*/
	N_("TOC Protocol Plugin"),
	NULL,                                             /**< author
*/
	PURPLE_WEBSITE,                                     /**<
homepage       */

	NULL,                                             /**< load
*/
	NULL,                                             /**< unload
*/
	NULL,                                             /**< destroy
*/

	NULL,                                             /**< ui_info
*/
	&prpl_info,                                       /**< extra_info
*/
	NULL,
	toc_actions
};




More information about the Devel mailing list