diff options
author | Florian Dold <florian@dold.me> | 2023-06-30 23:40:10 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-06-30 23:40:16 +0200 |
commit | 1946a5d76f0717d311121dacc48940f4a5d4f051 (patch) | |
tree | 5040b6baa0963a39b95047cbef5c681338b2cd0e | |
parent | 24862cea7b36ff1433d229e7a30328dc92257770 (diff) | |
download | quickjs-tart-1946a5d76f0717d311121dacc48940f4a5d4f051.tar.gz quickjs-tart-1946a5d76f0717d311121dacc48940f4a5d4f051.tar.bz2 quickjs-tart-1946a5d76f0717d311121dacc48940f4a5d4f051.zip |
taler-wallet-core lib: add comments from today's session
-rw-r--r-- | taler_wallet_core_lib.c | 9 | ||||
-rw-r--r-- | taler_wallet_core_lib.h | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c index 777793b..bc1bef3 100644 --- a/taler_wallet_core_lib.c +++ b/taler_wallet_core_lib.c @@ -24,9 +24,16 @@ #include <unistd.h> #include <string.h> +// Compiled JavaScript byte code for the prelude, +// i.e., functions to make wallet-core runnable under +// the quickjs / qtart runtime. extern const uint8_t qjsc_prelude[]; extern const uint32_t qjsc_prelude_size; +// Compiled JavaScript for wallet-core, +// compiled from taler-wallet-core-qjs.mjs +// This code does (or rather will!) +// also contain the anastasis functionality. extern const uint8_t qjsc_wallet_core[]; extern const uint32_t qjsc_wallet_core_size; @@ -139,14 +146,12 @@ run(void *cls) js_std_init_handlers(wh->rt); wh->ctx = JS_NewCustomContext(wh->rt); - if (!wh->ctx) { fprintf(stderr, "qjs: cannot allocate JS context\n"); pthread_mutex_unlock(&wh->handle_mutex); return NULL; } - JS_SetHostPromiseRejectionTracker(wh->rt, js_std_promise_rejection_tracker, NULL); diff --git a/taler_wallet_core_lib.h b/taler_wallet_core_lib.h index ad7d801..eaf7ded 100644 --- a/taler_wallet_core_lib.h +++ b/taler_wallet_core_lib.h @@ -55,6 +55,11 @@ TALER_WALLET_set_message_handler(struct TALER_WALLET_Instance *twi, TALER_WALLET_MessageHandlerFn handler_f, void *handler_p); +void +TALER_WALLET_set_anastasis_response_handler(struct TALER_WALLET_Instance *twi, + TALER_WALLET_AnastasisResponseHandlerFn handler_f, + void *handler_p); + /** * Set/override the JS file with the wallet-core implementation. @@ -75,6 +80,10 @@ int TALER_WALLET_send_request(struct TALER_WALLET_Instance *twi, const char *request); +int +TALER_WALLET_anastasis_reduce(struct TALER_WALLET_Instance *twi, + const char *request); + /** * Run wallet-core in a thread. * |