IDZEBRA  2.2.7
Macros | Typedefs | Functions
util.h File Reference
#include <yaz/yconfig.h>
#include <yaz/log.h>

Go to the source code of this file.

Macros

#define ZEBRA_GCC_ATTR(x)
 
#define ZINT_FORMAT0   "ld"
 
#define ZINT_FORMAT   "%" ZINT_FORMAT0
 
#define ZEBRA_FAIL   -1
 
#define ZEBRA_OK   0
 
#define CAST_ZINT_TO_INT(x)   (int)(x)
 
#define CAST_ZINT_TO_DOUBLE(x)   (double)(x)
 

Typedefs

typedef long zint
 Zebra integer. More...
 
typedef short ZEBRA_RES
 Common return type for Zebra API. More...
 

Functions

zint atoi_zn (const char *buf, zint len)
 
void zebra_zint_encode (char **dst, zint pos)
 
void zebra_zint_decode (const char **src, zint *pos)
 
void zebra_exit (const char *msg)
 
zint atozint (const char *src)
 

Macro Definition Documentation

◆ CAST_ZINT_TO_DOUBLE

#define CAST_ZINT_TO_DOUBLE (   x)    (double)(x)

Definition at line 97 of file util.h.

◆ CAST_ZINT_TO_INT

#define CAST_ZINT_TO_INT (   x)    (int)(x)

Definition at line 96 of file util.h.

◆ ZEBRA_FAIL

#define ZEBRA_FAIL   -1

Definition at line 81 of file util.h.

◆ ZEBRA_GCC_ATTR

#define ZEBRA_GCC_ATTR (   x)

expand GCC_ATTRIBUTE if GCC is in use. See : http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

To see gcc pre-defines for c: gcc -E -dM -x c /dev/null

Definition at line 41 of file util.h.

◆ ZEBRA_OK

#define ZEBRA_OK   0

Definition at line 82 of file util.h.

◆ ZINT_FORMAT

#define ZINT_FORMAT   "%" ZINT_FORMAT0

Definition at line 72 of file util.h.

◆ ZINT_FORMAT0

#define ZINT_FORMAT0   "ld"

Definition at line 67 of file util.h.

Typedef Documentation

◆ ZEBRA_RES

typedef ZEBRA_RES

Common return type for Zebra API.

This return code indicates success with code ZEBRA_OK and failure with ZEBRA_FAIL

Definition at line 80 of file util.h.

◆ zint

Zebra integer.

This integer is used in various Zebra APIs to specify record identifires, number of occurrences etc. It is a "large" integer and is usually 64-bit on newer architectures.

Definition at line 66 of file util.h.

Function Documentation

◆ atoi_zn()

zint atoi_zn ( const char *  buf,
zint  len 
)

◆ atozint()

zint atozint ( const char *  src)

◆ zebra_exit()

void zebra_exit ( const char *  msg)

◆ zebra_zint_decode()

void zebra_zint_decode ( const char **  src,
zint pos 
)

Definition at line 39 of file zint.c.

Referenced by rect_decode(), sort_term_decode1(), and sort_term_decode2().

◆ zebra_zint_encode()

void zebra_zint_encode ( char **  dst,
zint  pos 
)

Definition at line 26 of file zint.c.

Referenced by rect_encode(), sort_term_encode1(), and sort_term_encode2().