Keep hardcoded schema together in lists

This commit is contained in:
Howard Chu 2006-11-17 20:11:11 +00:00
parent ecd7c78547
commit f0f7324e0e
3 changed files with 28 additions and 4 deletions

View file

@ -61,6 +61,9 @@ static Avlnode *attr_cache = NULL;
static LDAP_STAILQ_HEAD(ATList, slap_attribute_type) attr_list
= LDAP_STAILQ_HEAD_INITIALIZER(attr_list);
/* Last hardcoded attribute registered */
static AttributeType *attr_sys_tail;
int at_oc_cache;
static int
@ -525,6 +528,10 @@ at_insert(
}
}
if ( sat->sat_flags & SLAP_AT_HARDCODE ) {
prev = attr_sys_tail;
attr_sys_tail = sat;
}
if ( prev ) {
LDAP_STAILQ_INSERT_AFTER( &attr_list, prev, sat, sat_next );
} else {

View file

@ -134,6 +134,7 @@ static Avlnode *oc_index = NULL;
static Avlnode *oc_cache = NULL;
static LDAP_STAILQ_HEAD(OCList, slap_object_class) oc_list
= LDAP_STAILQ_HEAD_INITIALIZER(oc_list);
static ObjectClass *oc_sys_tail;
static int
oc_index_cmp(
@ -669,7 +670,15 @@ oc_insert(
names++;
}
}
LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
if ( soc->soc_flags & SLAP_OC_HARDCODE ) {
prev = oc_sys_tail;
oc_sys_tail = soc;
}
if ( prev ) {
LDAP_STAILQ_INSERT_AFTER( &oc_list, prev, soc, soc_next );
} else {
LDAP_STAILQ_INSERT_TAIL( &oc_list, soc, soc_next );
}
return 0;
}

View file

@ -29,6 +29,8 @@
static LDAP_STAILQ_HEAD(OidMacroList, slap_oid_macro) om_list
= LDAP_STAILQ_HEAD_INITIALIZER(om_list);
static OidMacro *om_sys_tail;
/* Replace an OID Macro invocation with its full numeric OID.
* If the macro is used with "macroname:suffix" append ".suffix"
* to the expansion.
@ -98,7 +100,7 @@ parse_oidm(
OidMacro **rom)
{
char *oid;
OidMacro *om = NULL;
OidMacro *om = NULL, *prev = NULL;
struct berval bv;
oid = oidm_find( c->argv[1] );
@ -144,10 +146,16 @@ parse_oidm(
}
om->som_oid.bv_len = strlen( om->som_oid.bv_val );
if ( !user )
if ( !user ) {
om->som_flags |= SLAP_OM_HARDCODE;
prev = om_sys_tail;
}
LDAP_STAILQ_INSERT_TAIL( &om_list, om, som_next );
if ( prev ) {
LDAP_STAILQ_INSERT_AFTER( &om_list, prev, om, som_next );
} else {
LDAP_STAILQ_INSERT_TAIL( &om_list, om, som_next );
}
if ( rom ) *rom = om;
return 0;
}