+void
+at_destroy( void )
+{
+ AttributeType *a;
+ avl_free(attr_index, ldap_memfree);
+
+ while( !LDAP_SLIST_EMPTY(&attr_list) ) {
+ a = LDAP_SLIST_FIRST(&attr_list);
+ LDAP_SLIST_REMOVE_HEAD(&attr_list, sat_next);
+
+ if (a->sat_subtypes) ldap_memfree(a->sat_subtypes);
+ ad_destroy(a->sat_ad);
+ ldap_pvt_thread_mutex_destroy(&a->sat_ad_mutex);
+ ldap_attributetype_free((LDAPAttributeType *)a);
+ }
+
+ if ( slap_schema.si_at_undefined ) {
+ ad_destroy(slap_schema.si_at_undefined->sat_ad);
+ }
+}
+
+int
+at_start( AttributeType **at )
+{
+ assert( at );
+
+ *at = LDAP_SLIST_FIRST(&attr_list);
+
+ return (*at != NULL);
+}
+
+int
+at_next( AttributeType **at )
+{
+ assert( at );
+
+#if 1 /* pedantic check */
+ {
+ AttributeType *tmp = NULL;
+
+ LDAP_SLIST_FOREACH(tmp,&attr_list,sat_next) {
+ if ( tmp == *at ) {
+ break;
+ }
+ }
+
+ assert( tmp );
+ }
+#endif
+
+ *at = LDAP_SLIST_NEXT(*at,sat_next);
+
+ return (*at != NULL);
+}
+
+
+