Constify a few attr_*() routines

This commit is contained in:
Kurt Zeilenga 2000-01-29 22:03:34 +00:00
parent d4c814ecd9
commit 49976b5bc1
3 changed files with 19 additions and 14 deletions

View file

@ -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

View file

@ -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

View file

@ -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;