Added property for the backend
[pspp] / src / data / spreadsheet-reader.h
index 6ea0bde4a436403330186cba95c8adda6d24f6bb..f9a30209e4db281975b3fa5dc16752a5aa224549 100644 (file)
@@ -36,7 +36,6 @@ struct spreadsheet_read_options
 
 struct spreadsheet_read_info
 {
-  char *file_name ;        /* The name of the file to open (in filename encoding) */
   bool read_names ;        /* True if the first row is to be used as the names of the variables */
   int asw ;                /* The width of string variables in the created dictionary */
 };
@@ -52,5 +51,40 @@ bool convert_cell_ref (const char *ref,
 
 #define _xmlchar_to_int(X) (atoi(CHAR_CAST (const char *, X)))
 
+enum spreadsheet_type
+  {
+    SPREADSHEET_NONE,
+    SPREADSHEET_GNUMERIC,
+    SPREADSHEET_ODS
+  };
+
+struct spreadsheet
+{
+  char *file_name;
+
+  enum spreadsheet_type type;
+
+  /* The total number of sheets in the "workbook" */
+  int sheets;
+
+  /* The dictionary */
+  struct dictionary *dict;
+};
+
+/* 
+   Attempt to open the file called FILENAME as a spreadsheet.
+   It is not known a priori, what type of spreadsheet FILENAME is, or
+   even if it is a spreadsheet at all.
+   If it fails to open, then it will return NULL without any error or
+   warning messages.
+ */
+struct spreadsheet * spreadsheet_open (const char *filename);
+void spreadsheet_close (struct spreadsheet *);
+
+struct casereeader;
+struct casereader * spreadsheet_make_reader (struct spreadsheet *s);
+
+
+#define SPREADSHEET_CAST(X) ((struct spreadsheet *)(X))
 
 #endif