1 /* PSPP - computes sample statistics.
2 Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
3 Written by Ben Pfaff <blp@gnu.org>.
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
29 /* Max length of a short string value, generally 8 chars. */
30 #define MAX_SHORT_STRING ((SIZEOF_DOUBLE)>=8 ? ((SIZEOF_DOUBLE)+1)/2*2 : 8)
31 #define MIN_LONG_STRING (MAX_SHORT_STRING+1)
33 /* Max string length. */
34 #define MAX_STRING 255
36 /* FYI: It is a bad situation if sizeof(flt64) < MAX_SHORT_STRING:
37 then short string missing values can be truncated in system files
38 because there's only room for as many characters as can fit in a
40 #if MAX_SHORT_STRING > SHORT_NAME_LEN
41 #error MAX_SHORT_STRING must be less than or equal to SHORT_NAME_LEN.
45 #define SYSMIS (-DBL_MAX)
46 #define LOWEST second_lowest_value
47 #define HIGHEST DBL_MAX
49 /* Describes one value, which is either a floating-point number or a
53 /* A numeric value. */
56 /* A short-string value. */
57 char s[MAX_SHORT_STRING];
59 /* Used by evaluate_expression() to return a string result.
60 As currently implemented, it's a pointer to a dynamic
61 buffer in the appropriate expression.
63 Also used by the AGGREGATE procedure in handling string
68 /* Maximum number of `union value's in a single number or string
70 #define MAX_ELEMS_PER_VALUE (MAX_STRING / sizeof (union value) + 1)
72 int compare_values (const union value *a, const union value *b, int width);
74 unsigned hash_value(const union value *v, int width);