X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fodr_choice.c;h=a3264d9bbcda6ac2803bd27a46c68fc11bf74bb2;hp=3020e2d4b2ccb2be4292fcc1213b2a33238e04d8;hb=6ee0d7c0404834a0a59547c3bd7e2686f838ce37;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505 diff --git a/src/odr_choice.c b/src/odr_choice.c index 3020e2d..a3264d9 100644 --- a/src/odr_choice.c +++ b/src/odr_choice.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2005, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2013 Index Data * See the file LICENSE for details. - * - * $Id: odr_choice.c,v 1.5 2005-06-25 15:46:04 adam Exp $ */ /** @@ -19,7 +17,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 +29,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) { @@ -56,9 +54,9 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, { if (o->direction == ODR_DECODE && cl < 0) { - if (o->op->stackp > -1 && !odr_constructed_more(o)) + if (o->op->stack_top && !odr_constructed_more(o)) return 0; - if (ber_dectag(o->bp, &cl, &tg, &cn, odr_max(o)) <= 0) + if (ber_dectag(o->op->bp, &cl, &tg, &cn, odr_max(o)) <= 0) return 0; } else if (o->direction != ODR_DECODE) @@ -91,17 +89,18 @@ 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: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab