svn commit: samba r17236 - in branches/SOC/mkhl/ldb-map/modules: .

mkhl at samba.org mkhl at samba.org
Tue Jul 25 18:42:27 GMT 2006


Author: mkhl
Date: 2006-07-25 18:42:26 +0000 (Tue, 25 Jul 2006)
New Revision: 17236

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

Log:
Even more const declarations for `ldb_map_context's.

Martin
Modified:
   branches/SOC/mkhl/ldb-map/modules/ldb_map.c
   branches/SOC/mkhl/ldb-map/modules/ldb_map.h


Changeset:
Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c
===================================================================
--- branches/SOC/mkhl/ldb-map/modules/ldb_map.c	2006-07-25 18:22:03 UTC (rev 17235)
+++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c	2006-07-25 18:42:26 UTC (rev 17236)
@@ -92,7 +92,7 @@
 
 /* extract private data */
 static
-struct ldb_map_context *
+const struct ldb_map_context *
 map_get_context(struct ldb_module *module)
 {
 	struct map_private *data = talloc_get_type(module->private_data,
@@ -1446,7 +1446,7 @@
 		  struct ldb_parse_tree **new,
 		  const struct ldb_parse_tree *tree)
 {
-	struct ldb_map_context *data = map_get_context(module);
+	const struct ldb_map_context *data = map_get_context(module);
 	const struct ldb_map_attribute *map;
 
 	if (tree == NULL)
@@ -2984,10 +2984,10 @@
 static
 int
 map_init_dns(struct ldb_module *module,
+	     struct ldb_map_context *data,
 	     const char *name)
 {
 	static const char *const attrs[] = { MAP_DN_FROM, MAP_DN_TO, NULL};
-	struct ldb_map_context *data = map_get_context(module);
 	struct ldb_dn *dn;
 	struct ldb_message *msg;
 	struct ldb_result *res;
@@ -3034,10 +3034,10 @@
 static
 void
 map_init_maps(struct ldb_module *module,
+	      struct ldb_map_context *data,
 	      const struct ldb_map_attribute *attrs,
 	      const struct ldb_map_objectclass *ocls)
 {
-	struct ldb_map_context *data = map_get_context(module);
 	int i, last;
 
 	last = 0;
@@ -3092,7 +3092,7 @@
 	int ret;
 
 	/* prepare private data */
-	data = talloc(module, struct map_private);
+	data = talloc_zero(module, struct map_private);
 	if (data == NULL) {
 		ldb_oom(module->ldb);
                 goto failed;
@@ -3101,12 +3101,12 @@
 	module->private_data = data;
 
 	/* store local and remote baseDNs */
-	ret = map_init_dns(module, name);
+	ret = map_init_dns(module, &(data->context), name);
 	if (ret != LDB_SUCCESS)
 		goto failed;
 
 	/* store list of attribute and objectClass maps */
-	map_init_maps(module, attrs, ocls);
+	map_init_maps(module, &(data->context), attrs, ocls);
 
 	return LDB_SUCCESS;
 

Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.h
===================================================================
--- branches/SOC/mkhl/ldb-map/modules/ldb_map.h	2006-07-25 18:22:03 UTC (rev 17235)
+++ branches/SOC/mkhl/ldb-map/modules/ldb_map.h	2006-07-25 18:42:26 UTC (rev 17236)
@@ -68,7 +68,7 @@
 	
 	/* if set, will be called for search expressions that contain this attribute */
 	struct ldb_parse_tree *(*convert_operator) (
-		struct ldb_map_context *,
+		const struct ldb_map_context *,
 		TALLOC_CTX *ctx,
 		const struct ldb_parse_tree *);	
 



More information about the samba-cvs mailing list