Move smbconf_value_exists() to libnet/net_conf.c
authorMichael Adam <obnox@samba.org>
Sun, 23 Dec 2007 01:44:29 +0000 (02:44 +0100)
committerMichael Adam <obnox@samba.org>
Sun, 23 Dec 2007 03:10:31 +0000 (04:10 +0100)
renaming it to libnet_smbconf_value_exists().

Michael

source/libnet/libnet_conf.c
source/utils/net_conf.c

index dcaa7689b329dd710c995889de4dda196badff6e..9f64e7fc0dfcf76d323111024cecd8d640ac97c8 100644 (file)
@@ -194,3 +194,20 @@ WERROR libnet_smbconf_set_global_param(TALLOC_CTX *mem_ctx,
        return do_modify_val_config(key, param, val);
 }
 
+bool libnet_smbconf_value_exists(TALLOC_CTX *ctx,
+                                       struct registry_key *key,
+                                       const char *param)
+{
+       bool ret = False;
+       WERROR werr = WERR_OK;
+       struct registry_value *value = NULL;
+
+       werr = reg_queryvalue(ctx, key, param, &value);
+       if (W_ERROR_IS_OK(werr)) {
+               ret = True;
+       }
+
+       TALLOC_FREE(value);
+       return ret;
+}
+
index 808ba8d8857c99f766c3c3548955e088d167225b..c4707e4248dfdfbdd7806eac986cfdb63cdce497 100644 (file)
@@ -238,22 +238,6 @@ done:
        return werr;
 }
 
-static bool smbconf_value_exists(TALLOC_CTX *ctx, struct registry_key *key,
-                                const char *param)
-{
-       bool ret = False;
-       WERROR werr = WERR_OK;
-       struct registry_value *value = NULL;
-
-       werr = reg_queryvalue(ctx, key, param, &value);
-       if (W_ERROR_IS_OK(werr)) {
-               ret = True;
-       }
-
-       TALLOC_FREE(value);
-       return ret;
-}
-
 static WERROR list_values(TALLOC_CTX *ctx, struct registry_key *key)
 {
        WERROR werr = WERR_OK;
@@ -1037,7 +1021,7 @@ static int net_conf_delparm(int argc, const char **argv)
                goto done;
        }
 
-       if (!smbconf_value_exists(ctx, key, param)) {
+       if (!libnet_smbconf_value_exists(ctx, key, param)) {
                d_fprintf(stderr,
                          "Error: given parameter '%s' is not set.\n",
                          param);