libpurple/plugins/perl/common/Plugin.xs

Thu, 30 Oct 2008 22:40:49 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Thu, 30 Oct 2008 22:40:49 +0000
changeset 24569
5dbd0617a27d
parent 23983
586866581434
permissions
-rw-r--r--

Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
to detect when we're still using deprecated functions internally (and by
extension, when we've deprecated something we shouldn't have). In the
course of developing this changeset, I fixed a few such cases.

Given that the plan is to switch from PURPLE_HIDE_STRUCTS to
PURPLE_DISABLE_DEPRECATED as each struct is fully dealt with, this will
also ensure we have no regressions on the struct hiding work.

Deprecated functions are still available to the respective .c file, to
avoid missing prototype errors. Also, Perl and DBus undef the
*_DISABLE_DEPRECATED defines as appropriate so that deprecated functions
will still be exported to Perl plugins and via DBus. (Otherwise, we'd
be breaking backwards compatibility.)

#include "module.h"

MODULE = Purple::Plugin  PACKAGE = Purple::Plugin  PREFIX = purple_plugin_
PROTOTYPES: ENABLE

BOOT:
{
	HV *stash = gv_stashpv("Purple::Plugin::Type", 1);

	static const constiv *civ, const_iv[] = {
#define const_iv(name) {#name, (IV)PURPLE_PLUGIN_##name}
		const_iv(UNKNOWN),
		const_iv(STANDARD),
		const_iv(LOADER),
		const_iv(PROTOCOL),
	};

	for (civ = const_iv + sizeof(const_iv) / sizeof(const_iv[0]); civ-- > const_iv; )
		newCONSTSUB(stash, (char *)civ->name, newSViv(civ->iv));
}

Purple::Plugin
purple_plugin_new(native, path)
	gboolean native
	const char *path

Purple::Plugin
purple_plugin_probe(filename)
	const char *filename

gboolean
purple_plugin_register(plugin)
	Purple::Plugin plugin

gboolean
purple_plugin_load(plugin)
	Purple::Plugin plugin

gboolean
purple_plugin_unload(plugin)
	Purple::Plugin plugin

gboolean
purple_plugin_reload(plugin)
	Purple::Plugin plugin

void
purple_plugin_destroy(plugin)
	Purple::Plugin plugin

gboolean
purple_plugin_is_loaded(plugin)
	Purple::Plugin plugin

gboolean
purple_plugin_is_unloadable(plugin)
	Purple::Plugin plugin

const gchar *
purple_plugin_get_id(plugin)
	Purple::Plugin plugin

const gchar *
purple_plugin_get_name(plugin)
	Purple::Plugin plugin

const gchar *
purple_plugin_get_version(plugin)
	Purple::Plugin plugin

const gchar *
purple_plugin_get_summary(plugin)
	Purple::Plugin plugin

const gchar *
purple_plugin_get_description(plugin)
	Purple::Plugin plugin

const gchar *
purple_plugin_get_author(plugin)
	Purple::Plugin plugin

const gchar *
purple_plugin_get_homepage(plugin)
	Purple::Plugin plugin

MODULE = Purple::Plugin  PACKAGE = Purple::Plugin::IPC  PREFIX = purple_plugin_ipc_

void
purple_plugin_ipc_unregister(plugin, command)
	Purple::Plugin plugin
	const char *command

void
purple_plugin_ipc_unregister_all(plugin)
	Purple::Plugin plugin

MODULE = Purple::Plugin  PACKAGE = Purple::Plugins  PREFIX = purple_plugins_
PROTOTYPES: ENABLE

void
purple_plugins_add_search_path(path)
	const char *path

void
purple_plugins_unload_all()

void
purple_plugins_destroy_all()

void
purple_plugins_load_saved(key)
	const char *key

void
purple_plugins_probe(ext)
	const char *ext

gboolean
purple_plugins_enabled()

Purple::Plugin
purple_plugins_find_with_name(name)
	const char *name

Purple::Plugin
purple_plugins_find_with_filename(filename)
	const char *filename

Purple::Plugin
purple_plugins_find_with_basename(basename)
	const char *basename

Purple::Plugin
purple_plugins_find_with_id(id)
	const char *id

void
purple_plugins_get_loaded()
PREINIT:
	GList *l;
PPCODE:
	for (l = purple_plugins_get_loaded(); l != NULL; l = l->next) {
		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Plugin")));
	}

void
purple_plugins_get_protocols()
PREINIT:
	GList *l;
PPCODE:
	for (l = purple_plugins_get_protocols(); l != NULL; l = l->next) {
		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Plugin")));
	}

void
purple_plugins_get_all()
PREINIT:
	GList *l;
PPCODE:
	for (l = purple_plugins_get_all(); l != NULL; l = l->next) {
		XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Plugin")));
	}

Purple::Handle
purple_plugins_get_handle()

mercurial