1 /* This file is part of the Zebra server.
2 Copyright (C) Index Data
4 Zebra is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
9 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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 St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include <yaz/yconfig.h>
27 expand GCC_ATTRIBUTE if GCC is in use. See :
28 http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
30 To see gcc pre-defines for c:
31 gcc -E -dM -x c /dev/null
36 #define ZEBRA_GCC_ATTR(x) __attribute__ (x)
40 #ifndef ZEBRA_GCC_ATTR
41 #define ZEBRA_GCC_ATTR(x)
47 * \brief Zebra integer
49 * This integer is used in various Zebra APIs to specify record identifires,
50 * number of occurrences etc. It is a "large" integer and is usually
51 * 64-bit on newer architectures.
55 #define ZINT_FORMAT0 "I64d"
59 #error ZEBRA_ZINT undefined. idzebra-config not in use?
63 typedef long long int zint;
64 #define ZINT_FORMAT0 "lld"
67 #define ZINT_FORMAT0 "ld"
72 #define ZINT_FORMAT "%" ZINT_FORMAT0
74 /** \var typedef ZEBRA_RES
75 * \brief Common return type for Zebra API
77 * This return code indicates success with code ZEBRA_OK and failure
80 typedef short ZEBRA_RES;
84 YAZ_EXPORT zint atoi_zn(const char *buf, zint len);
86 YAZ_EXPORT void zebra_zint_encode(char **dst, zint pos);
88 YAZ_EXPORT void zebra_zint_decode(const char **src, zint *pos);
90 YAZ_EXPORT void zebra_exit(const char *msg);
92 YAZ_EXPORT zint atozint(const char *src);
96 #define CAST_ZINT_TO_INT(x) (int)(x)
97 #define CAST_ZINT_TO_DOUBLE(x) (double)(x)
103 * c-file-style: "Stroustrup"
104 * indent-tabs-mode: nil
106 * vim: shiftwidth=4 tabstop=8 expandtab