From c8fac1864c62c5da13c211e9c7f894b0af6663ac Mon Sep 17 00:00:00 2001 From: Juan Gomez Date: Fri, 11 Jun 1999 20:41:07 +0000 Subject: [PATCH] Added at_ooficial_type() for uniform naming of index files. --- servers/slapd/attr.c | 29 +++++++++++++++++++++++++++++ servers/slapd/proto-slap.h | 1 + 2 files changed, 30 insertions(+) diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 9e8319f911..98436b0a1f 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -528,6 +528,35 @@ at_add( return code; } + +char * +at_official_name( char * a_type ) +{ + AttributeType *atp; + + if ( (atp=at_find(a_type)) == NULL ) { + + return a_type; + + } else if ( atp->sat_names + && atp->sat_names[0] + && (*(atp->sat_names[0]) != '\0') ) { + + return atp->sat_names[0]; + + } else if (atp->sat_oid && (*atp->sat_oid != '\0')) { + + return atp->sat_oid; + + } else { + + return a_type; + + } + +}/* char * at_official_name() */ + + #if defined( SLAPD_SCHEMA_DN ) int diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 0987d57baa..cbb2a4b8a7 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -53,6 +53,7 @@ int at_delete_from_list LDAP_P(( int pos, AttributeType ***listp )); int at_fake_if_needed LDAP_P(( char *name )); int at_schema_info LDAP_P(( Entry *e )); int at_add LDAP_P(( LDAP_ATTRIBUTE_TYPE *at, char **err )); +char * at_official_name LDAP_P(( char * a_type )); /* * ava.c -- 2.39.5