1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2010 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 struct pspp_sav_header
31 /* Values for 'type' member of struct pspp_sav_format. */
32 #define PSPP_SAV_FMT_A 1
33 #define PSPP_SAV_FMT_AHEX 2
34 #define PSPP_SAV_FMT_COMMA 3
35 #define PSPP_SAV_FMT_DOLLAR 4
36 #define PSPP_SAV_FMT_F 5
37 #define PSPP_SAV_FMT_IB 6
38 #define PSPP_SAV_FMT_PIBHEX 7
39 #define PSPP_SAV_FMT_P 8
40 #define PSPP_SAV_FMT_PIB 9
41 #define PSPP_SAV_FMT_PK 10
42 #define PSPP_SAV_FMT_RB 11
43 #define PSPP_SAV_FMT_RBHEX 12
44 /* 13 and 14 are not used. */
45 #define PSPP_SAV_FMT_Z 15
46 #define PSPP_SAV_FMT_N 16
47 #define PSPP_SAV_FMT_E 17
48 /* 18 and 19 are not used. */
49 #define PSPP_SAV_FMT_DATE 20
50 #define PSPP_SAV_FMT_TIME 21
51 #define PSPP_SAV_FMT_DATETIME 22
52 #define PSPP_SAV_FMT_ADATE 23
53 #define PSPP_SAV_FMT_JDATE 24
54 #define PSPP_SAV_FMT_DTIME 25
55 #define PSPP_SAV_FMT_WKDAY 26
56 #define PSPP_SAV_FMT_MONTH 27
57 #define PSPP_SAV_FMT_MOYR 28
58 #define PSPP_SAV_FMT_QYR 29
59 #define PSPP_SAV_FMT_WKYR 30
60 #define PSPP_SAV_FMT_PCT 31
61 #define PSPP_SAV_FMT_DOT 32
62 #define PSPP_SAV_FMT_CCA 33
63 #define PSPP_SAV_FMT_CCB 34
64 #define PSPP_SAV_FMT_CCC 35
65 #define PSPP_SAV_FMT_CCD 36
66 #define PSPP_SAV_FMT_CCE 37
67 #define PSPP_SAV_FMT_EDATE 38
68 #define PSPP_SAV_FMT_SDATE 39
70 struct pspp_sav_format
72 int type; /* One of PSPP_SAV_FMT_*. */
74 int d; /* Number of decimal places, 0 for strings. */
83 struct pspp_sav_missing_values
86 union pspp_sav_value *values;
91 union pspp_sav_value lo, hi;
94 struct pspp_sav_variable
99 struct pspp_sav_format print;
100 struct pspp_sav_format write;
101 struct pspp_sav_missing_values missing;
104 struct pspp_sav_value_label
106 union pspp_sav_value value;
110 struct pspp_sav_value_labels
112 /* The variables that are labeled. */
117 struct pspp_sav_value_label *labels;
121 struct pspp_sav_document
127 #define PSPP_SAV_FP_IEEE754 1
128 #define PSPP_SAV_FP_IBM370 2
129 #define PSPP_SAV_FP_DECVAXE 3
131 #define PSPP_SAV_ENDIAN_BIG 1
132 #define PSPP_SAV_ENDIAN_LITTLE 2
134 #define PSPP_SAV_CC_EBCDIC 1
135 #define PSPP_SAV_CC_ASCII7 2
136 #define PSPP_SAV_CC_ASCII8 3
137 #define PSPP_SAV_CC_DECKANJI 4
139 struct pspp_sav_integer_info
143 int version_revision;
146 int compression_code;
151 struct pspp_sav_float_info
158 /* Type of a multiple response set. */
159 #define PSPP_SAV_MRSET_MDGROUP 0 /* Multiple dichotomy group. */
160 #define PSPP_SAV_MRSET_MCGROUP 1 /* Multiple category group. */
162 /* Source of category labels for a multiple dichotomy group. */
163 #define PSPP_SAV_MDGROUP_VARLABELS 0 /* Variable labels. */
164 #define PSPP_SAV_MDGROUP_COUNTEDVALUES 1 /* Value labels for counted value. */
166 struct pspp_sav_mrset
170 char **var_short_names;
172 int type; /* One of PSPP_SAV_MRSET_*. */
174 /* PSPP_SAV_MRSET_MDGROUP only */
175 int cat_source; /* Source of category labels. */
176 bool label_from_var_label; /* 'label' taken from variable label? */
177 union pspp_sav_value counted; /* Counted value. */
178 int width; /* Width of 'counted'. */
181 /* Measurement level. */
182 #define PSPP_SAV_MEASURE_UNKNOWN 0
183 #define PSPP_SAV_MEASURE_NOMINAL 1
184 #define PSPP_SAV_MEASURE_ORDINAL 2
185 #define PSPP_SAV_MEASURE_CONTINUOUS 3
188 #define PSPP_SAV_ALIGN_LEFT 0
189 #define PSPP_SAV_ALIGN_RIGHT 1
190 #define PSPP_SAV_ALIGN_CENTER 2
192 struct pspp_sav_display
194 int measure; /* One of PSPP_SAV_MEASURE_*. */
195 int width; /* Display width in ems, 0 if not present. */
196 int alignment; /* One of PSPP_SAV_ALIGN_*. */
199 struct pspp_sav_display_params
201 struct pspp_sav_display *params;
205 struct pspp_sav_long_name
211 struct pspp_sav_very_long_string
214 short int full_width;
217 struct pspp_sav_encoding
222 struct pspp_sav_long_string_value_labels
224 /* Labeled variable. */
225 char *var_name; /* Name of labeled variable. */
226 int width; /* Width of labeled variable, in [9,32767]. */
229 struct pspp_sav_value_label *labels;
233 struct pspp_sav_attribute
235 char *long_var_name; /* Variable name (NULL for file attribute). */
236 char *attr_name; /* Attribute name. */
237 char **values; /* All the values. */
238 size_t n_values; /* Number of values. */
241 struct pspp_sav_ncases64
243 long long int n_cases;
246 /* Compression opcodes. */
247 #define PSPP_SAV_OP_IGNORE 0 /* No-op */
248 #define PSPP_SAV_OP_INT_MIN 1 /* Minimum compressed integer opcode. */
249 #define PSPP_SAV_OP_INT_MIN 251 /* Maximum compressed integer opcode. */
250 #define PSPP_SAV_OP_EOF 252 /* End of data. */
251 #define PSPP_SAV_OP_LITERAL 253 /* 8-byte uncompressible data follows. */
252 #define PSPP_SAV_OP_SPACES 254 /* Represents 8 bytes of spaces. */
253 #define PSPP_SAV_OP_SYSMIS 255 /* Represents system missing value. */
255 #endif /* pspp-sav.h */