svn commit: samba r20415 - in branches/SAMBA_4_0/source/dsdb/schema: .

metze at samba.org metze at samba.org
Sat Dec 30 09:48:06 GMT 2006


Author: metze
Date: 2006-12-30 09:48:05 +0000 (Sat, 30 Dec 2006)
New Revision: 20415

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20415

Log:
add a function to get the lDAPDisplayName for an objectClass
or attribute

metze
Modified:
   branches/SAMBA_4_0/source/dsdb/schema/schema_init.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/schema/schema_init.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/schema/schema_init.c	2006-12-30 05:09:59 UTC (rev 20414)
+++ branches/SAMBA_4_0/source/dsdb/schema/schema_init.c	2006-12-30 09:48:05 UTC (rev 20415)
@@ -718,3 +718,23 @@
 
 	return NULL;
 }
+
+const char *dsdb_lDAPDisplayName_by_id(const struct dsdb_schema *schema,
+				       uint32_t id)
+{
+	struct dsdb_class *a;
+	struct dsdb_class *c;
+
+	/* TODO: add binary search */
+	a = dsdb_attribute_by_attributeID_id(schema, id);
+	if (a) {
+		return a->lDAPDisplayName;
+	}
+
+	c = dsdb_class_by_governsID_id(schema, id);
+	if (c) {
+		return c->lDAPDisplayName;
+	}
+
+	return NULL;
+}



More information about the samba-cvs mailing list