3 * boot.c : Installation and bootstraping routines to
4 * register the applix plugin.
6 * Copyright (C) 2000-2002 Jody Goldberg (jody@gnome.org)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23 #include <gnumeric-config.h>
27 #include <goffice/goffice.h>
28 #include <gnm-plugin.h>
29 #include <workbook-view.h>
32 #include <gsf/gsf-input.h>
35 GNM_PLUGIN_MODULE_HEADER
;
37 gboolean
applix_file_probe (GOFileOpener
const *fo
, GsfInput
*input
,
39 void applix_file_open (GOFileOpener
const *fo
, GOIOContext
*io_context
,
40 WorkbookView
*wb_view
, GsfInput
*input
);
41 void applix_file_save (GOFileSaver
const *fs
, GOIOContext
*io_context
,
42 WorkbookView
const *wb_view
, GsfOutput
*output
);
45 applix_file_probe (GOFileOpener
const *fo
, GsfInput
*input
, GOFileProbeLevel pl
)
47 static guint8
const signature
[] = "*BEGIN SPREADSHEETS VERSION";
50 return !gsf_input_seek (input
, 0, G_SEEK_SET
) &&
51 NULL
!= (header
= gsf_input_read (input
, sizeof (signature
)-1, NULL
)) &&
52 0 == memcmp (header
, signature
, sizeof (signature
)-1);
56 applix_file_open (GOFileOpener
const *fo
, GOIOContext
*io_context
,
57 WorkbookView
*wb_view
, GsfInput
*input
)
59 applix_read (io_context
, wb_view
, input
);
63 applix_file_save (GOFileSaver
const *fs
, GOIOContext
*io_context
,
64 WorkbookView
const *wb_view
, GsfOutput
*output
)
66 applix_write (io_context
, wb_view
, output
);