From 4a5c38e78760886f5ad53259481487e03c61e372 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Mon, 15 Oct 2018 18:42:21 +0900 Subject: [PATCH] fix intendation --- src/namestore/plugin_namestore_sqlite.c | 152 ++++++++++++------------ 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index 1a4e0138c..a47121082 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c @@ -1,20 +1,20 @@ - /* - * This file is part of GNUnet - * Copyright (C) 2009-2017 GNUnet e.V. - * - * GNUnet is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, - * or (at your option) any later version. - * - * GNUnet 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 - * Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +/* + * This file is part of GNUnet + * Copyright (C) 2009-2017 GNUnet e.V. + * + * GNUnet is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, + * or (at your option) any later version. + * + * GNUnet 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 + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ /** * @file namestore/plugin_namestore_sqlite.c @@ -176,7 +176,7 @@ database_setup (struct Plugin *plugin) &sqlite_filename)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "namestore-sqlite", + "namestore-sqlite", "FILENAME"); return GNUNET_SYSERR; } @@ -200,8 +200,8 @@ database_setup (struct Plugin *plugin) &plugin->dbh)) { LOG (GNUNET_ERROR_TYPE_ERROR, - _("Unable to initialize SQLite: %s.\n"), - sqlite3_errmsg (plugin->dbh)); + _("Unable to initialize SQLite: %s.\n"), + sqlite3_errmsg (plugin->dbh)); return GNUNET_SYSERR; } GNUNET_break (SQLITE_OK == @@ -213,8 +213,8 @@ database_setup (struct Plugin *plugin) { GNUNET_break (0); LOG (GNUNET_ERROR_TYPE_ERROR, - _("Failed to setup database at `%s'\n"), - plugin->fn); + _("Failed to setup database at `%s'\n"), + plugin->fn); return GNUNET_SYSERR; } @@ -224,8 +224,8 @@ database_setup (struct Plugin *plugin) { GNUNET_break (0); LOG (GNUNET_ERROR_TYPE_ERROR, - _("Failed to setup database at `%s'\n"), - plugin->fn); + _("Failed to setup database at `%s'\n"), + plugin->fn); return GNUNET_SYSERR; } return GNUNET_OK; @@ -259,7 +259,7 @@ database_shutdown (struct Plugin *plugin) if (result == SQLITE_BUSY) { LOG (GNUNET_ERROR_TYPE_WARNING, - _("Tried to close sqlite without finalizing all prepared statements.\n")); + _("Tried to close sqlite without finalizing all prepared statements.\n")); stmt = sqlite3_next_stmt (plugin->dbh, NULL); while (NULL != stmt) @@ -302,10 +302,10 @@ database_shutdown (struct Plugin *plugin) */ static int namestore_sqlite_store_records (void *cls, - const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, - const char *label, - unsigned int rd_count, - const struct GNUNET_GNSRECORD_Data *rd) + const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone_key, + const char *label, + unsigned int rd_count, + const struct GNUNET_GNSRECORD_Data *rd) { struct Plugin *plugin = cls; int n; @@ -314,8 +314,8 @@ namestore_sqlite_store_records (void *cls, ssize_t data_size; memset (&pkey, - 0, - sizeof (pkey)); + 0, + sizeof (pkey)); for (unsigned int i=0;idbh, plugin->delete_records); return GNUNET_SYSERR; @@ -393,12 +393,12 @@ namestore_sqlite_store_records (void *cls, GNUNET_SQ_bind (plugin->store_records, sparams)) { - LOG_SQLITE (plugin, - GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "sqlite3_bind_XXXX"); + LOG_SQLITE (plugin, + GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, + "sqlite3_bind_XXXX"); GNUNET_SQ_reset (plugin->dbh, plugin->store_records); - return GNUNET_SYSERR; + return GNUNET_SYSERR; } n = sqlite3_step (plugin->store_records); GNUNET_SQ_reset (plugin->dbh, @@ -407,26 +407,26 @@ namestore_sqlite_store_records (void *cls, } switch (n) { - case SQLITE_DONE: - if (0 != rd_count) - GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, - "sqlite", - "Record stored\n"); - else - GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, - "sqlite", - "Record deleted\n"); - return GNUNET_OK; - case SQLITE_BUSY: - LOG_SQLITE (plugin, - GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, - "sqlite3_step"); - return GNUNET_NO; - default: - LOG_SQLITE (plugin, - GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "sqlite3_step"); - return GNUNET_SYSERR; + case SQLITE_DONE: + if (0 != rd_count) + GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, + "sqlite", + "Record stored\n"); + else + GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, + "sqlite", + "Record deleted\n"); + return GNUNET_OK; + case SQLITE_BUSY: + LOG_SQLITE (plugin, + GNUNET_ERROR_TYPE_WARNING | GNUNET_ERROR_TYPE_BULK, + "sqlite3_step"); + return GNUNET_NO; + default: + LOG_SQLITE (plugin, + GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, + "sqlite3_step"); + return GNUNET_SYSERR; } } @@ -463,15 +463,15 @@ get_records_and_call_iterator (struct Plugin *plugin, if (SQLITE_DONE == sret) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Iteration done (no results)\n"); + "Iteration done (no results)\n"); ret = GNUNET_NO; break; } if (SQLITE_ROW != sret) { LOG_SQLITE (plugin, - GNUNET_ERROR_TYPE_ERROR, - "sqlite_step"); + GNUNET_ERROR_TYPE_ERROR, + "sqlite_step"); ret = GNUNET_SYSERR; break; } @@ -487,7 +487,7 @@ get_records_and_call_iterator (struct Plugin *plugin, GNUNET_SQ_result_spec_uint64 (&seq), GNUNET_SQ_result_spec_uint32 (&record_count), GNUNET_SQ_result_spec_variable_size (&data, - &data_size), + &data_size), GNUNET_SQ_result_spec_string (&label), GNUNET_SQ_result_spec_end }; @@ -495,7 +495,7 @@ get_records_and_call_iterator (struct Plugin *plugin, GNUNET_SQ_result_spec_uint64 (&seq), GNUNET_SQ_result_spec_uint32 (&record_count), GNUNET_SQ_result_spec_variable_size (&data, - &data_size), + &data_size), GNUNET_SQ_result_spec_string (&label), GNUNET_SQ_result_spec_auto_from_type (&zk), GNUNET_SQ_result_spec_end @@ -540,7 +540,7 @@ get_records_and_call_iterator (struct Plugin *plugin, zk = *zone_key; if (NULL != iter) iter (iter_cls, - seq, + seq, &zk, label, record_count, @@ -618,10 +618,10 @@ namestore_sqlite_lookup_records (void *cls, */ static int namestore_sqlite_iterate_records (void *cls, - const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, - uint64_t serial, + const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, + uint64_t serial, uint64_t limit, - GNUNET_NAMESTORE_RecordIterator iter, + GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls) { struct Plugin *plugin = cls; @@ -658,7 +658,7 @@ namestore_sqlite_iterate_records (void *cls, { LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "sqlite3_bind_XXXX"); + "sqlite3_bind_XXXX"); GNUNET_SQ_reset (plugin->dbh, stmt); return GNUNET_SYSERR; @@ -685,10 +685,10 @@ namestore_sqlite_iterate_records (void *cls, */ static int namestore_sqlite_zone_to_name (void *cls, - const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, - const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, - GNUNET_NAMESTORE_RecordIterator iter, - void *iter_cls) + const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, + const struct GNUNET_CRYPTO_EcdsaPublicKey *value_zone, + GNUNET_NAMESTORE_RecordIterator iter, + void *iter_cls) { struct Plugin *plugin = cls; struct GNUNET_SQ_QueryParam params[] = { @@ -703,7 +703,7 @@ namestore_sqlite_zone_to_name (void *cls, { LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, - "sqlite3_bind_XXXX"); + "sqlite3_bind_XXXX"); GNUNET_SQ_reset (plugin->dbh, plugin->zone_to_name); return GNUNET_SYSERR; -- 2.25.1