From 7436fd1fdf0ca6d2c5c68d9cc0cd57f53d9c8e12 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 8 Oct 1996 12:58:08 +0000 Subject: [PATCH] New ODR function, odr_choice_enable_bias, to control behaviour of odr_choice_bias. --- include/odr.h | 7 ++++++- include/prt.h | 1 + odr/odr.c | 7 ++++++- odr/odr_choice.c | 14 ++++++++++++-- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/include/odr.h b/include/odr.h index 1546d68..69cebfe 100644 --- a/include/odr.h +++ b/include/odr.h @@ -24,7 +24,11 @@ * OF THIS SOFTWARE. * * $Log: odr.h,v $ - * Revision 1.18 1996-07-26 13:38:14 quinn + * Revision 1.19 1996-10-08 12:58:08 adam + * New ODR function, odr_choice_enable_bias, to control behaviour of + * odr_choice_bias. + * + * Revision 1.18 1996/07/26 13:38:14 quinn * Various smaller things. Gathered header-files. * * Revision 1.17 1995/11/08 17:41:27 quinn @@ -247,6 +251,7 @@ typedef struct odr 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()) */ diff --git a/include/prt.h b/include/prt.h index 9d2dcd2..ef51694 100644 --- a/include/prt.h +++ b/include/prt.h @@ -47,6 +47,7 @@ int odr_write(ODR o, unsigned char *buf, int bytes); int odr_seek(ODR o, int whence, int offset); int odr_dumpBER(FILE *f, char *buf, int len); void odr_choice_bias(ODR o, int what); +void odr_choice_enable_bias(ODR o, int mode); int odr_total(ODR o); char *odr_errmsg(int n); Odr_oid *odr_getoidbystr(ODR o, char *str); diff --git a/odr/odr.c b/odr/odr.c index 301f151..d5b0ce5 100644 --- a/odr/odr.c +++ b/odr/odr.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr.c,v $ - * Revision 1.21 1996-07-26 13:38:19 quinn + * Revision 1.22 1996-10-08 12:58:17 adam + * New ODR function, odr_choice_enable_bias, to control behaviour of + * odr_choice_bias. + * + * Revision 1.21 1996/07/26 13:38:19 quinn * Various smaller things. Gathered header-files. * * Revision 1.20 1995/11/08 17:41:32 quinn @@ -129,6 +133,7 @@ ODR odr_createmem(int direction) r->ecb.can_grow = 1; r->buflen = 0; r->mem = nmem_create(); + r->enable_bias = 1; odr_reset(r); return r; } diff --git a/odr/odr_choice.c b/odr/odr_choice.c index 59beae4..6cdd740 100644 --- a/odr/odr_choice.c +++ b/odr/odr_choice.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: odr_choice.c,v $ - * Revision 1.11 1995-09-29 17:12:23 quinn + * Revision 1.12 1996-10-08 12:58:17 adam + * New ODR function, odr_choice_enable_bias, to control behaviour of + * odr_choice_bias. + * + * Revision 1.11 1995/09/29 17:12:23 quinn * Smallish * * Revision 1.10 1995/09/27 15:02:58 quinn @@ -102,5 +106,11 @@ int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp) void odr_choice_bias(ODR o, int what) { - o->choice_bias = what; + if (o->enable_bias) + o->choice_bias = what; +} + +void odr_choice_enable_bias (ODR o, int mode) +{ + o->enable_bias = mode; } -- 1.7.10.4