From 49976b5bc1d0521c5e047d2277aa15b358b7cd02 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 29 Jan 2000 22:03:34 +0000 Subject: [PATCH] Constify a few attr_*() routines --- servers/slapd/attr.c | 16 ++++++++-------- servers/slapd/proto-slap.h | 13 ++++++++----- servers/slapd/slap.h | 4 +++- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index efe6d61e78..7b1aecd735 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -124,7 +124,7 @@ attr_normalize( char *s ) int attr_merge_fast( Entry *e, - char *type, + const char *type, struct berval **vals, int nvals, int naddvals, @@ -164,7 +164,7 @@ attr_merge_fast( int attr_merge( Entry *e, - char *type, + const char *type, struct berval **vals ) { @@ -250,7 +250,7 @@ attr_delete( */ int -attr_syntax( char *type ) +attr_syntax( const char *type ) { AttributeType *sat; @@ -357,7 +357,7 @@ attr_syntax_config( int at_fake_if_needed( - char *name + const char *name ) { char *argv[3]; @@ -365,7 +365,7 @@ at_fake_if_needed( if ( at_find( name ) ) { return 0; } else { - argv[0] = name; + argv[0] = (char*) name; argv[1] = "cis"; argv[2] = NULL; attr_syntax_config( "implicit", 0, 2, argv ); @@ -706,7 +706,7 @@ at_add( char * #ifdef SLAPD_SCHEMA_COMPAT -at_canonical_name( char * a_type ) +at_canonical_name( const char * a_type ) #else at_canonical_name( AttributeType * atp ) #endif @@ -719,7 +719,7 @@ at_canonical_name( AttributeType * atp ) if ( atp == NULL ) { #ifdef SLAPD_SCHEMA_COMPAT - return a_type; + return (char *) a_type; #else return NULL; #endif @@ -734,7 +734,7 @@ at_canonical_name( AttributeType * atp ) } #ifdef SLAPD_SCHEMA_COMPAT - return a_type; + return (char *) a_type; #else return NULL; #endif diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 3ab5f7ec80..f7b1a1e2dc 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -51,24 +51,27 @@ LIBSLAPD_F (slap_access_mask_t) str2accessmask LDAP_P(( const char *str )); LIBSLAPD_F (void) attr_free LDAP_P(( Attribute *a )); LIBSLAPD_F (Attribute *) attr_dup LDAP_P(( Attribute *a )); LIBSLAPD_F (char *) attr_normalize LDAP_P(( char *s )); -LIBSLAPD_F (int) attr_merge_fast LDAP_P(( Entry *e, char *type, struct berval **vals, int nvals, int naddvals, int *maxvals, Attribute ***a )); -LIBSLAPD_F (int) attr_merge LDAP_P(( Entry *e, char *type, struct berval **vals )); +LIBSLAPD_F (int) attr_merge_fast LDAP_P(( Entry *e, const char *type, + struct berval **vals, int nvals, int naddvals, int *maxvals, + Attribute ***a )); +LIBSLAPD_F (int) attr_merge LDAP_P(( Entry *e, const char *type, + struct berval **vals )); LIBSLAPD_F (Attribute *) attr_find LDAP_P(( Attribute *a, const char *type )); LIBSLAPD_F (int) attr_delete LDAP_P(( Attribute **attrs, const char *type )); -LIBSLAPD_F (int) attr_syntax LDAP_P(( char *type )); +LIBSLAPD_F (int) attr_syntax LDAP_P(( const char *type )); LIBSLAPD_F (void) attr_syntax_config LDAP_P(( const char *fname, int lineno, int argc, char **argv )); LIBSLAPD_F (AttributeType *) at_find LDAP_P(( const char *name )); LIBSLAPD_F (int) at_find_in_list LDAP_P(( AttributeType *sat, AttributeType **list )); LIBSLAPD_F (int) at_append_to_list LDAP_P(( AttributeType *sat, AttributeType ***listp )); LIBSLAPD_F (int) at_delete_from_list LDAP_P(( int pos, AttributeType ***listp )); -LIBSLAPD_F (int) at_fake_if_needed LDAP_P(( char *name )); +LIBSLAPD_F (int) at_fake_if_needed LDAP_P(( const char *name )); LIBSLAPD_F (int) at_schema_info LDAP_P(( Entry *e )); LIBSLAPD_F (int) at_add LDAP_P(( LDAP_ATTRIBUTE_TYPE *at, const char **err )); #ifdef SLAPD_SCHEMA_COMPAT -LIBSLAPD_F (char *) at_canonical_name LDAP_P(( char * a_type )); +LIBSLAPD_F (char *) at_canonical_name LDAP_P(( const char * a_type )); #else LIBSLAPD_F (char *) at_canonical_name LDAP_P(( AttributeType *a_type )); #endif diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 6c07a050a4..6487727325 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -319,7 +319,9 @@ typedef struct slap_filter { typedef struct slap_attr { char *a_type; /* description */ struct berval **a_vals; -#ifdef SLAPD_SCHEMA_COMPAT +#ifdef SLAPD_SCHEMA_NOT_COMPAT + AttributeType *a_at; /* attribute type */ +#else int a_syntax; #endif struct slap_attr *a_next; -- 2.39.5