+struct spreadsheet *
+ods_probe (const char *filename, bool report_errors)
+{
+ struct ods_reader *r;
+ struct string errs = DS_EMPTY_INITIALIZER;
+ int sheet_count;
+ struct zip_reader *zr = zip_reader_create (filename, &errs);
+
+ if (zr == NULL)
+ {
+ if (report_errors)
+ {
+ msg (ME, _("Cannot open %s as a OpenDocument file: %s"),
+ filename, ds_cstr (&errs));
+ }
+ return NULL;
+ }
+
+ sheet_count = get_sheet_count (zr);
+
+ r = xzalloc (sizeof *r);
+ r->zreader = zr;
+ r->ref_cnt = 1;
+
+ if (! init_reader (r, report_errors))
+ {
+ goto error;
+ }
+
+ r->spreadsheet.n_sheets = sheet_count;
+ r->n_allocated_sheets = 0;
+ r->sheets = NULL;
+
+ ds_destroy (&errs);