#if !GNM_READ_SUPPORT
-struct casereader *
-gnumeric_open_reader (const struct spreadsheet_read_options *opts, struct dictionary **dict)
+struct spreadsheet *
+gnumeric_probe (const char *filename, bool report_errors)
{
- msg (ME, _("Support for %s files was not compiled into this installation of PSPP"), "Gnumeric");
+ if (report_errors)
+ msg (ME, _("Support for %s files was not compiled into this installation of PSPP"), "Gnumeric");
+
+ return NULL;
+}
+const char *
+gnumeric_get_sheet_name (struct spreadsheet *s, int n)
+{
+ return NULL;
+}
+
+char *
+gnumeric_get_sheet_range (struct spreadsheet *s, int n)
+{
return NULL;
}
#if !ODF_READ_SUPPORT
-struct casereader *
-ods_open_reader (const struct spreadsheet_read_options *opts,
- struct dictionary **dict)
+struct spreadsheet *
+ods_probe (const char *filename, bool report_errors)
{
- msg (ME, _("Support for %s files was not compiled into this installation of PSPP"), "OpenDocument");
+ if (report_errors)
+ msg (ME, _("Support for %s files was not compiled into this installation of PSPP"), "OpenDocument");
+
+ return NULL;
+}
+const char *
+ods_get_sheet_name (struct spreadsheet *s, int n)
+{
+ return NULL;
+}
+
+char *
+ods_get_sheet_range (struct spreadsheet *s, int n)
+{
return NULL;
}
#define _(msgid) gettext (msgid)
#define N_(msgid) (msgid)
-
-#ifdef ODF_READ_SUPPORT
-static const bool odf_read_support = true;
-#else
-static const bool odf_read_support = false;
-struct spreadsheet *ods_probe (const char *filename, bool report_errors){}
-#endif
-
-#ifdef GNM_READ_SUPPORT
-static const bool gnm_read_support = true;
-#else
-static const bool gnm_read_support = false;
-struct spreadsheet *gnumeric_probe (const char *filename, bool report_errors){}
-#endif
-
static bool parse_spreadsheet (struct lexer *lexer, char **filename,
struct spreadsheet_read_options *opts);
goto error;
struct spreadsheet *spreadsheet = NULL;
- if ( gnm_read_support && 0 == strncasecmp (tok, "GNM", 3))
+ if ( 0 == strncasecmp (tok, "GNM", 3))
spreadsheet = gnumeric_probe (filename, true);
- else if ( odf_read_support && 0 == strncasecmp (tok, "ODS", 3))
+ else if ( 0 == strncasecmp (tok, "ODS", 3))
spreadsheet = ods_probe (filename, true);
- free (filename);
if (spreadsheet == NULL)
- goto error;
+ {
+ msg (SE, _("error reading file `%s'"), filename);
+ free (filename);
+ goto error;
+ }
+ free (filename);
struct casereader *reader = spreadsheet_make_reader (spreadsheet, &opts);
if (reader)