summaryrefslogtreecommitdiff
path: root/source4/lib/registry/patchfile_dotreg.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-10-06 00:17:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:51 -0500
commitcc8f4eb3cd9b3bc4e3f3d61bfad240147e8a4e5e (patch)
tree4cbddb2cf829c772163e632d056935d82e881814 /source4/lib/registry/patchfile_dotreg.c
parente511090a4339221dfd1fa597964af7455f96ec28 (diff)
downloadsamba-cc8f4eb3cd9b3bc4e3f3d61bfad240147e8a4e5e.tar.gz
samba-cc8f4eb3cd9b3bc4e3f3d61bfad240147e8a4e5e.tar.bz2
samba-cc8f4eb3cd9b3bc4e3f3d61bfad240147e8a4e5e.zip
r25544: Cleanup some more indents in lib/registry.
Guenther (This used to be commit 0d9826dc54057db2cfebcb806e5442c4dcf60daa)
Diffstat (limited to 'source4/lib/registry/patchfile_dotreg.c')
-rw-r--r--source4/lib/registry/patchfile_dotreg.c70
1 files changed, 41 insertions, 29 deletions
diff --git a/source4/lib/registry/patchfile_dotreg.c b/source4/lib/registry/patchfile_dotreg.c
index 85cf8ab251..ebcafc92af 100644
--- a/source4/lib/registry/patchfile_dotreg.c
+++ b/source4/lib/registry/patchfile_dotreg.c
@@ -1,7 +1,7 @@
-/*
+/*
Unix SMB/CIFS implementation.
Reading .REG files
-
+
Copyright (C) Jelmer Vernooij 2004-2007
Copyright (C) Wilco Baan Hofman 2006
@@ -9,12 +9,12 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -43,7 +43,7 @@ static WERROR reg_dotreg_diff_add_key(void *_data, const char *key_name)
struct dotreg_data *data = (struct dotreg_data *)_data;
fdprintf(data->fd, "\n[%s]\n", key_name);
-
+
return WERR_OK;
}
@@ -52,23 +52,25 @@ static WERROR reg_dotreg_diff_del_key(void *_data, const char *key_name)
struct dotreg_data *data = (struct dotreg_data *)_data;
fdprintf(data->fd, "\n[-%s]\n", key_name);
-
+
return WERR_OK;
}
-static WERROR reg_dotreg_diff_set_value(void *_data, const char *path,
- const char *value_name, uint32_t value_type, DATA_BLOB value)
+static WERROR reg_dotreg_diff_set_value(void *_data, const char *path,
+ const char *value_name,
+ uint32_t value_type, DATA_BLOB value)
{
struct dotreg_data *data = (struct dotreg_data *)_data;
fdprintf(data->fd, "\"%s\"=%s:%s\n",
- value_name, str_regtype(value_type),
+ value_name, str_regtype(value_type),
reg_val_data_string(NULL, value_type, value));
-
+
return WERR_OK;
}
-static WERROR reg_dotreg_diff_del_value(void *_data, const char *path, const char *value_name)
+static WERROR reg_dotreg_diff_del_value(void *_data, const char *path,
+ const char *value_name)
{
struct dotreg_data *data = (struct dotreg_data *)_data;
@@ -87,7 +89,8 @@ static WERROR reg_dotreg_diff_done(void *_data)
return WERR_OK;
}
-static WERROR reg_dotreg_diff_del_all_values (void *callback_data, const char *key_name)
+static WERROR reg_dotreg_diff_del_all_values(void *callback_data,
+ const char *key_name)
{
return WERR_NOT_SUPPORTED;
}
@@ -95,8 +98,9 @@ static WERROR reg_dotreg_diff_del_all_values (void *callback_data, const char *k
/**
* Save registry diff
*/
-_PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
- struct reg_diff_callbacks **callbacks, void **callback_data)
+_PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
+ struct reg_diff_callbacks **callbacks,
+ void **callback_data)
{
struct dotreg_data *data;
@@ -125,13 +129,14 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
(*callbacks)->done = reg_dotreg_diff_done;
return WERR_OK;
-}
+}
/**
* Load diff file
*/
-_PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
- const struct reg_diff_callbacks *callbacks, void *callback_data)
+_PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
+ const struct reg_diff_callbacks *callbacks,
+ void *callback_data)
{
char *line, *p, *q;
char *curkey = NULL;
@@ -152,8 +157,8 @@ _PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
/* Ignore comments and empty lines */
if (strlen(line) == 0 || line[0] == ';') {
talloc_free(line);
-
- if (curkey) {
+
+ if (curkey) {
talloc_free(curkey);
}
curkey = NULL;
@@ -171,9 +176,11 @@ _PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
if (line[1] == '-') {
curkey = talloc_strndup(line, line+2, strlen(line)-3);
- error = callbacks->del_key(callback_data, curkey);
+ error = callbacks->del_key(callback_data,
+ curkey);
if (!W_ERROR_IS_OK(error)) {
- DEBUG(0,("Error deleting key %s\n", curkey));
+ DEBUG(0,("Error deleting key %s\n",
+ curkey));
talloc_free(mem_ctx);
return error;
}
@@ -213,9 +220,11 @@ _PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
/* Delete value */
if (strcmp(p, "-") == 0) {
- error = callbacks->del_value(callback_data, curkey, line);
+ error = callbacks->del_value(callback_data,
+ curkey, line);
if (!W_ERROR_IS_OK(error)) {
- DEBUG(0, ("Error deleting value %s in key %s\n", line, curkey));
+ DEBUG(0, ("Error deleting value %s in key %s\n",
+ line, curkey));
talloc_free(mem_ctx);
return error;
}
@@ -223,18 +232,21 @@ _PUBLIC_ WERROR reg_dotreg_diff_load(int fd,
talloc_free(line);
continue;
}
-
+
q = strchr_m(p, ':');
if (q) {
- *q = '\0';
+ *q = '\0';
q++;
}
- reg_string_to_val(line, q?p:"REG_SZ", q?q:p, &value_type, &value);
-
- error = callbacks->set_value(callback_data, curkey, line, value_type, value);
+ reg_string_to_val(line, q?p:"REG_SZ", q?q:p,
+ &value_type, &value);
+
+ error = callbacks->set_value(callback_data, curkey, line,
+ value_type, value);
if (!W_ERROR_IS_OK(error)) {
- DEBUG(0, ("Error setting value for %s in %s\n", line, curkey));
+ DEBUG(0, ("Error setting value for %s in %s\n",
+ line, curkey));
talloc_free(mem_ctx);
return error;
}