1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2006, 2011 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/>. */
17 #ifndef LIBPSPP_INTEGER_FORMAT_H
18 #define LIBPSPP_INTEGER_FORMAT_H 1
23 #include "libpspp/str.h"
25 /* An integer format. */
28 INTEGER_MSB_FIRST, /* Big-endian: MSB at lowest address. */
29 INTEGER_LSB_FIRST, /* Little-endian: LSB at lowest address. */
30 INTEGER_VAX, /* VAX-endian: little-endian 16-bit words
31 in big-endian order. */
33 /* Native endianness. */
34 #ifdef WORDS_BIGENDIAN
35 INTEGER_NATIVE = INTEGER_MSB_FIRST
37 INTEGER_NATIVE = INTEGER_LSB_FIRST
41 void integer_convert (enum integer_format, const void *,
42 enum integer_format, void *,
44 uint64_t integer_get (enum integer_format, const void *, size_t);
45 void integer_put (uint64_t, enum integer_format, void *, size_t);
47 bool integer_identify (uint64_t expected_value, const void *, size_t,
48 enum integer_format *);
50 #endif /* libpspp/integer-format.h */