fix intendation
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Mon, 15 Oct 2018 09:42:21 +0000 (18:42 +0900)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Mon, 15 Oct 2018 09:42:21 +0000 (18:42 +0900)
src/namestore/plugin_namestore_sqlite.c

index 1a4e0138c6780420243c68fded5a3a9a898ac3c1..a4712108298eab8494c39048b3e88f48feb6e806 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
 */
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
 
 /**
  * @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;i<rd_count;i++)
     if (GNUNET_GNSRECORD_TYPE_PKEY == rd[i].record_type)
     {
@@ -351,11 +351,11 @@ namestore_sqlite_store_records (void *cls,
     ssize_t ret;
 
     ret = GNUNET_GNSRECORD_records_serialize (rd_count,
-                                             rd,
-                                             data_size,
-                                             data);
+                                              rd,
+                                              data_size,
+                                              data);
     if ( (ret < 0) ||
-        (data_size != ret) )
+         (data_size != ret) )
     {
       GNUNET_break (0);
       return GNUNET_SYSERR;
@@ -365,8 +365,8 @@ namestore_sqlite_store_records (void *cls,
                         dparams))
     {
       LOG_SQLITE (plugin,
-                 GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-                 "sqlite3_bind_XXXX");
+                  GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
+                  "sqlite3_bind_XXXX");
       GNUNET_SQ_reset (plugin->dbh,
                        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;