[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33605 - gnunet/src/datastore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33605 - gnunet/src/datastore |
Date: |
Sun, 8 Jun 2014 15:54:33 +0200 |
Author: grothoff
Date: 2014-06-08 15:54:33 +0200 (Sun, 08 Jun 2014)
New Revision: 33605
Modified:
gnunet/src/datastore/plugin_datastore_postgres.c
Log:
-doxygen
Modified: gnunet/src/datastore/plugin_datastore_postgres.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_postgres.c 2014-06-08 13:24:25 UTC
(rev 33604)
+++ gnunet/src/datastore/plugin_datastore_postgres.c 2014-06-08 13:54:33 UTC
(rev 33605)
@@ -65,7 +65,7 @@
* @brief Get a database handle
*
* @param plugin global context
- * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
static int
init_connection (struct Plugin *plugin)
@@ -75,6 +75,7 @@
plugin->dbh = GNUNET_POSTGRES_connect (plugin->env->cfg,
"datastore-postgres");
if (NULL == plugin->dbh)
return GNUNET_SYSERR;
+
ret =
PQexec (plugin->dbh,
"CREATE TABLE gn090 (" " repl INTEGER NOT NULL DEFAULT 0,"
@@ -86,16 +87,23 @@
" hash BYTEA NOT NULL DEFAULT '',"
" vhash BYTEA NOT NULL DEFAULT '',"
" value BYTEA NOT NULL DEFAULT '')" "WITH OIDS");
- if ((ret == NULL) || ((PQresultStatus (ret) != PGRES_COMMAND_OK) && (0 !=
strcmp ("42P07", /* duplicate table */
-
PQresultErrorField
-
(ret,
-
PG_DIAG_SQLSTATE)))))
+ if ( (NULL == ret) ||
+ ((PQresultStatus (ret) != PGRES_COMMAND_OK) &&
+ (0 != strcmp ("42P07", /* duplicate table */
+ PQresultErrorField
+ (ret,
+ PG_DIAG_SQLSTATE)))))
{
- (void) GNUNET_POSTGRES_check_result (plugin->dbh, ret, PGRES_COMMAND_OK,
"CREATE TABLE", "gn090");
+ (void) GNUNET_POSTGRES_check_result (plugin->dbh,
+ ret,
+ PGRES_COMMAND_OK,
+ "CREATE TABLE",
+ "gn090");
PQfinish (plugin->dbh);
plugin->dbh = NULL;
return GNUNET_SYSERR;
}
+
if (PQresultStatus (ret) == PGRES_COMMAND_OK)
{
if ((GNUNET_OK !=
@@ -124,6 +132,7 @@
}
}
PQclear (ret);
+
ret =
PQexec (plugin->dbh,
"ALTER TABLE gn090 ALTER value SET STORAGE EXTERNAL");
@@ -217,7 +226,7 @@
* Get an estimate of how much space the database is
* currently using.
*
- * @param cls our "struct Plugin*"
+ * @param cls our `struct Plugin *`
* @return number of bytes used on disk
*/
static unsigned long long
@@ -257,7 +266,7 @@
/**
* Store an item in the datastore.
*
- * @param cls closure with the 'struct Plugin'
+ * @param cls closure with the `struct Plugin`
* @param key key for the item
* @param size number of bytes in data
* @param data content stored
@@ -267,7 +276,7 @@
* @param replication replication-level for the content
* @param expiration expiration time for the content
* @param msg set to error message
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
*/
static int
postgres_plugin_put (void *cls, const struct GNUNET_HashCode * key, uint32_t
size,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33605 - gnunet/src/datastore,
gnunet <=