libpurple/plugins/perl/common/Cmds.xs

branch
cpw.khc.msnp14
changeset 20478
46933dc62880
parent 20472
6a6d2ef151e6
parent 15894
765ec644ac47
child 20481
65485e2ed8a3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/plugins/perl/common/Cmds.xs	Sun Apr 15 03:43:17 2007 +0000
@@ -0,0 +1,49 @@
+#include "module.h"
+#include "../perl-handlers.h"
+
+MODULE = Purple::Cmd  PACKAGE = Purple::Cmd  PREFIX = purple_cmd_
+PROTOTYPES: ENABLE
+
+void
+purple_cmd_help(conv, command)
+	Purple::Conversation conv
+	const gchar *command
+PREINIT:
+	GList *l;
+PPCODE:
+	for (l = purple_cmd_help(conv, command); l != NULL; l = l->next) {
+		XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
+	}
+
+void
+purple_cmd_list(conv)
+	Purple::Conversation conv
+PREINIT:
+	GList *l;
+PPCODE:
+	for (l = purple_cmd_list(conv); l != NULL; l = l->next) {
+		XPUSHs(sv_2mortal(newSVpv(l->data, 0)));
+	}
+
+Purple::Cmd::Id
+purple_cmd_register(plugin, command, args, priority, flag, prpl_id, func, helpstr, data = 0)
+	Purple::Plugin plugin
+	const gchar *command
+	const gchar *args
+	Purple::Cmd::Priority priority
+	Purple::Cmd::Flag flag
+	const gchar *prpl_id
+	SV *func
+	const gchar *helpstr
+	SV *data
+CODE:
+	RETVAL = purple_perl_cmd_register(plugin, command, args, priority, flag,
+	                                prpl_id, func, helpstr, data);
+OUTPUT:
+	RETVAL
+
+void
+purple_cmd_unregister(id)
+	Purple::Cmd::Id id
+CODE:
+	purple_perl_cmd_unregister(id);

mercurial