1 /* This file is part of the Zebra server.
2 Copyright (C) 1994-2011 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>
26 #include <idzebra/version.h>
29 expand GCC_ATTRIBUTE if GCC is in use. See :
30 http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
32 To see gcc pre-defines for c:
33 gcc -E -dM -x c /dev/null
38 #define ZEBRA_GCC_ATTR(x) __attribute__ (x)
42 #ifndef ZEBRA_GCC_ATTR
43 #define ZEBRA_GCC_ATTR(x)
46 /* check that we don't have all too old yaz */
48 #error Need a modern yaz with YLOG_ defines
54 * \brief Zebra integer
56 * This integer is used in various Zebra APIs to specify record identifires,
57 * number of occurrences etc. It is a "large" integer and is usually
58 * 64-bit on newer architectures.
62 #define ZINT_FORMAT0 "I64d"
66 #error ZEBRA_ZINT undefined. idzebra-config not in use?
70 typedef long long int zint;
71 #define ZINT_FORMAT0 "lld"
74 #define ZINT_FORMAT0 "ld"
79 #define ZINT_FORMAT "%" ZINT_FORMAT0
81 /** \var typedef ZEBRA_RES
82 * \brief Common return type for Zebra API
84 * This return code indicates success with code ZEBRA_OK and failure
87 typedef short ZEBRA_RES;
91 YAZ_EXPORT zint atoi_zn(const char *buf, zint len);
93 YAZ_EXPORT void zebra_zint_encode(char **dst, zint pos);
95 YAZ_EXPORT void zebra_zint_decode(const char **src, zint *pos);
97 YAZ_EXPORT void zebra_exit(const char *msg);
99 YAZ_EXPORT zint atozint(const char *src);
103 #define CAST_ZINT_TO_INT(x) (int)(x)
104 #define CAST_ZINT_TO_DOUBLE(x) (double)(x)
110 * c-file-style: "Stroustrup"
111 * indent-tabs-mode: nil
113 * vim: shiftwidth=4 tabstop=8 expandtab