Various smaller things. Gathered header-files.
authorSebastian Hammer <quinn@indexdata.com>
Fri, 26 Jul 1996 13:37:06 +0000 (13:37 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Fri, 26 Jul 1996 13:37:06 +0000 (13:37 +0000)
client/default.bib
include/odr.h
include/prt.h
odr/Makefile
odr/odr.c
odr/odr_cons.c
tab/gils-b.est
tab/gils-g.est
tab/gils.abs

index 198f81b..2316a29 100644 (file)
@@ -1,5 +1,5 @@
 # Subset of bib-1 attributes map to CCL qualifiers 
 # Subset of bib-1 attributes map to CCL qualifiers 
-# $Id: default.bib,v 1.3 1996-07-06 19:58:30 quinn Exp $
+# $Id: default.bib,v 1.4 1996-07-26 13:37:06 quinn Exp $
 #
 term t=l,r  s=pw
 clean t=l
 #
 term t=l,r  s=pw
 clean t=l
@@ -16,7 +16,6 @@ la   u=54   s=pw
 ab   u=62   s=pw
 note u=63   s=pw
 af   u=1006 s=pw
 ab   u=62   s=pw
 note u=63   s=pw
 af   u=1006 s=pw
-
 north  u=2040 r=o
 south  u=2041 r=o
 east  u=2038 r=o
 north  u=2040 r=o
 south  u=2041 r=o
 east  u=2038 r=o
index e1b0c0c..1546d68 100644 (file)
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
- * Revision 1.17  1995-11-08 17:41:27  quinn
+ * 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
  * Smallish.
  *
  * Revision 1.16  1995/11/01  13:54:36  quinn
  * Smallish.
  *
  * Revision 1.16  1995/11/01  13:54:36  quinn
@@ -245,6 +248,7 @@ typedef struct odr
     int t_tag;
 
     int choice_bias;     /* force choice */
     int t_tag;
 
     int choice_bias;     /* force choice */
+    int lenlen;          /* force length-of-lenght (odr_setlen()) */
 
     FILE *print;         /* output file for direction print */
     int indent;          /* current indent level for printing */
 
     FILE *print;         /* output file for direction print */
     int indent;          /* current indent level for printing */
@@ -282,6 +286,7 @@ typedef struct odr_arm
 #define ODATA           8
 #define OSTACK          9
 #define OCONLEN        10
 #define ODATA           8
 #define OSTACK          9
 #define OCONLEN        10
+#define OLENOV         11
 
 extern char *odr_errlist[];
 
 
 extern char *odr_errlist[];
 
index fd7dc73..9d2dcd2 100644 (file)
@@ -52,5 +52,6 @@ char *odr_errmsg(int n);
 Odr_oid *odr_getoidbystr(ODR o, char *str);
 int odr_initmember(ODR o, void *p, int size);
 int odr_peektag(ODR o, int *class, int *tag, int *cons);
 Odr_oid *odr_getoidbystr(ODR o, char *str);
 int odr_initmember(ODR o, void *p, int size);
 int odr_peektag(ODR o, int *class, int *tag, int *cons);
+void odr_setlenlen(ODR o, int len);
 
 #endif
 
 #endif
index 4f129d3..30b8dfc 100644 (file)
@@ -1,13 +1,13 @@
 # Copyright (C) 1994, Index Data I/S 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
 # Copyright (C) 1994, Index Data I/S 
 # All rights reserved.
 # Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.23 1996-05-22 08:35:50 adam Exp $
+# $Id: Makefile,v 1.24 1996-07-26 13:38:18 quinn Exp $
 
 SHELL=/bin/sh
 INCLUDE=-I../include -I.
 LIBDIR=../lib
 LIBINCLUDE=-L$(LIBDIR)
 
 SHELL=/bin/sh
 INCLUDE=-I../include -I.
 LIBDIR=../lib
 LIBINCLUDE=-L$(LIBDIR)
-DEFS=$(INCLUDE)
+DEFS=$(INCLUDE) -DODR_DEBUG
 LIB=$(LIBDIR)/libodr.a
 LIBS=-lodr
 PO = odr_bool.o ber_bool.o ber_len.o ber_tag.o odr_util.o odr_null.o \
 LIB=$(LIBDIR)/libodr.a
 LIBS=-lodr
 PO = odr_bool.o ber_bool.o ber_len.o ber_tag.o odr_util.o odr_null.o \
index af2665d..301f151 100644 (file)
--- a/odr/odr.c
+++ b/odr/odr.c
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr.c,v $
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr.c,v $
- * Revision 1.20  1995-11-08 17:41:32  quinn
+ * 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
  * Smallish.
  *
  * Revision 1.19  1995/11/01  13:54:41  quinn
  * Smallish.
  *
  * Revision 1.19  1995/11/01  13:54:41  quinn
@@ -88,7 +91,8 @@ char *odr_errlist[] =
     "Protocol error",
     "Malformed data",
     "Stack overflow",
     "Protocol error",
     "Malformed data",
     "Stack overflow",
-    "Length of constructed type different from sum of members"
+    "Length of constructed type different from sum of members",
+    "Overflow writing definite length of constructed type"
 };
 
 char *odr_errmsg(int n)
 };
 
 char *odr_errmsg(int n)
@@ -142,6 +146,7 @@ void odr_reset(ODR o)
     o->stackp = -1;
     nmem_reset(o->mem);
     o->choice_bias = -1;
     o->stackp = -1;
     nmem_reset(o->mem);
     o->choice_bias = -1;
+    o->lenlen = 1;
 }
     
 void odr_destroy(ODR o)
 }
     
 void odr_destroy(ODR o)
index 1ae66c1..917e154 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_cons.c,v $
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_cons.c,v $
- * Revision 1.15  1995-09-29 17:12:23  quinn
+ * Revision 1.16  1996-07-26 13:38:20  quinn
+ * Various smaller things. Gathered header-files.
+ *
+ * Revision 1.15  1995/09/29  17:12:23  quinn
  * Smallish
  *
  * Revision 1.14  1995/09/27  15:02:58  quinn
  * Smallish
  *
  * Revision 1.14  1995/09/27  15:02:58  quinn
 #include <odr.h>
 #include <assert.h>
 
 #include <odr.h>
 #include <assert.h>
 
+void odr_setlenlen(ODR o, int len)
+{
+    o->lenlen = len;
+}
+
 int odr_constructed_begin(ODR o, void *p, int class, int tag)
 {
     int res;
     int cons = 1;
 int odr_constructed_begin(ODR o, void *p, int class, int tag)
 {
     int res;
     int cons = 1;
+    int lenlen = o->lenlen;
 
     if (o->error)
        return 0;
 
     if (o->error)
        return 0;
+    o->lenlen = 1; /* reset lenlen */
     if (o->t_class < 0)
     {
        o->t_class = class;
     if (o->t_class < 0)
     {
        o->t_class = class;
@@ -86,8 +96,11 @@ int odr_constructed_begin(ODR o, void *p, int class, int tag)
 #endif
     if (o->direction == ODR_ENCODE)
     {
 #endif
     if (o->direction == ODR_ENCODE)
     {
-       o->stack[o->stackp].lenlen = 1;
-       if (odr_putc(o, 0) < 0)     /* dummy */
+       unsigned char dummy[sizeof(int)+1];
+
+       o->stack[o->stackp].lenlen = lenlen;
+
+       if (odr_write(o, dummy, lenlen) < 0) /* dummy */
            return 0;
     }
     else if (o->direction == ODR_DECODE)
            return 0;
     }
     else if (o->direction == ODR_DECODE)
@@ -167,7 +180,10 @@ int odr_constructed_end(ODR o)
            odr_seek(o, ODR_S_SET, o->stack[o->stackp].len_offset);
            if ((res = ber_enclen(o, pos - o->stack[o->stackp].base_offset,
                o->stack[o->stackp].lenlen, 1)) < 0)
            odr_seek(o, ODR_S_SET, o->stack[o->stackp].len_offset);
            if ((res = ber_enclen(o, pos - o->stack[o->stackp].base_offset,
                o->stack[o->stackp].lenlen, 1)) < 0)
+           {
+               o->error = OLENOV;
                return 0;
                return 0;
+           }
            odr_seek(o, ODR_S_END, 0);
            if (res == 0)   /* indefinite encoding */
            {
            odr_seek(o, ODR_S_END, 0);
            if (res == 0)   /* indefinite encoding */
            {
index aff86b0..d00e5c0 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: gils-b.est,v 1.6 1996-07-06 19:58:36 quinn Exp $
+# $Id: gils-b.est,v 1.7 1996-07-26 13:38:23 quinn Exp $
 simpleelement (1,1)
 simpleelement (1,10)
 simpleelement (1,12)
 simpleelement (1,1)
 simpleelement (1,10)
 simpleelement (1,12)
@@ -7,3 +7,4 @@ simpleelement (1,14)
 simpleelement (1,16)
 simpleelement (4,1)
 simpleelement (4,52)
 simpleelement (1,16)
 simpleelement (4,1)
 simpleelement (4,52)
+simpleelement (4,70)/(4,17)
index ba35172..01624c0 100644 (file)
@@ -7,3 +7,10 @@ simpleelement (1,16)
 simpleelement (4,1)
 simpleelement (4,52)
 simpleelement (4,98)
 simpleelement (4,1)
 simpleelement (4,52)
 simpleelement (4,98)
+
+#
+# These are not formally required by GILS
+#
+simpleelement (4,59)
+simpleelement (4,70)
+simpleelement (4,97)
index cab3f82..e1d1119 100644 (file)
@@ -94,3 +94,11 @@ elm (4,98)/(4,17)           crossReferenceLinkage         !
 elm (4,98)/(4,18)           crossReferenceType            !
 elm (4,23)                  originalControlIdentifier     !
 elm (4,59)                  supplementalInformation       !
 elm (4,98)/(4,18)           crossReferenceType            !
 elm (4,23)                  originalControlIdentifier     !
 elm (4,59)                  supplementalInformation       !
+
+elm (2,9)                   bodyOfDisplay                Any
+
+#
+# Local tags - testing only
+#
+
+elm sampleText              bodyOfText                 !