1 /* PSPP - computes sample statistics.
2 Copyright (C) 2006 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
20 #ifndef LIBPSPP_INTEGER_FORMAT_H
21 #define LIBPSPP_INTEGER_FORMAT_H 1
26 #include <libpspp/str.h>
28 /* An integer format. */
31 INTEGER_MSB_FIRST, /* Big-endian: MSB at lowest address. */
32 INTEGER_LSB_FIRST, /* Little-endian: LSB at lowest address. */
33 INTEGER_VAX, /* VAX-endian: little-endian 16-bit words
34 in big-endian order. */
36 /* Native endianness. */
37 #ifdef WORDS_BIGENDIAN
38 INTEGER_NATIVE = INTEGER_MSB_FIRST
40 INTEGER_NATIVE = INTEGER_LSB_FIRST
44 void integer_convert (enum integer_format, const void *,
45 enum integer_format, void *,
47 uint64_t integer_get (enum integer_format, const void *, size_t);
48 void integer_put (uint64_t, enum integer_format, void *, size_t);
50 bool integer_identify (uint64_t expected_value, const void *, size_t,
51 enum integer_format *);
53 #endif /* libpspp/integer-format.h */