summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-01-28 20:37:51 +0100
committerChristian Grothoff <christian@grothoff.org>2015-01-28 20:37:51 +0100
commitc4b63c13029b9d731b826ffab4a9d59005b0c6a5 (patch)
tree9759b338c7766c767eced6be160b855db531fbd0
parentbc8f6e81a4d737625e05e5e268d0d682489873d5 (diff)
downloadexchange-c4b63c13029b9d731b826ffab4a9d59005b0c6a5.tar.gz
exchange-c4b63c13029b9d731b826ffab4a9d59005b0c6a5.tar.bz2
exchange-c4b63c13029b9d731b826ffab4a9d59005b0c6a5.zip
move PostGres-specific logic out of libtalerutil
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am2
-rw-r--r--src/include/taler_json_lib.h10
-rw-r--r--src/mint/Makefile.am5
-rw-r--r--src/pq/Makefile.am16
-rw-r--r--src/pq/db_pq.c (renamed from src/util/db.c)6
-rw-r--r--src/util/Makefile.am7
-rw-r--r--src/util/json.c8
8 files changed, 36 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index 55ee8f11a..f17463330 100644
--- a/configure.ac
+++ b/configure.ac
@@ -151,6 +151,7 @@ AC_CONFIG_FILES([Makefile
src/Makefile
src/include/Makefile
src/util/Makefile
+ src/pq/Makefile
src/mint/Makefile
src/lib/Makefile
])
diff --git a/src/Makefile.am b/src/Makefile.am
index ed9c9c2bf..1edbf2a54 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,2 +1,2 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/include
-SUBDIRS = include util mint lib
+SUBDIRS = include util pq mint lib
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index ec354cce7..b9e42069a 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -13,13 +13,11 @@
You should have received a copy of the GNU General Public License along with
TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
*/
-
/**
* @file include/taler_json_lib.h
* @brief helper functions for JSON processing using libjansson
* @author Sree Harsha Totakura <sreeharsha@totakura.in>
*/
-
#ifndef TALER_JSON_LIB_H_
#define TALER_JSON_LIB_H_
@@ -75,7 +73,7 @@ TALER_JSON_from_data (const void *data, size_t size);
*
* @param json the json object representing Amount
* @param r_amount where the amount has to be written
- * @return #GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error
+ * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
TALER_JSON_to_amount (json_t *json,
@@ -86,7 +84,7 @@ TALER_JSON_to_amount (json_t *json,
*
* @param json the json object representing absolute time in seconds
* @param r_abs where the time has to be written
- * @return #GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error
+ * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
TALER_JSON_to_abs (json_t *json,
@@ -97,8 +95,8 @@ TALER_JSON_to_abs (json_t *json,
*
* @param json the json object representing data
* @param out the pointer to hold the parsed data.
- * @param out_size the size of r_data.
- * @return #GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error
+ * @param out_size the size of @a out
+ * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
TALER_JSON_to_data (json_t *json,
diff --git a/src/mint/Makefile.am b/src/mint/Makefile.am
index e2c44d21f..d1a68e590 100644
--- a/src/mint/Makefile.am
+++ b/src/mint/Makefile.am
@@ -31,6 +31,7 @@ taler_mint_keyup_SOURCES = \
taler_mint_keyup_LDADD = \
$(LIBGCRYPT_LIBS) \
$(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
$(top_builddir)/src/mint/libtalermint_common.la \
-lpq \
-lgnunetutil
@@ -43,6 +44,7 @@ taler_mint_keycheck_SOURCES = \
taler_mint_keycheck_LDADD = \
$(LIBGCRYPT_LIBS) \
$(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
$(top_builddir)/src/mint/libtalermint_common.la \
-lgnunetutil \
-lpq
@@ -53,6 +55,7 @@ taler_mint_reservemod_SOURCES = \
taler_mint_reservemod_LDADD = \
$(LIBGCRYPT_LIBS) \
$(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
$(top_builddir)/src/mint/libtalermint_common.la \
-lpq \
-lgnunetutil
@@ -73,6 +76,7 @@ taler_mint_httpd_SOURCES = \
taler_mint_httpd_LDADD = \
$(LIBGCRYPT_LIBS) \
$(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
$(top_builddir)/src/mint/libtalermint_common.la \
-lpq \
-lmicrohttpd \
@@ -88,6 +92,7 @@ taler_mint_dbinit_SOURCES = \
taler_mint_dbinit_LDADD = \
$(LIBGCRYPT_LIBS) \
$(top_builddir)/src/util/libtalerutil.la \
+ $(top_builddir)/src/pq/libtalerpq.la \
$(top_builddir)/src/mint/libtalermint_common.la \
-lpq \
-lgnunetutil
diff --git a/src/pq/Makefile.am b/src/pq/Makefile.am
new file mode 100644
index 000000000..cd7a5c93f
--- /dev/null
+++ b/src/pq/Makefile.am
@@ -0,0 +1,16 @@
+AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS) $(POSTGRESQL_CPPFLAGS)
+
+lib_LTLIBRARIES = \
+ libtalerpq.la
+
+libtalerpq_la_SOURCES = \
+ db_pq.c
+
+libtalerpq_la_LIBADD = \
+ -lgnunetutil \
+ -lpq
+
+libtalerpq_la_LDFLAGS = \
+ $(POSTGRESQL_LDFLAGS) \
+ -version-info 0:0:0 \
+ -export-dynamic -no-undefined
diff --git a/src/util/db.c b/src/pq/db_pq.c
index c048a30ff..2864f3475 100644
--- a/src/util/db.c
+++ b/src/pq/db_pq.c
@@ -14,8 +14,8 @@
TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
*/
/**
- * @file util/db.c
- * @brief helper functions for DB interactions
+ * @file util/db_pq.c
+ * @brief helper functions for libpq (PostGres) interactions
* @author Sree Harsha Totakura <sreeharsha@totakura.in>
* @author Florian Dold
* @author Christian Grothoff
@@ -214,4 +214,4 @@ TALER_DB_extract_amount (PGresult *result,
return GNUNET_OK;
}
-/* end of util/db.c */
+/* end of pq/db_pq.c */
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index bb07e2ca3..b62e8a42f 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -7,17 +7,14 @@ libtalerutil_la_SOURCES = \
amount.c \
crypto.c \
util.c \
- json.c \
- db.c
+ json.c
libtalerutil_la_LIBADD = \
-lgnunetutil \
$(LIBGCRYPT_LIBS) \
-ljansson \
- -lmicrohttpd \
- -lpq
+ -lmicrohttpd
libtalerutil_la_LDFLAGS = \
- $(POSTGRESQL_LDFLAGS) \
-version-info 0:0:0 \
-export-dynamic -no-undefined
diff --git a/src/util/json.c b/src/util/json.c
index fecf0c5af..252def394 100644
--- a/src/util/json.c
+++ b/src/util/json.c
@@ -146,7 +146,7 @@ TALER_JSON_from_data (const void *data, size_t size)
*
* @param json the json object representing Amount
* @param r_amount where the amount has to be written
- * @return GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error
+ * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
TALER_JSON_to_amount (json_t *json,
@@ -177,7 +177,7 @@ TALER_JSON_to_amount (json_t *json,
*
* @param json the json object representing Amount
* @param r_amount where the amount has to be written
- * @return GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error
+ * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
TALER_JSON_to_abs (json_t *json,
@@ -201,8 +201,8 @@ TALER_JSON_to_abs (json_t *json,
*
* @param json the json object representing data
* @param out the pointer to hold the parsed data.
- * @param out_size the size of r_data.
- * @return GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error
+ * @param out_size the size of @a out
+ * @return #GNUNET_OK upon successful parsing; #GNUNET_SYSERR upon error
*/
int
TALER_JSON_to_data (json_t *json,