Commit 7c1e9d5c authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

libgsf has landed.


libgsf has landed.

2002-06-07  Jody Goldberg <jody@gnome.org>

	* src/workbook-view.c (wb_view_open) : convert to libgsf.

	* src/stf.c (stf_open_and_read) : convert to libgsf.
	(stf_preparse) : ditto.
	(stf_read_workbook) : ditto.
	(stf_read_workbook_auto_csvtab) : ditto.
	(stf_read_default_probe) : ditto.

	* src/stf-parse.c (stf_parse_is_valid_data) : actually disable the
	  wide char support if it is not available.

	* src/gutils.c (gnm_extension_pointer) : copied from libgnome to
	  decrease our dependence on it.

	* src/gui-util.c (gnumeric_editable_enters) : modernize a bit.

	* src/gnumeric-simple-canvas.c (gnm_simple_canvas_grab) : suppress
	  warning.

	* src/file.c (gnum_file_opener_probe_real) : Use libgsf.
	(gnum_file_opener_open_real) : ditto.
	(gnum_file_opener_probe) : ditto.
	(gnum_file_opener_open) : ditto.
	(gnum_file_saver_save_to_stream_real) : disable, we can move this out
	  of here when GsfOutput comes online.

	* src/collect.c (string_range_function) : suppress warning.

	* src/cell.c (cell_set_array_formula) : Adjust to the signature change
	  for gnm_expr_new_array.
	* src/sheet-autofill.c (autofill_cell) : ditto.

2002-06-07  Jody Goldberg <jody@gnome.org>

	* configure.in : require libgsf.

	* src/xml-io.c (xml_check_version) : move the sanity checking here.
	(gnumeric_xml_read_workbook) : rather than here.  Support GsfInput.
	(xml_probe) : and here.
	(gnumeric_xml_write_workbook_to_stream) : delete.

2002-05-31  Jody Goldberg <jody@gnome.org>

	* src/gnumeric-simple-canvas.c (gnm_simple_canvas_grab) : actually
	  return the result.
parent b1973fb4
2002-06-05 Jody Goldberg <jody@gnome.org>
* pln.c (pln_file_probe) : add.
(pln_file_open) : use probe and convert to GsfInput.
(pln_parse_sheet) : use GsfInput, and clean up a mite.
2002-05-29 Jody Goldberg <jody@gnome.org>
* Release 1.1.4
......
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* pln.c: read sheets using a Plan Perfect encoding.
*
......@@ -7,23 +8,13 @@
#include <gnumeric-config.h>
#include <gnumeric.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 <math.h>
#include <gnome.h>
#include "plugin.h"
#include "numbers.h"
#include "plugin-util.h"
#include "module-plugin-defs.h"
#include "error-info.h"
#include "file.h"
#include "sheet.h"
#include "value.h"
#include "cell.h"
#include "workbook.h"
......@@ -31,25 +22,23 @@
#include "command-context.h"
#include "io-context.h"
#include <gsf/gsf-input.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
#include <math.h>
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
gboolean pln_file_probe (GnumFileOpener const *fo, GsfInput *input,
FileProbeLevel pl);
void pln_file_open (GnumFileOpener const *fo, IOContext *io_context,
WorkbookView *view, char const *filename);
typedef struct {
char const *data, *cur;
int len;
int line;
Sheet *sheet;
} FileSource_t;
WorkbookView *view, GsfInput *input);
#define FONT_WIDTH 8
/* Font width should really be calculated, but it's too hard right now */
#define PLN_BYTE(pointer) (((int)((*(pointer)))) & 0xFF)
#define PLN_WORD(pointer) (PLN_BYTE(pointer) + PLN_BYTE((pointer) + 1) * 256)
#define PLN_WORD(pointer) (PLN_BYTE (pointer) | (PLN_BYTE ((pointer) + 1) << 8))
static const char* formula1[] =
{
......@@ -710,45 +699,21 @@ g_warning("PLN: Undefined formula code %d", fcode);
return result1;
}
static void
pln_parse_sheet (FileSource_t *src, ErrorInfo **ret_error)
static ErrorInfo *
pln_parse_sheet (GsfInput *input, Sheet *sheet)
{
int rcode, rlength;
int crow, ccol, ctype, cformat, chelp, clength, cattr, cwidth;
int cextra;
Cell *cell = NULL;
gnum_float dvalue;
char* svalue;
Value *val;
int lastrow = SHEET_MAX_ROWS;
int lastcol = SHEET_MAX_COLS;
guint8 const *data;
*ret_error = NULL;
/*
* Make sure it really is a plan-perfect file
* 0 = -1
* 1-3 = "WPC"
* 4-7 = 16 (double word)
* 8 = 9 (plan perfect file)
* 9 = 10 (worksheet file)
* 10 = major version number
* 11 = minor version number
* 12-13 = encryption key
* 14-15 = unused
*/
if (memcmp(src->cur, "\377WPC\020\0\0\0\011\012", 10) != 0) {
*ret_error = error_info_new_str (_("PLN : Not a PlanPerfect File"));
return;
}
if ((*(src->cur + 12) != 0) || (*(src->cur + 13) != 0)) {
*ret_error = error_info_new_str (_("PLN : Spreadsheet is password encrypted"));
return;
}
/*
* Point to beginning of real data (16 byte header)
*/
src->cur += 16;
data = gsf_input_read (input, 6, NULL);
if (data == NULL || PLN_WORD (data + 2) != 0)
return error_info_new_str (_("PLN : Spreadsheet is password encrypted"));
/*
* Now process the record based sections
......@@ -758,28 +723,32 @@ pln_parse_sheet (FileSource_t *src, ErrorInfo **ret_error)
*/
rcode = 0;
while ((src->len > (src->cur - src->data)) && (rcode != 25))
{
rcode = PLN_WORD(src->cur);
rlength = PLN_WORD(src->cur + 2);
do {
data = gsf_input_read (input, 4, NULL);
if (data == NULL)
break;
switch(rcode)
{
rcode = PLN_WORD (data);
rlength = PLN_WORD (data);
data = gsf_input_read (input, rlength, NULL);
if (data == NULL)
break;
switch (rcode) {
case 1: /* Last row/column */
lastrow = PLN_WORD(src->cur + 4);
lastcol = PLN_WORD(src->cur + 6);
lastrow = PLN_WORD (data);
lastcol = PLN_WORD (data + 2);
break;
case 3: /* Column format information */
for (ccol = 0; ccol < rlength / 6; ccol++)
{
cattr = PLN_WORD(src->cur + ccol * 6 + 4);
cformat = PLN_WORD(src->cur + ccol * 6 + 6);
cwidth = PLN_WORD(src->cur + ccol * 6 + 8);
if ((cwidth != 0) && (ccol <= lastcol))
{
for (ccol = 0; ccol < rlength / 6; ccol++) {
cattr = PLN_WORD (data + ccol * 6 + 0);
cformat = PLN_WORD (data + ccol * 6 + 2);
cwidth = PLN_WORD (data + ccol * 6 + 4);
if ((cwidth != 0) && (ccol <= lastcol)) {
sheet_col_set_size_pts
(src->sheet, ccol,
(sheet, ccol,
(cwidth & 255) * FONT_WIDTH,
FALSE);
}
......@@ -787,145 +756,139 @@ pln_parse_sheet (FileSource_t *src, ErrorInfo **ret_error)
break;
default:
#if 0
g_warning("PLN : Record handling code for code %d not yet written", rcode);
#endif
break;
g_warning("PLN : Record handling code for code %d not yet written", rcode);
}
} while (rcode != 25);
/*
* Next record (4 bytes for header + data)
*/
src->cur += rlength + 4;
}
/*
* Now process the CELL information
*/
while (src->len > (src->cur - src->data))
{
crow = PLN_WORD(src->cur);
/* process the CELL information */
while (1) {
data = gsf_input_read (input, 20, NULL);
if (data == NULL)
break;
crow = PLN_WORD (data);
/* Special value indicating end of sheet */
if (crow == 65535)
return;
if (crow >= SHEET_MAX_ROWS) {
*ret_error = error_info_new_printf (
return NULL;
if (crow >= SHEET_MAX_ROWS)
return error_info_new_printf (
_("Invalid PLN file has more than the maximum\n"
"number of %s %d"),
_("rows"),
SHEET_MAX_ROWS);
return;
}
ccol = PLN_WORD(src->cur + 2);
ctype = PLN_WORD(src->cur + 12);
cformat = PLN_WORD(src->cur + 14);
chelp = PLN_WORD(src->cur + 16);
clength = PLN_WORD(src->cur + 18);
cextra = 0;
ccol = PLN_WORD (data + 2);
ctype = PLN_WORD (data + 12);
cformat = PLN_WORD (data + 14);
chelp = PLN_WORD (data + 16);
clength = PLN_WORD (data + 18);
switch (ctype & 7)
{
switch (ctype & 7) {
case 0: /* Empty Cell */
case 6: /* format only, no data in cell */
break;
case 1: /* Floating Point */
dvalue = pln_get_number(src->cur + 4);
cell = sheet_cell_fetch (src->sheet, ccol, crow);
cell_set_value (cell, value_new_float (dvalue), NULL);
dvalue = pln_get_number (data + 4);
cell = sheet_cell_fetch (sheet, ccol, crow);
cell_set_value (cell, value_new_float (dvalue));
break;
case 2: /* Short Text */
svalue = g_strndup(src->cur + 5, PLN_BYTE(src->cur + 4));
cell = sheet_cell_fetch (src->sheet, ccol, crow);
cell_set_text (cell, svalue);
g_free(svalue);
cell = sheet_cell_fetch (sheet, ccol, crow);
if (cell != NULL) {
val = value_new_string_nocopy (
g_strndup (data + 5, PLN_BYTE (data + 4)));
cell_set_value (cell, val);
}
break;
case 3: /* Long Text */
cextra = PLN_WORD(src->cur + 4);
svalue = g_strndup(src->cur + 22,
PLN_WORD(src->cur + 20));
cell = sheet_cell_fetch (src->sheet, ccol, crow);
cell_set_text (cell, svalue);
g_free(svalue);
data = gsf_input_read (input, PLN_WORD (data+4), NULL);
if (data != NULL) {
cell = sheet_cell_fetch (sheet, ccol, crow);
if (cell != NULL) {
val = value_new_string_nocopy (
g_strndup (data + 2, PLN_WORD (data)));
cell_set_value (cell, val);
}
}
break;
case 4: /* Error Cell */
cell = sheet_cell_fetch (src->sheet, ccol, crow);
/* TODO : What to use as the eval position */
cell_set_value (cell, value_new_error (NULL, gnumeric_err_VALUE), NULL);
cell_set_value (sheet_cell_fetch (sheet, ccol, crow),
value_new_error (NULL, gnumeric_err_VALUE));
break;
case 5: /* na Cell */
cell = sheet_cell_fetch (src->sheet, ccol, crow);
/* TODO : What to use as the eval position */
cell_set_value (cell, value_new_error (NULL, gnumeric_err_NA), NULL);
cell_set_value (sheet_cell_fetch (sheet, ccol, crow),
value_new_error (NULL, gnumeric_err_NA));
break;
}
if (clength != 0 && cell != NULL)
{
svalue = pln_parse_formula(src->cur + 20 + cextra,
crow, ccol);
cell_set_text (cell, svalue);
g_free(svalue);
if (clength != 0 && cell != NULL) {
data = gsf_input_read (input, clength, NULL);
if (data != NULL) {
char *expr = pln_parse_formula (data, crow, ccol);
cell_set_text (cell, expr);
g_free (expr);
}
}
src->cur += 20 + clength + cextra;
}
return NULL;
}
void
pln_file_open (GnumFileOpener const *fo, IOContext *io_context,
WorkbookView *view, char const *filename)
WorkbookView *wb_view, GsfInput *input)
{
int len;
struct stat sbuf;
char const *data;
gint fd;
Workbook *book = wb_view_workbook (view);
Workbook *wb;
char *name;
Sheet *sheet;
ErrorInfo *error;
fd = gnumeric_open_error_info (filename, O_RDONLY, &error);
if (fd < 0) {
gnumeric_io_error_info_set (io_context, error);
return;
}
if (fstat(fd, &sbuf) < 0) {
close (fd);
gnumeric_io_error_info_set (io_context, error_info_new_from_errno ());
if (!pln_file_probe (NULL, input, FILE_PROBE_CONTENT_FULL)) {
gnumeric_io_error_info_set (io_context,
error_info_new_str (_("PLN : Not a PlanPerfect File")));
return;
}
len = sbuf.st_size;
if (MAP_FAILED != (data = (char const *) (mmap(0, len, PROT_READ,
MAP_PRIVATE, fd, 0)))) {
FileSource_t src;
char * name = g_strdup_printf (_("Imported %s"), g_basename (filename));
wb = wb_view_workbook (wb_view);
name = workbook_sheet_get_free_name (wb, "PlanPerfect", FALSE, TRUE);
sheet = sheet_new (wb, name);
g_free (name);
workbook_sheet_attach (wb, sheet, NULL);
src.data = data;
src.cur = data;
src.len = len;
src.sheet = sheet_new (book, name);
workbook_sheet_attach (book, src.sheet, NULL);
g_free (name);
error = pln_parse_sheet (input, sheet);
if (error != NULL) {
workbook_sheet_detach (wb, sheet);
gnumeric_io_error_info_set (io_context, error);
}
}
pln_parse_sheet (&src, &error);
if (error != NULL) {
workbook_sheet_detach (book, src.sheet);
gnumeric_io_error_info_set (io_context, error);
}
static guint8 const signature[] =
{ 0xff, 'W','P','C', 0x10, 0, 0, 0, 0x9, 0x10 };
munmap((char *)data, len);
} else {
gnumeric_io_error_string (io_context, _("Unable to mmap the file"));
}
close(fd);
gboolean
pln_file_probe (GnumFileOpener const *fo, GsfInput *input,
FileProbeLevel pl)
{
/*
* a plan-perfect header
* 0 = -1
* 1-3 = "WPC"
* 4-7 = 16 (double word)
* 8 = 9 (plan perfect file)
* 9 = 10 (worksheet file)
* 10 = major version number
* 11 = minor version number
* 12-13 = encryption key
* 14-15 = unused
*/
char const *header = NULL;
if (!gsf_input_seek (input, 0, GSF_SEEK_SET))
header = gsf_input_read (input, sizeof (signature), NULL);
return header != NULL &&
memcmp (header, signature, sizeof (signature)) == 0;
}
......@@ -8,7 +8,7 @@
<attribute name="module_file" value="plan_perfect.la"/>
</loader>
<services>
<service type="file_opener" id="pln" priority="1" probe="FALSE"
<service type="file_opener" id="pln" priority="1" probe="TRUE"
open="FALSE" import="TRUE">
<information>
<_description>Plan Perfect Format (PLN) import</_description>
......
2002-06-07 Jody Goldberg <jody@gnome.org>
* psiconv-read.c (psiconv_file_to_buffer) : BROKEN!
This routine relies on a convenience routine that I do not have to
map from the input source -> an in memory buffer. why you would wan
tto copy the entire thing in 1 go is beyond me but without that
libarary I can't fix it right now.
(psiconv_read_header): convert to libgsf.
(psiconv_read) : ditto.
* boot.c (psiconv_file_open) : convert to gsfinput.
(psiconv_file_probe) : ditto.
2002-05-29 Jody Goldberg <jody@gnome.org>
* Release 1.1.4
......
......@@ -39,41 +39,21 @@
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
gboolean psiconv_file_probe (GnumFileOpener const *fo, const gchar *file_name,
gboolean psiconv_file_probe (GnumFileOpener const *fo, GsfInput *input,
FileProbeLevel pl);
void psiconv_file_open (GnumFileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, const char *filename);
WorkbookView *wb_view, GsfInput *input);
gboolean
psiconv_file_probe (GnumFileOpener const *fo, const gchar *file_name, FileProbeLevel pl)
psiconv_file_probe (GnumFileOpener const *fo, GsfInput *input, FileProbeLevel pl)
{
FILE *file;
gboolean res;
file = fopen (file_name, "rb");
if (file == NULL)
return FALSE;
res = psiconv_read_header (file);
fclose (file);
return res;
return psiconv_read_header (input);
}
void
psiconv_file_open (GnumFileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, const char *filename)
WorkbookView *wb_view, GsfInput *input)
{
FILE *file;
ErrorInfo *error;
Workbook *wb;
file = gnumeric_fopen_error_info (filename, "r", &error);
if (file == NULL) {
gnumeric_io_error_info_set (io_context, error);
} else {
wb = wb_view_workbook(wb_view);
psiconv_read (io_context, wb, file);
fclose (file);
}
psiconv_read (io_context, wb_view_workbook(wb_view), input);
}
......@@ -5,7 +5,7 @@
#include "io-context.h"
#include <stdio.h>
gboolean psiconv_read_header (FILE *file);
void psiconv_read (IOContext *io_context, Workbook *wb, FILE *file);
gboolean psiconv_read_header (GsfInput *input);
void psiconv_read (IOContext *io_context, Workbook *wb, GsfInput *input);
#endif /* PLUGIN_PSICONV_PLUGIN_H */
......@@ -548,7 +548,7 @@ add_sheetfile(Workbook *wb, psiconv_sheet_f psi_file)
static psiconv_buffer
psiconv_file_to_buffer(FILE *file)
psiconv_file_to_buffer (GsfInput *input)
{
psiconv_buffer buf;
......@@ -558,6 +558,7 @@ psiconv_file_to_buffer(FILE *file)
if (!(buf = psiconv_buffer_new())) {
return NULL;
}
#warning BROKEN BROKEN BROKEN someone using this library needs to supply a way to read from GsfInputs
if (psiconv_buffer_fread_all(buf,file)) {
psiconv_buffer_free(buf);
return NULL;
......@@ -566,12 +567,12 @@ psiconv_file_to_buffer(FILE *file)
}
void
psiconv_read (IOContext *io_context, Workbook *wb, FILE *file)
psiconv_read (IOContext *io_context, Workbook *wb, GsfInput *input)
{
psiconv_buffer buf;
psiconv_file psi_file;
if (!(buf = psiconv_file_to_buffer(file))) {
if (!(buf = psiconv_file_to_buffer (input))) {
gnumeric_io_error_info_set (io_context,
error_info_new_str(_("Error while reading psiconv file.")));
return;
......@@ -595,14 +596,14 @@ psiconv_read (IOContext *io_context, Workbook *wb, FILE *file)
}
gboolean
psiconv_read_header (FILE *file)
psiconv_read_header (GsfInput *input)
{
gboolean res;
psiconv_buffer buf;
if (!(buf = psiconv_file_to_buffer(file))) {
if (!(buf = psiconv_file_to_buffer (input)))
return FALSE;
}
res = psiconv_file_type(buf,NULL,NULL) == psiconv_sheet_file;
psiconv_buffer_free(buf);
return res;
......
2002-06-07 Jody Goldberg <jody@gnome.org>
* sc.c (sc_file_probe) : new.
(sc_file_open) : use probe, and rewrite to support GsfInput.
(sc_parse_line) : signature change.
(sc_parse_label) : ditto.
(sc_parse_let_expr) : ditto.
(sc_parse_let) : ditto.
(sc_parse_sheet) : ditto.
2002-05-29 Jody Goldberg <jody@gnome.org>
* Release 1.1.4
......
......@@ -8,7 +8,7 @@
<attribute name="module_file" value="sc.la"/>
</loader>
<services>
<service type="file_opener" id="sc" priority="1" probe="FALSE"
<service type="file_opener" id="sc" priority="1" probe="TRUE"
open="FALSE" import="TRUE">
<information>
<_description>SC/xspread</_description>
......
......@@ -11,7 +11,6 @@
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
#include <gnome.h>
#include "plugin.h"
#include "plugin-util.h"
#include "module-plugin-defs.h"
......@@ -26,19 +25,18 @@
#include "style.h"
#include "sheet.h"
#include <gsf/gsf-input.h>
#include <gsf/gsf-input-textline.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
#include <math.h>
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
gboolean sc_file_probe (GnumFileOpener const *fo, GsfInput *input,
FileProbeLevel pl);
void sc_file_open (GnumFileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, const char *filename);
typedef struct {
/* input data */
FILE *f;
/* gnumeric sheet */
Sheet *sheet;
} sc_file_state_t;
WorkbookView *wb_view, GsfInput *input);
typedef enum {
LABEL,
......@@ -128,7 +126,7 @@ sc_parse_coord (const char **strdata, int *col, int *row)
static gboolean
sc_parse_label (sc_file_state_t *src, const char *cmd, const char *str, int col, int row)
sc_parse_label (Sheet *sheet, const char *cmd, const char *str, int col, int row)
{
Cell *cell;
char *s = NULL, *tmpout;
......@@ -136,13 +134,13 @@ sc_parse_label (sc_file_state_t *src, const char *cmd, const char *str, int col,
gboolean result = FALSE;
sc_string_cmd_t cmdtype;
g_return_val_if_fail (src, FALSE);
g_return_val_if_fail (sheet, FALSE);
g_return_val_if_fail (cmd, FALSE);
g_return_val_if_fail (str, FALSE);
g_return_val_if_fail (col >= 0, FALSE);
g_return_val_if_fail (row >= 0, FALSE);
if (!src || !str || *str != '"' || col == -1 || row == -1)
if (!str || *str != '"' || col == -1 || row == -1)
goto err_out;
s = tmpout = g_strdup (str);
......@@ -162,7 +160,7 @@ sc_parse_label (sc_file_state_t *src, const char *cmd, const char *str, int col,
tmpout--;
*tmpout = 0;
cell = sheet_cell_fetch (src->sheet, col, row);
cell = sheet_cell_fetch (sheet, col, row);
if (!cell)
goto err_out;
......@@ -240,13 +238,13 @@ sc_parse_cell_name_list (Sheet *sheet, const char *cell_name_str,
static gboolean
sc_parse_let_expr (sc_file_state_t *src, const char *cmd, const char *str, int col, int row)
sc_parse_let_expr (Sheet *sheet, const char *cmd, const char *str, int col, int row)
{
char *error = NULL;
GnmExpr *tree;
Cell *cell;
g_return_val_if_fail (src, FALSE);
g_return_val_if_fail (sheet, FALSE);
g_return_val_if_fail (cmd, FALSE);
g_return_val_if_fail (str, FALSE);
g_return_val_if_fail (col >= 0, FALSE);
......@@ -262,7 +260,7 @@ sc_parse_let_expr (sc_file_state_t *src, const char *cmd, const char *str, int c
/* FIXME FIXME FIXME sc/xspread rows start at A0 not A1. we must
* go through and fixup each row number in each cell reference */
cell = sheet_cell_fetch (src->sheet, col, row);
cell = sheet_cell_fetch (sheet, col, row);
if (!cell)
return FALSE;
......@@ -278,12 +276,12 @@ out:
static gboolean
sc_parse_let (sc_file_state_t *src, const char *cmd, const char *str, int col, int row)
sc_parse_let (Sheet *sheet, const char *cmd, const char *str, int col, int row)
{
Cell *cell;
Value *v;
g_return_val_if_fail (src, FALSE);
g_return_val_if_fail (sheet, FALSE);
g_return_val_if_fail (cmd, FALSE);
g_return_val_if_fail (str, FALSE);
g_return_val_if_fail (col >= 0, FALSE);
......@@ -295,12 +293,12 @@ sc_parse_let (sc_file_state_t *src, const char *cmd, const char *str, int col, i
/* it's an expression not a simple value, handle elsewhere */
if (*str == '@')
#if SC_EXPR_PARSE_WORKS
return sc_parse_let_expr (src, cmd, str, col, row);
return sc_parse_let_expr (sheet, cmd, str, col, row);
#else
return TRUE;
#endif
cell = sheet_cell_fetch (src->sheet, col, row);
cell = sheet_cell_fetch (sheet, col, row);
if (!cell)
return FALSE;
......@@ -317,7 +315,7 @@ sc_parse_let (sc_file_state_t *src, const char *cmd, const char *str, int col, i
typedef struct {
const char *name;
int namelen;
gboolean (*handler) (sc_file_state_t *src, const char *name,
gboolean (*handler) (Sheet *sheet, const char *name,
const char *str, int col, int row);
unsigned have_coord : 1;
} sc_cmd_t;
......@@ -333,13 +331,13 @@ static const sc_cmd_t sc_cmd_list[] = {
static gboolean
sc_parse_line (sc_file_state_t *src, char *buf)
sc_parse_line (Sheet *sheet, char *buf)
{
const char *space;
int i, cmdlen;
const sc_cmd_t *cmd;
g_return_val_if_fail (src, FALSE);
g_return_val_if_fail (sheet, FALSE);
g_return_val_if_fail (buf, FALSE);
space =