Commit 33aada25 authored by Chyla Zbigniew's avatar Chyla Zbigniew

Conversion to new plugins code.


* Makefile.am, plugin.c, plugin.xml:
Conversion to new plugins code.
parent 5429c720
2001-01-27 Zbigniew Chyla <cyba@gnome.pl>
* Makefile.am, plugin.c, plugin.xml:
Conversion to new plugins code.
2000-12-17 Jody Goldberg <jgoldberg@home.com>
* Release 0.61
......
# Do not build by default until we are ready.
#if WITH_PERL
PERL_TARGET = gnum_perl.so
PERL_PROGRAMS_TARGET = perl.so
PERL_DATA_TARGET = plugin.xml
#else
#PERL_TARGET =
#PERL_PROGRAMS_TARGET =
#PERL_DATA_TARGET =
#endif
gnperldir = $(gnumeric_datadir)/perl
......@@ -15,12 +17,14 @@ PERL_CFLAGS = -I../.. $(PERL_CCCDLFLAGS) \
#
# Do not build the plugin until there is a maintainer
#
gnumeric_plugin_PROGRAMS = $(PERL_TARGET)
gnum_perl_so_SOURCES = perl.c
gnumeric_plugin_perldir = $(gnumeric_plugindir)/perl
gnumeric_plugin_perl_DATA = $(PERL_DATA_TARGET)
gnumeric_plugin_perl_PROGRAMS = $(PERL_PROGRAMS_TARGET)
perl_so_SOURCES = perl.c
gnum_perl.so: perl.o xsinit.o ext.timestamp
-$(PERL_LD) $(PERL_LDDLFLAGS) -o gnum_perl.so perl.o xsinit.o $(PERL_LDOPTS)
perl.so: perl.o xsinit.o ext.timestamp
-$(PERL_LD) $(PERL_LDDLFLAGS) -o perl.so perl.o xsinit.o $(PERL_LDOPTS)
perl.o: $(srcdir)/perl.c
$(PERL_CC) $(PERL_CFLAGS) -c $(srcdir)/perl.c
......
......@@ -10,36 +10,35 @@
#undef dirty
#include <glib.h>
#include <gnome.h>
#include "../../src/gnumeric.h"
#include "../../src/plugin.h"
#include "gnumeric.h"
#include "plugin.h"
#define dirty _perl_dirty
#undef _perl_dirty
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
extern void xs_init(void);
static PerlInterpreter *gnumeric_perl_interp;
static int
no_unloading_for_me (PluginData *pd)
gboolean
can_deactivate_plugin (PluginInfo *pinfo)
{
return 0;
return FALSE;
}
static void
no_cleanup_for_me (PluginData *pd)
gboolean
cleanup_plugin (PluginInfo *pinfo)
{
return;
return TRUE;
}
PluginInitResult
init_plugin (CommandContext *context, PluginData *pd)
gboolean
init_plugin (PluginInfo *pinfo, ErrorInfo **ret_error)
{
char *argv[] = { "", NULL, NULL, NULL };
char *arg;
if (plugin_version_mismatch (context, pd, GNUMERIC_VERSION))
return PLUGIN_QUIET_ERROR;
/* Initialize the Perl interpreter. */
arg = gnumeric_sys_data_dir ("perl");
argv[1] = g_strconcat("-I", arg, NULL);
......@@ -50,11 +49,5 @@ init_plugin (CommandContext *context, PluginData *pd)
perl_parse(gnumeric_perl_interp, xs_init, 3, argv, NULL);
perl_run(gnumeric_perl_interp);
if (plugin_data_init (pd, no_unloading_for_me, no_cleanup_for_me,
_("Perl"),
_("Enables the creation of functions in PERL")))
return PLUGIN_OK;
else
return PLUGIN_ERROR;
return TRUE;
}
<?xml version="1.0"?>
<gnumeric_plugin_group>
<plugin id="Gnumeric_perl">
<information name="Perl" description="Enables the creation of functions in Perl"/>
<activation type="g_module" module_file="perl.so"/>
</plugin>
</gnumeric_plugin_group>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment