-include wallet headers if compiling wallet library

This commit is contained in:
Christian Grothoff 2015-06-02 12:52:05 +02:00
parent 68a8c36f06
commit 401745fc30
5 changed files with 28 additions and 14 deletions

View File

@ -20,7 +20,6 @@
*/ */
#ifndef TALER_UTIL_H #ifndef TALER_UTIL_H
#define TALER_UTIL_H #define TALER_UTIL_H
#include <gnunet/gnunet_util_taler_wallet_lib.h> #include <gnunet/gnunet_util_taler_wallet_lib.h>
#include "taler_amount_lib.h" #include "taler_amount_lib.h"
#include "taler_crypto_lib.h" #include "taler_crypto_lib.h"

View File

@ -165,7 +165,7 @@ postgres_create_tables (void *cls,
if (CONNECTION_OK != PQstatus (conn)) if (CONNECTION_OK != PQstatus (conn))
{ {
TALER_LOG_ERROR ("Database connection failed: %s\n", TALER_LOG_ERROR ("Database connection failed: %s\n",
PQerrorMessage (conn)); PQerrorMessage (conn));
GNUNET_break (0); GNUNET_break (0);
PQfinish (conn); PQfinish (conn);
return GNUNET_SYSERR; return GNUNET_SYSERR;
@ -1067,7 +1067,7 @@ postgres_reserves_in_insert (void *cls,
if (PGRES_COMMAND_OK != PQresultStatus(result)) if (PGRES_COMMAND_OK != PQresultStatus(result))
{ {
const char *efield; const char *efield;
efield = PQresultErrorField (result, efield = PQresultErrorField (result,
PG_DIAG_SQLSTATE); PG_DIAG_SQLSTATE);
if ( (PGRES_FATAL_ERROR == PQresultStatus(result)) && if ( (PGRES_FATAL_ERROR == PQresultStatus(result)) &&

View File

@ -23,7 +23,13 @@
*/ */
#include "platform.h" #include "platform.h"
#include "taler_util.h" #include "taler_util.h"
#if HAVE_GNUNET_GNUNET_UTIL_TALER_WALLET_LIB_H
#include <gnunet/gnunet_util_taler_wallet_lib.h>
#endif
#if HAVE_GNUNET_GNUNET_UTIL_LIB_H
#include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_util_lib.h>
#endif
#include <gcrypt.h> #include <gcrypt.h>

View File

@ -19,7 +19,12 @@
* @author Sree Harsha Totakura <sreeharsha@totakura.in> * @author Sree Harsha Totakura <sreeharsha@totakura.in>
*/ */
#include "platform.h" #include "platform.h"
#if HAVE_GNUNET_GNUNET_UTIL_TALER_WALLET_LIB_H
#include <gnunet/gnunet_util_taler_wallet_lib.h>
#endif
#if HAVE_GNUNET_GNUNET_UTIL_LIB_H
#include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_util_lib.h>
#endif
#include "taler_util.h" #include "taler_util.h"
/** /**
@ -155,7 +160,7 @@ TALER_json_from_rsa_public_key (struct GNUNET_CRYPTO_rsa_PublicKey *pk)
/** /**
* Convert JSON to RSA public key. * Convert JSON to RSA public key.
* *
* @param pk JSON encoding to convert * @param pk JSON encoding to convert
* @return corresponding public key * @return corresponding public key
*/ */
struct GNUNET_CRYPTO_rsa_PublicKey * struct GNUNET_CRYPTO_rsa_PublicKey *
@ -172,10 +177,10 @@ TALER_json_to_rsa_public_key (json_t *json)
len = strlen (enc); len = strlen (enc);
buf_len = (len * 5) / 8; buf_len = (len * 5) / 8;
buf = GNUNET_malloc (buf_len); buf = GNUNET_malloc (buf_len);
EXITIF (GNUNET_OK != EXITIF (GNUNET_OK !=
GNUNET_STRINGS_string_to_data (enc, GNUNET_STRINGS_string_to_data (enc,
len, len,
buf, buf,
buf_len)); buf_len));
EXITIF (NULL == (pk = GNUNET_CRYPTO_rsa_public_key_decode (buf, EXITIF (NULL == (pk = GNUNET_CRYPTO_rsa_public_key_decode (buf,
buf_len))); buf_len)));
@ -190,7 +195,7 @@ TALER_json_to_rsa_public_key (json_t *json)
/** /**
* Convert JSON to RSA signature. * Convert JSON to RSA signature.
* *
* @param pk JSON encoding to convert * @param pk JSON encoding to convert
* @return corresponding signature * @return corresponding signature
*/ */
struct GNUNET_CRYPTO_rsa_Signature * struct GNUNET_CRYPTO_rsa_Signature *
@ -207,10 +212,10 @@ TALER_json_to_rsa_signature (json_t *json)
len = strlen (enc); len = strlen (enc);
buf_len = (len * 5) / 8; buf_len = (len * 5) / 8;
buf = GNUNET_malloc (buf_len); buf = GNUNET_malloc (buf_len);
EXITIF (GNUNET_OK != EXITIF (GNUNET_OK !=
GNUNET_STRINGS_string_to_data (enc, GNUNET_STRINGS_string_to_data (enc,
len, len,
buf, buf,
buf_len)); buf_len));
EXITIF (NULL == (sig = GNUNET_CRYPTO_rsa_signature_decode (buf, EXITIF (NULL == (sig = GNUNET_CRYPTO_rsa_signature_decode (buf,
buf_len))); buf_len)));

View File

@ -24,8 +24,12 @@
#include "platform.h" #include "platform.h"
#include "taler_util.h" #include "taler_util.h"
#include <gnunet/gnunet_common.h> #if HAVE_GNUNET_GNUNET_UTIL_TALER_WALLET_LIB_H
#include <gnunet/gnunet_util_taler_wallet_lib.h>
#endif
#if HAVE_GNUNET_GNUNET_UTIL_LIB_H
#include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_util_lib.h>
#endif
#include <gcrypt.h> #include <gcrypt.h>