projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pspp-mode.el: Make indentation closer to what lisp people like.
[pspp]
/
src
/
data
/
spreadsheet-reader.h
diff --git
a/src/data/spreadsheet-reader.h
b/src/data/spreadsheet-reader.h
index e9656ab12d2751818abf4abf0ae2d483106b210d..efba6f369fbf3577511aa01f422c64d241893db4 100644
(file)
--- a/
src/data/spreadsheet-reader.h
+++ b/
src/data/spreadsheet-reader.h
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* 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
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 <stdbool.h>
#define SPREADSHEET_READ_H 1
#include <stdbool.h>
+#include <libpspp/compiler.h>
struct casereeader;
struct casereeader;
@@
-31,7
+32,8
@@
struct casereeader;
struct spreadsheet_read_options
{
char *sheet_name ; /* The name of the sheet to open (in UTF-8) */
struct spreadsheet_read_options
{
char *sheet_name ; /* The name of the sheet to open (in UTF-8) */
- int sheet_index ; /* The index of the sheet to open (only used if sheet_name is NULL) */
+ int sheet_index ; /* The index of the sheet to open (only used if sheet_name is NULL).
+ The first index is 1 NOT 0 */
char *cell_range ; /* The cell range (in UTF-8) */
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 */
char *cell_range ; /* The cell range (in UTF-8) */
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 */
@@
-45,9
+47,9
@@
bool convert_cell_ref (const char *ref,
int *coli, int *rowi);
int *coli, int *rowi);
-#define _xml(X) (CHAR_CAST (const xmlChar *,
X
))
+#define _xml(X) (CHAR_CAST (const xmlChar *,
(X)
))
-#define _xmlchar_to_int(X) (
atoi(CHAR_CAST (const char *, X))
)
+#define _xmlchar_to_int(X) (
(X) ? atoi (CHAR_CAST (const char *, (X))) : -1
)
enum spreadsheet_type
{
enum spreadsheet_type
{
@@
-59,28
+61,32
@@
enum spreadsheet_type
struct spreadsheet
{
struct spreadsheet
{
- c
onst c
har *file_name;
+ char *file_name;
enum spreadsheet_type type;
/* The total number of sheets in the "workbook" */
int n_sheets;
enum spreadsheet_type type;
/* The total number of sheets in the "workbook" */
int n_sheets;
- /* The dictionary */
+ /* The dictionary for client's reference.
+ Client must ref or clone it if it needs a permanent or modifiable copy. */
struct dictionary *dict;
struct dictionary *dict;
+
+ int ref_cnt;
};
struct casereader * spreadsheet_make_reader (struct spreadsheet *, const struct spreadsheet_read_options *);
};
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);
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 *);