/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include "slap.h"
-int is_at_syntax(
- AttributeType *at,
- const char *oid )
+const char *
+at_syntax(
+ AttributeType *at )
{
- for( ; at != NULL; at = at->sat_sup ) {
- if( at->sat_syntax_oid ) {
- return ( strcmp( at->sat_syntax_oid, oid ) == 0 );
+ for ( ; at != NULL; at = at->sat_sup ) {
+ if ( at->sat_syntax_oid ) {
+ return at->sat_syntax_oid;
}
}
+ assert( 0 );
+
+ return NULL;
+}
+
+int
+is_at_syntax(
+ AttributeType *at,
+ const char *oid )
+{
+ const char *syn_oid = at_syntax( at );
+
+ if ( syn_oid ) {
+ return strcmp( syn_oid, oid ) == 0;
+ }
+
return 0;
}
= LDAP_STAILQ_HEAD_INITIALIZER(attr_list);
/* Last hardcoded attribute registered */
-static AttributeType *attr_sys_tail;
+AttributeType *at_sys_tail;
int at_oc_cache;
}
if ( sat->sat_flags & SLAP_AT_HARDCODE ) {
- prev = attr_sys_tail;
- attr_sys_tail = sat;
+ prev = at_sys_tail;
+ at_sys_tail = sat;
}
if ( prev ) {
LDAP_STAILQ_INSERT_AFTER( &attr_list, prev, sat, sat_next );
/* count the result size */
i = 0;
for ( at=start; at; at=LDAP_STAILQ_NEXT(at, sat_next)) {
- if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+ if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) break;
i++;
if ( at == end ) break;
}
i = 0;
for ( at=start; at; at=LDAP_STAILQ_NEXT(at, sat_next)) {
LDAPAttributeType lat, *latp;
- if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) continue;
+ if ( sys && !(at->sat_flags & SLAP_AT_HARDCODE)) break;
if ( at->sat_oidmacro ) {
lat = at->sat_atype;
lat.at_oid = at->sat_oidmacro;