summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFabio Fiorina <fiorinaf@gnutls.org>2002-07-01 20:04:32 +0000
committerFabio Fiorina <fiorinaf@gnutls.org>2002-07-01 20:04:32 +0000
commita3144f043e1c7c1da9c212a89d9e32ceff3e0ea4 (patch)
tree0795570f20b32b951811518dd9904c39f36263f4 /lib
parent33583825c4df6d34fb8af3e3c47b239db4172857 (diff)
downloadlibtasn1-a3144f043e1c7c1da9c212a89d9e32ceff3e0ea4.tar.gz
libtasn1-a3144f043e1c7c1da9c212a89d9e32ceff3e0ea4.tar.bz2
libtasn1-a3144f043e1c7c1da9c212a89d9e32ceff3e0ea4.zip
add const keyword
Diffstat (limited to 'lib')
-rw-r--r--lib/ASN1.c23
-rw-r--r--lib/ASN1.y9
-rw-r--r--lib/coding.c19
-rw-r--r--lib/decoding.c25
-rw-r--r--lib/der.h18
-rw-r--r--lib/element.c7
-rw-r--r--lib/element.h2
-rw-r--r--lib/int.h17
-rw-r--r--lib/libtasn1.h36
-rw-r--r--lib/parser_aux.c9
-rw-r--r--lib/parser_aux.h6
-rw-r--r--lib/structure.c9
-rw-r--r--lib/structure.h2
13 files changed, 96 insertions, 86 deletions
diff --git a/lib/ASN1.c b/lib/ASN1.c
index 394eebe..044f8e9 100644
--- a/lib/ASN1.c
+++ b/lib/ASN1.c
@@ -1,5 +1,5 @@
/* A Bison parser, made from ASN1.y
- by GNU bison 1.32. */
+ by GNU bison 1.33. */
#define YYBISON 1 /* Identify Bison output. */
@@ -58,7 +58,7 @@ unsigned long lineNumber; /* line number describing the parser position
char lastToken[MAX_NAME_SIZE+1]; /* last token find in the file to parse before the
'parse error' */
char identifierMissing[MAX_NAME_SIZE+1]; /* identifier name not found */
-char *fileName; /* file to parse */
+const char *fileName; /* file to parse */
int yyerror (char *);
int yylex(void);
@@ -357,10 +357,12 @@ static const short yycheck[] =
43, 137, 49, 43, 43, 43, 26
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/usr/share/bison/bison.simple"
+#line 3 "/usr/local/share/bison/bison.simple"
/* Skeleton output parser for bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc.
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -406,12 +408,10 @@ static const short yycheck[] =
# if YYSTACK_USE_ALLOCA
# define YYSTACK_ALLOC alloca
-# define YYSIZE_T YYSTD (size_t)
# else
# ifndef YYSTACK_USE_ALLOCA
# if defined (alloca) || defined (_ALLOCA_H)
# define YYSTACK_ALLOC alloca
-# define YYSIZE_T YYSTD (size_t)
# else
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
@@ -696,7 +696,7 @@ yystpcpy (yydest, yysrc)
# endif
#endif
-#line 341 "/usr/share/bison/bison.simple"
+#line 341 "/usr/local/share/bison/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
@@ -1509,7 +1509,7 @@ case 91:
break;
}
-#line 727 "/usr/share/bison/bison.simple"
+#line 727 "/usr/local/share/bison/bison.simple"
yyvsp -= yylen;
@@ -1921,7 +1921,7 @@ _asn1_create_errorDescription(int error,char *errorDescription)
* ASN1_NAME_TOO_LONG\: in the file there is an identifier whith more than MAX_NAME_SIZE characters.
**/
asn1_retCode
-asn1_parser2tree(char *file_name,ASN1_TYPE *definitions,char *errorDescription){
+asn1_parser2tree(const char *file_name,ASN1_TYPE *definitions,char *errorDescription){
p_tree=ASN1_TYPE_EMPTY;
@@ -2002,10 +2002,11 @@ asn1_parser2tree(char *file_name,ASN1_TYPE *definitions,char *errorDescription){
* ASN1_IDENTIFIER_NOT_FOUND\: in the file there is an identifier that is not defined.
* ASN1_NAME_TOO_LONG\: in the file there is an identifier whith more than MAX_NAME_SIZE characters.
**/
-int asn1_parser2array(char *inputFileName,char *outputFileName,char *vectorName,char *errorDescription){
+int asn1_parser2array(const char *inputFileName,const char *outputFileName,
+ const char *vectorName,char *errorDescription){
char *file_out_name=NULL;
char *vector_name=NULL;
- char *char_p,*slash_p,*dot_p;
+ const char *char_p,*slash_p,*dot_p;
p_tree=NULL;
diff --git a/lib/ASN1.y b/lib/ASN1.y
index b6f874c..62d36c3 100644
--- a/lib/ASN1.y
+++ b/lib/ASN1.y
@@ -42,7 +42,7 @@ unsigned long lineNumber; /* line number describing the parser position
char lastToken[MAX_NAME_SIZE+1]; /* last token find in the file to parse before the
'parse error' */
char identifierMissing[MAX_NAME_SIZE+1]; /* identifier name not found */
-char *fileName; /* file to parse */
+const char *fileName; /* file to parse */
int yyerror (char *);
int yylex(void);
@@ -555,7 +555,7 @@ _asn1_create_errorDescription(int error,char *errorDescription)
* ASN1_NAME_TOO_LONG\: in the file there is an identifier whith more than MAX_NAME_SIZE characters.
**/
asn1_retCode
-asn1_parser2tree(char *file_name,ASN1_TYPE *definitions,char *errorDescription){
+asn1_parser2tree(const char *file_name,ASN1_TYPE *definitions,char *errorDescription){
p_tree=ASN1_TYPE_EMPTY;
@@ -636,10 +636,11 @@ asn1_parser2tree(char *file_name,ASN1_TYPE *definitions,char *errorDescription){
* ASN1_IDENTIFIER_NOT_FOUND\: in the file there is an identifier that is not defined.
* ASN1_NAME_TOO_LONG\: in the file there is an identifier whith more than MAX_NAME_SIZE characters.
**/
-int asn1_parser2array(char *inputFileName,char *outputFileName,char *vectorName,char *errorDescription){
+int asn1_parser2array(const char *inputFileName,const char *outputFileName,
+ const char *vectorName,char *errorDescription){
char *file_out_name=NULL;
char *vector_name=NULL;
- char *char_p,*slash_p,*dot_p;
+ const char *char_p,*slash_p,*dot_p;
p_tree=NULL;
diff --git a/lib/coding.c b/lib/coding.c
index eef6270..1b9cbfd 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -139,7 +139,7 @@ _asn1_tag_der(unsigned char class,unsigned int tag_value,unsigned char *ans,int
/* Return: */
/******************************************************/
void
-_asn1_octet_der(unsigned char *str,int str_len,unsigned char *der,int *der_len)
+_asn1_octet_der(const unsigned char *str,int str_len,unsigned char *der,int *der_len)
{
int len_len;
@@ -285,7 +285,7 @@ char bit_mask[]={0xFF,0xFE,0xFC,0xF8,0xF0,0xE0,0xC0,0x80};
/* Return: */
/******************************************************/
void
-_asn1_bit_der(unsigned char *str,int bit_len,unsigned char *der,int *der_len)
+_asn1_bit_der(const unsigned char *str,int bit_len,unsigned char *der,int *der_len)
{
int len_len,len_byte,len_pad;
@@ -673,7 +673,7 @@ _asn1_ordering_set_of(unsigned char *der,node_asn *node)
* ASN1_VALUE_NOT_FOUND\: there is an element without a value.
**/
asn1_retCode
-asn1_der_coding(ASN1_TYPE element,char *name,unsigned char *der,int *len,
+asn1_der_coding(ASN1_TYPE element,const char *name,unsigned char *der,int *len,
char *ErrorDescription)
{
node_asn *node,*p;
@@ -815,3 +815,16 @@ asn1_der_coding(ASN1_TYPE element,char *name,unsigned char *der,int *len,
}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib/decoding.c b/lib/decoding.c
index 79c4abc..219be0f 100644
--- a/lib/decoding.c
+++ b/lib/decoding.c
@@ -46,7 +46,7 @@ _asn1_error_description_tag_error(node_asn *node,char *ErrorDescription)
unsigned long
-_asn1_get_length_der(unsigned char *der,int *len)
+_asn1_get_length_der(const unsigned char *der,int *len)
{
unsigned long ans;
int k,punt;
@@ -72,7 +72,7 @@ _asn1_get_length_der(unsigned char *der,int *len)
unsigned int
-_asn1_get_tag_der(unsigned char *der,unsigned char *class,int *len)
+_asn1_get_tag_der(const unsigned char *der,unsigned char *class,int *len)
{
int punt,ris;
@@ -98,7 +98,7 @@ _asn1_get_tag_der(unsigned char *der,unsigned char *class,int *len)
int
-_asn1_get_octet_der(unsigned char *der,int *der_len,unsigned char *str,int str_size, int *str_len)
+_asn1_get_octet_der(const unsigned char *der,int *der_len,unsigned char *str,int str_size, int *str_len)
{
int len_len;
@@ -118,7 +118,7 @@ _asn1_get_octet_der(unsigned char *der,int *der_len,unsigned char *str,int str_s
void
-_asn1_get_time_der(unsigned char *der,int *der_len,unsigned char *str)
+_asn1_get_time_der(const unsigned char *der,int *der_len,unsigned char *str)
{
int len_len,str_len;
@@ -132,7 +132,7 @@ _asn1_get_time_der(unsigned char *der,int *der_len,unsigned char *str)
void
-_asn1_get_objectid_der(unsigned char *der,int *der_len,unsigned char *str, int str_size)
+_asn1_get_objectid_der(const unsigned char *der,int *der_len,unsigned char *str, int str_size)
{
int len_len,len,k;
char temp[20];
@@ -165,7 +165,7 @@ _asn1_get_objectid_der(unsigned char *der,int *der_len,unsigned char *str, int s
int
-_asn1_get_bit_der(unsigned char *der,int *der_len,unsigned char *str, int str_size, int *bit_len)
+_asn1_get_bit_der(const unsigned char *der,int *der_len,unsigned char *str, int str_size, int *bit_len)
{
int len_len,len_byte;
@@ -187,7 +187,7 @@ _asn1_get_bit_der(unsigned char *der,int *der_len,unsigned char *str, int str_si
int
-_asn1_extract_tag_der(node_asn *node,unsigned char *der,int *der_len)
+_asn1_extract_tag_der(node_asn *node,const unsigned char *der,int *der_len)
{
node_asn *p;
int counter,len2,len3,is_tag_implicit;
@@ -371,7 +371,8 @@ _asn1_delete_not_used(node_asn *node)
**/
asn1_retCode
-asn1_der_decoding(ASN1_TYPE *element,unsigned char *der,int len,char *errorDescription)
+asn1_der_decoding(ASN1_TYPE *element,const unsigned char *der,int len,
+ char *errorDescription)
{
node_asn *node,*p,*p2,*p3;
char temp[128];
@@ -663,7 +664,8 @@ asn1_der_decoding(ASN1_TYPE *element,unsigned char *der,int len,char *errorDescr
* ASN1_TAG_ERROR,ASN1_DER_ERROR\: the der encoding doesn't match the structure STRUCTURE. *ELEMENT deleted.
**/
asn1_retCode
-asn1_der_decoding_element(ASN1_TYPE *structure,char *elementName,unsigned char *der,int len,char *errorDescription)
+asn1_der_decoding_element(ASN1_TYPE *structure,const char *elementName,
+ const unsigned char *der,int len,char *errorDescription)
{
node_asn *node,*p,*p2,*p3,*nodeFound=ASN1_TYPE_EMPTY;
char temp[128],currentName[MAX_NAME_SIZE*10],*dot_p,*char_p;
@@ -1114,7 +1116,8 @@ asn1_der_decoding_element(ASN1_TYPE *structure,char *elementName,unsigned char *
*
**/
asn1_retCode
-asn1_der_decoding_startEnd(ASN1_TYPE element,unsigned char *der,int len,char *name_element,int *start, int *end)
+asn1_der_decoding_startEnd(ASN1_TYPE element,const unsigned char *der,int len,
+ const char *name_element,int *start, int *end)
{
node_asn *node,*node_to_find,*p,*p2,*p3;
int counter,len2,len3,move,ris;
@@ -1513,7 +1516,7 @@ asn1_expand_any_defined_by(ASN1_TYPE definitions,ASN1_TYPE *element)
**/
asn1_retCode
asn1_expand_octet_string(ASN1_TYPE definitions,ASN1_TYPE *element,
- char *octetName,char *objectName)
+ const char *octetName,const char *objectName)
{
char name[2*MAX_NAME_SIZE+1],value[512];
asn1_retCode retCode=ASN1_SUCCESS,result;
diff --git a/lib/der.h b/lib/der.h
index 301336d..5d0927f 100644
--- a/lib/der.h
+++ b/lib/der.h
@@ -27,32 +27,26 @@
#define TAG_ENUMERATED 0x0A
#define TAG_NULL 0x05
-unsigned int _asn1_get_tag_der(unsigned char *der,
+unsigned int _asn1_get_tag_der(const unsigned char *der,
unsigned char *class,int *len);
-void _asn1_octet_der(unsigned char *str,int str_len,
+void _asn1_octet_der(const unsigned char *str,int str_len,
unsigned char *der,int *der_len);
-asn1_retCode _asn1_get_octet_der(unsigned char *der,
+asn1_retCode _asn1_get_octet_der(const unsigned char *der,
int *der_len,unsigned char *str,int str_size, int *str_len);
-void _asn1_bit_der(unsigned char *str,int bit_len,
+void _asn1_bit_der(const unsigned char *str,int bit_len,
unsigned char *der,int *der_len);
-asn1_retCode _asn1_get_bit_der(unsigned char *der,
+asn1_retCode _asn1_get_bit_der(const unsigned char *der,
int *der_len,unsigned char *str, int str_size,
int *bit_len);
-unsigned long _asn1_get_length_der(unsigned char *der,int *len);
+unsigned long _asn1_get_length_der(const unsigned char *der,int *len);
void _asn1_length_der(unsigned long len,unsigned char *ans,int *ans_len);
-asn1_retCode
-asn1_der_coding(ASN1_TYPE element,char *name,unsigned char *der,int *len,
- char *ErrorDescription);
-
-asn1_retCode
-asn1_der_decoding(ASN1_TYPE *element,unsigned char *der,int len,char *errorDescription);
#endif
diff --git a/lib/element.c b/lib/element.c
index f1d87eb..6937908 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -72,7 +72,7 @@ _asn1_hierarchical_name(node_asn *node,char *name,int name_size)
/* Return: ASN1_MEM_ERROR or ASN1_SUCCESS */
/******************************************************************/
asn1_retCode
-_asn1_convert_integer(char *value,unsigned char *value_out,int value_out_size, int *len)
+_asn1_convert_integer(const char *value,unsigned char *value_out,int value_out_size, int *len)
{
char negative;
unsigned char val[SIZEOF_UNSIGNED_LONG_INT],temp;
@@ -243,7 +243,8 @@ _asn1_append_sequence_set(node_asn *node)
*
**/
asn1_retCode
-asn1_write_value(node_asn *node_root,char *name,unsigned char *value,int len)
+asn1_write_value(node_asn *node_root,const char *name,
+ const unsigned char *value,int len)
{
node_asn *node,*p,*p2;
unsigned char *temp,*value_temp=NULL,*default_temp=NULL;
@@ -555,7 +556,7 @@ asn1_write_value(node_asn *node_root,char *name,unsigned char *value,int len)
*
**/
asn1_retCode
-asn1_read_value(node_asn *root,char *name,unsigned char *value, int *len)
+asn1_read_value(node_asn *root,const char *name,unsigned char *value, int *len)
{
node_asn *node,*p;
int len2,len3;
diff --git a/lib/element.h b/lib/element.h
index 9fff601..3db9529 100644
--- a/lib/element.h
+++ b/lib/element.h
@@ -5,7 +5,7 @@
asn1_retCode _asn1_append_sequence_set(node_asn *node);
-asn1_retCode _asn1_convert_integer(char *value,unsigned char *value_out,
+asn1_retCode _asn1_convert_integer(const char *value,unsigned char *value_out,
int value_out_size, int *len);
void _asn1_hierarchical_name(node_asn *node,char *name,int name_size);
diff --git a/lib/int.h b/lib/int.h
index 947415a..ecad211 100644
--- a/lib/int.h
+++ b/lib/int.h
@@ -148,21 +148,16 @@ typedef struct static_struct_asn ASN1_ARRAY_TYPE;
/* functions */
asn1_retCode asn1_delete_structure(ASN1_TYPE *structure);
-asn1_retCode asn1_create_element(ASN1_TYPE definitions,char *source_name,
- ASN1_TYPE *element, char *dest_name);
+asn1_retCode asn1_create_element(ASN1_TYPE definitions,const char *source_name,
+ ASN1_TYPE *element,const char *dest_name);
-asn1_retCode asn1_read_value(ASN1_TYPE element,char *name,unsigned char *value,
- int *len);
-
-asn1_retCode
-asn1_expand_any_defined_by(ASN1_TYPE definitions,ASN1_TYPE *element);
-
-void
-asn1_print_structure(FILE *out,ASN1_TYPE structure,char *name,int mode);
+asn1_retCode asn1_read_value(ASN1_TYPE element,const char *name,
+ unsigned char *value,int *len);
asn1_retCode
asn1_expand_octet_string(ASN1_TYPE definitions,ASN1_TYPE *element,
- char *octetName,char *objectName);
+ const char *octetName,const char *objectName);
+
#endif /* INT_H */
diff --git a/lib/libtasn1.h b/lib/libtasn1.h
index fa3badd..a794f17 100644
--- a/lib/libtasn1.h
+++ b/lib/libtasn1.h
@@ -28,7 +28,7 @@
extern "C" {
#endif
-#define LIBASN1_VERSION "0.1.0"
+#define LIBASN1_VERSION "0.1.1"
#include <sys/types.h>
#include <time.h>
@@ -103,47 +103,47 @@ typedef struct static_struct_asn ASN1_ARRAY_TYPE;
/* Functions definitions */
/***********************************/
-asn1_retCode asn1_parser2tree(char *file_name,ASN1_TYPE *definitions,
+asn1_retCode asn1_parser2tree(const char *file_name,ASN1_TYPE *definitions,
char *errorDescription);
-asn1_retCode asn1_parser2array(char *inputFileName,char *outputFileName,
- char *vectorName,char *errorDescription);
+asn1_retCode asn1_parser2array(const char *inputFileName,const char *outputFileName,
+ const char *vectorName,char *errorDescription);
asn1_retCode asn1_array2tree(const ASN1_ARRAY_TYPE *array,
ASN1_TYPE *definitions,char *errorDescription);
-void asn1_print_structure(FILE *out,ASN1_TYPE structure,char *name,int mode);
+void asn1_print_structure(FILE *out,ASN1_TYPE structure,const char *name,int mode);
-asn1_retCode asn1_create_element(ASN1_TYPE definitions,char *source_name,
- ASN1_TYPE *element, char *dest_name);
+asn1_retCode asn1_create_element(ASN1_TYPE definitions,const char *source_name,
+ ASN1_TYPE *element,const char *dest_name);
asn1_retCode asn1_delete_structure(ASN1_TYPE *structure);
-asn1_retCode asn1_write_value(ASN1_TYPE element,char *name,
- unsigned char *value,int len);
+asn1_retCode asn1_write_value(ASN1_TYPE element,const char *name,
+ const unsigned char *value,int len);
-asn1_retCode asn1_read_value(ASN1_TYPE element,char *name,unsigned char *value,
+asn1_retCode asn1_read_value(ASN1_TYPE element,const char *name,unsigned char *value,
int *len);
-asn1_retCode asn1_number_of_elements(ASN1_TYPE element,char *name,int *num);
+asn1_retCode asn1_number_of_elements(ASN1_TYPE element,const char *name,int *num);
-asn1_retCode asn1_der_coding(ASN1_TYPE element,char *name,
+asn1_retCode asn1_der_coding(ASN1_TYPE element,const char *name,
unsigned char *der,int *len,char *ErrorDescription);
-asn1_retCode asn1_der_decoding(ASN1_TYPE *element,unsigned char *der,int len,
+asn1_retCode asn1_der_decoding(ASN1_TYPE *element,const unsigned char *der,int len,
char *errorDescription);
-asn1_retCode asn1_der_decoding_element(ASN1_TYPE *structure,char *elementName,
- unsigned char *der,int len,char *errorDescription);
+asn1_retCode asn1_der_decoding_element(ASN1_TYPE *structure,const char *elementName,
+ const unsigned char *der,int len,char *errorDescription);
-asn1_retCode asn1_der_decoding_startEnd(ASN1_TYPE element,unsigned char *der,
- int len,char *name,int *start, int *end);
+asn1_retCode asn1_der_decoding_startEnd(ASN1_TYPE element,const unsigned char *der,
+ int len,const char *name,int *start, int *end);
asn1_retCode asn1_expand_any_defined_by(ASN1_TYPE definitions,
ASN1_TYPE *element);
asn1_retCode asn1_expand_octet_string(ASN1_TYPE definitions,ASN1_TYPE *element,
- char *octetName,char *objectName);
+ const char *octetName,const char *objectName);
const char* libasn1_strerror(asn1_retCode error);
diff --git a/lib/parser_aux.c b/lib/parser_aux.c
index b891a3a..fbe5aad 100644
--- a/lib/parser_aux.c
+++ b/lib/parser_aux.c
@@ -92,10 +92,11 @@ _asn1_add_node(unsigned int type)
/* Return: the searching result. NULL if not find. */
/******************************************************************/
node_asn *
-_asn1_find_node(node_asn *pointer,char *name)
+_asn1_find_node(node_asn *pointer,const char *name)
{
node_asn *p;
- char *n_start,*n_end,n[128];
+ char *n_end,n[128];
+ const char *n_start;
if((name==NULL) || (name[0]==0)) return NULL;
@@ -167,7 +168,7 @@ _asn1_find_node(node_asn *pointer,char *name)
/* Return: pointer to the NODE_ASN element. */
/******************************************************************/
node_asn *
-_asn1_set_value(node_asn *node,unsigned char *value,unsigned int len)
+_asn1_set_value(node_asn *node,const unsigned char *value,unsigned int len)
{
if(node==NULL) return node;
@@ -194,7 +195,7 @@ _asn1_set_value(node_asn *node,unsigned char *value,unsigned int len)
/* Return: pointer to the NODE_ASN element. */
/******************************************************************/
node_asn *
-_asn1_set_name(node_asn *node,char *name)
+_asn1_set_name(node_asn *node,const char *name)
{
if(node==NULL) return node;
diff --git a/lib/parser_aux.h b/lib/parser_aux.h
index 937df66..08dcd7d 100644
--- a/lib/parser_aux.h
+++ b/lib/parser_aux.h
@@ -10,10 +10,10 @@ node_asn *
_asn1_add_node(unsigned int type);
node_asn *
-_asn1_set_value(node_asn *node,unsigned char *value,unsigned int len);
+_asn1_set_value(node_asn *node,const unsigned char *value,unsigned int len);
node_asn *
-_asn1_set_name(node_asn *node,char *name);
+_asn1_set_name(node_asn *node,const char *name);
node_asn *
_asn1_set_right(node_asn *node,node_asn *right);
@@ -47,7 +47,7 @@ char * _asn1_ltostr(long v,char *str);
node_asn * _asn1_find_up(node_asn *node);
-node_asn * _asn1_find_node(node_asn *pointer,char *name);
+node_asn * _asn1_find_node(node_asn *pointer,const char *name);
asn1_retCode _asn1_change_integer_value(ASN1_TYPE node);
diff --git a/lib/structure.c b/lib/structure.c
index 03798de..1df77c4 100644
--- a/lib/structure.c
+++ b/lib/structure.c
@@ -366,7 +366,7 @@ _asn1_copy_structure3(node_asn *source_node)
node_asn *
-_asn1_copy_structure2(node_asn *root,char *source_name)
+_asn1_copy_structure2(node_asn *root,const char *source_name)
{
node_asn *source_node;
@@ -539,7 +539,8 @@ _asn1_expand_identifier(node_asn **node,node_asn *root)
* result=asn1_create_structure(cert_def,"PKIX1.Certificate",&cert,"certificate1");
**/
asn1_retCode
-asn1_create_element(ASN1_TYPE definitions,char *source_name,ASN1_TYPE *element,char *dest_name)
+asn1_create_element(ASN1_TYPE definitions,const char *source_name,
+ ASN1_TYPE *element,const char *dest_name)
{
node_asn *dest_node;
int res;
@@ -572,7 +573,7 @@ asn1_create_element(ASN1_TYPE definitions,char *source_name,ASN1_TYPE *element,c
* the structure *POINTER.
**/
void
-asn1_print_structure(FILE *out,ASN1_TYPE structure,char *name,int mode)
+asn1_print_structure(FILE *out,ASN1_TYPE structure,const char *name,int mode)
{
node_asn *p,*root;
int k,indent=0,len,len2,len3;
@@ -828,7 +829,7 @@ asn1_print_structure(FILE *out,ASN1_TYPE structure,char *name,int mode)
*
**/
asn1_retCode
-asn1_number_of_elements(ASN1_TYPE element,char *name,int *num)
+asn1_number_of_elements(ASN1_TYPE element,const char *name,int *num)
{
node_asn *node,*p;
diff --git a/lib/structure.h b/lib/structure.h
index 8309761..5c302fa 100644
--- a/lib/structure.h
+++ b/lib/structure.h
@@ -23,7 +23,7 @@ asn1_retCode _asn1_create_static_structure(node_asn *pointer,
node_asn* _asn1_copy_structure3(node_asn *source_node);
-node_asn* _asn1_copy_structure2(node_asn *root,char *source_name);
+node_asn* _asn1_copy_structure2(node_asn *root,const char *source_name);
node_asn * _asn1_add_node_only(unsigned int type);