Added const modifier to some of the BER/ODR encoding routines.
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 8 Jan 1999 11:23:10 +0000 (11:23 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 8 Jan 1999 11:23:10 +0000 (11:23 +0000)
19 files changed:
CHANGELOG
LICENSE
README
comstack/tcpip.c
comstack/waislen.c
header.c
include/odr.h
include/prt.h
include/tcpip.h
odr/ber_any.c
odr/ber_bit.c
odr/ber_int.c
odr/ber_len.c
odr/ber_oct.c
odr/ber_tag.c
odr/dumpber.c
odr/odr_enum.c
odr/odr_int.c
odr/odr_util.c

index 7f27f4e..39246fa 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,9 @@
 Possible compatibility problems with earlier versions marked with '*'.
 
 Possible compatibility problems with earlier versions marked with '*'.
 
+* Added const modifier to buffer parameter for some ODR/BER encoding
+routines: ber_dectag, ber_declen, odp_more_chunks, completeBER,
+completeWAIS, odr_dumpBER.
+
 Fixed bug in client.c which caused a crash when a scanResponse didn't
 contain positionOfTerm.
 
 Fixed bug in client.c which caused a crash when a scanResponse didn't
 contain positionOfTerm.
 
diff --git a/LICENSE b/LICENSE
index a530fc2..42fb75c 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 1995-1998 Index Data.
+ * Copyright (c) 1995-1999 Index Data.
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
diff --git a/README b/README
index 2521a65..5409620 100644 (file)
--- a/README
+++ b/README
@@ -1,10 +1,10 @@
 
 
- * Copyright (C) 1995-1998, Index Data.
+ * Copyright (C) 1995-1999, Index Data.
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
 
 Compilation and installation for YAZ 
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
 
 Compilation and installation for YAZ 
-  $Id: README,v 1.23 1998-09-22 09:41:21 adam Exp $
+  $Id: README,v 1.24 1999-01-08 11:23:12 adam Exp $
 
 The primary output of the source here is the lib/libyaz.a library,
 which contains support functions for implementing the server or client
 
 The primary output of the source here is the lib/libyaz.a library,
 which contains support functions for implementing the server or client
index 667accf..29960cd 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995-1998, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: tcpip.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: tcpip.c,v $
- * Revision 1.25  1998-07-07 15:49:23  adam
+ * Revision 1.26  1999-01-08 11:23:14  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.25  1998/07/07 15:49:23  adam
  * Added braces to avoid warning.
  *
  * Revision 1.24  1998/06/29 07:59:17  adam
  * Added braces to avoid warning.
  *
  * Revision 1.24  1998/06/29 07:59:17  adam
 #include <comstack.h>
 #include <tcpip.h>
 
 #include <comstack.h>
 #include <tcpip.h>
 
-/* Chas added the following 2, so we get the definition of completeBER */
+/* Chas added the following, so we get the definition of completeBER */
 #include <odr.h>
 #include <odr.h>
-#include <prt.h>
 
 int tcpip_close(COMSTACK h);
 int tcpip_put(COMSTACK h, char *buf, int size);
 
 int tcpip_close(COMSTACK h);
 int tcpip_put(COMSTACK h, char *buf, int size);
@@ -178,14 +180,6 @@ COMSTACK tcpip_accept(COMSTACK h);
 char *tcpip_addrstr(COMSTACK h);
 void *tcpip_straddr(COMSTACK h, const char *str);
 
 char *tcpip_addrstr(COMSTACK h);
 void *tcpip_straddr(COMSTACK h, const char *str);
 
-/*
- * Determine length/completeness of incoming packages
- */
-/* Chas: Removed the definition of completeBERfrom here, use the one in the */
-/* include directory as that as the extern "C" around it */
-/*int completeBER(unsigned char *buf, int len); */ /* from the ODR module */
-int completeWAIS(unsigned char *buf, int len); /* from waislen.c */
-
 #undef TRACE_TCPIP
 #ifdef TRACE_TCPIP
 #define TRC(x) x
 #undef TRACE_TCPIP
 #ifdef TRACE_TCPIP
 #define TRC(x) x
@@ -201,7 +195,7 @@ typedef struct tcpip_state
 
     int written;  /* -1 if we aren't writing */
     int towrite;  /* to verify against user input */
 
     int written;  /* -1 if we aren't writing */
     int towrite;  /* to verify against user input */
-    int (*complete)(unsigned char *buf, int len); /* length/completeness */
+    int (*complete)(const unsigned char *buf, int len); /* length/comple. */
     struct sockaddr_in addr;  /* returned by cs_straddr */
     char buf[128]; /* returned by cs_addrstr */
 } tcpip_state;
     struct sockaddr_in addr;  /* returned by cs_straddr */
     char buf[128]; /* returned by cs_addrstr */
 } tcpip_state;
index aabe69c..8a91cf3 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995, Index Data.
+ * Copyright (c) 1995-1999, Index Data.
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: waislen.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: waislen.c,v $
- * Revision 1.3  1996-02-29 14:23:13  adam
+ * Revision 1.4  1999-01-08 11:23:15  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.3  1996/02/29 14:23:13  adam
  * Bug fix.
  *
  * Revision 1.2  1996/02/26  18:34:44  adam
  * Bug fix.
  *
  * Revision 1.2  1996/02/26  18:34:44  adam
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
+#include <comstack.h>
+#include <tcpip.h>
 /*
  * Return length of WAIS package or 0
  */
 /*
  * Return length of WAIS package or 0
  */
-int completeWAIS(unsigned char *buf, int len)
+int completeWAIS(const unsigned char *buf, int len)
 {
     int i, lval = 0;
 
 {
     int i, lval = 0;
 
index 206e856..82fbbcb 100644 (file)
--- a/header.c
+++ b/header.c
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995-1998, Index Data.
+ * Copyright (c) 1995-1999, Index Data.
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
- *
+ 9
  * $Log: header.c,v $
  * $Log: header.c,v $
- * Revision 1.6  1998-01-05 09:03:37  adam
+ * Revision 1.7  1999-01-08 11:23:13  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.6  1998/01/05 09:03:37  adam
  * 1998.
  *
  * Revision 1.5  1997/07/02 14:12:52  adam
  * 1998.
  *
  * Revision 1.5  1997/07/02 14:12:52  adam
index bd0356f..2e15659 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 1995-1998, Index Data.
+ * Copyright (c) 1995-1999, Index Data.
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
  * OF THIS SOFTWARE.
  *
  * $Log: odr.h,v $
- * Revision 1.26  1998-03-20 17:29:20  adam
+ * Revision 1.27  1999-01-08 11:23:17  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.26  1998/03/20 17:29:20  adam
  * Include of odr_use.h in odr.h. Added prototype for odr_enum.
  *
  * Revision 1.25  1998/02/11 11:53:33  adam
  * Include of odr_use.h in odr.h. Added prototype for odr_enum.
  *
  * Revision 1.25  1998/02/11 11:53:33  adam
@@ -237,11 +240,11 @@ typedef int Odr_oid;   /* terminate by -1 */
 
 typedef struct odr_constack
 {
 
 typedef struct odr_constack
 {
-    unsigned char *base;         /* starting point of data */
+    const unsigned char *base;   /* starting point of data */
     int base_offset;
     int len;                     /* length of data, if known, else -1
                                         (decoding only) */
     int base_offset;
     int len;                     /* length of data, if known, else -1
                                         (decoding only) */
-    unsigned char *lenb;         /* where to encode length */
+    const unsigned char *lenb;   /* where to encode length */
     int len_offset;
     int lenlen;                  /* length of length-field */
 } odr_constack;
     int len_offset;
     int lenlen;                  /* length of length-field */
 } odr_constack;
@@ -271,9 +274,9 @@ typedef struct odr
     int direction;       /* the direction of this stream */
 
     int error;           /* current error state (0==OK) */
     int direction;       /* the direction of this stream */
 
     int error;           /* current error state (0==OK) */
-    unsigned char *buf;  /* for encoding or decoding */
+    const unsigned char *buf;  /* for encoding or decoding */
     int buflen;          /* size of buffer for encoding, len for decoding */
     int buflen;          /* size of buffer for encoding, len for decoding */
-    unsigned char *bp;   /* position in buffer */
+    const unsigned char *bp;   /* position in buffer */
     int left;            /* bytes remaining in buffer */
 
     odr_ecblock ecb;     /* memory control block */
     int left;            /* bytes remaining in buffer */
 
     odr_ecblock ecb;     /* memory control block */
index ed79b41..ac021d1 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995-1998, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: prt.h,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: prt.h,v $
- * Revision 1.24  1998-03-20 17:29:20  adam
+ * Revision 1.25  1999-01-08 11:23:18  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.24  1998/03/20 17:29:20  adam
  * Include of odr_use.h in odr.h. Added prototype for odr_enum.
  *
  * Revision 1.23  1998/03/20 14:45:27  adam
  * Include of odr_use.h in odr.h. Added prototype for odr_enum.
  *
  * Revision 1.23  1998/03/20 14:45:27  adam
@@ -32,13 +35,13 @@ extern "C" {
 YAZ_EXPORT int ber_boolean(ODR o, int *val);
 YAZ_EXPORT int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt);
 YAZ_EXPORT int ber_enctag(ODR o, int zclass, int tag, int constructed);
 YAZ_EXPORT int ber_boolean(ODR o, int *val);
 YAZ_EXPORT int ber_tag(ODR o, void *p, int zclass, int tag, int *constructed, int opt);
 YAZ_EXPORT int ber_enctag(ODR o, int zclass, int tag, int constructed);
-YAZ_EXPORT int ber_dectag(unsigned char *buf, int *zclass, int *tag, int *constructed);
+YAZ_EXPORT int ber_dectag(const unsigned char *buf, int *zclass, int *tag, int *constructed);
 YAZ_EXPORT int odr_bool(ODR o, int **p, int opt);
 YAZ_EXPORT int odr_integer(ODR o, int **p, int opt);
 YAZ_EXPORT int odr_enum(ODR o, int **p, int opt);
 YAZ_EXPORT int odr_implicit_settag(ODR o, int zclass, int tag);
 YAZ_EXPORT int ber_enclen(ODR o, int len, int lenlen, int exact);
 YAZ_EXPORT int odr_bool(ODR o, int **p, int opt);
 YAZ_EXPORT int odr_integer(ODR o, int **p, int opt);
 YAZ_EXPORT int odr_enum(ODR o, int **p, int opt);
 YAZ_EXPORT int odr_implicit_settag(ODR o, int zclass, int tag);
 YAZ_EXPORT int ber_enclen(ODR o, int len, int lenlen, int exact);
-YAZ_EXPORT int ber_declen(unsigned char *buf, int *len);
+YAZ_EXPORT int ber_declen(const unsigned char *buf, int *len);
 YAZ_EXPORT char *odr_indent(ODR o);
 YAZ_EXPORT int ber_null(ODR o);
 YAZ_EXPORT int odr_null(ODR o, Odr_null **p, int opt);
 YAZ_EXPORT char *odr_indent(ODR o);
 YAZ_EXPORT int ber_null(ODR o);
 YAZ_EXPORT int odr_null(ODR o, Odr_null **p, int opt);
@@ -51,7 +54,7 @@ YAZ_EXPORT int odr_sequence_end(ODR o);
 YAZ_EXPORT int odr_set_end(ODR o);
 YAZ_EXPORT int ber_octetstring(ODR o, Odr_oct *p, int cons);
 YAZ_EXPORT int odr_octetstring(ODR o, Odr_oct **p, int opt);
 YAZ_EXPORT int odr_set_end(ODR o);
 YAZ_EXPORT int ber_octetstring(ODR o, Odr_oct *p, int cons);
 YAZ_EXPORT int odr_octetstring(ODR o, Odr_oct **p, int opt);
-YAZ_EXPORT int odp_more_chunks(ODR o, unsigned char *base, int len);
+YAZ_EXPORT int odp_more_chunks(ODR o, const unsigned char *base, int len);
 YAZ_EXPORT int odr_constructed_more(ODR o);
 YAZ_EXPORT int odr_bitstring(ODR o, Odr_bitmask **p, int opt);
 YAZ_EXPORT int ber_bitstring(ODR o, Odr_bitmask *p, int cons);
 YAZ_EXPORT int odr_constructed_more(ODR o);
 YAZ_EXPORT int odr_bitstring(ODR o, Odr_bitmask **p, int opt);
 YAZ_EXPORT int ber_bitstring(ODR o, Odr_bitmask *p, int cons);
@@ -64,7 +67,7 @@ YAZ_EXPORT int odr_sequence_of(ODR o, Odr_fun type, void *p, int *num);
 YAZ_EXPORT int odr_set_of(ODR o, Odr_fun type, void *p, int *num);
 YAZ_EXPORT int odr_any(ODR o, Odr_any **p, int opt);
 YAZ_EXPORT int ber_any(ODR o, Odr_any **p);
 YAZ_EXPORT int odr_set_of(ODR o, Odr_fun type, void *p, int *num);
 YAZ_EXPORT int odr_any(ODR o, Odr_any **p, int opt);
 YAZ_EXPORT int ber_any(ODR o, Odr_any **p);
-YAZ_EXPORT int completeBER(unsigned char *buf, int len);
+YAZ_EXPORT int completeBER(const unsigned char *buf, int len);
 YAZ_EXPORT void odr_begin(ODR o);
 YAZ_EXPORT void odr_end(ODR o);
 YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, Odr_oid *o);
 YAZ_EXPORT void odr_begin(ODR o);
 YAZ_EXPORT void odr_end(ODR o);
 YAZ_EXPORT Odr_oid *odr_oiddup(ODR odr, Odr_oid *o);
@@ -72,7 +75,7 @@ YAZ_EXPORT Odr_oid *odr_oiddup_nmem(NMEM nmem, Odr_oid *o);
 YAZ_EXPORT int odr_grow_block(odr_ecblock *b, int min_bytes);
 YAZ_EXPORT int odr_write(ODR o, unsigned char *buf, int bytes);
 YAZ_EXPORT int odr_seek(ODR o, int whence, int offset);
 YAZ_EXPORT int odr_grow_block(odr_ecblock *b, int min_bytes);
 YAZ_EXPORT int odr_write(ODR o, unsigned char *buf, int bytes);
 YAZ_EXPORT int odr_seek(ODR o, int whence, int offset);
-YAZ_EXPORT int odr_dumpBER(FILE *f, char *buf, int len);
+YAZ_EXPORT int odr_dumpBER(FILE *f, const char *buf, int len);
 YAZ_EXPORT void odr_choice_bias(ODR o, int what);
 YAZ_EXPORT void odr_choice_enable_bias(ODR o, int mode);
 YAZ_EXPORT int odr_total(ODR o);
 YAZ_EXPORT void odr_choice_bias(ODR o, int what);
 YAZ_EXPORT void odr_choice_enable_bias(ODR o, int mode);
 YAZ_EXPORT int odr_total(ODR o);
index 1c30c3f..c1bd7ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 1995, Index Data.
+ * Copyright (c) 1995-1999, Index Data.
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  *
  * Permission to use, copy, modify, distribute, and sell this software and
  * its documentation, in whole or in part, for any purpose, is hereby granted,
  * OF THIS SOFTWARE.
  *
  * $Log: tcpip.h,v $
  * OF THIS SOFTWARE.
  *
  * $Log: tcpip.h,v $
- * Revision 1.11  1998-06-22 11:32:38  adam
+ * Revision 1.12  1999-01-08 11:23:19  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.11  1998/06/22 11:32:38  adam
  * Added 'conditional cs_listen' feature.
  *
  * Revision 1.10  1998/05/18 13:07:01  adam
  * Added 'conditional cs_listen' feature.
  *
  * Revision 1.10  1998/05/18 13:07:01  adam
@@ -83,6 +86,7 @@
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
+YAZ_EXPORT int completeWAIS(const unsigned char *buf, int len);
 YAZ_EXPORT struct sockaddr_in *tcpip_strtoaddr(const char *str);
 YAZ_EXPORT COMSTACK tcpip_type(int s, int blocking, int protocol);
 
 YAZ_EXPORT struct sockaddr_in *tcpip_strtoaddr(const char *str);
 YAZ_EXPORT COMSTACK tcpip_type(int s, int blocking, int protocol);
 
index 3c00d47..bebfbb3 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_any.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_any.c,v $
- * Revision 1.14  1998-02-11 11:53:34  adam
+ * Revision 1.15  1999-01-08 11:23:20  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.14  1998/02/11 11:53:34  adam
  * Changed code so that it compiles as C++.
  *
  * Revision 1.13  1997/05/14 06:53:56  adam
  * Changed code so that it compiles as C++.
  *
  * Revision 1.13  1997/05/14 06:53:56  adam
@@ -80,10 +83,10 @@ int ber_any(ODR o, Odr_any **p)
 /*
  * Return length of BER-package or 0.
  */
 /*
  * Return length of BER-package or 0.
  */
-int completeBER(unsigned char *buf, int len)
+int completeBER(const unsigned char *buf, int len)
 {
     int res, ll, zclass, tag, cons;
 {
     int res, ll, zclass, tag, cons;
-    unsigned char *b = buf;
+    const unsigned char *b = buf;
     
     if (!len)
        return 0;
     
     if (!len)
        return 0;
index 6f9dcdc..d95336b 100644 (file)
@@ -4,7 +4,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_bit.c,v $
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_bit.c,v $
- * Revision 1.7  1995-09-29 17:12:16  quinn
+ * Revision 1.8  1999-01-08 11:23:21  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.7  1995/09/29 17:12:16  quinn
  * Smallish
  *
  * Revision 1.6  1995/09/27  15:02:54  quinn
  * Smallish
  *
  * Revision 1.6  1995/09/27  15:02:54  quinn
@@ -34,7 +37,7 @@
 int ber_bitstring(ODR o, Odr_bitmask *p, int cons)
 {
     int res, len;
 int ber_bitstring(ODR o, Odr_bitmask *p, int cons)
 {
     int res, len;
-    unsigned char *base;
+    const unsigned char *base;
 
     switch (o->direction)
     {
 
     switch (o->direction)
     {
index 8b5ea7d..6d0da35 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_int.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_int.c,v $
- * Revision 1.12  1996-07-06 19:58:33  quinn
+ * Revision 1.13  1999-01-08 11:23:22  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.12  1996/07/06 19:58:33  quinn
  * System headerfiles gathered in yconfig
  *
  * Revision 1.11  1995/09/29  17:12:16  quinn
  * System headerfiles gathered in yconfig
  *
  * Revision 1.11  1995/09/29  17:12:16  quinn
 #include <string.h>
 
 #include <odr.h>
 #include <string.h>
 
 #include <odr.h>
-#include <prt.h>
 
 static int ber_encinteger(ODR o, int val);
 
 static int ber_encinteger(ODR o, int val);
-static int ber_decinteger(unsigned char *buf, int *val);
+static int ber_decinteger(const unsigned char *buf, int *val);
 
 int ber_integer(ODR o, int *val)
 {
 
 int ber_integer(ODR o, int *val)
 {
@@ -112,9 +114,10 @@ int ber_encinteger(ODR o, int val)
 /*
  * Returns: Number of bytes read or 0 if no match, -1 if error.
  */
 /*
  * Returns: Number of bytes read or 0 if no match, -1 if error.
  */
-int ber_decinteger(unsigned char *buf, int *val)
+int ber_decinteger(const unsigned char *buf, int *val)
 {
 {
-    unsigned char *b = buf, fill;
+    const unsigned char *b = buf;
+    unsigned char fill;
     int res, len, remains;
     union { int i; unsigned char c[sizeof(int)]; } tmp;
 
     int res, len, remains;
     union { int i; unsigned char c[sizeof(int)]; } tmp;
 
index d9b43ab..e772e73 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (C) 1995, Index Data.
+ * Copyright (C) 1995-1999, Index Data.
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_len.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_len.c,v $
- * Revision 1.6  1995-09-29 17:12:17  quinn
+ * Revision 1.7  1999-01-08 11:23:23  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.6  1995/09/29 17:12:17  quinn
  * Smallish
  *
  * Revision 1.5  1995/09/27  15:02:55  quinn
  * Smallish
  *
  * Revision 1.5  1995/09/27  15:02:55  quinn
@@ -91,9 +94,9 @@ int ber_enclen(ODR o, int len, int lenlen, int exact)
  * len = -1   indefinite.
  * len >= 0    Length.
  */
  * len = -1   indefinite.
  * len >= 0    Length.
  */
-int ber_declen(unsigned char *buf, int *len)
+int ber_declen(const unsigned char *buf, int *len)
 {
 {
-    unsigned char *b = buf;
+    const unsigned char *b = buf;
     int n;
 
     if (*b == 0X80)     /* Indefinite */
     int n;
 
     if (*b == 0X80)     /* Indefinite */
index e7c91a8..86c4e5a 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_oct.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_oct.c,v $
- * Revision 1.11  1998-02-11 11:53:34  adam
+ * Revision 1.12  1999-01-08 11:23:24  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.11  1998/02/11 11:53:34  adam
  * Changed code so that it compiles as C++.
  *
  * Revision 1.10  1995/09/29 17:12:18  quinn
  * Changed code so that it compiles as C++.
  *
  * Revision 1.10  1995/09/29 17:12:18  quinn
@@ -45,7 +48,8 @@
 int ber_octetstring(ODR o, Odr_oct *p, int cons)
 {
     int res, len;
 int ber_octetstring(ODR o, Odr_oct *p, int cons)
 {
     int res, len;
-    unsigned char *base, *c;
+    const unsigned char *base;
+    unsigned char *c;
 
     switch (o->direction)
     {
 
     switch (o->direction)
     {
index 8dc5e17..dcfd8ae 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995-1997, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_tag.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: ber_tag.c,v $
- * Revision 1.18  1998-02-11 11:53:34  adam
+ * Revision 1.19  1999-01-08 11:23:25  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.18  1998/02/11 11:53:34  adam
  * Changed code so that it compiles as C++.
  *
  * Revision 1.17  1997/09/30 09:33:10  adam
  * Changed code so that it compiles as C++.
  *
  * Revision 1.17  1997/09/30 09:33:10  adam
@@ -199,9 +202,9 @@ int ber_enctag(ODR o, int zclass, int tag, int constructed)
 /* ber_dectag
  * Decode BER identifier octets. Return number of bytes read or -1 for error.
  */
 /* ber_dectag
  * Decode BER identifier octets. Return number of bytes read or -1 for error.
  */
-int ber_dectag(unsigned char *buf, int *zclass, int *tag, int *constructed)
+int ber_dectag(const unsigned char *buf, int *zclass, int *tag, int *constructed)
 {
 {
-    unsigned char *b = buf;
+    const unsigned char *b = buf;
 
     *zclass = *b >> 6;
     *constructed = (*b >> 5) & 0X01;
 
     *zclass = *b >> 6;
     *constructed = (*b >> 5) & 0X01;
index 1af624a..62a1735 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995, Index Data.
+ * Copyright (c) 1995-1999, Index Data.
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: dumpber.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: dumpber.c,v $
- * Revision 1.9  1998-01-14 09:53:26  quinn
+ * Revision 1.10  1999-01-08 11:23:26  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.9  1998/01/14 09:53:26  quinn
  * Added a bit more info to dump.
  *
  * Revision 1.8  1997/05/14 06:53:57  adam
  * Added a bit more info to dump.
  *
  * Revision 1.8  1997/05/14 06:53:57  adam
 #include <odr.h>
 #include <stdio.h>
 
 #include <odr.h>
 #include <stdio.h>
 
-static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset)
+static int do_dumpBER(FILE *f, const char *buf, int len, int level, int offset)
 {
     int res, ll, zclass, tag, cons, lenlen, taglen;
 {
     int res, ll, zclass, tag, cons, lenlen, taglen;
-    char *b = buf, *bp = buf;
+    const char *b = buf, *bp = buf;
     
     if (!len)
        return 0;
     
     if (!len)
        return 0;
@@ -133,7 +136,7 @@ static int do_dumpBER(FILE *f, char *buf, int len, int level, int offset)
     return b - buf;
 }
 
     return b - buf;
 }
 
-int odr_dumpBER(FILE *f, char *buf, int len)
+int odr_dumpBER(FILE *f, const char *buf, int len)
 {
     return do_dumpBER(f, buf, len, 0, 0);
 }
 {
     return do_dumpBER(f, buf, len, 0, 0);
 }
index 078593d..7c4f900 100644 (file)
@@ -1,16 +1,18 @@
 /*
 /*
- * Copyright (c) 1995-1998, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_enum.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_enum.c,v $
- * Revision 1.1  1998-03-20 14:45:01  adam
+ * Revision 1.2  1999-01-08 11:23:27  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.1  1998/03/20 14:45:01  adam
  * Implemented odr_enum and odr_set_of.
  *
  */
 
 #include <odr.h>
  * Implemented odr_enum and odr_set_of.
  *
  */
 
 #include <odr.h>
-#include <prt.h>
 
 /*
  * Top level enum en/decoder.
 
 /*
  * Top level enum en/decoder.
index 8cfab5f..a7d1eef 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_int.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_int.c,v $
- * Revision 1.11  1998-02-11 11:53:34  adam
+ * Revision 1.12  1999-01-08 11:23:28  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.11  1998/02/11 11:53:34  adam
  * Changed code so that it compiles as C++.
  *
  * Revision 1.10  1995/09/29 17:12:24  quinn
  * Changed code so that it compiles as C++.
  *
  * Revision 1.10  1995/09/29 17:12:24  quinn
@@ -40,7 +43,6 @@
  */
 
 #include <odr.h>
  */
 
 #include <odr.h>
-#include <prt.h>
 
 /*
  * Top level integer en/decoder.
 
 /*
  * Top level integer en/decoder.
index e8856e6..bb0194b 100644 (file)
@@ -1,10 +1,13 @@
 /*
 /*
- * Copyright (c) 1995-1998, Index Data
+ * Copyright (c) 1995-1999, Index Data
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_util.c,v $
  * See the file LICENSE for details.
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: odr_util.c,v $
- * Revision 1.14  1998-10-13 15:58:36  adam
+ * Revision 1.15  1999-01-08 11:23:29  adam
+ * Added const modifier to some of the BER/ODR encoding routines.
+ *
+ * Revision 1.14  1998/10/13 15:58:36  adam
  * Minor fix in odr_getoidbystr_nmem.
  *
  * Revision 1.13  1998/02/11 11:53:34  adam
  * Minor fix in odr_getoidbystr_nmem.
  *
  * Revision 1.13  1998/02/11 11:53:34  adam
@@ -35,7 +38,7 @@ char *odr_indent(ODR o)
     return buf;
 }
 
     return buf;
 }
 
-int odp_more_chunks(ODR o, unsigned char *base, int len)
+int odp_more_chunks(ODR o, const unsigned char *base, int len)
 {
     if (!len)
        return 0;
 {
     if (!len)
        return 0;