#else
static const bool odf_read_support = false;
struct spreadsheet *ods_probe (const char *filename, bool report_errors){}
-struct casereader * ods_make_reader (struct spreadsheet *spreadsheet,
- const struct spreadsheet_read_options *opts){}
-void ods_unref (struct spreadsheet *r){}
#endif
#ifdef GNM_READ_SUPPORT
#else
static const bool gnm_read_support = false;
struct spreadsheet *gnumeric_probe (const char *filename, bool report_errors){}
-struct casereader * gnumeric_make_reader (struct spreadsheet *spreadsheet,
- const struct spreadsheet_read_options *opts){}
-void gnumeric_unref (struct spreadsheet *r){}
-
#endif
static bool parse_spreadsheet (struct lexer *lexer, char **filename,
lex_get (lexer);
}
- if (!lex_force_id (lexer)
- || !dict_id_is_valid (dict, lex_tokcstr (lexer), true))
- goto error;
name = xstrdup (lex_tokcstr (lexer));
+ if (!lex_force_id (lexer)
+ || !dict_id_is_valid (dict, name, true))
+ {
+ goto error;
+ }
lex_get (lexer);
-
if (type == DP_DELIMITED)
{
if (!parse_format_specifier (lexer, &input)
- || !fmt_check_input (&input))
- goto error;
-
+ || !fmt_check_input (&input))
+ {
+ goto error;
+ }
output = fmt_for_output_from_input (&input);
}
else
msg (SE, _("Unknown format type `%s'."), fmt_type_name);
goto error;
}
-
/* Compose input format. */
input.type = fmt_type;
input.w = lc - fc + 1;
input.d = 0;
if (!fmt_check_input (&input))
goto error;
-
/* Compose output format. */
if (w != 0)
{
else
output = fmt_for_output_from_input (&input);
}
-
v = dict_create_var (dict, name, fmt_var_width (&input));
if (v == NULL)
{
goto error;
}
var_set_both_formats (v, &output);
-
if (type == DP_DELIMITED)
data_parser_add_delimited_field (parser, &input,
var_get_case_index (v),