X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fspreadsheet-reader.h;h=37b249d4e9c4af6c4884ac7b7da8b2d4259e6b53;hb=0eaa93ed33ee3c78e2b1fd710751db7ed06ac786;hp=5e7eaa6e4603a128ca2368934e018f0b879425b4;hpb=dc0421d8193bedae4344d665a89ba639d1f29c8d;p=pspp diff --git a/src/data/spreadsheet-reader.h b/src/data/spreadsheet-reader.h index 5e7eaa6e46..37b249d4e9 100644 --- a/src/data/spreadsheet-reader.h +++ b/src/data/spreadsheet-reader.h @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2007, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2010, 2016 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,7 @@ #define SPREADSHEET_READ_H 1 #include +#include struct casereeader; @@ -59,28 +60,32 @@ enum spreadsheet_type struct spreadsheet { - const char *file_name; + char *file_name; enum spreadsheet_type type; /* The total number of sheets in the "workbook" */ int n_sheets; - /* The dictionary */ - struct dictionary *dict; + /* The dictionary for client's reference. + Client must clone if it needs a permanent or modifiable copy. */ + const struct dictionary *dict; + + int ref_cnt; }; struct casereader * spreadsheet_make_reader (struct spreadsheet *, const struct spreadsheet_read_options *); -const char * spreadsheet_get_sheet_name (struct spreadsheet *s, int n); -char * spreadsheet_get_sheet_range (struct spreadsheet *s, int n); +const char * spreadsheet_get_sheet_name (struct spreadsheet *s, int n) OPTIMIZE(2); +char * spreadsheet_get_sheet_range (struct spreadsheet *s, int n) OPTIMIZE(2); char * create_cell_ref (int col0, int row0); char *create_cell_range (int col0, int row0, int coli, int rowi); -void spreadsheet_destroy (struct spreadsheet *); +void spreadsheet_unref (struct spreadsheet *); +void spreadsheet_ref (struct spreadsheet *);