Commit 6ba33eed authored by Chyla Zbigniew's avatar Chyla Zbigniew
Browse files

Export "file_opener" plugin service (+ "file_saver" for dif and html). Use


* plugins/applix/applix-read.c,
plugins/applix/applix.h, plugins/applix/boot.c,
plugins/applix/plugin.xml,
plugins/dif/dif.c, /plugins/dif/plugin.xml,
plugins/html/boot.c, plugins/html/html.c,
plugins/html/html.h, /plugins/html/latex.c,
plugins/html/latex.h, plugins/html/plugin.xml,
plugins/html/roff.c, /plugins/html/roff.h,
plugins/lotus-123/boot.c, plugins/lotus-123/lotus.c,
plugins/lotus-123/lotus.h, plugins/lotus-123/plugin.xml,
plugins/oleo/boot.c, plugins/oleo/oleo.c,
plugins/oleo/oleo.h, plugins/oleo/plugin.xml,
plugins/plan-perfect/pln.c, plugins/plan-perfect/plugin.xml,
plugins/sc/plugin.xml, plugins/sc/sc.c,
plugins/sylk/plugin.xml, plugins/sylk/sylk.c,
plugins/xbase/boot.c, plugins/xbase/plugin.xml,
plugins/xbase/xbase.c, plugins/xbase/xbase.h,
plugins/xml2/plugin.xml, plugins/xml2/xml2.c:
Export "file_opener" plugin service (+ "file_saver" for dif and html).
Use ErrorInfo where needed.
Use GNUMERIC_MODULE_PLUGIN_INFO_DECL macro instead of
gnumeric_plugin_version[] declaration.

* plugins/numtheory/numtheory.c, plugins/numtheory/plugin.xml:
Export "function_group" plugin service.

* plugins/gb/plugin.c, plugins/gb/plugin.xml,
plugins/gda/plugin-gda.c, plugins/gda/plugin.xml,
plugins/guile/plugin.c, /plugins/guile/plugin.xml,
plugins/perl/perl.c, plugins/perl/plugin.xml,
plugins/python/Makefile.am, plugins/python/plugin.xml,
plugins/python/python.c:
Export "general" plugin service.
Use ErrorInfo where needed.
(init_plugin, can_deactivate_plugin, cleanup_plugin): Rename and
signature changes.

* plugins/excel/boot.c (excel_save_95, excel_save_98, excel_save, excel_probe,
excel_load): Signature changes.

* plugins/excel/ms-formula-write.c: Use accessor functions from
func.h instead of accessing FunctionDefinition struct directly.
parent a924975e
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/applix-read.c,
plugins/applix/applix.h, plugins/applix/boot.c,
plugins/applix/plugin.xml,
plugins/dif/dif.c, /plugins/dif/plugin.xml,
plugins/html/boot.c, plugins/html/html.c,
plugins/html/html.h, /plugins/html/latex.c,
plugins/html/latex.h, plugins/html/plugin.xml,
plugins/html/roff.c, /plugins/html/roff.h,
plugins/lotus-123/boot.c, plugins/lotus-123/lotus.c,
plugins/lotus-123/lotus.h, plugins/lotus-123/plugin.xml,
plugins/oleo/boot.c, plugins/oleo/oleo.c,
plugins/oleo/oleo.h, plugins/oleo/plugin.xml,
plugins/plan-perfect/pln.c, plugins/plan-perfect/plugin.xml,
plugins/sc/plugin.xml, plugins/sc/sc.c,
plugins/sylk/plugin.xml, plugins/sylk/sylk.c,
plugins/xbase/boot.c, plugins/xbase/plugin.xml,
plugins/xbase/xbase.c, plugins/xbase/xbase.h,
plugins/xml2/plugin.xml, plugins/xml2/xml2.c:
Export "file_opener" plugin service (+ "file_saver" for dif and html).
Use ErrorInfo where needed.
Use GNUMERIC_MODULE_PLUGIN_INFO_DECL macro instead of
gnumeric_plugin_version[] declaration.
* plugins/numtheory/numtheory.c, plugins/numtheory/plugin.xml:
Export "function_group" plugin service.
* plugins/gb/plugin.c, plugins/gb/plugin.xml,
plugins/gda/plugin-gda.c, plugins/gda/plugin.xml,
plugins/guile/plugin.c, /plugins/guile/plugin.xml,
plugins/perl/perl.c, plugins/perl/plugin.xml,
plugins/python/Makefile.am, plugins/python/plugin.xml,
plugins/python/python.c:
Export "general" plugin service.
Use ErrorInfo where needed.
(init_plugin, can_deactivate_plugin, cleanup_plugin): Rename and
signature changes.
* plugins/excel/boot.c (excel_save_95, excel_save_98, excel_save, excel_probe,
excel_load): Signature changes.
* plugins/excel/ms-formula-write.c: Use accessor functions from
func.h instead of accessing FunctionDefinition struct directly.
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am: Added files: plugin-service.[ch],
......
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/applix-read.c,
plugins/applix/applix.h, plugins/applix/boot.c,
plugins/applix/plugin.xml,
plugins/dif/dif.c, /plugins/dif/plugin.xml,
plugins/html/boot.c, plugins/html/html.c,
plugins/html/html.h, /plugins/html/latex.c,
plugins/html/latex.h, plugins/html/plugin.xml,
plugins/html/roff.c, /plugins/html/roff.h,
plugins/lotus-123/boot.c, plugins/lotus-123/lotus.c,
plugins/lotus-123/lotus.h, plugins/lotus-123/plugin.xml,
plugins/oleo/boot.c, plugins/oleo/oleo.c,
plugins/oleo/oleo.h, plugins/oleo/plugin.xml,
plugins/plan-perfect/pln.c, plugins/plan-perfect/plugin.xml,
plugins/sc/plugin.xml, plugins/sc/sc.c,
plugins/sylk/plugin.xml, plugins/sylk/sylk.c,
plugins/xbase/boot.c, plugins/xbase/plugin.xml,
plugins/xbase/xbase.c, plugins/xbase/xbase.h,
plugins/xml2/plugin.xml, plugins/xml2/xml2.c:
Export "file_opener" plugin service (+ "file_saver" for dif and html).
Use ErrorInfo where needed.
Use GNUMERIC_MODULE_PLUGIN_INFO_DECL macro instead of
gnumeric_plugin_version[] declaration.
* plugins/numtheory/numtheory.c, plugins/numtheory/plugin.xml:
Export "function_group" plugin service.
* plugins/gb/plugin.c, plugins/gb/plugin.xml,
plugins/gda/plugin-gda.c, plugins/gda/plugin.xml,
plugins/guile/plugin.c, /plugins/guile/plugin.xml,
plugins/perl/perl.c, plugins/perl/plugin.xml,
plugins/python/Makefile.am, plugins/python/plugin.xml,
plugins/python/python.c:
Export "general" plugin service.
Use ErrorInfo where needed.
(init_plugin, can_deactivate_plugin, cleanup_plugin): Rename and
signature changes.
* plugins/excel/boot.c (excel_save_95, excel_save_98, excel_save, excel_probe,
excel_load): Signature changes.
* plugins/excel/ms-formula-write.c: Use accessor functions from
func.h instead of accessing FunctionDefinition struct directly.
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am: Added files: plugin-service.[ch],
......
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/applix-read.c,
plugins/applix/applix.h, plugins/applix/boot.c,
plugins/applix/plugin.xml,
plugins/dif/dif.c, /plugins/dif/plugin.xml,
plugins/html/boot.c, plugins/html/html.c,
plugins/html/html.h, /plugins/html/latex.c,
plugins/html/latex.h, plugins/html/plugin.xml,
plugins/html/roff.c, /plugins/html/roff.h,
plugins/lotus-123/boot.c, plugins/lotus-123/lotus.c,
plugins/lotus-123/lotus.h, plugins/lotus-123/plugin.xml,
plugins/oleo/boot.c, plugins/oleo/oleo.c,
plugins/oleo/oleo.h, plugins/oleo/plugin.xml,
plugins/plan-perfect/pln.c, plugins/plan-perfect/plugin.xml,
plugins/sc/plugin.xml, plugins/sc/sc.c,
plugins/sylk/plugin.xml, plugins/sylk/sylk.c,
plugins/xbase/boot.c, plugins/xbase/plugin.xml,
plugins/xbase/xbase.c, plugins/xbase/xbase.h,
plugins/xml2/plugin.xml, plugins/xml2/xml2.c:
Export "file_opener" plugin service (+ "file_saver" for dif and html).
Use ErrorInfo where needed.
Use GNUMERIC_MODULE_PLUGIN_INFO_DECL macro instead of
gnumeric_plugin_version[] declaration.
* plugins/numtheory/numtheory.c, plugins/numtheory/plugin.xml:
Export "function_group" plugin service.
* plugins/gb/plugin.c, plugins/gb/plugin.xml,
plugins/gda/plugin-gda.c, plugins/gda/plugin.xml,
plugins/guile/plugin.c, /plugins/guile/plugin.xml,
plugins/perl/perl.c, plugins/perl/plugin.xml,
plugins/python/Makefile.am, plugins/python/plugin.xml,
plugins/python/python.c:
Export "general" plugin service.
Use ErrorInfo where needed.
(init_plugin, can_deactivate_plugin, cleanup_plugin): Rename and
signature changes.
* plugins/excel/boot.c (excel_save_95, excel_save_98, excel_save, excel_probe,
excel_load): Signature changes.
* plugins/excel/ms-formula-write.c: Use accessor functions from
func.h instead of accessing FunctionDefinition struct directly.
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am: Added files: plugin-service.[ch],
......
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/applix-read.c,
plugins/applix/applix.h, plugins/applix/boot.c,
plugins/applix/plugin.xml,
plugins/dif/dif.c, /plugins/dif/plugin.xml,
plugins/html/boot.c, plugins/html/html.c,
plugins/html/html.h, /plugins/html/latex.c,
plugins/html/latex.h, plugins/html/plugin.xml,
plugins/html/roff.c, /plugins/html/roff.h,
plugins/lotus-123/boot.c, plugins/lotus-123/lotus.c,
plugins/lotus-123/lotus.h, plugins/lotus-123/plugin.xml,
plugins/oleo/boot.c, plugins/oleo/oleo.c,
plugins/oleo/oleo.h, plugins/oleo/plugin.xml,
plugins/plan-perfect/pln.c, plugins/plan-perfect/plugin.xml,
plugins/sc/plugin.xml, plugins/sc/sc.c,
plugins/sylk/plugin.xml, plugins/sylk/sylk.c,
plugins/xbase/boot.c, plugins/xbase/plugin.xml,
plugins/xbase/xbase.c, plugins/xbase/xbase.h,
plugins/xml2/plugin.xml, plugins/xml2/xml2.c:
Export "file_opener" plugin service (+ "file_saver" for dif and html).
Use ErrorInfo where needed.
Use GNUMERIC_MODULE_PLUGIN_INFO_DECL macro instead of
gnumeric_plugin_version[] declaration.
* plugins/numtheory/numtheory.c, plugins/numtheory/plugin.xml:
Export "function_group" plugin service.
* plugins/gb/plugin.c, plugins/gb/plugin.xml,
plugins/gda/plugin-gda.c, plugins/gda/plugin.xml,
plugins/guile/plugin.c, /plugins/guile/plugin.xml,
plugins/perl/perl.c, plugins/perl/plugin.xml,
plugins/python/Makefile.am, plugins/python/plugin.xml,
plugins/python/python.c:
Export "general" plugin service.
Use ErrorInfo where needed.
(init_plugin, can_deactivate_plugin, cleanup_plugin): Rename and
signature changes.
* plugins/excel/boot.c (excel_save_95, excel_save_98, excel_save, excel_probe,
excel_load): Signature changes.
* plugins/excel/ms-formula-write.c: Use accessor functions from
func.h instead of accessing FunctionDefinition struct directly.
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am: Added files: plugin-service.[ch],
......
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* plugins/applix/applix-read.c,
plugins/applix/applix.h, plugins/applix/boot.c,
plugins/applix/plugin.xml,
plugins/dif/dif.c, /plugins/dif/plugin.xml,
plugins/html/boot.c, plugins/html/html.c,
plugins/html/html.h, /plugins/html/latex.c,
plugins/html/latex.h, plugins/html/plugin.xml,
plugins/html/roff.c, /plugins/html/roff.h,
plugins/lotus-123/boot.c, plugins/lotus-123/lotus.c,
plugins/lotus-123/lotus.h, plugins/lotus-123/plugin.xml,
plugins/oleo/boot.c, plugins/oleo/oleo.c,
plugins/oleo/oleo.h, plugins/oleo/plugin.xml,
plugins/plan-perfect/pln.c, plugins/plan-perfect/plugin.xml,
plugins/sc/plugin.xml, plugins/sc/sc.c,
plugins/sylk/plugin.xml, plugins/sylk/sylk.c,
plugins/xbase/boot.c, plugins/xbase/plugin.xml,
plugins/xbase/xbase.c, plugins/xbase/xbase.h,
plugins/xml2/plugin.xml, plugins/xml2/xml2.c:
Export "file_opener" plugin service (+ "file_saver" for dif and html).
Use ErrorInfo where needed.
Use GNUMERIC_MODULE_PLUGIN_INFO_DECL macro instead of
gnumeric_plugin_version[] declaration.
* plugins/numtheory/numtheory.c, plugins/numtheory/plugin.xml:
Export "function_group" plugin service.
* plugins/gb/plugin.c, plugins/gb/plugin.xml,
plugins/gda/plugin-gda.c, plugins/gda/plugin.xml,
plugins/guile/plugin.c, /plugins/guile/plugin.xml,
plugins/perl/perl.c, plugins/perl/plugin.xml,
plugins/python/Makefile.am, plugins/python/plugin.xml,
plugins/python/python.c:
Export "general" plugin service.
Use ErrorInfo where needed.
(init_plugin, can_deactivate_plugin, cleanup_plugin): Rename and
signature changes.
* plugins/excel/boot.c (excel_save_95, excel_save_98, excel_save, excel_probe,
excel_load): Signature changes.
* plugins/excel/ms-formula-write.c: Use accessor functions from
func.h instead of accessing FunctionDefinition struct directly.
2001-02-24 Zbigniew Chyla <cyba@gnome.pl>
* src/Makefile.am: Added files: plugin-service.[ch],
......
......@@ -24,6 +24,7 @@
* USA
*/
#include "config.h"
#include <libgnome/libgnome.h>
#include "applix.h"
#include "application.h"
#include "expr.h"
......@@ -42,6 +43,7 @@
#include "io-context.h"
#include "workbook-view.h"
#include "workbook.h"
#include "error-info.h"
#include <ctype.h>
#include <string.h>
......@@ -50,14 +52,14 @@
static int debug_applix_read = 1;
typedef struct {
FILE *file;
IOContext *context;
WorkbookView *wb_view;
Workbook *wb;
GHashTable *exprs, *styles;
GPtrArray *colours;
GPtrArray *attrs;
GPtrArray *font_names;
FILE *file;
ErrorInfo *parse_error;
WorkbookView *wb_view;
Workbook *wb;
GHashTable *exprs, *styles;
GPtrArray *colours;
GPtrArray *attrs;
GPtrArray *font_names;
char *buffer;
int buffer_size;
......@@ -71,9 +73,12 @@ typedef struct {
static int
applix_parse_error (ApplixReadState *state, char const *msg)
{
gchar *tmp = g_strconcat ("APPLIX : ", msg, NULL);
gnumeric_io_error_read (state->context, msg);
g_free (tmp);
if (state->parse_error == NULL) {
state->parse_error = error_info_new_str (
_("Parse error while reading Applix file."));
}
error_info_add_details (state->parse_error,
error_info_new_str (msg));
return -1;
}
......@@ -1280,25 +1285,24 @@ cb_remove_style (gpointer key, gpointer value, gpointer user_data)
return TRUE;
}
int
applix_read (IOContext *context, WorkbookView *wb_view,
FILE *file)
void
applix_read (IOContext *io_context, WorkbookView *wb_view, FILE *file)
{
int i;
int res;
ApplixReadState state;
/* Init the state variable */
ApplixReadState state;
state.file = file;
state.context = context;
state.wb_view = wb_view;
state.wb = wb_view_workbook (wb_view);
state.exprs = g_hash_table_new (&g_int_hash, &g_int_equal);
state.styles = g_hash_table_new (&g_str_hash, &g_str_equal);
state.colours = g_ptr_array_new ();
state.attrs = g_ptr_array_new ();
state.font_names= g_ptr_array_new ();
state.buffer = NULL;
state.file = file;
state.parse_error = NULL;
state.wb_view = wb_view;
state.wb = wb_view_workbook (wb_view);
state.exprs = g_hash_table_new (&g_int_hash, &g_int_equal);
state.styles = g_hash_table_new (&g_str_hash, &g_str_equal);
state.colours = g_ptr_array_new ();
state.attrs = g_ptr_array_new ();
state.font_names = g_ptr_array_new ();
state.buffer = NULL;
/* Actualy read the workbook */
res = applix_read_impl (&state);
......@@ -1324,5 +1328,5 @@ applix_read (IOContext *context, WorkbookView *wb_view,
g_free (g_ptr_array_index(state.font_names, i));
g_ptr_array_free (state.font_names, TRUE);
return res;
gnumeric_io_error_info_set (io_context, state.parse_error);
}
#ifndef PLUGIN_APPLIX_H
# define PLUGIN_APPLIX_H
#define PLUGIN_APPLIX_H
#include "gnumeric.h"
#include "io-context.h"
#include <stdio.h>
gboolean applix_read_header (FILE *file);
int applix_read (IOContext *context, WorkbookView *wb_view,
FILE *file);
void applix_read (IOContext *io_context, WorkbookView *wb_view, FILE *file);
#endif /* PLUGIN_APPLIX_H */
......@@ -25,8 +25,10 @@
*/
#include "config.h"
#include "gnumeric.h"
#include "io-context.h"
#include "plugin.h"
#include "plugin-util.h"
#include "module-plugin-defs.h"
#include "applix.h"
#include "workbook-view.h"
#include "workbook.h"
......@@ -35,72 +37,42 @@
#include <string.h>
#include <gnome.h>
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
static FileOpenerId applix_opener_id;
gboolean applix_file_probe (FileOpener const *fo, const gchar *file_name);
void applix_file_open (FileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, const char *filename);
static gboolean
applix_probe (const char *filename, gpointer user_data)
gboolean
applix_file_probe (FileOpener const *fo, const gchar *file_name)
{
gboolean res;
FILE *file;
gboolean res;
if (g_strcasecmp ("as", g_extension_pointer (filename)) != 0) {
return FALSE;
file = fopen (file_name, "r");
if (file == NULL) {
res = FALSE;
} else {
res = applix_read_header (file);
fclose (file);
}
/* Use fopen rather than gnumeric_fopen because we do not want
* to report errors.
*/
file = fopen (filename, "r");
if (file == NULL)
return FALSE;
res = applix_read_header (file);
fclose (file);
return res;
}
static int
applix_load (IOContext *context, WorkbookView *wb_view,
const char *filename, gpointer user_data)
void
applix_file_open (FileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, const char *filename)
{
int res;
FILE *file = gnumeric_fopen (context, filename, "r");
if (file == NULL)
return -1;
res = applix_read (context, wb_view, file);
fclose (file);
if (res == 0)
workbook_set_saveinfo (wb_view_workbook (wb_view),
filename, FILE_FL_MANUAL_REMEMBER,
FILE_SAVER_ID_INVALID);
return res;
}
gboolean
can_deactivate_plugin (PluginInfo *pinfo)
{
return TRUE;
}
gboolean
cleanup_plugin (PluginInfo *pinfo)
{
file_format_unregister_open (applix_opener_id);
return TRUE;
}
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);
return TRUE;
FILE *file;
ErrorInfo *error;
file = gnumeric_fopen_error_info (filename, "r", &error);
if (file == NULL) {
gnumeric_io_error_info_set (io_context, error);
} else {
applix_read (io_context, wb_view, file);
fclose (file);
}
}
......@@ -2,6 +2,17 @@
<gnumeric_plugin_group>
<plugin id="Gnumeric_applix">
<information name="Applix" description="Imports version 4.[234] spreadsheets"/>
<activation type="g_module" module_file="applix.so"/>
<loader type="g_module">
<attribute name="module_file" value="applix.so"/>
</loader>
<services>
<service type="file_opener" id="applix" priority="100" probe="TRUE">
<information description="Applix (*.as) file format"/>
<file_patterns>
<file_pattern type="shell_pattern" value="*.as"/>
</file_patterns>
<save_info saver_id="" format_level="manual_remember"/>
</service>
</services>
</plugin>
</gnumeric_plugin_group>
......@@ -18,6 +18,7 @@
#include <gnome.h>
#include "plugin.h"
#include "plugin-util.h"
#include "module-plugin-defs.h"
#include "gnumeric.h"
#include "cell.h"
#include "value.h"
......@@ -26,14 +27,12 @@
#include "workbook-view.h"
#include "workbook.h"
gchar gnumeric_plugin_version[] = GNUMERIC_VERSION;
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
static FileOpenerId dif_opener_id;
static FileSaverId dif_saver_id;
static int
dif_write_workbook (IOContext *context, WorkbookView *wb_view,
const char *filename, gpointer user_data);
void dif_file_open (FileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, char const *filename);
void dif_file_save (FileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, const gchar *file_name);
typedef struct {
char const *data, *cur;
......@@ -248,25 +247,26 @@ g_warning("DIF SUCCESS");
# define MAP_FAILED -1
#endif
static int
dif_read_workbook (IOContext *context, WorkbookView *wb_view,
char const *filename, gpointer user_data)
void
dif_file_open (FileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, char const *filename)
{
int result = 0;
int len;
struct stat sbuf;
char const *data;
int const fd = open(filename, O_RDONLY);
int fd;
ErrorInfo *error;
fd = gnumeric_open_error_info (filename, O_RDONLY, &error);
if (fd < 0) {
gnumeric_io_error_system (context, g_strerror (errno));
return -1;
gnumeric_io_error_info_set (io_context, error);
return;
}
if (fstat(fd, &sbuf) < 0) {
if (fstat (fd, &sbuf) < 0) {
gnumeric_io_error_info_set (io_context, error_info_new_from_errno ());
close (fd);
gnumeric_io_error_system (context, g_strerror (errno));
return -1;
return;
}
len = sbuf.st_size;
......@@ -280,20 +280,15 @@ dif_read_workbook (IOContext *context, WorkbookView *wb_view,
src.sheet = workbook_sheet_add (wb, NULL, FALSE);
if (!dif_parse_sheet (&src)) {
gnumeric_io_error_read (context,
_("DIF : Failed to load sheet"));
result = -1;
} else {
workbook_set_saveinfo (wb, filename, FILE_FL_MANUAL, dif_saver_id);
gnumeric_io_error_info_set (io_context,
error_info_new_str (_("DIF : Failed to load sheet")));
}
munmap((char *)data, len);
} else {
result = -1;
gnumeric_io_error_read (context, _("Unable to mmap the file"));
gnumeric_io_error_info_set (io_context,
error_info_new_str (_("Unable to mmap the file")));
}
close(fd);
return result;
close (fd);
}
static int
......@@ -323,20 +318,22 @@ 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, gpointer user_data)
void
dif_file_save (FileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, const gchar *file_name)
{
Workbook *wb = wb_view_workbook (wb_view);
GList *sheet_list;
Cell *cell;
int row, col, rc=0;
char *workstring;
FILE *f = fopen (filename, "w");
FILE *f;
ErrorInfo *error;
if (!f) {
gnumeric_io_error_system (context, g_strerror (errno));
return -1;
f = gnumeric_fopen_error_info (file_name, "w", &error);
if (f == NULL) {
gnumeric_io_error_info_set (io_context, error);
return;
}
/*
......@@ -386,36 +383,8 @@ dif_write_workbook (IOContext *context, WorkbookView *wb_view,
out:
if (f)
fclose (f);
if (rc < 0)
gnumeric_io_error_save (context, "");
return rc; /* Q: what do we have to return here?? */
}
gboolean
can_deactivate_plugin (PluginInfo *pinfo)
{
return TRUE;
}
gboolean
cleanup_plugin (PluginInfo *pinfo)
{
file_format_unregister_open (dif_opener_id);