1 /* PSPP - computes sample statistics.
2 Copyright (C) 2006 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 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, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 #ifndef LIBPSPP_INTEGER_FORMAT_H
20 #define LIBPSPP_INTEGER_FORMAT_H 1
25 #include <libpspp/str.h>
27 /* An integer format. */
30 INTEGER_MSB_FIRST, /* Big-endian: MSB at lowest address. */
31 INTEGER_LSB_FIRST, /* Little-endian: LSB at lowest address. */
32 INTEGER_VAX, /* VAX-endian: little-endian 16-bit words
33 in big-endian order. */
35 /* Native endianness. */
36 #ifdef WORDS_BIGENDIAN
37 INTEGER_NATIVE = INTEGER_MSB_FIRST
39 INTEGER_NATIVE = INTEGER_LSB_FIRST
43 void integer_convert (enum integer_format, const void *,
44 enum integer_format, void *,
46 uint64_t integer_get (enum integer_format, const void *, size_t);
47 void integer_put (uint64_t, enum integer_format, void *, size_t);
49 bool integer_identify (uint64_t expected_value, const void *, size_t,
50 enum integer_format *);
52 #endif /* libpspp/integer-format.h */