File: importer.h

package info (click to toggle)
gretl 2022c-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,552 kB
  • sloc: ansic: 409,074; sh: 4,449; makefile: 3,222; cpp: 2,777; xml: 599; perl: 364
file content (73 lines) | stat: -rw-r--r-- 2,529 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* 
 *  gretl -- Gnu Regression, Econometrics and Time-series Library
 *  Copyright (C) 2001 Allin Cottrell and Riccardo "Jack" Lucchetti
 * 
 *  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
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

typedef struct wbook_ wbook;

typedef enum {
    BOOK_NUMERIC_DATES   = 1 << 0,
    BOOK_DATE_BASE_1904  = 1 << 1,
    BOOK_AUTO_VARNAMES   = 1 << 2,
    BOOK_TIME_SERIES     = 1 << 3,
    BOOK_OBS_LABELS      = 1 << 4,
    BOOK_OBS_BLANK       = 1 << 5,
    BOOK_DEBUG           = 1 << 6,
    BOOK_DATA_REVERSED   = 1 << 7,
    BOOK_TOP_LEFT_EMPTY  = 1 << 8,
    BOOK_NON_NUMERIC     = 1 << 9
} BookFlag;

enum {
    COL_OFFSET,
    ROW_OFFSET
};

#define book_numeric_dates(b) ((b)->flags & BOOK_NUMERIC_DATES)
#define book_base_1904(b)     ((b)->flags & BOOK_DATE_BASE_1904)
#define book_auto_varnames(b) ((b)->flags & BOOK_AUTO_VARNAMES)
#define book_time_series(b)   ((b)->flags & BOOK_TIME_SERIES)
#define book_obs_labels(b)    ((b)->flags & BOOK_OBS_LABELS)
#define book_debugging(b)     ((b)->flags & BOOK_DEBUG)

#define book_set_numeric_dates(b) ((b)->flags |= BOOK_NUMERIC_DATES)
#define book_unset_numeric_dates(b) ((b)->flags &= ~BOOK_NUMERIC_DATES)
#define book_set_base_1904(b)     ((b)->flags |= BOOK_DATE_BASE_1904)
#define book_set_auto_varnames(b) ((b)->flags |= BOOK_AUTO_VARNAMES)
#define book_set_time_series(b)   ((b)->flags |= BOOK_TIME_SERIES)
#define book_set_obs_labels(b)    ((b)->flags |= BOOK_OBS_LABELS)
#define book_set_debug(b)         ((b)->flags |= BOOK_DEBUG)

#define book_unset_obs_labels(b)  ((b)->flags &= ~BOOK_OBS_LABELS)
#define book_unset_time_series(b) ((b)->flags &= ~BOOK_TIME_SERIES)

struct wbook_ {
    BookFlag flags;
    int version;
    int nsheets;
    int selected;
    int col_offset, row_offset;
    char *targname;
    char **sheetnames;
    guint32 *byte_offsets;
    void *colspin, *rowspin;
    int *xf_list;
    int (*get_min_offset)();
    void *data;
};