X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fodr.h;h=9c7ea51a04b6e6b0daeb785e36478ce48f3ee218;hb=cabcc223cd47503763e7c42969e3be30c58276af;hp=32cb334f282930e9fcccfaffd53051d44eb96edf;hpb=77c5a4fca8b516fd39b8ba213daed17a465a6b2a;p=yaz-moved-to-github.git diff --git a/include/yaz/odr.h b/include/yaz/odr.h index 32cb334..9c7ea51 100644 --- a/include/yaz/odr.h +++ b/include/yaz/odr.h @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2012 Index Data. + * Copyright (C) 1995-2013 Index Data. * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -96,11 +96,15 @@ typedef nmem_bool_t Odr_bool; #define ODR_ENCODE 1 #define ODR_PRINT 2 +#define OCT_SIZE 0 + typedef struct odr_oct { unsigned char *buf; int len; +#if OCT_SIZE int size; +#endif } Odr_oct; typedef void Odr_null; @@ -285,6 +289,7 @@ YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, const Odr_oid *o); YAZ_EXPORT Odr_oid *odr_oiddup_nmem(NMEM nmem, const Odr_oid *o); YAZ_EXPORT int odr_grow_block(ODR b, int min_bytes); YAZ_EXPORT int odr_write(ODR o, unsigned char *buf, int bytes); +YAZ_EXPORT int odr_write2(ODR o, const char *buf, int bytes); YAZ_EXPORT int odr_seek(ODR o, int whence, int offset); YAZ_EXPORT int odr_dumpBER(FILE *f, const char *buf, int len); YAZ_EXPORT void odr_choice_bias(ODR o, int what); @@ -312,7 +317,7 @@ typedef struct Odr_external union { Odr_any *single_ASN1_type; - Odr_oct *octet_aligned; + Odr_oct *octet_aligned; Odr_bitmask *arbitrary; /* we aren't really equipped for this*/ } u; } Odr_external; @@ -329,7 +334,7 @@ YAZ_EXPORT int odr_generalizedtime(ODR o, char **p, int opt, YAZ_EXPORT int odr_set_charset(ODR o, const char *to, const char *from); YAZ_EXPORT void odr_set_stream(ODR o, void *handle, - void (*stream_write)(ODR o, + void (*stream_write)(ODR o, void *handle, int type, const char *buf,