diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-01-28 15:06:09 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-01-28 15:06:09 +0100 |
commit | c119d914b39305add86ef58e058e80ef7af20a40 (patch) | |
tree | 3cb3df8840179218f861b9c5669237d796b4ffbb /src | |
parent | 9cbc31afc495ebdfe7b24535ca2eee54b5a17ab7 (diff) |
more restructuring
Diffstat (limited to 'src')
-rw-r--r-- | src/mint/mint.h | 16 | ||||
-rw-r--r-- | src/mint/mint_db.h | 14 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd.h | 1 | ||||
-rw-r--r-- | src/mint/taler-mint-reservemod.c | 27 |
4 files changed, 33 insertions, 25 deletions
diff --git a/src/mint/mint.h b/src/mint/mint.h index 1c5e9802e..202de94d3 100644 --- a/src/mint/mint.h +++ b/src/mint/mint.h @@ -18,9 +18,6 @@ * @brief Common functionality for the mint * @author Florian Dold * @author Benedikt Mueller - * - * TODO: - * - move DB functions to mint_db.h */ #ifndef _MINT_H #define _MINT_H @@ -28,7 +25,6 @@ #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_common.h> #include <jansson.h> -#include <libpq-fe.h> #include "taler_util.h" #include "taler_signatures.h" @@ -330,16 +326,4 @@ struct Reserve -int -TALER_TALER_DB_extract_amount (PGresult *result, - unsigned int row, - int indices[3], - struct TALER_Amount *denom); - -int -TALER_TALER_DB_extract_amount_nbo (PGresult *result, - unsigned int row, - int indices[3], - struct TALER_AmountNBO *denom_nbo); - #endif /* _MINT_H */ diff --git a/src/mint/mint_db.h b/src/mint/mint_db.h index 3a62f1835..64d72a350 100644 --- a/src/mint/mint_db.h +++ b/src/mint/mint_db.h @@ -282,4 +282,18 @@ TALER_MINT_DB_init (const char *connection_cfg); + +int +TALER_TALER_DB_extract_amount (PGresult *result, + unsigned int row, + int indices[3], + struct TALER_Amount *denom); + +int +TALER_TALER_DB_extract_amount_nbo (PGresult *result, + unsigned int row, + int indices[3], + struct TALER_AmountNBO *denom_nbo); + + #endif /* _NEURO_MINT_DB_H */ diff --git a/src/mint/taler-mint-httpd.h b/src/mint/taler-mint-httpd.h index 59f38aadb..cff2859db 100644 --- a/src/mint/taler-mint-httpd.h +++ b/src/mint/taler-mint-httpd.h @@ -38,6 +38,7 @@ extern struct GNUNET_CONFIGURATION_Handle *cfg; /** * Main directory with mint data. + * FIXME: should we have those globals really here? */ extern char *mintdir; diff --git a/src/mint/taler-mint-reservemod.c b/src/mint/taler-mint-reservemod.c index 48a9c88b4..b2129d261 100644 --- a/src/mint/taler-mint-reservemod.c +++ b/src/mint/taler-mint-reservemod.c @@ -27,10 +27,14 @@ #include "taler_util.h" #include "taler_signatures.h" #include "mint.h" +#include "mint_db.h" + +char *mintdir; -static char *mintdir; static struct GNUNET_CRYPTO_EddsaPublicKey *reserve_pub; -static struct GNUNET_CONFIGURATION_Handle *kcfg; + +struct GNUNET_CONFIGURATION_Handle *cfg; + static PGconn *db_conn; @@ -169,22 +173,27 @@ main (int argc, char *const *argv) reserve_pub = GNUNET_new (struct GNUNET_CRYPTO_EddsaPublicKey); if ((NULL == reserve_pub_str) || - (GNUNET_OK != GNUNET_STRINGS_string_to_data (reserve_pub_str, - strlen (reserve_pub_str), - reserve_pub, - sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))) + (GNUNET_OK != + GNUNET_STRINGS_string_to_data (reserve_pub_str, + strlen (reserve_pub_str), + reserve_pub, + sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))) { fprintf (stderr, "reserve key invalid\n"); return 1; } - kcfg = TALER_config_load (mintdir); - if (NULL == kcfg) + cfg = TALER_config_load (mintdir); + if (NULL == cfg) { fprintf (stderr, "can't load mint configuration\n"); return 1; } - if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (kcfg, "mint", "db", &TALER_MINT_db_connection_cfg_str)) + if (GNUNET_OK != + GNUNET_CONFIGURATION_get_value_string (cfg, + "mint", + "db", + &TALER_MINT_db_connection_cfg_str)) { fprintf (stderr, "db configuration string not found\n"); return 42; |