s4-schema: added dsdb_attribute_by_lDAPDisplayName_ldb_val
authorAndrew Tridgell <tridge@samba.org>
Thu, 7 Jan 2010 06:27:46 +0000 (17:27 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 8 Jan 2010 02:03:04 +0000 (13:03 +1100)
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/dsdb/schema/schema_query.c

index 75d971607079ec51345469e0caadee39f6417859..4e11e50c17dc7aff17c82461345d3d0ce4ec51be 100644 (file)
@@ -100,6 +100,18 @@ const struct dsdb_attribute *dsdb_attribute_by_lDAPDisplayName(const struct dsdb
        return c;
 }
 
+const struct dsdb_attribute *dsdb_attribute_by_lDAPDisplayName_ldb_val(const struct dsdb_schema *schema,
+                                                                      const struct ldb_val *name)
+{
+       struct dsdb_attribute *a;
+
+       if (!name) return NULL;
+
+       BINARY_ARRAY_SEARCH_P(schema->attributes_by_lDAPDisplayName,
+                             schema->num_attributes, lDAPDisplayName, name, strcasecmp_with_ldb_val, a);
+       return a;
+}
+
 const struct dsdb_attribute *dsdb_attribute_by_linkID(const struct dsdb_schema *schema,
                                                      int linkID)
 {