Commit 2fb61c09 authored by Chyla Zbigniew's avatar Chyla Zbigniew

Defined gnumeric_plugin_version variable containing Gnumeric version


* plugins/applix/boot.c plugins/dif/dif.c plugins/excel/boot.c
plugins/gb/plugin.c plugins/gda/plugin-gda.c plugins/guile/plugin.c
plugins/html/boot.c plugins/html/boot.h plugins/html/html.c
plugins/html/html.h plugins/html/latex.c plugins/html/latex.h
plugins/html/roff.c plugins/html/roff.h plugins/lotus-123/boot.c
plugins/numtheory/numtheory.c plugins/oleo/boot.c
plugins/plan-perfect/pln.c plugins/python/python.c plugins/sc/sc.c
plugins/sylk/sylk.c plugins/xbase/boot.c plugins/xml2/xml2.c:
Defined gnumeric_plugin_version variable containing Gnumeric version
string for every plugin.
Added user_data parameter to "probe", "open" and "save" functions.
Changed PluginData to PluginInfo.
Modified can_deactivate_plugin, cleanup_plugin and init_plugin
functions to match new prototypes in plugin.h.
Storing registered opener_id/saver_id in variables and using them
while unregistering.

* plugins/applix/Makefile.am plugins/dif/Makefile.am
plugins/gda/Makefile.am plugins/html/Makefile.am
plugins/lotus-123/Makefile.am plugins/numtheory/Makefile.am
plugins/oleo/Makefile.am plugins/plan-perfect/Makefile.am
plugins/sc/Makefile.am plugins/sylk/Makefile.am
plugins/xbase/Makefile.am plugins/xml2/Makefile.am:
Installing every plugin in separate directory, together with plugin
descriptions (plugin.xml files).

* plugins/applix/plugin.xml, plugins/dif/plugin.xml,
plugins/gda/plugin.xml, plugins/html/plugin.xml,
plugins/lotus-123/plugin.xml, plugins/numtheory/plugin.xml,
plugins/oleo/plugin.xml, plugins/plan-perfect/plugin.xml,
plugins/python/plugin.xml, plugins/sc/plugin.xml,
plugins/sylk/plugin.xml, plugins/xbase/plugin.xml,
plugins/xml2/plugin.xml:
New files - plugin descriptions in XML files.
parent fbc4a7c5
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c plugins/dif/dif.c plugins/excel/boot.c
plugins/gb/plugin.c plugins/gda/plugin-gda.c plugins/guile/plugin.c
plugins/html/boot.c plugins/html/boot.h plugins/html/html.c
plugins/html/html.h plugins/html/latex.c plugins/html/latex.h
plugins/html/roff.c plugins/html/roff.h plugins/lotus-123/boot.c
plugins/numtheory/numtheory.c plugins/oleo/boot.c
plugins/plan-perfect/pln.c plugins/python/python.c plugins/sc/sc.c
plugins/sylk/sylk.c plugins/xbase/boot.c plugins/xml2/xml2.c:
Defined gnumeric_plugin_version variable containing Gnumeric version
string for every plugin.
Added user_data parameter to "probe", "open" and "save" functions.
Changed PluginData to PluginInfo.
Modified can_deactivate_plugin, cleanup_plugin and init_plugin
functions to match new prototypes in plugin.h.
Storing registered opener_id/saver_id in variables and using them
while unregistering.
* plugins/applix/Makefile.am plugins/dif/Makefile.am
plugins/gda/Makefile.am plugins/html/Makefile.am
plugins/lotus-123/Makefile.am plugins/numtheory/Makefile.am
plugins/oleo/Makefile.am plugins/plan-perfect/Makefile.am
plugins/sc/Makefile.am plugins/sylk/Makefile.am
plugins/xbase/Makefile.am plugins/xml2/Makefile.am:
Installing every plugin in separate directory, together with plugin
descriptions (plugin.xml files).
* plugins/applix/plugin.xml, plugins/dif/plugin.xml,
plugins/gda/plugin.xml, plugins/html/plugin.xml,
plugins/lotus-123/plugin.xml, plugins/numtheory/plugin.xml,
plugins/oleo/plugin.xml, plugins/plan-perfect/plugin.xml,
plugins/python/plugin.xml, plugins/sc/plugin.xml,
plugins/sylk/plugin.xml, plugins/xbase/plugin.xml,
plugins/xml2/plugin.xml:
New files - plugin descriptions in XML files.
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am (GNUMERIC_BASE_SOURCES): Added error-info.[ch]
......
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c plugins/dif/dif.c plugins/excel/boot.c
plugins/gb/plugin.c plugins/gda/plugin-gda.c plugins/guile/plugin.c
plugins/html/boot.c plugins/html/boot.h plugins/html/html.c
plugins/html/html.h plugins/html/latex.c plugins/html/latex.h
plugins/html/roff.c plugins/html/roff.h plugins/lotus-123/boot.c
plugins/numtheory/numtheory.c plugins/oleo/boot.c
plugins/plan-perfect/pln.c plugins/python/python.c plugins/sc/sc.c
plugins/sylk/sylk.c plugins/xbase/boot.c plugins/xml2/xml2.c:
Defined gnumeric_plugin_version variable containing Gnumeric version
string for every plugin.
Added user_data parameter to "probe", "open" and "save" functions.
Changed PluginData to PluginInfo.
Modified can_deactivate_plugin, cleanup_plugin and init_plugin
functions to match new prototypes in plugin.h.
Storing registered opener_id/saver_id in variables and using them
while unregistering.
* plugins/applix/Makefile.am plugins/dif/Makefile.am
plugins/gda/Makefile.am plugins/html/Makefile.am
plugins/lotus-123/Makefile.am plugins/numtheory/Makefile.am
plugins/oleo/Makefile.am plugins/plan-perfect/Makefile.am
plugins/sc/Makefile.am plugins/sylk/Makefile.am
plugins/xbase/Makefile.am plugins/xml2/Makefile.am:
Installing every plugin in separate directory, together with plugin
descriptions (plugin.xml files).
* plugins/applix/plugin.xml, plugins/dif/plugin.xml,
plugins/gda/plugin.xml, plugins/html/plugin.xml,
plugins/lotus-123/plugin.xml, plugins/numtheory/plugin.xml,
plugins/oleo/plugin.xml, plugins/plan-perfect/plugin.xml,
plugins/python/plugin.xml, plugins/sc/plugin.xml,
plugins/sylk/plugin.xml, plugins/xbase/plugin.xml,
plugins/xml2/plugin.xml:
New files - plugin descriptions in XML files.
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am (GNUMERIC_BASE_SOURCES): Added error-info.[ch]
......
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c plugins/dif/dif.c plugins/excel/boot.c
plugins/gb/plugin.c plugins/gda/plugin-gda.c plugins/guile/plugin.c
plugins/html/boot.c plugins/html/boot.h plugins/html/html.c
plugins/html/html.h plugins/html/latex.c plugins/html/latex.h
plugins/html/roff.c plugins/html/roff.h plugins/lotus-123/boot.c
plugins/numtheory/numtheory.c plugins/oleo/boot.c
plugins/plan-perfect/pln.c plugins/python/python.c plugins/sc/sc.c
plugins/sylk/sylk.c plugins/xbase/boot.c plugins/xml2/xml2.c:
Defined gnumeric_plugin_version variable containing Gnumeric version
string for every plugin.
Added user_data parameter to "probe", "open" and "save" functions.
Changed PluginData to PluginInfo.
Modified can_deactivate_plugin, cleanup_plugin and init_plugin
functions to match new prototypes in plugin.h.
Storing registered opener_id/saver_id in variables and using them
while unregistering.
* plugins/applix/Makefile.am plugins/dif/Makefile.am
plugins/gda/Makefile.am plugins/html/Makefile.am
plugins/lotus-123/Makefile.am plugins/numtheory/Makefile.am
plugins/oleo/Makefile.am plugins/plan-perfect/Makefile.am
plugins/sc/Makefile.am plugins/sylk/Makefile.am
plugins/xbase/Makefile.am plugins/xml2/Makefile.am:
Installing every plugin in separate directory, together with plugin
descriptions (plugin.xml files).
* plugins/applix/plugin.xml, plugins/dif/plugin.xml,
plugins/gda/plugin.xml, plugins/html/plugin.xml,
plugins/lotus-123/plugin.xml, plugins/numtheory/plugin.xml,
plugins/oleo/plugin.xml, plugins/plan-perfect/plugin.xml,
plugins/python/plugin.xml, plugins/sc/plugin.xml,
plugins/sylk/plugin.xml, plugins/xbase/plugin.xml,
plugins/xml2/plugin.xml:
New files - plugin descriptions in XML files.
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am (GNUMERIC_BASE_SOURCES): Added error-info.[ch]
......
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c plugins/dif/dif.c plugins/excel/boot.c
plugins/gb/plugin.c plugins/gda/plugin-gda.c plugins/guile/plugin.c
plugins/html/boot.c plugins/html/boot.h plugins/html/html.c
plugins/html/html.h plugins/html/latex.c plugins/html/latex.h
plugins/html/roff.c plugins/html/roff.h plugins/lotus-123/boot.c
plugins/numtheory/numtheory.c plugins/oleo/boot.c
plugins/plan-perfect/pln.c plugins/python/python.c plugins/sc/sc.c
plugins/sylk/sylk.c plugins/xbase/boot.c plugins/xml2/xml2.c:
Defined gnumeric_plugin_version variable containing Gnumeric version
string for every plugin.
Added user_data parameter to "probe", "open" and "save" functions.
Changed PluginData to PluginInfo.
Modified can_deactivate_plugin, cleanup_plugin and init_plugin
functions to match new prototypes in plugin.h.
Storing registered opener_id/saver_id in variables and using them
while unregistering.
* plugins/applix/Makefile.am plugins/dif/Makefile.am
plugins/gda/Makefile.am plugins/html/Makefile.am
plugins/lotus-123/Makefile.am plugins/numtheory/Makefile.am
plugins/oleo/Makefile.am plugins/plan-perfect/Makefile.am
plugins/sc/Makefile.am plugins/sylk/Makefile.am
plugins/xbase/Makefile.am plugins/xml2/Makefile.am:
Installing every plugin in separate directory, together with plugin
descriptions (plugin.xml files).
* plugins/applix/plugin.xml, plugins/dif/plugin.xml,
plugins/gda/plugin.xml, plugins/html/plugin.xml,
plugins/lotus-123/plugin.xml, plugins/numtheory/plugin.xml,
plugins/oleo/plugin.xml, plugins/plan-perfect/plugin.xml,
plugins/python/plugin.xml, plugins/sc/plugin.xml,
plugins/sylk/plugin.xml, plugins/xbase/plugin.xml,
plugins/xml2/plugin.xml:
New files - plugin descriptions in XML files.
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am (GNUMERIC_BASE_SOURCES): Added error-info.[ch]
......
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/boot.c plugins/dif/dif.c plugins/excel/boot.c
plugins/gb/plugin.c plugins/gda/plugin-gda.c plugins/guile/plugin.c
plugins/html/boot.c plugins/html/boot.h plugins/html/html.c
plugins/html/html.h plugins/html/latex.c plugins/html/latex.h
plugins/html/roff.c plugins/html/roff.h plugins/lotus-123/boot.c
plugins/numtheory/numtheory.c plugins/oleo/boot.c
plugins/plan-perfect/pln.c plugins/python/python.c plugins/sc/sc.c
plugins/sylk/sylk.c plugins/xbase/boot.c plugins/xml2/xml2.c:
Defined gnumeric_plugin_version variable containing Gnumeric version
string for every plugin.
Added user_data parameter to "probe", "open" and "save" functions.
Changed PluginData to PluginInfo.
Modified can_deactivate_plugin, cleanup_plugin and init_plugin
functions to match new prototypes in plugin.h.
Storing registered opener_id/saver_id in variables and using them
while unregistering.
* plugins/applix/Makefile.am plugins/dif/Makefile.am
plugins/gda/Makefile.am plugins/html/Makefile.am
plugins/lotus-123/Makefile.am plugins/numtheory/Makefile.am
plugins/oleo/Makefile.am plugins/plan-perfect/Makefile.am
plugins/sc/Makefile.am plugins/sylk/Makefile.am
plugins/xbase/Makefile.am plugins/xml2/Makefile.am:
Installing every plugin in separate directory, together with plugin
descriptions (plugin.xml files).
* plugins/applix/plugin.xml, plugins/dif/plugin.xml,
plugins/gda/plugin.xml, plugins/html/plugin.xml,
plugins/lotus-123/plugin.xml, plugins/numtheory/plugin.xml,
plugins/oleo/plugin.xml, plugins/plan-perfect/plugin.xml,
plugins/python/plugin.xml, plugins/sc/plugin.xml,
plugins/sylk/plugin.xml, plugins/xbase/plugin.xml,
plugins/xml2/plugin.xml:
New files - plugin descriptions in XML files.
2001-01-25 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am (GNUMERIC_BASE_SOURCES): Added error-info.[ch]
......
......@@ -4,6 +4,8 @@ INCLUDES = \
-I$(includedir) -I$(top_srcdir)/src \
$(GNOME_INCLUDEDIR)
gnumeric_plugin_LTLIBRARIES = gnum_applix.la
gnum_applix_la_LDFLAGS = -module -avoid-version
gnum_applix_la_SOURCES = boot.c applix.h applix-read.c
gnumeric_plugin_applixdir = $(gnumeric_plugindir)/applix
gnumeric_plugin_applix_DATA = plugin.xml
gnumeric_plugin_applix_LTLIBRARIES = applix.la
applix_la_LDFLAGS = -module -avoid-version
applix_la_SOURCES = boot.c applix.h applix-read.c
......@@ -35,8 +35,12 @@
#include <string.h>
#include <gnome.h>
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
static FileOpenerId applix_opener_id;
static gboolean
applix_probe (const char *filename)
applix_probe (const char *filename, gpointer user_data)
{
gboolean res;
FILE *file;
......@@ -60,7 +64,7 @@ applix_probe (const char *filename)
static int
applix_load (IOContext *context, WorkbookView *wb_view,
const char *filename)
const char *filename, gpointer user_data)
{
int res;
FILE *file = gnumeric_fopen (context, filename, "r");
......@@ -72,37 +76,30 @@ applix_load (IOContext *context, WorkbookView *wb_view,
if (res == 0)
workbook_set_saveinfo (wb_view_workbook (wb_view),
filename, FILE_FL_MANUAL, NULL);
filename, FILE_FL_MANUAL, FILE_SAVER_ID_INVAID);
return res;
}
static int
applix_can_unload (PluginData *pd)
gboolean
can_deactivate_plugin (PluginInfo *pinfo)
{
return TRUE;
}
static void
applix_cleanup_plugin (PluginData *pd)
gboolean
cleanup_plugin (PluginInfo *pinfo)
{
file_format_unregister_open (applix_probe, applix_load);
file_format_unregister_open (applix_opener_id);
return TRUE;
}
PluginInitResult
init_plugin (CommandContext *context, PluginData *pd)
gboolean
init_plugin (PluginInfo *pinfo, ErrorInfo **ret_error)
{
applix_opener_id = file_format_register_open (
100, _("Applix (*.as) file format"),
&applix_probe, &applix_load, NULL);
if (plugin_version_mismatch (context, pd, GNUMERIC_VERSION))
return PLUGIN_QUIET_ERROR;
file_format_register_open (100,
_("Applix (*.as) file format"),
&applix_probe, &applix_load);
if (plugin_data_init (pd, &applix_can_unload, &applix_cleanup_plugin,
_("Applix"),
_("Imports version 4.[234] spreadsheets")))
return PLUGIN_OK;
return PLUGIN_ERROR;
return TRUE;
}
<?xml version="1.0"?>
<gnumeric_plugin_group>
<plugin id="Gnumeric_applix">
<information name="Applix" description="Imports version 4.[234] spreadsheets"/>
<activation type="g_module" module_file="applix.so"/>
</plugin>
</gnumeric_plugin_group>
......@@ -3,6 +3,8 @@ INCLUDES = \
-I$(includedir) -I$(top_srcdir)/src \
$(GNOME_INCLUDEDIR)
gnumeric_plugin_LTLIBRARIES = gnum_dif.la
gnum_dif_la_LDFLAGS = -module -avoid-version
gnum_dif_la_SOURCES = dif.h dif.c
gnumeric_plugin_difdir = $(gnumeric_plugindir)/dif
gnumeric_plugin_dif_DATA = plugin.xml
gnumeric_plugin_dif_LTLIBRARIES = dif.la
dif_la_LDFLAGS = -module -avoid-version
dif_la_SOURCES = dif.h dif.c
......@@ -17,6 +17,7 @@
#include <errno.h>
#include <gnome.h>
#include "plugin.h"
#include "plugin-util.h"
#include "gnumeric.h"
#include "cell.h"
#include "value.h"
......@@ -26,9 +27,14 @@
#include "workbook-view.h"
#include "workbook.h"
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
static FileOpenerId dif_opener_id;
static FileSaverId dif_saver_id;
static int
dif_write_workbook (IOContext *context,
WorkbookView *wb_view, const char *filename);
dif_write_workbook (IOContext *context, WorkbookView *wb_view,
const char *filename, gpointer user_data);
typedef struct {
char const *data, *cur;
......@@ -245,7 +251,7 @@ g_warning("DIF SUCCESS");
static int
dif_read_workbook (IOContext *context, WorkbookView *wb_view,
char const *filename)
char const *filename, gpointer user_data)
{
int result = 0;
int len;
......@@ -278,10 +284,9 @@ dif_read_workbook (IOContext *context, WorkbookView *wb_view,
gnumeric_io_error_read (context,
_("DIF : Failed to load sheet"));
result = -1;
} else
workbook_set_saveinfo (wb, filename, FILE_FL_MANUAL,
dif_write_workbook);
} else {
workbook_set_saveinfo (wb, filename, FILE_FL_MANUAL, dif_saver_id);
}
munmap((char *)data, len);
} else {
result = -1;
......@@ -320,8 +325,8 @@ dif_write_cell (FILE *f, Cell const *cell)
* write every sheet of the workbook to a DIF format file
*/
static int
dif_write_workbook (IOContext *context,
WorkbookView *wb_view, const char *filename)
dif_write_workbook (IOContext *context, WorkbookView *wb_view,
const char *filename, gpointer user_data)
{
Workbook *wb = wb_view_workbook (wb_view);
GList *sheet_list;
......@@ -389,38 +394,29 @@ out:
}
static int
dif_can_unload (PluginData *pd)
gboolean
can_deactivate_plugin (PluginInfo *pinfo)
{
/* We can always unload */
return TRUE;
}
static void
dif_cleanup_plugin (PluginData *pd)
gboolean
cleanup_plugin (PluginInfo *pinfo)
{
file_format_unregister_open (NULL, dif_read_workbook);
file_format_unregister_save (dif_write_workbook);
file_format_unregister_open (dif_opener_id);
file_format_unregister_save (dif_saver_id);
return TRUE;
}
PluginInitResult
init_plugin (CommandContext *context, PluginData * pd)
gboolean
init_plugin (PluginInfo *pinfo, ErrorInfo **ret_error)
{
if (plugin_version_mismatch (context, pd, GNUMERIC_VERSION))
return PLUGIN_QUIET_ERROR;
file_format_register_open (1,
_("Data Interchange Format (*.dif) file format"),
NULL, &dif_read_workbook);
file_format_register_save (".dif",
_("Data Interchange Format (*.dif)"),
FILE_FL_MANUAL, &dif_write_workbook);
if (plugin_data_init (pd, &dif_can_unload, &dif_cleanup_plugin,
_("Data Interchange Format (CSV) module"),
_("Reads and writes information stored in the Data Interchange Format (*.dif)")))
return PLUGIN_OK;
else
return PLUGIN_ERROR;
dif_opener_id = file_format_register_open (
1, _("Data Interchange Format (*.dif) file format"),
NULL, &dif_read_workbook, NULL);
dif_saver_id = file_format_register_save (
".dif", _("Data Interchange Format (*.dif)"),
FILE_FL_MANUAL, &dif_write_workbook, NULL);
return TRUE;
}
<?xml version="1.0"?>
<gnumeric_plugin_group>
<plugin id="Gnumeric_dif">
<information name="Data Interchange Format (CSV) module" description="Reads and writes information stored in the Data Interchange Format (*.dif)"/>
<activation type="g_module" module_file="dif.so"/>
</plugin>
</gnumeric_plugin_group>
......@@ -18,6 +18,7 @@
#include "io-context.h"
#include "workbook-view.h"
#include "workbook.h"
#include "plugin-util.h"
#include "excel.h"
#include "ms-summary.h"
......@@ -26,12 +27,15 @@
extern int ms_excel_read_debug;
MsExcelReadGbFn ms_excel_read_gb = NULL;
static FileOpenerId excel_opener_id;
static FileSaverId excel95_saver_id, excel98_saver_id;
static int
excel_save_95 (IOContext *context, WorkbookView *wb_view,
const char *filename);
const char *filename, gpointer user_data);
static gboolean
excel_probe (const char *filename)
excel_probe (const char *filename, gpointer user_data)
{
MsOle *file;
......@@ -58,15 +62,16 @@ excel_probe (const char *filename)
/*
* excel_load
* @context: Command context
* @wb: Workbook
* @wb: Workbook
* @filename: File name
* @user_data: ignored
*
* Load en excel workbook.
* Returns 0 on success, -1 on failure.
*/
static int
excel_load (IOContext *context, WorkbookView *new_wb_view,
const char *filename)
const char *filename, gpointer user_data)
{
MsOleErr ole_error;
MsOle *f;
......@@ -95,8 +100,7 @@ excel_load (IOContext *context, WorkbookView *new_wb_view,
g_warning ("Failed to read Basic scripts");
}
workbook_set_saveinfo (wb, filename, FILE_FL_MANUAL,
excel_save_95);
workbook_set_saveinfo (wb, filename, FILE_FL_MANUAL, excel95_saver_id);
}
ms_ole_destroy (&f);
......@@ -161,14 +165,14 @@ excel_save (IOContext *context, WorkbookView *wb_view, const char *filename,
static int
excel_save_98 (IOContext *context, WorkbookView *wb_view,
const char *filename)
const char *filename, gpointer user_data)
{
return excel_save (context, wb_view, filename, MS_BIFF_V8);
}
static int
excel_save_95 (IOContext *context, WorkbookView *wb_view,
const char *filename)
const char *filename, gpointer user_data)
{
return excel_save (context, wb_view, filename, MS_BIFF_V7);
}
......@@ -177,17 +181,17 @@ void
excel_init (void)
{
/* We register Excel format with a precendence of 100 */
file_format_register_open (100,
_("Microsoft(R) Excel file format"),
&excel_probe, &excel_load);
if (gnumeric_debugging > 0)
file_format_register_save (".xls",
_("Excel(R) 97 file format"),
FILE_FL_MANUAL, &excel_save_98);
file_format_register_save (".xls",
_("Excel(R) 95 file format"),
FILE_FL_MANUAL, &excel_save_95);
excel_opener_id = file_format_register_open (
100, _("Microsoft(R) Excel file format"),
&excel_probe, &excel_load, NULL);
if (gnumeric_debugging > 0) {
excel98_saver_id = file_format_register_save (
".xls", _("Excel(R) 97 file format"),
FILE_FL_MANUAL, &excel_save_98, NULL);
}
excel95_saver_id = file_format_register_save (
".xls", _("Excel(R) 95 file format"),
FILE_FL_MANUAL, &excel_save_95, NULL);
}
void
......
......@@ -29,6 +29,7 @@
#include "gnumeric.h"
#include "plugin.h"
#include "plugin-util.h"
#include "expr.h"
#include "func.h"
......@@ -39,6 +40,8 @@
#include "excel-gb-context.h"
#include "../excel/excel.h"
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
#ifndef MAP_FAILED
/* Someone needs their head examining - BSD ? */
# define MAP_FAILED ((void *)-1)
......
GDA_TARGET = gnum_gdaif.la
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) -I$(top_srcdir)/src \
$(GNOME_INCLUDEDIR) \
$(GDA_CFLAGS)
gnumeric_plugin_LTLIBRARIES = $(GDA_TARGET)
gnum_gdaif_la_LDFLAGS = -module -avoid-version
gnum_gdaif_la_SOURCES = plugin-gda.c
gnum_gdaif_la_LIBADD = $(GDA_LIBS)
gnumeric_plugin_gdaifdir = $(gnumeric_plugindir)/gdaif
gnumeric_plugin_gdaif_DATA = plugin.xml
gnumeric_plugin_gdaif_LTLIBRARIES = gdaif.la
gdaif_la_LDFLAGS = -module -avoid-version
gdaif_la_SOURCES = plugin-gda.c
gdaif_la_LIBADD = $(GDA_LIBS)
......@@ -24,8 +24,11 @@
#include "gnumeric.h"
#include "func.h"
#include "plugin.h"
#include "plugin-util.h"
#include "expr.h"
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
static Gda_ConnectionPool* connection_pool = NULL;
static Value *
......@@ -156,11 +159,8 @@ gnumeric_execSQL (FunctionEvalInfo *ei, Value **args)
return ret;
}
/*
+ Plugin initialization
*/
static int
can_unload (PluginData *pd)
gboolean
can_deactivate_plugin (PluginInfo *pinfo)
{
FunctionDefinition *func;
......@@ -168,8 +168,8 @@ can_unload (PluginData *pd)
return func != NULL && func->ref_count <= 1;
}
static void
cleanup_plugin (PluginData *pd)
gboolean
cleanup_plugin (PluginInfo *pinfo)
{
FunctionDefinition *func;
......@@ -183,25 +183,18 @@ cleanup_plugin (PluginData *pd)
gda_connection_pool_free(connection_pool);
connection_pool = NULL;
}
return TRUE;
}
PluginInitResult
init_plugin (CommandContext *context, PluginData *pd)
gboolean
init_plugin (PluginInfo *pinfo, ErrorInfo **ret_error)
{
FunctionCategory *cat;
if (plugin_version_mismatch (context, pd, GNUMERIC_VERSION))
return PLUGIN_QUIET_ERROR;
/* register functions */
cat = function_get_category(_("Database"));
function_add_args(cat, "execSQL", "ssss", "dsn,username,password,sql", &help_execSQL, gnumeric_execSQL);
if (plugin_data_init (pd, can_unload, cleanup_plugin,
_("Database"),
_("Database functions for allowing the retrieval of data from a database")))
return PLUGIN_OK;
else
return PLUGIN_ERROR;
return TRUE;
}
<?xml version="1.0"?>
<gnumeric_plugin_group>
<plugin id="Gnumeric_gdaif">
<information name="Database" description="Database functions for allowing the retrieval of data from a database"/>
<activation type="g_module" module_file="gdaif.so"/>
</plugin>
</gnumeric_plugin_group>
......@@ -31,6 +31,7 @@
#include "gnumeric.h"
#include "plugin.h"
#include "plugin-util.h"
#include "expr.h"
#include "gutils.h"
#include "func.h"
......@@ -41,6 +42,7 @@
#include "guile-support.h"
#include "smob-value.h"
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
/* This is damn ugly.
* However, it will get things working again (I hope)
......
......@@ -3,9 +3,11 @@ INCLUDES = \
-I$(includedir) -I$(top_srcdir)/src \
$(GNOME_INCLUDEDIR)
gnumeric_plugin_LTLIBRARIES = gnum_html.la
gnum_html_la_LDFLAGS = -module -avoid-version
gnum_html_la_SOURCES = \
gnumeric_plugin_htmldir = $(gnumeric_plugindir)/html
gnumeric_plugin_html_DATA = plugin.xml
gnumeric_plugin_html_LTLIBRARIES = html.la
html_la_LDFLAGS = -module -avoid-version
html_la_SOURCES = \
boot.h boot.c \
html.h html.c \
latex.h latex.c \
......
......@@ -35,11 +35,22 @@
#include "epsf.h"
#endif
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
static FileOpenerId html_opener_id;
static FileSaverId html32_saver_id, html40_saver_id,
latex_saver_id, latex2e_saver_id,
dvi_saver_id, troff_saver_id,
pdf_saver_id;
#ifdef SUPPORT_OLD_EPSF
static FileSaverId eps_saver_id;
#endif
/*
* We can unload
*/
static int
html_can_unload (PluginData *pd)
gboolean
can_deactivate_plugin (PluginInfo *pinfo)
{
return TRUE;
}
......@@ -47,20 +58,24 @@ html_can_unload (PluginData *pd)
/*
* called when unloading the plugin
*/
static void
html_cleanup_plugin (PluginData *pd)
gboolean
cleanup_plugin (PluginInfo *pinfo)
{
file_format_unregister_save (html_write_wb_html32);
file_format_unregister_save (html_write_wb_html40);
file_format_unregister_save (html_write_wb_latex);
file_format_unregister_save (html_write_wb_latex2e);
file_format_unregister_save (html_write_wb_roff_dvi);
file_format_unregister_save (html_write_wb_roff_pdf);
file_format_unregister_save (html_write_wb_roff);
file_format_unregister_save (html32_saver_id);
file_format_unregister_save (html40_saver_id);
file_format_unregister_save (latex_saver_id);
file_format_unregister_save (latex2e_saver_id);
file_format_unregister_save (dvi_saver_id);
file_format_unregister_save (pdf_saver_id);
file_format_unregister_save (troff_saver_id);
#ifdef SUPPORT_OLD_EPSF
file_format_unregister_save (epsf_write_wb);
file_format_unregister_save (eps_saver_id);
#endif
file_format_unregister_open (NULL,html_read);
file_format_unregister_open (html_opener_id);
set_default_file_saver_id (html32_saver_id);
return TRUE;
}
/*
......@@ -69,64 +84,53 @@ html_cleanup_plugin (PluginData *pd)
static void
html_init (void)
{
char *desc;
desc = _("HTML 3.2 file format (*.html)");
file_format_register_save (".html", desc, FILE_FL_AUTO,
html_write_wb_html32);
html32_saver_id = file_format_register_save (
".html", _("HTML 3.2 file format (*.html)"),
FILE_FL_AUTO, html_write_wb_html32, NULL);