diff options
| author | Özgür Kesim <oec-taler@kesim.org> | 2023-07-28 16:22:48 +0200 | 
|---|---|---|
| committer | Özgür Kesim <oec-taler@kesim.org> | 2023-07-28 16:22:48 +0200 | 
| commit | 8f9731e83009f13a8b4e172aec1252bc79c4dee1 (patch) | |
| tree | 4d454894c302d97e3bfdb9cb820b176f2d8177f6 /src/include | |
| parent | 429aeb9e5e8272f8303f878e5e077bbbb0bf07a2 (diff) | |
| parent | 94e5193bffd5b2107710ba4fab0405ba22ea6dcf (diff) | |
Merge branch 'new-amount', lookup OIDs for composites
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/taler_exchangedb_lib.h | 1 | ||||
| -rw-r--r-- | src/include/taler_pq_lib.h | 27 | 
2 files changed, 27 insertions, 1 deletions
| diff --git a/src/include/taler_exchangedb_lib.h b/src/include/taler_exchangedb_lib.h index 45889435..17b01b0a 100644 --- a/src/include/taler_exchangedb_lib.h +++ b/src/include/taler_exchangedb_lib.h @@ -46,7 +46,6 @@ TALER_EXCHANGEDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg);  void  TALER_EXCHANGEDB_plugin_unload (struct TALER_EXCHANGEDB_Plugin *plugin); -  /**   * Information about an account from the configuration.   */ diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h index 43561703..051962b2 100644 --- a/src/include/taler_pq_lib.h +++ b/src/include/taler_pq_lib.h @@ -19,16 +19,43 @@   * @author Sree Harsha Totakura <sreeharsha@totakura.in>   * @author Florian Dold   * @author Christian Grothoff + * @author Özgür Kesim   */  #ifndef TALER_PQ_LIB_H_  #define TALER_PQ_LIB_H_  #include <libpq-fe.h>  #include <jansson.h> +#include <gnunet/gnunet_common.h>  #include <gnunet/gnunet_pq_lib.h>  #include "taler_util.h"  /** + * Enumerates the composite types that Taler defines in Postgres. + * The corresponding OIDs (which are assigned by postgres at time of + * declaration) are stored in TALER_PQ_CompositeOIDs. + */ +enum TALER_PQ_CompositeType +{ +  TALER_PQ_CompositeAmount, +  TALER_PQ_CompositeMAX /* MUST be last */ +}; + +/** + * The correspondence of the Composite types and their OID in Postgres + */ +extern Oid TALER_PQ_CompositeOIDs[TALER_PQ_CompositeMAX]; + +/** + * Initialize the list of OIDs in TALER_PQ_CompositeOIDs.  MUST be called + * before any composite type is used in arrays-specs/-params. + * + * @return GNUNET_SYSERR on failure + */ +enum GNUNET_GenericReturnValue +TALER_PQ_load_oids_for_composite_types (struct GNUNET_PQ_Context *db); + +/**   * Generate query parameter for a currency, consisting of the three   * components "value", "fraction" and "currency" in this order. The   * types must be a 64-bit integer, 32-bit integer and a | 
