summaryrefslogtreecommitdiff
path: root/taler_wallet_core_lib.c
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-01-16 18:11:46 +0100
committerFlorian Dold <florian@dold.me>2023-01-16 18:25:39 +0100
commitfa280c5811fadfbf7e568e9bbb54dc9d3036ec5e (patch)
treeff7aadbd73f4f0a342928ab40ca23f7e908161f5 /taler_wallet_core_lib.c
parent014de832b405fdf90e46160b25b1315a67377c2c (diff)
downloadquickjs-tart-fa280c5811fadfbf7e568e9bbb54dc9d3036ec5e.tar.gz
quickjs-tart-fa280c5811fadfbf7e568e9bbb54dc9d3036ec5e.tar.bz2
quickjs-tart-fa280c5811fadfbf7e568e9bbb54dc9d3036ec5e.zip
skeleton for destroy function
Diffstat (limited to 'taler_wallet_core_lib.c')
-rw-r--r--taler_wallet_core_lib.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/taler_wallet_core_lib.c b/taler_wallet_core_lib.c
index 47efa5d..9c65fa4 100644
--- a/taler_wallet_core_lib.c
+++ b/taler_wallet_core_lib.c
@@ -49,6 +49,7 @@ struct TALER_WALLET_Instance
void *handler_cls;
};
+
static int eval_buf(JSContext *ctx, const char *codestr, const char *filename)
{
JSValue val;
@@ -64,6 +65,7 @@ static int eval_buf(JSContext *ctx, const char *codestr, const char *filename)
return ret;
}
+
/* also used to initialize the worker context */
static JSContext *JS_NewCustomContext(JSRuntime *rt)
{
@@ -79,6 +81,7 @@ static JSContext *JS_NewCustomContext(JSRuntime *rt)
return ctx;
}
+
void
TALER_WALLET_set_message_handler(struct TALER_WALLET_Instance *twi,
TALER_WALLET_MessageHandlerFn handler_f,
@@ -88,6 +91,7 @@ TALER_WALLET_set_message_handler(struct TALER_WALLET_Instance *twi,
twi->handler_f = handler_f;
}
+
int
TALER_WALLET_send_request (struct TALER_WALLET_Instance *twi,
const char *msg)
@@ -99,6 +103,7 @@ TALER_WALLET_send_request (struct TALER_WALLET_Instance *twi,
return ret;
}
+
static void
wallet_host_message_handler(void *cls, const char *msg)
{
@@ -109,6 +114,7 @@ wallet_host_message_handler(void *cls, const char *msg)
}
}
+
struct TALER_WALLET_Instance *
TALER_WALLET_create(void)
{
@@ -122,6 +128,7 @@ TALER_WALLET_create(void)
return wh;
}
+
static void *
run(void *cls)
{
@@ -153,7 +160,6 @@ run(void *cls)
pthread_mutex_unlock(&wh->handle_mutex);
eval_buf(wh->ctx, "installNativeWalletListener()", "<talerwalletcore>");
- //eval_buf(wh->ctx, "setTimeout(() => console.log('hehe'), 1000);", "<talerwalletcore>");
printf("starting main loop\n");
@@ -163,6 +169,7 @@ run(void *cls)
return NULL;
}
+
void
TALER_WALLET_run (struct TALER_WALLET_Instance *wh)
{
@@ -177,7 +184,15 @@ TALER_WALLET_run (struct TALER_WALLET_Instance *wh)
wh->wallet_thread = wallet_thread;
}
+
void TALER_WALLET_join(struct TALER_WALLET_Instance *wh)
{
pthread_join(wh->wallet_thread, NULL);
}
+
+
+void
+TALER_WALLET_destroy(struct TALER_WALLET_Instance *twi)
+{
+ // FIXME: Implement!
+}