summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-17 00:02:52 +0100
committerMichael Adam <obnox@samba.org>2008-03-17 08:22:32 +0100
commit8432f7f8cf2ec6aa35f4fa40c824f46c0f255228 (patch)
tree2779bf274091798875c4dc341bc78ac52ab748c8 /source3
parent0a98b3ce1d9dee648786e0e96fdb0ae83c3715e5 (diff)
downloadsamba-8432f7f8cf2ec6aa35f4fa40c824f46c0f255228.tar.gz
samba-8432f7f8cf2ec6aa35f4fa40c824f46c0f255228.tar.bz2
samba-8432f7f8cf2ec6aa35f4fa40c824f46c0f255228.zip
registry: reformat init_registry_data() some, killing long lines.
Michael (This used to be commit f357b1ddd3ea552163151f27b4ec70fe0488a0ba)
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_backend_db.c68
1 files changed, 39 insertions, 29 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index d29a5323b3..59b5bad6ae 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -83,7 +83,7 @@ static struct builtin_regkey_value builtin_registry_values[] = {
Open the registry data in the tdb
***********************************************************************/
-static bool init_registry_data( void )
+static bool init_registry_data(void)
{
char *path = NULL;
char *base = NULL;
@@ -105,7 +105,7 @@ static bool init_registry_data( void )
* transaction behaviour.
*/
- if ( regdb->transaction_start( regdb ) == -1 ) {
+ if (regdb->transaction_start(regdb) == -1) {
DEBUG(0, ("init_registry_data: tdb_transaction_start "
"failed\n"));
return false;
@@ -113,11 +113,12 @@ static bool init_registry_data( void )
/* loop over all of the predefined paths and add each component */
- for ( i=0; builtin_registry_paths[i] != NULL; i++ ) {
+ for (i=0; builtin_registry_paths[i] != NULL; i++) {
frame = talloc_stackframe();
- DEBUG(6,("init_registry_data: Adding [%s]\n", builtin_registry_paths[i]));
+ DEBUG(6, ("init_registry_data: Adding [%s]\n",
+ builtin_registry_paths[i]));
path = talloc_strdup(frame, builtin_registry_paths[i]);
base = talloc_strdup(frame, "");
@@ -155,7 +156,8 @@ static bool init_registry_data( void )
p2 = remaining;
if (!next_token_talloc(frame, &p2,
- &subkeyname, "\\")) {
+ &subkeyname, "\\"))
+ {
subkeyname = talloc_strdup(frame,p2);
if (!subkeyname) {
goto fail;
@@ -163,14 +165,15 @@ static bool init_registry_data( void )
}
}
- DEBUG(10,("init_registry_data: Storing key [%s] with subkey [%s]\n",
- base, *subkeyname ? subkeyname : "NULL"));
+ DEBUG(10,("init_registry_data: Storing key [%s] with "
+ "subkey [%s]\n", base,
+ *subkeyname ? subkeyname : "NULL"));
- /* we don't really care if the lookup succeeds or not since
- we are about to update the record. We just want any
- subkeys already present */
+ /* we don't really care if the lookup succeeds or not
+ * since we are about to update the record.
+ * We just want any subkeys already present */
- if ( !(subkeys = TALLOC_ZERO_P(frame, REGSUBKEY_CTR )) ) {
+ if (!(subkeys = TALLOC_ZERO_P(frame, REGSUBKEY_CTR))) {
DEBUG(0,("talloc() failure!\n"));
goto fail;
}
@@ -197,36 +200,43 @@ static bool init_registry_data( void )
goto fail;
}
- regdb_fetch_values( builtin_registry_values[i].path, values);
+ regdb_fetch_values(builtin_registry_values[i].path, values);
- /* preserve existing values across restarts. Only add new ones */
+ /* preserve existing values across restarts. Only add new ones */
- if (!regval_ctr_key_exists(values, builtin_registry_values[i].valuename)) {
+ if (!regval_ctr_key_exists(values,
+ builtin_registry_values[i].valuename))
+ {
switch(builtin_registry_values[i].type) {
case REG_DWORD:
- regval_ctr_addvalue( values,
- builtin_registry_values[i].valuename,
- REG_DWORD,
- (char*)&builtin_registry_values[i].data.dw_value,
- sizeof(uint32) );
+ regval_ctr_addvalue(values,
+ builtin_registry_values[i].valuename,
+ REG_DWORD,
+ (char*)&builtin_registry_values[i].data.dw_value,
+ sizeof(uint32));
break;
case REG_SZ:
- init_unistr2( &data, builtin_registry_values[i].data.string, UNI_STR_TERMINATE);
- regval_ctr_addvalue( values,
- builtin_registry_values[i].valuename,
- REG_SZ,
- (char*)data.buffer,
- data.uni_str_len*sizeof(uint16) );
+ init_unistr2(&data,
+ builtin_registry_values[i].data.string,
+ UNI_STR_TERMINATE);
+ regval_ctr_addvalue(values,
+ builtin_registry_values[i].valuename,
+ REG_SZ,
+ (char*)data.buffer,
+ data.uni_str_len*sizeof(uint16));
break;
default:
- DEBUG(0,("init_registry_data: invalid value type in builtin_registry_values [%d]\n",
- builtin_registry_values[i].type));
+ DEBUG(0, ("init_registry_data: invalid value "
+ "type in builtin_registry_values "
+ "[%d]\n",
+ builtin_registry_values[i].type));
}
- regdb_store_values( builtin_registry_values[i].path, values );
+ regdb_store_values(builtin_registry_values[i].path,
+ values);
}
- TALLOC_FREE( values );
+ TALLOC_FREE(values);
}
TALLOC_FREE(frame);