New ODR function, odr_choice_enable_bias, to control behaviour of
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 8 Oct 1996 12:58:08 +0000 (12:58 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 8 Oct 1996 12:58:08 +0000 (12:58 +0000)
odr_choice_bias.

include/odr.h
include/prt.h
odr/odr.c
odr/odr_choice.c

index 1546d68..69cebfe 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
  * 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
  * 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 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()) */
 
     int choice_bias;     /* force choice */
     int lenlen;          /* force length-of-lenght (odr_setlen()) */
 
index 9d2dcd2..ef51694 100644 (file)
@@ -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);
 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);
 int odr_total(ODR o);
 char *odr_errmsg(int n);
 Odr_oid *odr_getoidbystr(ODR o, char *str);
index 301f151..d5b0ce5 100644 (file)
--- a/odr/odr.c
+++ b/odr/odr.c
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr.c,v $
  * 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
  * 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->ecb.can_grow = 1;
     r->buflen = 0;
     r->mem = nmem_create();
+    r->enable_bias = 1;
     odr_reset(r);
     return r;
 }
     odr_reset(r);
     return r;
 }
index 59beae4..6cdd740 100644 (file)
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_choice.c,v $
  * 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
  * 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)
 {
 
 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;
 }
 }