gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-quickjs-tart] 01/03: android: implement native interface with cur


From: gnunet
Subject: [taler-quickjs-tart] 01/03: android: implement native interface with curl
Date: Thu, 21 Mar 2024 18:53:03 +0100

This is an automated email from the git hooks/post-receive script.

ivan-avalos pushed a commit to branch master
in repository quickjs-tart.

commit 01125a17a010a6d78fd4b25be549691a152c4349
Author: Iván Ávalos <avalos@disroot.org>
AuthorDate: Thu Mar 21 10:01:29 2024 -0600

    android: implement native interface with curl
---
 .../qtart/src/main/java/net/taler/qtart/TalerWalletCore.kt       | 5 +++++
 taler_wallet_core_lib.c                                          | 7 +++++++
 taler_wallet_core_lib.h                                          | 9 +++++++++
 3 files changed, 21 insertions(+)

diff --git 
a/QuickJS-android/qtart/src/main/java/net/taler/qtart/TalerWalletCore.kt 
b/QuickJS-android/qtart/src/main/java/net/taler/qtart/TalerWalletCore.kt
index 9923f19..237d555 100644
--- a/QuickJS-android/qtart/src/main/java/net/taler/qtart/TalerWalletCore.kt
+++ b/QuickJS-android/qtart/src/main/java/net/taler/qtart/TalerWalletCore.kt
@@ -64,6 +64,7 @@ class TalerWalletCore {
         fun TALER_WALLET_run(twi: Pointer): Int
         fun TALER_WALLET_join(twi: Pointer)
         fun TALER_start_redirect_std(logfn: TALER_LogFn, cls: Pointer)
+        fun TALER_set_curl_http_client(twi: Pointer)
     }
 
     private val walletInstance: Pointer = 
TalerNative.INSTANCE.TALER_WALLET_create()
@@ -99,6 +100,10 @@ class TalerWalletCore {
         TalerNative.INSTANCE.TALER_WALLET_send_request(walletInstance, request)
     }
 
+    fun setCurlHttpClient() {
+        TalerNative.INSTANCE.TALER_set_curl_http_client(walletInstance)
+    }
+
     fun run() {
         TalerNative.INSTANCE.TALER_WALLET_run(walletInstance)
     }
diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c
index d18e20b..73f27f2 100644
--- a/taler_wallet_core_lib.c
+++ b/taler_wallet_core_lib.c
@@ -335,6 +335,13 @@ TALER_set_http_client_implementation(struct 
TALER_WALLET_Instance *twi,
   twi->http_impl = impl;
 }
 
+void
+TALER_set_curl_http_client(struct TALER_WALLET_Instance *twi)
+{
+    struct JSHttpClientImplementation *client = js_curl_http_client_create();
+    TALER_set_http_client_implementation(twi, client);
+}
+
 #pragma mark -
 struct JSHttpClientImplementation *
 TALER_pack_http_client_implementation(JSHttpReqCreateFn req_create,
diff --git a/taler_wallet_core_lib.h b/taler_wallet_core_lib.h
index 13b8bef..e260f82 100644
--- a/taler_wallet_core_lib.h
+++ b/taler_wallet_core_lib.h
@@ -163,6 +163,15 @@ void
 TALER_set_http_client_implementation(struct TALER_WALLET_Instance *twi,
                                      struct JSHttpClientImplementation *impl);
 
+/**
+ * Set the reference CuRL-based HTTP client implementation as the one
+ * to be used by the wallet.
+ *
+ * @param twi wallet-core instance
+ */
+void
+TALER_set_curl_http_client(struct TALER_WALLET_Instance *twi);
+
 #pragma mark -
 /**
  * Build JSHttpClientImplementation struct for native HTTP client 
implementation to be used by the wallet.

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]