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 */
};
#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