(no commit message)
[oweals/gnunet.git] / src / datastore / plugin_datastore_postgres.c
index a5f4b2c4b8c03b90b982bd349b2923613cea26dc..44a01fcb8fb22960d53c07207a0e605e9dbce288 100644 (file)
@@ -276,6 +276,7 @@ pq_exec (struct Plugin *plugin,
  * Prepare SQL statement.
  *
  * @param plugin global context
+ * @param name name for the prepared SQL statement
  * @param sql SQL code to prepare
  * @param nparams number of parameters in sql
  * @param line code line for error reporting
@@ -283,10 +284,10 @@ pq_exec (struct Plugin *plugin,
  */
 static int
 pq_prepare (struct Plugin *plugin,
-           const char *name, const char *sql, int nparms, int line)
+           const char *name, const char *sql, int nparams, int line)
 {
   PGresult *ret;
-  ret = PQprepare (plugin->dbh, name, sql, nparms, NULL);
+  ret = PQprepare (plugin->dbh, name, sql, nparams, NULL);
   if (GNUNET_OK !=
       check_result (plugin, 
                    ret, PGRES_COMMAND_OK, "PQprepare", sql, line))
@@ -604,7 +605,7 @@ postgres_plugin_put (void *cls,
   uint32_t btype = htonl (type);
   uint32_t bprio = htonl (priority);
   uint32_t banon = htonl (anonymity);
-  uint64_t bexpi = GNUNET_TIME_absolute_hton (expiration).value__;
+  uint64_t bexpi = GNUNET_TIME_absolute_hton (expiration).abs_value__;
   const char *paramValues[] = {
     (const char *) &btype,
     (const char *) &bprio,
@@ -648,7 +649,7 @@ postgres_plugin_put (void *cls,
  * asking the database plugin to call the iterator
  * with the next item.
  *
- * @param cls the 'struct NextRequestClosure'
+ * @param next_cls the 'struct NextRequestClosure'
  * @param tc scheduler context
  */
 static void 
@@ -766,12 +767,12 @@ postgres_next_request_cont (void *next_cls,
   type = ntohl (*(uint32_t *) PQgetvalue (res, 0, 0));
   priority = ntohl (*(uint32_t *) PQgetvalue (res, 0, 1));
   anonymity = ntohl ( *(uint32_t *) PQgetvalue (res, 0, 2));
-  expiration_time.value = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3));
+  expiration_time.abs_value = GNUNET_ntohll (*(uint64_t *) PQgetvalue (res, 0, 3));
   memcpy (&key, PQgetvalue (res, 0, 4), sizeof (GNUNET_HashCode));
   size = PQgetlength (res, 0, 5);
 
   nrc->blast_prio = htonl (priority);
-  nrc->blast_expire = GNUNET_htonll (expiration_time.value);
+  nrc->blast_expire = GNUNET_htonll (expiration_time.abs_value);
   nrc->blast_rowid = htonl (rowid);
   nrc->count++;
 
@@ -885,7 +886,7 @@ postgres_plugin_update (void *cls,
   PGresult *ret;
   int32_t bdelta = (int32_t) htonl ((uint32_t) delta);
   uint32_t boid = htonl ( (uint32_t) uid);
-  uint64_t bexpire = GNUNET_TIME_absolute_hton (expire).value__;
+  uint64_t bexpire = GNUNET_TIME_absolute_hton (expire).abs_value__;
   const char *paramValues[] = {
     (const char *) &bdelta,
     (const char *) &bexpire,
@@ -995,7 +996,7 @@ postgres_iterate (struct Plugin *plugin,
       GNUNET_free (nrc);
       return;
     }
-  nrc->bnow = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()).value__;
+  nrc->bnow = GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_get ()).abs_value__;
   postgres_plugin_next_request (nrc,
                                GNUNET_NO);
 }