status.xs

来自「Linux下的多协议即时通讯程序源代码」· XS 代码 · 共 457 行

XS
457
字号
#include "module.h"/* TODOvoidpurple_status_type_add_attrs(status_type, id, name, value, purple_status_type_add_attrs)	Purple::StatusType status_type	const char *id	const char *name	Purple::Value value	...Purple::StatusTypepurple_status_type_new_with_attrs(primitive, id, name, saveable, user_settable, independent, attr_id, attr_name, attr_value, purple_status_type_new_with_attrs)	Purple::StatusPrimitive primitive	const char *id	const char *name	gboolean saveable	gboolean user_settable	gboolean independent	const char *attr_id	const char *attr_name	Purple::Value attr_value	...*//* These break on faceprint's amd64 boxvoidpurple_status_type_add_attrs_vargs(status_type, args)	Purple::StatusType status_type	va_list argsvoidpurple_status_set_active_with_attrs(status, active, args)	Purple::Status status	gboolean active	va_list args	*/MODULE = Purple::Status  PACKAGE = Purple::Presence  PREFIX = purple_presence_PROTOTYPES: ENABLEBOOT:{	HV *context_stash = gv_stashpv("Purple::Presence::Context", 1);	HV *primitive_stash = gv_stashpv("Purple::Status::Primitive", 1);	static const constiv *civ, context_const_iv[] = {#define const_iv(name) {#name, (IV)PURPLE_PRESENCE_CONTEXT_##name}		const_iv(UNSET),		const_iv(ACCOUNT),		const_iv(CONV),		const_iv(BUDDY),	};	static const constiv primitive_const_iv[] = {#undef const_iv#define const_iv(name) {#name, (IV)PURPLE_STATUS_##name}		const_iv(UNSET),		const_iv(OFFLINE),		const_iv(AVAILABLE),		const_iv(UNAVAILABLE),		const_iv(INVISIBLE),		const_iv(AWAY),		const_iv(EXTENDED_AWAY),		const_iv(MOBILE),	};	for (civ = context_const_iv + sizeof(context_const_iv) / sizeof(context_const_iv[0]); civ-- > context_const_iv; )		newCONSTSUB(context_stash, (char *)civ->name, newSViv(civ->iv));	for (civ = primitive_const_iv + sizeof(primitive_const_iv) / sizeof(primitive_const_iv[0]); civ-- > primitive_const_iv; )		newCONSTSUB(primitive_stash, (char *)civ->name, newSViv(civ->iv));}voidpurple_presence_add_list(presence, source_list)	Purple::Presence presence	SV *source_listPREINIT:	GList *t_GL;	int i, t_len;PPCODE:	t_GL = NULL;	t_len = av_len((AV *)SvRV(source_list));	for (i = 0; i < t_len; i++) {		STRLEN t_sl;		t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(source_list), i, 0), t_sl));	}	purple_presence_add_list(presence, t_GL);voidpurple_presence_add_status(presence, status)	Purple::Presence presence	Purple::Status statusgintpurple_presence_compare(presence1, presence2)	Purple::Presence presence1	Purple::Presence presence2voidpurple_presence_destroy(presence)	Purple::Presence presencePurple::Accountpurple_presence_get_account(presence)	Purple::Presence presencePurple::Statuspurple_presence_get_active_status(presence)	Purple::Presence presenceconst char *purple_presence_get_chat_user(presence)	Purple::Presence presencePurple::PresenceContextpurple_presence_get_context(presence)	Purple::Presence presencePurple::Conversationpurple_presence_get_conversation(presence)	Purple::Presence presencetime_tpurple_presence_get_idle_time(presence)	Purple::Presence presencetime_tpurple_presence_get_login_time(presence)	Purple::Presence presencePurple::Statuspurple_presence_get_status(presence, status_id)	Purple::Presence presence	const char *status_idvoidpurple_presence_get_statuses(presence)	Purple::Presence presencePREINIT:	const GList *l;PPCODE:	for (l = purple_presence_get_statuses(presence); l != NULL; l = l->next) {		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Status")));	}gbooleanpurple_presence_is_available(presence)	Purple::Presence presencegbooleanpurple_presence_is_idle(presence)	Purple::Presence presencegbooleanpurple_presence_is_online(presence)	Purple::Presence presencegbooleanpurple_presence_is_status_active(presence, status_id)	Purple::Presence presence	const char *status_idgbooleanpurple_presence_is_status_primitive_active(presence, primitive)	Purple::Presence presence	Purple::StatusPrimitive primitivePurple::Presencepurple_presence_new(context)	Purple::PresenceContext contextPurple::Presencepurple_presence_new_for_account(account)	Purple::Account accountPurple::Presencepurple_presence_new_for_buddy(buddy)	Purple::BuddyList::Buddy buddyPurple::Presencepurple_presence_new_for_conv(conv)	Purple::Conversation convvoidpurple_presence_set_idle(presence, idle, idle_time)	Purple::Presence presence	gboolean idle	time_t idle_timevoidpurple_presence_set_login_time(presence, login_time)	Purple::Presence presence	time_t login_timevoidpurple_presence_set_status_active(presence, status_id, active)	Purple::Presence presence	const char *status_id	gboolean activevoidpurple_presence_switch_status(presence, status_id)	Purple::Presence presence	const char *status_idMODULE = Purple::Status  PACKAGE = Purple::Primitive  PREFIX = purple_primitive_PROTOTYPES: ENABLEconst char *purple_primitive_get_id_from_type(type)	Purple::StatusPrimitive typeconst char *purple_primitive_get_name_from_type(type)	Purple::StatusPrimitive typePurple::StatusPrimitivepurple_primitive_get_type_from_id(id)	const char *idMODULE = Purple::Status  PACKAGE = Purple::StatusAttr PREFIX = purple_status_attr_PROTOTYPES: ENABLEvoidpurple_status_attr_destroy(attr)	Purple::StatusAttr attrconst char *purple_status_attr_get_id(attr)	Purple::StatusAttr attrconst char *purple_status_attr_get_name(attr)	Purple::StatusAttr attrPurple::Valuepurple_status_attr_get_value(attr)	Purple::StatusAttr attrPurple::StatusAttrpurple_status_attr_new(id, name, value_type)	const char *id	const char *name	Purple::Value value_typeMODULE = Purple::Status  PACKAGE = Purple::Status  PREFIX = purple_status_PROTOTYPES: ENABLEgintpurple_status_compare(status1, status2)	Purple::Status status1	Purple::Status status2voidpurple_status_destroy(status)	Purple::Status statusgbooleanpurple_status_get_attr_boolean(status, id)	Purple::Status status	const char *idintpurple_status_get_attr_int(status, id)	Purple::Status status	const char *idconst char *purple_status_get_attr_string(status, id)	Purple::Status status	const char *idPurple::Valuepurple_status_get_attr_value(status, id)	Purple::Status status	const char *idPurple::Handlepurple_status_get_handle()const char *purple_status_get_id(status)	Purple::Status statusconst char *purple_status_get_name(status)	Purple::Status statusPurple::Presencepurple_status_get_presence(status)	Purple::Status statusPurple::StatusTypepurple_status_get_type(status)	Purple::Status statusgbooleanpurple_status_is_active(status)	Purple::Status statusgbooleanpurple_status_is_available(status)	Purple::Status statusgbooleanpurple_status_is_exclusive(status)	Purple::Status statusgbooleanpurple_status_is_independent(status)	Purple::Status statusgbooleanpurple_status_is_online(status)	Purple::Status statusPurple::Statuspurple_status_new(status_type, presence)	Purple::StatusType status_type	Purple::Presence presencevoidpurple_status_set_active(status, active)	Purple::Status status	gboolean activevoidpurple_status_set_attr_boolean(status, id, value)	Purple::Status status	const char *id	gboolean valuevoidpurple_status_set_attr_string(status, id, value)	Purple::Status status	const char *id	const char *valuevoidpurple_status_init()voidpurple_status_uninit()MODULE = Purple::Status  PACKAGE = Purple::StatusType  PREFIX = purple_status_type_PROTOTYPES: ENABLEvoidpurple_status_type_add_attr(status_type, id, name, value)	Purple::StatusType status_type	const char *id	const char *name	Purple::Value valuevoidpurple_status_type_destroy(status_type)	Purple::StatusType status_typePurple::StatusTypepurple_status_type_find_with_id(status_types, id)	SV *status_types	const char *idPREINIT:/* XXX Check that this function actually works, I think it might need a *//* status_type as it's first argument to work as $status_type->find_with_id *//* properly. */	GList *t_GL;	int i, t_len;CODE:	t_GL = NULL;	t_len = av_len((AV *)SvRV(status_types));	for (i = 0; i < t_len; i++) {		STRLEN t_sl;		t_GL = g_list_append(t_GL, SvPV(*av_fetch((AV *)SvRV(status_types), i, 0), t_sl));	}	RETVAL = (PurpleStatusType *)purple_status_type_find_with_id(t_GL, id);OUTPUT:	RETVALPurple::StatusAttrpurple_status_type_get_attr(status_type, id)	Purple::StatusType status_type	const char *idvoidpurple_status_type_get_attrs(status_type)	Purple::StatusType status_typePREINIT:	const GList *l;PPCODE:	for (l = purple_status_type_get_attrs(status_type); l != NULL; l = l->next) {		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::StatusAttr")));	}const char *purple_status_type_get_id(status_type)	Purple::StatusType status_typeconst char *purple_status_type_get_name(status_type)	Purple::StatusType status_typeconst char *purple_status_type_get_primary_attr(status_type)	Purple::StatusType status_typePurple::StatusPrimitivepurple_status_type_get_primitive(status_type)	Purple::StatusType status_typegbooleanpurple_status_type_is_available(status_type)	Purple::StatusType status_typegbooleanpurple_status_type_is_exclusive(status_type)	Purple::StatusType status_typegbooleanpurple_status_type_is_independent(status_type)	Purple::StatusType status_typegbooleanpurple_status_type_is_saveable(status_type)	Purple::StatusType status_typegbooleanpurple_status_type_is_user_settable(status_type)	Purple::StatusType status_typePurple::StatusTypepurple_status_type_new(primitive, id, name, user_settable)	Purple::StatusPrimitive primitive	const char *id	const char *name	gboolean user_settablePurple::StatusTypepurple_status_type_new_full(primitive, id, name, saveable, user_settable, independent)	Purple::StatusPrimitive primitive	const char *id	const char *name	gboolean saveable	gboolean user_settable	gboolean independentvoidpurple_status_type_set_primary_attr(status_type, attr_id)	Purple::StatusType status_type	const char *attr_id

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?