diff options
author | Michael Adam <obnox@samba.org> | 2007-12-23 03:47:16 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2007-12-23 04:10:32 +0100 |
commit | b6527f3d29dccc4b86252e7d6722371e61870e80 (patch) | |
tree | 221e39168f7eff02e8888aab4e6f42d7bf9b81eb /source3 | |
parent | 62f08d3dd9b1f1d53a8e9ecf352fbbfb4c12c484 (diff) | |
download | samba-b6527f3d29dccc4b86252e7d6722371e61870e80.tar.gz samba-b6527f3d29dccc4b86252e7d6722371e61870e80.tar.bz2 samba-b6527f3d29dccc4b86252e7d6722371e61870e80.zip |
Reorder libnet_conf.c some, adding "section" comments.
Michael
(This used to be commit b9f22adfd3e67046b7d786b5b338e078b4cdc6df)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libnet/libnet_conf.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c index 00dc1d473d..f364e4fb64 100644 --- a/source3/libnet/libnet_conf.c +++ b/source3/libnet/libnet_conf.c @@ -20,6 +20,13 @@ #include "includes.h" +/********************************************************************** + * + * Helper functions (mostly registry related) + * TODO: These should be eventually static. + + **********************************************************************/ + /* * Open a subkey of KEY_SMBCONF (i.e a service) * - variant without error output (q = quiet)- @@ -77,6 +84,23 @@ done: return ret; } +static 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; +} + /* * Open a subkey of KEY_SMBCONF (i.e a service) * - variant with error output - @@ -148,7 +172,6 @@ done: return werr; } - /* * add a value to a key. */ @@ -235,6 +258,12 @@ static WERROR do_modify_val_config(struct registry_key *key, return reg_setvalue(key, val_name, &val); } +/********************************************************************** + * + * The actual net conf api functions, that are exported. + * + **********************************************************************/ + WERROR libnet_smbconf_setparm(TALLOC_CTX *mem_ctx, const char *service, const char *param, @@ -287,23 +316,6 @@ WERROR libnet_smbconf_set_global_param(TALLOC_CTX *mem_ctx, return do_modify_val_config(key, param, val); } -static 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; -} - WERROR libnet_smbconf_delparm(TALLOC_CTX *mem_ctx, const char *service, const char *param) |