server.xs
来自「Linux下的多协议即时通讯程序源代码」· XS 代码 · 共 217 行
XS
217 行
#include "module.h"MODULE = Purple::Serv PACKAGE = Purple::Serv PREFIX = serv_PROTOTYPES: ENABLEvoid serv_add_deny(con, a) Purple::Connection con const char * avoid serv_add_permit(a, b) Purple::Connection a const char * bvoid serv_alias_buddy(buddy) Purple::BuddyList::Buddy buddy void serv_chat_invite(con, a, b, c) Purple::Connection con int a const char * b const char * cvoid serv_chat_leave(a, b) Purple::Connection a int bint serv_chat_send(con, a, b, flags) Purple::Connection con int a const char * b Purple::MessageFlags flagsvoid serv_chat_whisper(con, a, b, c) Purple::Connection con int a const char * b const char * cvoid serv_get_info(con, a) Purple::Connection con const char * avoid serv_got_alias(gc, who, alias) Purple::Connection gc const char *who const char *aliasvoid serv_got_chat_in(g, id, who, chatflags, message, mtime) Purple::Connection g int id const char *who Purple::MessageFlags chatflags const char *message time_t mtimevoid serv_got_chat_invite(gc, name, who, message, components) Purple::Connection gc const char *name const char *who const char *message SV * componentsINIT: HV * t_HV; HE * t_HE; SV * t_SV; GHashTable * t_GHash; I32 len; char *t_key, *t_value;CODE: t_HV = (HV *)SvRV(components); t_GHash = g_hash_table_new(g_str_hash, g_str_equal); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); t_SV = *hv_fetch(t_HV, t_key, len, 0); t_value = SvPV(t_SV, PL_na); g_hash_table_insert(t_GHash, t_key, t_value); } serv_got_chat_invite(gc, name, who, message, t_GHash);void serv_got_chat_left(g, id) Purple::Connection g int idvoid serv_got_im(gc, who, msg, imflags, mtime) Purple::Connection gc const char *who const char *msg Purple::MessageFlags imflags time_t mtimePurple::Conversationserv_got_joined_chat(gc, id, name) Purple::Connection gc int id const char *namevoid serv_got_typing(gc, name, timeout, state) Purple::Connection gc const char *name int timeout Purple::TypingState statevoid serv_got_typing_stopped(gc, name) Purple::Connection gc const char *namevoid serv_join_chat(con, components) Purple::Connection con SV * componentsINIT: HV * t_HV; HE * t_HE; SV * t_SV; GHashTable * t_GHash; I32 len; char *t_key, *t_value;CODE: t_HV = (HV *)SvRV(components); t_GHash = g_hash_table_new(g_str_hash, g_str_equal); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); t_SV = *hv_fetch(t_HV, t_key, len, 0); t_value = SvPV(t_SV, PL_na); g_hash_table_insert(t_GHash, t_key, t_value); } serv_join_chat(con, t_GHash);void serv_move_buddy(buddy, group1, group2) Purple::BuddyList::Buddy buddy Purple::BuddyList::Group group1 Purple::BuddyList::Group group2void serv_reject_chat(con, components) Purple::Connection con SV * componentsINIT: HV * t_HV; HE * t_HE; SV * t_SV; GHashTable * t_GHash; I32 len; char *t_key, *t_value;CODE: t_HV = (HV *)SvRV(components); t_GHash = g_hash_table_new(g_str_hash, g_str_equal); for (t_HE = hv_iternext(t_HV); t_HE != NULL; t_HE = hv_iternext(t_HV) ) { t_key = hv_iterkey(t_HE, &len); t_SV = *hv_fetch(t_HV, t_key, len, 0); t_value = SvPV(t_SV, PL_na); g_hash_table_insert(t_GHash, t_key, t_value); } serv_reject_chat(con, t_GHash);void serv_rem_deny(con, a) Purple::Connection con const char * avoid serv_rem_permit(con, a) Purple::Connection con const char * avoid serv_send_file(gc, who, file) Purple::Connection gc const char *who const char *fileint serv_send_im(con, a, b, flags ) Purple::Connection con const char * a const char * b Purple::MessageFlags flagsint serv_send_typing(con, a, state) Purple::Connection con const char * a Purple::TypingState statevoid serv_set_info(con, a) Purple::Connection con const char * avoid serv_set_permit_deny(con) Purple::Connection con
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?