From db93359f0cbf9a1e9dc81ea05f7b8662f843ae3d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 19 Mar 2007 21:08:13 +0000 Subject: [PATCH] Moved more members of public struct odr (ODR*) to struct Odr_private. --- include/yaz/odr.h | 24 ++++++++---------------- src/ber_tag.c | 4 ++-- src/odr-priv.h | 11 ++++++++++- src/odr.c | 28 ++++++++++++++-------------- src/odr_bit.c | 11 ++++++----- src/odr_bool.c | 11 ++++++----- src/odr_choice.c | 12 ++++++------ src/odr_cons.c | 21 +++++++++++---------- src/odr_enum.c | 11 ++++++----- src/odr_int.c | 11 ++++++----- src/odr_mem.c | 4 ++-- src/odr_null.c | 11 ++++++----- src/odr_oct.c | 31 +++++++++++++++++-------------- src/odr_oid.c | 11 ++++++----- src/odr_seq.c | 18 +++++++++--------- src/odr_tag.c | 10 +++++----- src/odr_util.c | 6 +++--- 17 files changed, 123 insertions(+), 112 deletions(-) diff --git a/include/yaz/odr.h b/include/yaz/odr.h index a25ad20..78cc834 100644 --- a/include/yaz/odr.h +++ b/include/yaz/odr.h @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* $Id: odr.h,v 1.25 2007-01-03 08:42:14 adam Exp $ */ +/* $Id: odr.h,v 1.26 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr.h @@ -115,35 +115,27 @@ typedef int Odr_oid; /* terminate by -1 */ #define ODR_S_CUR 1 #define ODR_S_END 2 -typedef struct odr +typedef struct odr *ODR; + +/** ODR handle and the public structs */ +struct odr { int direction; /* the direction of this stream */ - int error; /* current error state (0==OK) */ + int error; /* current error state (0==OK) */ - int can_grow; /* are we allowed to reallocate */ unsigned char *buf; /* memory handle */ + int top; /* top of buffer (max pos when encoding) */ int size; /* current buffer size (encoding+decoding) */ int pos; /* current position (encoding) */ - int top; /* top of buffer (max pos when encoding) */ const unsigned char *bp; /* position in buffer (decoding) */ - int t_class; /* implicit tagging (-1==default tag) */ - int t_tag; - - int enable_bias; /* force choice enable flag */ - int choice_bias; /* force choice */ - int lenlen; /* force length-of-lenght (odr_setlen()) */ - - FILE *print; /* output file handler for direction print */ - int indent; /* current indent level for printing */ - NMEM mem; /* memory handle for decoding (primarily) */ struct Odr_private *op; -} *ODR; +}; typedef int (*Odr_fun)(ODR, char **, int, const char *); diff --git a/src/ber_tag.c b/src/ber_tag.c index cdf4dd9..a6b6ae8 100644 --- a/src/ber_tag.c +++ b/src/ber_tag.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: ber_tag.c,v 1.7 2007-01-03 08:42:15 adam Exp $ + * $Id: ber_tag.c,v 1.8 2007-03-19 21:08:13 adam Exp $ */ /** @@ -42,7 +42,7 @@ int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt, if (o->direction == ODR_DECODE) *pp = 0; - o->t_class = -1; + o->op->t_class = -1; if (ODR_STACK_EMPTY(o)) { odr_seek(o, ODR_S_SET, 0); diff --git a/src/odr-priv.h b/src/odr-priv.h index 135c187..d7133c0 100644 --- a/src/odr-priv.h +++ b/src/odr-priv.h @@ -60,7 +60,6 @@ struct Odr_private { struct odr_constack *stack_first; /** first member of allocated stack */ struct odr_constack *stack_top; /** top of stack */ - const char **tmp_names_buf; /** array returned by odr_get_element_path */ int tmp_names_sz; /** size of tmp_names_buf */ @@ -72,6 +71,16 @@ struct Odr_private { void (*stream_write)(ODR o, void *handle, int type, const char *buf, int len); void (*stream_close)(void *handle); + + int can_grow; /* are we allowed to reallocate */ + int t_class; /* implicit tagging (-1==default tag) */ + int t_tag; + + int enable_bias; /* force choice enable flag */ + int choice_bias; /* force choice */ + int lenlen; /* force length-of-lenght (odr_setlen()) */ + FILE *print; /* output file handler for direction print */ + int indent; /* current indent level for printing */ }; #define ODR_STACK_POP(x) (x)->op->stack_top = (x)->op->stack_top->prev diff --git a/src/odr.c b/src/odr.c index 645317e..beb2986 100644 --- a/src/odr.c +++ b/src/odr.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr.c,v 1.15 2007-02-23 10:15:01 adam Exp $ + * $Id: odr.c,v 1.16 2007-03-19 21:08:13 adam Exp $ * */ @@ -184,7 +184,7 @@ void odr_set_stream(ODR o, void *handle, const char *buf, int len), void (*stream_close)(void *handle)) { - o->print = (FILE*) handle; + o->op->print = (FILE*) handle; o->op->stream_write = stream_write; o->op->stream_close = stream_close; } @@ -215,13 +215,13 @@ ODR odr_createmem(int direction) if (!(o = (ODR)xmalloc(sizeof(*o)))) return 0; + o->op = (struct Odr_private *) xmalloc (sizeof(*o->op)); o->direction = direction; o->buf = 0; o->size = o->pos = o->top = 0; - o->can_grow = 1; + o->op->can_grow = 1; o->mem = nmem_create(); - o->enable_bias = 1; - o->op = (struct Odr_private *) xmalloc (sizeof(*o->op)); + o->op->enable_bias = 1; o->op->odr_ber_tag.lclass = -1; o->op->iconv_handle = 0; odr_setprint(o, stderr); @@ -242,16 +242,16 @@ void odr_reset(ODR o) o->bp = o->buf; odr_seek(o, ODR_S_SET, 0); o->top = 0; - o->t_class = -1; - o->t_tag = -1; - o->indent = 0; + o->op->t_class = -1; + o->op->t_tag = -1; + o->op->indent = 0; o->op->stack_first = 0; o->op->stack_top = 0; o->op->tmp_names_sz = 0; o->op->tmp_names_buf = 0; nmem_reset(o->mem); - o->choice_bias = -1; - o->lenlen = 1; + o->op->choice_bias = -1; + o->op->lenlen = 1; if (o->op->iconv_handle != 0) yaz_iconv(o->op->iconv_handle, 0, 0, 0, 0); yaz_log (log_level, "odr_reset o=%p", o); @@ -260,10 +260,10 @@ void odr_reset(ODR o) void odr_destroy(ODR o) { nmem_destroy(o->mem); - if (o->buf && o->can_grow) + if (o->buf && o->op->can_grow) xfree(o->buf); if (o->op->stream_close) - o->op->stream_close(o->print); + o->op->stream_close(o->op->print); if (o->op->iconv_handle != 0) yaz_iconv_close (o->op->iconv_handle); xfree(o->op); @@ -277,7 +277,7 @@ void odr_setbuf(ODR o, char *buf, int len, int can_grow) o->bp = (unsigned char *) buf; o->buf = (unsigned char *) buf; - o->can_grow = can_grow; + o->op->can_grow = can_grow; o->top = o->pos = 0; o->size = len; } @@ -297,7 +297,7 @@ void odr_printf(ODR o, const char *fmt, ...) va_start(ap, fmt); yaz_vsnprintf(buf, sizeof(buf), fmt, ap); - o->op->stream_write(o, o->print, ODR_VISIBLESTRING, buf, strlen(buf)); + o->op->stream_write(o, o->op->print, ODR_VISIBLESTRING, buf, strlen(buf)); va_end(ap); } /* diff --git a/src/odr_bit.c b/src/odr_bit.c index 5addedc..2622281 100644 --- a/src/odr_bit.c +++ b/src/odr_bit.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_bit.c,v 1.6 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_bit.c,v 1.7 2007-03-19 21:08:13 adam Exp $ */ /** @@ -27,12 +27,13 @@ int odr_bitstring(ODR o, Odr_bitmask **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_BITSTRING; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_BITSTRING; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); diff --git a/src/odr_bool.c b/src/odr_bool.c index 6a77716..7c9279e 100644 --- a/src/odr_bool.c +++ b/src/odr_bool.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_bool.c,v 1.6 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_bool.c,v 1.7 2007-03-19 21:08:13 adam Exp $ */ /** @@ -26,12 +26,13 @@ int odr_bool(ODR o, int **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_BOOLEAN; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_BOOLEAN; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); diff --git a/src/odr_choice.c b/src/odr_choice.c index 082dbda..b3744ca 100644 --- a/src/odr_choice.c +++ b/src/odr_choice.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_choice.c,v 1.7 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_choice.c,v 1.8 2007-03-19 21:08:13 adam Exp $ */ /** @@ -19,7 +19,7 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, const char *name) { - int i, cl = -1, tg, cn, *which = (int *)whichp, bias = o->choice_bias; + int i, cl = -1, tg, cn, *which = (int *)whichp, bias = o->op->choice_bias; if (o->error) return 0; @@ -31,7 +31,7 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, *which = -1; *(char**)p = 0; } - o->choice_bias = -1; + o->op->choice_bias = -1; if (o->direction == ODR_PRINT) { @@ -91,13 +91,13 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, void odr_choice_bias(ODR o, int what) { - if (o->enable_bias) - o->choice_bias = what; + if (o->op->enable_bias) + o->op->choice_bias = what; } void odr_choice_enable_bias (ODR o, int mode) { - o->enable_bias = mode; + o->op->enable_bias = mode; } /* * Local variables: diff --git a/src/odr_cons.c b/src/odr_cons.c index c6d092c..2f88087 100644 --- a/src/odr_cons.c +++ b/src/odr_cons.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_cons.c,v 1.8 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_cons.c,v 1.9 2007-03-19 21:08:13 adam Exp $ * */ @@ -21,7 +21,7 @@ void odr_setlenlen(ODR o, int len) { - o->lenlen = len; + o->op->lenlen = len; } int odr_constructed_begin(ODR o, void *xxp, int zclass, int tag, @@ -29,17 +29,18 @@ int odr_constructed_begin(ODR o, void *xxp, int zclass, int tag, { int res; int cons = 1; - int lenlen = o->lenlen; + int lenlen = o->op->lenlen; if (o->error) return 0; - o->lenlen = 1; /* reset lenlen */ - if (o->t_class < 0) + o->op->lenlen = 1; /* reset lenlen */ + if (o->op->t_class < 0) { - o->t_class = zclass; - o->t_tag = tag; + o->op->t_class = zclass; + o->op->t_tag = tag; } - if ((res = ber_tag(o, xxp, o->t_class, o->t_tag, &cons, 1, name)) < 0) + res = ber_tag(o, xxp, o->op->t_class, o->op->t_tag, &cons, 1, name); + if (res < 0) return 0; if (!res || !cons) return 0; @@ -122,7 +123,7 @@ int odr_constructed_begin(ODR o, void *xxp, int zclass, int tag, { odr_prname(o, name); odr_printf(o, "{\n"); - o->indent++; + o->op->indent++; } else { @@ -202,7 +203,7 @@ int odr_constructed_end(ODR o) return 1; case ODR_PRINT: ODR_STACK_POP(o); - o->indent--; + o->op->indent--; odr_prname(o, 0); odr_printf(o, "}\n"); return 1; diff --git a/src/odr_enum.c b/src/odr_enum.c index 214cdb3..d994c70 100644 --- a/src/odr_enum.c +++ b/src/odr_enum.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_enum.c,v 1.6 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_enum.c,v 1.7 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_enum.c @@ -24,12 +24,13 @@ int odr_enum(ODR o, int **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_ENUM; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_ENUM; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); diff --git a/src/odr_int.c b/src/odr_int.c index cb9645f..8c4b158 100644 --- a/src/odr_int.c +++ b/src/odr_int.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_int.c,v 1.6 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_int.c,v 1.7 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_int.c @@ -24,12 +24,13 @@ int odr_integer(ODR o, int **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_INTEGER; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_INTEGER; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); diff --git a/src/odr_mem.c b/src/odr_mem.c index c994c23..d9e4025 100644 --- a/src/odr_mem.c +++ b/src/odr_mem.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_mem.c,v 1.8 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_mem.c,v 1.9 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_mem.c @@ -77,7 +77,7 @@ int odr_grow_block(ODR b, int min_bytes) { int togrow; - if (!b->can_grow) + if (!b->op->can_grow) return -1; if (!b->size) togrow = 1024; diff --git a/src/odr_null.c b/src/odr_null.c index bf6df75..e3a8ab8 100644 --- a/src/odr_null.c +++ b/src/odr_null.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_null.c,v 1.7 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_null.c,v 1.8 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_null.c @@ -24,12 +24,13 @@ int odr_null(ODR o, Odr_null **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_NULL; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_NULL; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); diff --git a/src/odr_oct.c b/src/odr_oct.c index 5d2603f..b21125a 100644 --- a/src/odr_oct.c +++ b/src/odr_oct.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_oct.c,v 1.10 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_oct.c,v 1.11 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_oct.c @@ -24,12 +24,13 @@ int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OCTETSTRING; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_OCTETSTRING; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); @@ -38,7 +39,7 @@ int odr_octetstring(ODR o, Odr_oct **p, int opt, const char *name) odr_prname(o, name); odr_printf(o, "OCTETSTRING(len=%d) ", (*p)->len); - o->op->stream_write(o, o->print, ODR_OCTETSTRING, + o->op->stream_write(o, o->op->print, ODR_OCTETSTRING, (char*) (*p)->buf, (*p)->len); odr_printf(o, "\n"); return 1; @@ -66,12 +67,13 @@ int odr_cstring(ODR o, char **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OCTETSTRING; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_OCTETSTRING; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); @@ -113,12 +115,13 @@ int odr_iconv_string(ODR o, char **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OCTETSTRING; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_OCTETSTRING; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); diff --git a/src/odr_oid.c b/src/odr_oid.c index 1034a7b..be45098 100644 --- a/src/odr_oid.c +++ b/src/odr_oid.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_oid.c,v 1.8 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_oid.c,v 1.9 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_oid.c @@ -25,12 +25,13 @@ int odr_oid(ODR o, Odr_oid **p, int opt, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_OID; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_OID; } - if ((res = ber_tag(o, p, o->t_class, o->t_tag, &cons, opt, name)) < 0) + res = ber_tag(o, p, o->op->t_class, o->op->t_tag, &cons, opt, name); + if (res < 0) return 0; if (!res) return odr_missing(o, opt, name); diff --git a/src/odr_seq.c b/src/odr_seq.c index b73d1fd..b9413e7 100644 --- a/src/odr_seq.c +++ b/src/odr_seq.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_seq.c,v 1.6 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_seq.c,v 1.7 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_seq.c @@ -20,14 +20,14 @@ int odr_sequence_begin(ODR o, void *p, int size, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_SEQUENCE; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_SEQUENCE; } if (o->direction == ODR_DECODE) *pp = 0; - if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) + if (odr_constructed_begin(o, p, o->op->t_class, o->op->t_tag, name)) { if (o->direction == ODR_DECODE && size) *pp = (char *)odr_malloc(o, size); @@ -43,14 +43,14 @@ int odr_set_begin(ODR o, void *p, int size, const char *name) if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = ODR_UNIVERSAL; - o->t_tag = ODR_SET; + o->op->t_class = ODR_UNIVERSAL; + o->op->t_tag = ODR_SET; } if (o->direction == ODR_DECODE) *pp = 0; - if (odr_constructed_begin(o, p, o->t_class, o->t_tag, name)) + if (odr_constructed_begin(o, p, o->op->t_class, o->op->t_tag, name)) { if (o->direction == ODR_DECODE && size) *pp = (char *)odr_malloc(o, size); diff --git a/src/odr_tag.c b/src/odr_tag.c index 3fe167b..ba83507 100644 --- a/src/odr_tag.c +++ b/src/odr_tag.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_tag.c,v 1.6 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_tag.c,v 1.7 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_tag.c @@ -35,10 +35,10 @@ int odr_implicit_settag(ODR o, int zclass, int tag) { if (o->error) return 0; - if (o->t_class < 0) + if (o->op->t_class < 0) { - o->t_class = zclass; - o->t_tag = tag; + o->op->t_class = zclass; + o->op->t_tag = tag; } return 1; } @@ -53,7 +53,7 @@ int odr_initmember(ODR o, void *p, int size) *pp = (char *)odr_malloc(o, size); else if (!*pp) { - o->t_class = -1; + o->op->t_class = -1; return 0; } return 1; diff --git a/src/odr_util.c b/src/odr_util.c index 370132f..9a9f445 100644 --- a/src/odr_util.c +++ b/src/odr_util.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: odr_util.c,v 1.9 2007-01-03 08:42:15 adam Exp $ + * $Id: odr_util.c,v 1.10 2007-03-19 21:08:13 adam Exp $ */ /** * \file odr_util.c @@ -21,9 +21,9 @@ void odr_prname(ODR o, const char *name) { if (name) - odr_printf(o, "%*s%s ", o->indent*4, "", name); + odr_printf(o, "%*s%s ", o->op->indent*4, "", name); else - odr_printf(o, "%*s", o->indent*4, ""); + odr_printf(o, "%*s", o->op->indent*4, ""); } int odp_more_chunks(ODR o, const unsigned char *base, int len) -- 1.7.10.4