quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

commit 67e1d6709faa82837ae8dbfce914466c9c373d18
parent f1df0ebc62537953b1d93d45594de7c81f583583
Author: Florian Dold <florian@dold.me>
Date:   Wed, 21 Dec 2022 15:39:54 +0100

wallet core header

Diffstat:
Mtaler_wallet_core_lib.h | 52++++++----------------------------------------------
1 file changed, 6 insertions(+), 46 deletions(-)

diff --git a/taler_wallet_core_lib.h b/taler_wallet_core_lib.h @@ -36,13 +36,13 @@ struct TALER_WALLET_Handle; * @param handler_p opaque closure for the message handler * @param message message from wallet-core as a JSON string */ -typedef void TALER_WALLET_MessageHandlerFn(void *handler_p, char *message); +typedef void (*TALER_WALLET_MessageHandlerFn)(void *handler_p, char *message); /** * Create a new wallet-core handle. */ struct TALER_WALLET_Handle * -TALER_WALLET_create(); +TALER_WALLET_create(void); /** * Set a handler for notification and response messages. @@ -57,53 +57,12 @@ TALER_WALLET_set_handler(struct TALER_WALLET_Handle *h, /** - * Enable or disable message queueing mode of the wallet. - * - * Queueing is disabled by default. - */ -void -TALER_WALLET_set_queueing (struct TALER_WALLET_Handle *h, - int yesno); - -/** - * Get a pipe file descriptor that signals the availability - * of new messages in the message queue. - * - * One byte of data will be written to the pipe for every available message. - * The client is responsible for ensuring that every call - * to #TALER_WALLET_discard_message is paired with a 1-byte - * read from the pipe. - * - * Returns -1 if on error, for example when the platform - * doesn't support pipes. - */ -int -TALER_WALLET_get_eventpipe (struct TALER_WALLET_Handle *h); - -/** - * Look at the message at the head of the message queue. - * - * Only works when queueing is enabled. - * - * @returns message from wallet-core as a JSON string, valid until - * #TALER_WALLET_discard_message is called - */ -const char * -TALER_WALLET_peek_message (struct TALER_WALLET_Handle *h); - -/** - * Discard the message at the head of the message queue. - */ -void -TALER_WALLET_discard_message (struct TALER_WALLET_Handle *h); - -/** * Set/override the JS file with the wallet-core implementation. * Must be called before the wallet runs. */ void TALER_WALLET_set_jsfile(struct TALER_WALLET_Handle *h, - char *filename); + const char *filename); /** * Send a message to wallet-core. @@ -112,7 +71,8 @@ TALER_WALLET_set_jsfile(struct TALER_WALLET_Handle *h, * set with #TALER_WALLET_set_handler. */ void -TALER_WALLET_send_message (struct TALER_WALLET_Handle *h); +TALER_WALLET_send_message (struct TALER_WALLET_Handle *h, + const char *msg); /** * Run wallet-core in a thread. @@ -120,7 +80,7 @@ TALER_WALLET_send_message (struct TALER_WALLET_Handle *h); * This function creates a new thread and returns immediately. */ void -TALER_WALLET_run (); +TALER_WALLET_run (struct TALER_WLLET_Handle *h); /** * Destroy the wallet handle and free resources associated with it.