gnunet-svn
[Top][All Lists]
Advanced

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

[taler-quickjs-tart] branch master updated: Separate struct creation and


From: gnunet
Subject: [taler-quickjs-tart] branch master updated: Separate struct creation and usage
Date: Wed, 28 Feb 2024 13:14:04 +0100

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

marc-stibane pushed a commit to branch master
in repository quickjs-tart.

The following commit(s) were added to refs/heads/master by this push:
     new e1aa89a  Separate struct creation and usage
e1aa89a is described below

commit e1aa89af968473fdbb8d5b3782a6f83d834be285
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Feb 28 13:13:56 2024 +0100

    Separate struct creation and usage
---
 taler_wallet_core_lib.c              | 12 +++++-------
 taler_wallet_core_lib.h              | 13 ++++++-------
 taler_wallet_core_lib_preprocessed.h | 13 ++++++-------
 3 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c
index ecf131c..d18e20b 100644
--- a/taler_wallet_core_lib.c
+++ b/taler_wallet_core_lib.c
@@ -336,17 +336,15 @@ TALER_set_http_client_implementation(struct 
TALER_WALLET_Instance *twi,
 }
 
 #pragma mark -
-void
-TALER_set_native_http_client_implementation(struct TALER_WALLET_Instance *twi,
-                                            JSHttpReqCreateFn req_create,
-                                            JSHttpReqCancelFn req_cancel,
-                                            void *handler_p)
+struct JSHttpClientImplementation *
+TALER_pack_http_client_implementation(JSHttpReqCreateFn req_create,
+                                      JSHttpReqCancelFn req_cancel,
+                                      void *handler_p)
 {
     // will (and should!) crash if this tiny malloc fails
     struct JSHttpClientImplementation *impl = malloc(sizeof *impl);
     impl->cls = handler_p;
     impl->req_create = req_create;
     impl->req_cancel = req_cancel;
-    twi->http_impl = impl;
-    // no need to free impl, because this is a singleton
+    return impl;
 }
diff --git a/taler_wallet_core_lib.h b/taler_wallet_core_lib.h
index 96b15da..13b8bef 100644
--- a/taler_wallet_core_lib.h
+++ b/taler_wallet_core_lib.h
@@ -165,16 +165,15 @@ TALER_set_http_client_implementation(struct 
TALER_WALLET_Instance *twi,
 
 #pragma mark -
 /**
- * Set the native HTTP client implementation to be used by the wallet.
+ * Build JSHttpClientImplementation struct for native HTTP client 
implementation to be used by the wallet.
  *
- * @param twi wallet-core instance
  * @param req_create HTTP client implementation
  * @param req_cancel HTTP client implementation
+ * @param handler_p Pointer to Handler's "this"
  */
-void
-TALER_set_native_http_client_implementation(struct TALER_WALLET_Instance *twi,
-                                            JSHttpReqCreateFn req_create,
-                                            JSHttpReqCancelFn req_cancel,
-                                            void *handler_p);
+struct JSHttpClientImplementation *
+TALER_pack_http_client_implementation(JSHttpReqCreateFn req_create,
+                                      JSHttpReqCancelFn req_cancel,
+                                      void *handler_p);
 
 #endif /*_TALER_WALLET_LIB_H */
diff --git a/taler_wallet_core_lib_preprocessed.h 
b/taler_wallet_core_lib_preprocessed.h
index c1159be..c262291 100644
--- a/taler_wallet_core_lib_preprocessed.h
+++ b/taler_wallet_core_lib_preprocessed.h
@@ -374,16 +374,15 @@ TALER_set_http_client_implementation(struct 
TALER_WALLET_Instance *twi,
 
 #pragma mark -
 /**
- * Set the native HTTP client implementation to be used by the wallet.
+ * Build JSHttpClientImplementation struct for native HTTP client 
implementation to be used by the wallet.
  *
- * @param twi wallet-core instance
  * @param req_create HTTP client implementation
  * @param req_cancel HTTP client implementation
+ * @param handler_p Pointer to Handler's "this"
  */
-void
-TALER_set_native_http_client_implementation(struct TALER_WALLET_Instance *twi,
-                                            JSHttpReqCreateFn req_create,
-                                            JSHttpReqCancelFn req_cancel,
-                                            void *handler_p);
+struct JSHttpClientImplementation *
+TALER_pack_http_client_implementation(JSHttpReqCreateFn req_create,
+                                      JSHttpReqCancelFn req_cancel,
+                                      void *handler_p);
 
 #endif /*_TALER_WALLET_LIB_H */

-- 
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]