/*
* This file is part of GNUnet
- * (C) 2009-2013 Christian Grothoff (and other contributing authors)
+ * Copyright (C) 2009-2013, 2016 GNUnet e.V.
*
* GNUnet is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
*
* You should have received a copy of the GNU General Public License
* along with GNUnet; see the file COPYING. If not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
*/
/**
#include "gnunet_namestore_service.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_postgres_lib.h"
+#include "gnunet_pq_lib.h"
#include "namestore.h"
struct Plugin
{
+ /**
+ * Our configuration.
+ */
const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* as needed as well).
*
* @param plugin the plugin context (state for this module)
- * @return GNUNET_OK on success
+ * @return #GNUNET_OK on success
*/
static int
database_setup (struct Plugin *plugin)
(GNUNET_OK !=
GNUNET_POSTGRES_prepare (plugin->dbh,
"iterate_zone",
- "SELECT record_count, record_data, label FROM ns097records"
+ "SELECT record_count,record_data,label FROM ns097records"
" WHERE zone_private_key=$1 ORDER BY rvalue LIMIT 1 OFFSET $2", 2)) ||
(GNUNET_OK !=
GNUNET_POSTGRES_prepare (plugin->dbh,
" FROM ns097records ORDER BY rvalue LIMIT 1 OFFSET $1", 1)) ||
(GNUNET_OK !=
GNUNET_POSTGRES_prepare (plugin->dbh,
- "lookup_label",
- "SELECT record_count,record_data,label,zone_private_key"
- " FROM ns097records WHERE records zone_private_key=$1 AND label=$2", 2)))
+ "lookup_label",
+ "SELECT record_count,record_data,label"
+ " FROM ns097records WHERE zone_private_key=$1 AND label=$2", 2)))
{
PQfinish (plugin->dbh);
plugin->dbh = NULL;
}
{
char data[data_size];
+ // FIXME: use libgnunetpq!
const char *paramValues[] = {
(const char *) zone_key,
(const char *) &pkey,
*/
static int
namestore_postgres_lookup_records (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, const char *label,
- GNUNET_NAMESTORE_RecordIterator iter, void *iter_cls)
+ const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
+ const char *label,
+ GNUNET_NAMESTORE_RecordIterator iter,
+ void *iter_cls)
{
struct Plugin *plugin = cls;
const char *paramValues[] = {
/**
* Entry point for the plugin.
*
- * @param cls the "struct GNUNET_NAMESTORE_PluginEnvironment*"
+ * @param cls the `struct GNUNET_NAMESTORE_PluginEnvironment*`
* @return NULL on error, othrewise the plugin context
*/
void *