Commit 43074ed0 authored by Morten Welinder's avatar Morten Welinder

Get rid of old plugins.

parent d56e31e1
2000-06-30 Morten Welinder <terra@diku.dk>
* plugins/Makefile.am (SUBDIRS): Delete text, ff-csv, and sample
plugins. Separate the remaining ones into file formats and
functions.
2000-06-30 JP Rosevear <jpr@arcavia.com>
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use consistent names.
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use
consistent names.
* gnumeric.gnorba: Make server names consistent
......
2000-06-30 Morten Welinder <terra@diku.dk>
* plugins/Makefile.am (SUBDIRS): Delete text, ff-csv, and sample
plugins. Separate the remaining ones into file formats and
functions.
2000-06-30 JP Rosevear <jpr@arcavia.com>
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use consistent names.
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use
consistent names.
* gnumeric.gnorba: Make server names consistent
......
2000-06-30 Morten Welinder <terra@diku.dk>
* plugins/Makefile.am (SUBDIRS): Delete text, ff-csv, and sample
plugins. Separate the remaining ones into file formats and
functions.
2000-06-30 JP Rosevear <jpr@arcavia.com>
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use consistent names.
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use
consistent names.
* gnumeric.gnorba: Make server names consistent
......
2000-06-30 Morten Welinder <terra@diku.dk>
* plugins/Makefile.am (SUBDIRS): Delete text, ff-csv, and sample
plugins. Separate the remaining ones into file formats and
functions.
2000-06-30 JP Rosevear <jpr@arcavia.com>
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use consistent names.
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use
consistent names.
* gnumeric.gnorba: Make server names consistent
......
2000-06-30 Morten Welinder <terra@diku.dk>
* plugins/Makefile.am (SUBDIRS): Delete text, ff-csv, and sample
plugins. Separate the remaining ones into file formats and
functions.
2000-06-30 JP Rosevear <jpr@arcavia.com>
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use consistent names.
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use
consistent names.
* gnumeric.gnorba: Make server names consistent
......
2000-06-30 Morten Welinder <terra@diku.dk>
* plugins/Makefile.am (SUBDIRS): Delete text, ff-csv, and sample
plugins. Separate the remaining ones into file formats and
functions.
2000-06-30 JP Rosevear <jpr@arcavia.com>
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use consistent names.
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use
consistent names.
* gnumeric.gnorba: Make server names consistent
......
2000-06-30 Morten Welinder <terra@diku.dk>
* plugins/Makefile.am (SUBDIRS): Delete text, ff-csv, and sample
plugins. Separate the remaining ones into file formats and
functions.
2000-06-30 JP Rosevear <jpr@arcavia.com>
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use consistent names.
* src/embeddable-grid.c (EmbeddableGridFactory_init): Use
consistent names.
* gnumeric.gnorba: Make server names consistent
......
......@@ -408,7 +408,6 @@ doc/C/Makefile
doc/es/Makefile
corba-test/Makefile
plugins/Makefile
plugins/sample/Makefile
plugins/numtheory/Makefile
plugins/sc/Makefile
plugins/sylk/Makefile
......@@ -420,8 +419,6 @@ plugins/python/Makefile
plugins/perl/Makefile
plugins/perl/ext/Makefile.PL
plugins/guile/Makefile
plugins/ff-csv/Makefile
plugins/text/Makefile
plugins/xbase/Makefile
plugins/html/Makefile
plugins/dif/Makefile
......
......@@ -24,6 +24,10 @@ else
GB_DIR =
endif
SUBDIRS = excel lotus-123 oleo sc sylk text ff-csv xbase html dif plan-perfect \
$(PYTHON_DIR) $(PERL_DIR) $(GUILE_DIR) $(GB_DIR) \
sample numtheory gda xml2
SUBDIRS_FILE_FORMATS = excel lotus-123 oleo sc sylk xbase html dif plan-perfect \
xml2
SUBDIRS_FUNCTIONS = $(PYTHON_DIR) $(PERL_DIR) $(GUILE_DIR) $(GB_DIR) \
numtheory gda
SUBDIRS = $(SUBDIRS_FILE_FORMATS) $(SUBDIRS_FUNCTIONS)
Gnumeric plugins typically either define a file format (input and/or output)
or a set of functions. Nothing prevents a mixture -- that is just how things
have turned out so far.
When you add or delete files, don't forget...
* Edit po/POTFILES.in
* Edit configure.in
File-format plugins
--------------------
For a good skeleton, grab a copy of the applix plugin. (The Excel plugin is
the most sophisticated, but it is currently statically linked into Gnumeric.
It will probably become a regular plugin at some point.)
Plugins containing functions
-----------------------------
For a good skeleton, grab a copy of the numtheory plugin.
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.56
2000-06-18 Jody Goldberg <jgoldberg@home.com>
* Release 0.55
2000-05-20 Jody Goldberg <jgoldberg@home.com>
* Release 0.54
2000-05-09 Jody Goldberg <jgoldberg@home.com>
* Release 0.53
2000-05-08 Jon K Hellan <hellan@acm.org>
* csv-io.c (CSV_DESCR): Description said that plugin can read and
write. Fixed to say write only.
2000-04-20 Jody Goldberg <jgoldberg@home.com>
* csv-io.c (csv_write_cell) : Use cell_get_rendered_text instead of
accessing it directly.
2000-04-02 Jody Goldberg <jgoldberg@home.com>
* csv-io.c : Disable the CSV parse code because it has been deprecated
in favour of the STF.
2000-03-26 Almer. S. Tigelaar. <almer1@dds.nl>
* csv-io.c (csv_write_workbook, csv_read_workbook) : modified to use
new plugin-utils (src/plugin-util.[ch])
2000-03-23 Jon K Hellan <hellan@acm.org>
* csv-io.c (csv_read_workbook): Set save info, tag as MANUAL.
(init_plugin): Tag saver as MANUAL.
2000-02-26 Jody Goldberg <jgoldberg@home.com>
* csv-io.c (csv_read_workbook) : Bug 5716.
2000-01-31 Jon K Hellan <hellan@acm.org>
* csv-io.c (csv_write_workbook): Improve reporting.
2000-01-31 Jon K Hellan <hellan@acm.org>
* csv-io.c (csv_write_workbook): Call gnumeric_error_save on
failure.
2000-01-29 Jon K Hellan <hellan@acm.org>
* csv-io.c (csv_read_workbook, csv_write_workbook,
csv_parse_sheet, csv_parse_field): Add CommandContext. Return 0 on
success, -1 on failure. Use gnumeric_error_read to report errors.
1999-12-29 Jody Goldberg <jgoldberg@home.com>
* csv-io.c (csv_parse_sheet) : Minor adjustment to the previous
enhancement.
(csv_parse_field) : Extend \r\n to embedded newlines also.
1999-12-28 Stephane Alnet <stephane@u-picardie.fr>
* csv-io.c (csv_parse_sheet): Small fix to handle CRLF files.
1999-11-21 Jeff Garzik <jgarzik@mandrakesoft.com>
* csv-io.c (csv_cleanup_plugin): free pd->title
1999-11-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* csv-io.c (MAP_FAILED): Define MAP_FAILED for those systems that
do not define it.
1999-11-18 Jeff Garzik <jgarzik@mandrakesoft.com>
* csv-io.c (csv_write_cell): Properly quote " chars.
1999-11-17 Jeff Garzik <jgarzik@mandrakesoft.com>
* csv-io.c (csv_parse_sheet): Correct previous check-in;
Return FALSE, not NULL.
1999-11-17 Jody Goldberg <jgoldberg@home.com>
* csv-io.c (csv_parse_sheet) : Add some checks to handle
files with more than SHEET_MAX_COLS columns fail.
1999-11-17 Jeff Garzik <jgarzik@mandrakesoft.com>
* csv-io.c (csv_write_workbook/cell): new functions
(init_plugin, csv_cleanup_plugin): add CSV export capability
1999-07-31 Morten Welinder <terra@diku.dk>
* libcsv.c (read_line): Make static.
1999-07-05 Miguel de Icaza <miguel@gnu.org>
* csv-io.c (csv_read_workbook): Load here now.
(init_plugin): Do not provide a probing routine.
1999-07-02 Miguel de Icaza <miguel@nuclecu.unam.mx>
* csv-io.c (init_plugin): Do not use for now. it has a memory
problem somewhere.
* libcsv.c: Rewrote to use Alan's library.
1999-06-25 Morten Welinder <terra@diku.dk>
* csv-io.c (insert_csv_cell): Use g_free. Cleanup the mess.
(csv_init): Up priority to 1 -- we have slightly more structure
than plain text.
(csv_parse_file): Fix off-by-one error. Fix \r logic. Handle
foreign locales with more grace. Handle mmap failures by
reverting to good old read.
1999-06-14 Morten Welinder <terra@diku.dk>
* csv-io.c (csv_read_workbook): Make static.
(csv_read_workbook): Make static.
(csv_init): Make static.
(csv_cleanup_plugin): Fix type.
* csv-io.h: Fix includes.
1999-04-06 Miguel de Icaza <miguel@nuclecu.unam.mx>
* csv-io.c (csv_cleanup_plugin): Return proper value.
1999-02-22 Tim Mooney <mooney@dogbert.cc.ndsu.nodak.edu>
* csv-io.c (insert_csv_cell): Do not test pointer for > 0, but for
NULL.
1999-02-06 Vincent Renardias <vincent@ldsol.com>
* csv-io.h, csv-io.c: A few fixes.
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(includedir) -I$(top_srcdir)/src \
$(GNOME_INCLUDEDIR)
gnumeric_plugin_LTLIBRARIES = gnum_csv.la
gnum_csv_la_LDFLAGS = -module -avoid-version
gnum_csv_la_SOURCES = csv-io.h csv-io.c
/*
* csv-io.c: read sheets using a CSV encoding.
*
* Miguel de Icaza <miguel@gnu.org>
* Jody Goldberg <jgoldberg@home.com>
*/
#include <config.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <gnome.h>
#include "plugin.h"
#include "plugin-util.h"
#include "gnumeric.h"
#include "workbook.h"
#include "cell.h"
#include "file.h"
#include "command-context.h"
#include "rendered-value.h"
static int
csv_write_workbook (CommandContext *context, Workbook *wb,
const char *filename);
#ifdef ENABLE_OLD_CSV_IMPORT
typedef struct {
char const *data, *cur;
int len;
int line;
Sheet *sheet;
} FileSource_t;
static int
csv_parse_field (CommandContext *context, FileSource_t *src, Cell *cell)
{
GString *res = NULL;
char *field;
char const *cur = src->cur;
char const delim =
(*cur != '"' && *cur != '\'')
? ',' : *cur;
char const * const start = (delim == ',') ? cur : ++cur;
char *template = _("Invalid CSV file - \n"
"unexpected end of line at line %d");
char *message;
while (*cur && *cur != delim && *cur != '\n' && *cur != '\r') {
if (*cur == '\\') {
/* If this is the first escape character get setup */
if (start != cur) {
char *tmp = g_strndup (start, cur-start);
res = g_string_new (tmp);
g_free (tmp);
} else
res = g_string_new ("");
if (!cur[1]) {
message = g_strdup_printf (template,
src->line);
gnumeric_error_read (context, message);
g_free (message);
return -1;
}
/* \r\n is a single embedded newline, ignore the \r */
if (cur [1] == '\r' && cur [2] == '\n')
++cur;
g_string_append_c (res, cur[1]);
cur += 2;
} else {
if (res != NULL)
g_string_append_c (res, *cur);
++cur;
}
}
/* Skip close delimiter */
if (*cur) {
src->cur = cur;
if (delim != ',')
++src->cur;
if (*src->cur == ',')
++src->cur;
}
if (res != NULL) {
field = res->str;
g_string_free (res, FALSE);
} else
field = g_strndup (start, cur-start);
cell_set_text (cell, field);
g_free (field);
return 0;
}
static int
csv_parse_sheet (CommandContext *context, FileSource_t *src)
{
int row, col;
char *template = _("Invalid CSV file has more than the maximum\n"
"number of %s %d");
char *message;
int result;
for (row = 0 ; *src->cur ; ++row, ++src->line, ++(src->cur)) {
if (row >= SHEET_MAX_ROWS) {
message = g_strdup_printf (template, _("rows"),
SHEET_MAX_ROWS);
gnumeric_error_read (context, message);
g_free (message);
return -1;
}
for (col = 0 ;
*src->cur && *src->cur != '\n' && *src->cur != '\r' ;
++col) {
Cell *cell;
if (col >= SHEET_MAX_COLS) {
message = g_strdup_printf (template,
_("columns"),
SHEET_MAX_ROWS);
gnumeric_error_read (context, message);
g_free (message);
return -1;
}
cell = sheet_cell_new (src->sheet, col, row);
result = csv_parse_field (context, src, cell);
if (result != 0)
return result;
}
/* \r\n is a single end of line, ignore the \r */
if (src->cur [0] == '\r' && src->cur [1] == '\n')
src->cur++;
}
return 0;
}
static int
csv_read_workbook (CommandContext *context, Workbook *book,
char const *filename)
{
int result = 0;
int len;
char const *data;
int fd;
if ((data = gnumeric_mmap_open (context, filename, &fd, &len)) != NULL) {
FileSource_t src;
char *name = g_strdup_printf (_("Imported %s"), g_basename (filename));
src.data = data;
src.cur = data;
src.len = len;
src.sheet = sheet_new (book, name);
workbook_attach_sheet (book, src.sheet);
g_free (name);
result = csv_parse_sheet (context, &src);
if (result != 0)
workbook_detach_sheet (book, src.sheet, TRUE);
else
workbook_set_saveinfo (book, filename, FILE_FL_MANUAL,
csv_write_workbook);
gnumeric_mmap_close (context, data, fd, len);
} else {
result = -1;
}
return result;
}
#endif
static int
csv_write_cell (FILE *f, Cell *cell, int col, int row)
{
if (col > 0)
fputc (',', f);
if (cell) {
gboolean quoting = FALSE;
char * text = cell_get_rendered_text (cell);
char const *s = text;
if (strchr (s, ',') || strchr (s, '"') ||
strchr (s, ' ') || strchr (s, '\t')) {
quoting = TRUE;
fputc ('"', f);
}
while (*s) {
if (*s == '"')
fputs ("\"\"", f);
else
fputc (*s, f);
s++;
}
if (quoting)
fputc ('"', f);
g_free (text);
}
if (ferror (f))
return -1;
return 0;
}
#ifndef PAGE_SIZE
#define PAGE_SIZE (BUFSIZ*8)
#endif
/*
* write every sheet of the workbook to a comma-separated-values file
*/
static int
csv_write_workbook (CommandContext *context, Workbook *wb,
const char *filename)
{
GList *sheet_list;
Sheet *sheet;
Cell *cell;
int row, col, rc=0;
FILE *f = gnumeric_fopen (context, filename, "w");
if (!f)
return -1;
setvbuf (f, NULL, _IOFBF, PAGE_SIZE);
sheet_list = workbook_sheets (wb);
while (sheet_list) {
sheet = sheet_list->data;
for (row = 0; row <= sheet->rows.max_used; row++) {
for (col = 0; col <= sheet->cols.max_used; col++) {
cell = sheet_cell_get (sheet, col, row);
rc = csv_write_cell (f, cell, col, row);
if (rc)
goto out;
}
/* TODO TODO TODO : Add a flag to optionally
* produce \r\n pairs.
*/
fputc ('\n', f);
}
sheet_list = sheet_list->next;
}
out:
if (f)
fclose (f);
if (rc < 0)
gnumeric_error_save (context, "");
return rc; /* Q: what do we have to return here?? */
}
static int
csv_can_unload (PluginData *pd)
{
/* We can always unload */
return TRUE;
}
static void
csv_cleanup_plugin (PluginData *pd)
{
#ifdef ENABLE_OLD_CSV_IMPORT
file_format_unregister_open (NULL, csv_read_workbook);
#endif
file_format_unregister_save (csv_write_workbook);
}
#define CSV_TITLE _("Comma Separated Value (CSV) module")
#ifdef ENABLE_OLD_CSV_IMPORT
#define CSV_DESCR _("This plugin reads and writes comma separated value formatted data (*.csv)")
#else
#define CSV_DESCR _("This plugin writes comma separated value formatted data (*.csv)")
#endif
PluginInitResult
init_plugin (CommandContext *context, PluginData *pd)
{
char *desc;
if (plugin_version_mismatch (context, pd, GNUMERIC_VERSION))
return PLUGIN_QUIET_ERROR;
#ifdef ENABLE_OLD_CSV_IMPORT
desc = _("Comma Separated Value (CSV) import");
file_format_register_open (1, desc, NULL, csv_read_workbook);
#endif
desc = _("Comma Separated Value format (*.csv)");
file_format_register_save (".csv", desc, FILE_FL_MANUAL,
csv_write_workbook);
desc = _("Comma Separated Value (CSV) module");
if (plugin_data_init (pd, csv_can_unload, csv_cleanup_plugin,
CSV_TITLE, CSV_DESCR))
return PLUGIN_OK;
else
return PLUGIN_ERROR;
}
/*
* csv-io.h: interfaces to save/read Sheets using a CSV encoding.
* (most of the code taken from xml-io.h by Daniel Veillard <Daniel.Veillard@w3.org>)
*
* Vincent Renardias <vincent@ldsol.com>
*
* $Id$
*/
#ifndef GNUMERIC_CSV_IO_H
#define GNUMERIC_CSV_IO_H
#include "sheet.h"
#include "plugin.h"
PluginInitResult init_plugin (CommandContext *context, PluginData *pd);
#endif /* GNUMERIC_CSV_IO_H */
The ff-stf plugin is Obsolete, please read README.NOW
-----------------------------------------------------
2000-02-01 Jason Leach <leach@wam.umd.edu>
* dialog-stf-format-page.c (format_page_set_col_formatting):
kill bug #5718: a C++ comment changed to a C style comment for
compatability with non-gcc compilers.
2000-01-31 Jon K Hellan <hellan@acm.org>
* dialog-stf.c (dialog_stf): Return -1 on cancel, 0 otherwise.
2000-01-29 Jon K Hellan <hellan@acm.org>
Megacommit.
The purpose of the changeset is twofold:
1. Use CommandContexts for error reporting for file read/save.
2. This allows us to let FileFormatOpen return 0 on success, -1 on
failure, same as FileFormatSave. The convention to return NULL
on success was highly ideosyncratic.
* dialog-stf.h: Add CommandContext. Return int.
* dialog-stf.c (dialog_stf) : Add CommandContext. Return 0 on success,
-1 on failure. Use gnumeric_error_read to report errors.
* stf.c (stf_read_workbook): Ditto.
2000-01-15 Almer. S. Tigelaar. <almer1@dds.nl>
* stf-separated.c, stf-fixed.c :
If a file's last line has _no_ line terminator but instead ends
with a \0 both the fixed and separated parse functions would skip
over this \0 and continue parsing past the buffer, this is fixed
now.
* dialog-stf.c :
Pressing the Back button on the main page would result in a
Page Cycle Error from the STF and another error from the Druid.
Fixed.
* stf.c :
No more memory mapping is done, this caused portability problems
and is now replaced with read and a dynamically allocated buffer.
* stf.c :
Added a check (stf_is_valid_input_data) which will check the data
and see if it _really_ is a valid text file/valid input data.
* stf-util.c, stf-util.h, stf-fixed.c, stf-separated.c :
References to the overkill (stf_is_line_terminator) function have
been replaced by *buffer != '\n'.
* dialog-stf-csv-page.c :
Attached a new signal to the Custom Checkbutton on the Separation
Customization page so that the text widget next to it will do nice
stuff like changing sensitivity and auto focus.
* dialog-stf-csv-page.c :
Added some gnome style headers
they weren't all there yet
* stf-preview.c:
Made the column headers in the preview gray to make them more
distinguishable from the cells that contain data.
2000-01-15 <miguel@gnu.org>
* stf.c (init_plugin): Renamed to be more obvious
2000-01-07 Almer. S. Tigelaar <almer1@dds.nl>
* Initial release
Please, read README.NOW
\ No newline at end of file