X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=include%2Fidzebra%2Futil.h;h=831ef3f7aeaa12075ce670feb0074603ba62bdbf;hb=b04a1cdb1a0345252a78caa8f7731089df314ad0;hp=2abf9cf4b932671ae0c5210386d46dd0bbd545a6;hpb=5ffac76f04c812b586d0fb5619cb281135a7fe4c;p=idzebra-moved-to-github.git diff --git a/include/idzebra/util.h b/include/idzebra/util.h index 2abf9cf..831ef3f 100644 --- a/include/idzebra/util.h +++ b/include/idzebra/util.h @@ -1,4 +1,4 @@ -/* $Id: util.h,v 1.9 2006-10-10 14:45:42 adam Exp $ +/* $Id: util.h,v 1.13 2006-12-22 13:48:20 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -28,6 +28,24 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include +/** + 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 +*/ + +#ifdef __GNUC__ +#if __GNUC__ >= 4 +#define ZEBRA_GCC_ATTR(x) __attribute__ (x) +#endif +#endif + +#ifndef ZEBRA_GCC_ATTR +#define ZEBRA_GCC_ATTR(x) +#endif + /* check that we don't have all too old yaz */ #ifndef YLOG_ERRNO #error Need a modern yaz with YLOG_ defines @@ -73,16 +91,32 @@ typedef short ZEBRA_RES; #define ZEBRA_FAIL -1 #define ZEBRA_OK 0 -typedef zint SYSNO; +YAZ_EXPORT zint atoi_zn(const char *buf, zint len); -YAZ_EXPORT -zint atoi_zn (const char *buf, zint len); +YAZ_EXPORT void zebra_zint_encode(char **dst, zint pos); -YAZ_EXPORT -void zebra_zint_encode(char **dst, zint pos); +YAZ_EXPORT void zebra_zint_decode(const char **src, zint *pos); +YAZ_EXPORT void zebra_exit(const char *msg); + +typedef struct zebra_timing *zebra_timing_t; + +YAZ_EXPORT +zebra_timing_t zebra_timing_create(void); +YAZ_EXPORT +void zebra_timing_start(zebra_timing_t t); +YAZ_EXPORT +void zebra_timing_stop(zebra_timing_t t); YAZ_EXPORT -void zebra_zint_decode(const char **src, zint *pos); +double zebra_timing_get_real(zebra_timing_t t); +YAZ_EXPORT +double zebra_timing_get_user(zebra_timing_t t); +YAZ_EXPORT +double zebra_timing_get_sys(zebra_timing_t t); +YAZ_EXPORT +void zebra_timing_destroy(zebra_timing_t *tp); + +YAZ_EXPORT zint atozint(const char *src); YAZ_END_CDECL