s3:registry: add a regsubkey_ctr_init function for allocating a regsubkey_ctr
authorMichael Adam <obnox@samba.org>
Tue, 24 Feb 2009 21:43:47 +0000 (22:43 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 19 Mar 2009 17:03:57 +0000 (18:03 +0100)
Michael

Signed-off-by: Michael Adam <obnox@samba.org>
source/include/proto.h
source/registry/reg_objects.c

index 9d932a2dee0d817ad1ae5bc9d5b6d276bb09bcde..ddc0e0500dd9468876d955ee6259be1396b9aa05 100644 (file)
@@ -6801,6 +6801,7 @@ WERROR registry_init_smbconf(const char *keyname);
 
 /* The following definitions come from registry/reg_objects.c  */
 
 
 /* The following definitions come from registry/reg_objects.c  */
 
+WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr);
 WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname );
 int regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname );
 bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname );
 WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname );
 int regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname );
 bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname );
index 15f98797067bdfd8d040cf3eca6312ac4fbfc342..10ad41e84b3c7313628df7f69ae1dd692d817450 100644 (file)
  talloc()'d since the methods use the object pointer as the talloc
  context for internal private data.
 
  talloc()'d since the methods use the object pointer as the talloc
  context for internal private data.
 
- There is no longer a regXXX_ctr_intit() and regXXX_ctr_destroy()
+ There is no longer a regval_ctr_intit() and regval_ctr_destroy()
  pair of functions.  Simply TALLOC_ZERO_P() and TALLOC_FREE() the
  object.
 
  **********************************************************************/
 
  pair of functions.  Simply TALLOC_ZERO_P() and TALLOC_FREE() the
  object.
 
  **********************************************************************/
 
+WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr)
+{
+       if (ctr == NULL) {
+               return WERR_INVALID_PARAM;
+       }
+
+       *ctr = talloc_zero(mem_ctx, struct regsubkey_ctr);
+       if (*ctr == NULL) {
+               return WERR_NOMEM;
+       }
+
+       return WERR_OK;
+}
+
 /***********************************************************************
  Add a new key to the array
  **********************************************************************/
 /***********************************************************************
  Add a new key to the array
  **********************************************************************/