64-bit BER integers. Fixes bug #114.
[yaz-moved-to-github.git] / include / yaz / odr.h
index d687d14..c0dc755 100644 (file)
 
 YAZ_BEGIN_CDECL
 
+#define ODR_INT_PRINTF "%lld"
+
+typedef long long int odr_int_t;
+typedef int odr_bool_t;
+
 #ifndef bool_t
 #define bool_t int
 #endif
@@ -184,7 +189,8 @@ YAZ_EXPORT void *odr_malloc(ODR o, int size);
 YAZ_EXPORT char *odr_strdup(ODR o, const char *str);
 YAZ_EXPORT char *odr_strdupn(ODR o, const char *str, size_t n);
 YAZ_EXPORT char *odr_strdup_null(ODR o, const char *str);
-YAZ_EXPORT int *odr_intdup(ODR o, int v);
+YAZ_EXPORT odr_int_t *odr_intdup(ODR o, odr_int_t v);
+YAZ_EXPORT odr_bool_t *odr_booldup(ODR o, odr_bool_t v);
 YAZ_EXPORT Odr_oct *odr_create_Odr_oct(ODR o, const unsigned char *buf,
                                        int sz);
 YAZ_EXPORT NMEM odr_extract_mem(ODR o);
@@ -229,15 +235,15 @@ YAZ_EXPORT int ber_enctag(ODR o, int zclass, int tag, int constructed);
 YAZ_EXPORT int ber_dectag(const unsigned char *buf, int *zclass,
                           int *tag, int *constructed, int max);
 YAZ_EXPORT int odr_bool(ODR o, int **p, int opt, const char *name);
-YAZ_EXPORT int odr_integer(ODR o, int **p, int opt, const char *name);
-YAZ_EXPORT int odr_enum(ODR o, int **p, int opt, const char *name);
+YAZ_EXPORT int odr_integer(ODR o, odr_int_t **p, int opt, const char *name);
+YAZ_EXPORT int odr_enum(ODR o, odr_int_t **p, int opt, const char *name);
 YAZ_EXPORT int odr_implicit_settag(ODR o, int zclass, int tag);
 YAZ_EXPORT int ber_enclen(ODR o, int len, int lenlen, int exact);
 YAZ_EXPORT int ber_declen(const unsigned char *buf, int *len, int max);
 YAZ_EXPORT void odr_prname(ODR o, const char *name);
 YAZ_EXPORT int ber_null(ODR o);
 YAZ_EXPORT int odr_null(ODR o, Odr_null **p, int opt, const char *name);
-YAZ_EXPORT int ber_integer(ODR o, int *val);
+YAZ_EXPORT int ber_integer(ODR o, odr_int_t *val);
 YAZ_EXPORT int odr_constructed_begin(ODR o, void *p, int zclass, int tag,
                                      const char *name);
 YAZ_EXPORT int odr_constructed_end(ODR o);
@@ -298,7 +304,7 @@ YAZ_EXPORT char *odr_prepend(ODR o, const char *prefix, const char *old);
 typedef struct Odr_external
 {
     Odr_oid *direct_reference;       /* OPTIONAL */
-    int     *indirect_reference;     /* OPTIONAL */
+    odr_int_t *indirect_reference;   /* OPTIONAL */
     char    *descriptor;             /* OPTIONAL */
     int which;
 #define ODR_EXTERNAL_single 0