quickjs-tart

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

commit ff3478054f5c259eea5b2fac5c0f706627c2d35d
parent 8b8e2777ba9e0b0501288db90396125486c7b006
Author: Marc Stibane <marc@taler.net>
Date:   Thu, 12 Jan 2023 17:02:04 +0100

moved ObjC/Swift files into a new "xcode" folder

Diffstat:
MQuickJS-rt.xcodeproj/project.pbxproj | 14+++++++++++---
DTalerWalletcore.h | 21---------------------
DTalerWalletcore.m | 38--------------------------------------
RTalerWalletcore-Bridging-Header.h -> xcode/TalerWalletcore-Bridging-Header.h | 0
Axcode/TalerWalletcore.h | 29+++++++++++++++++++++++++++++
Axcode/TalerWalletcore.m | 45+++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 85 insertions(+), 62 deletions(-)

diff --git a/QuickJS-rt.xcodeproj/project.pbxproj b/QuickJS-rt.xcodeproj/project.pbxproj @@ -2450,9 +2450,20 @@ name = Frameworks; sourceTree = "<group>"; }; + 4E579B552970650F007B89A4 /* xcode */ = { + isa = PBXGroup; + children = ( + 4E579B1029702103007B89A4 /* TalerWalletcore.h */, + 4E579B1529702ACA007B89A4 /* TalerWalletcore.m */, + 4E579B2B29702FFE007B89A4 /* TalerWalletcore-Bridging-Header.h */, + ); + path = xcode; + sourceTree = "<group>"; + }; 4E5C305F296C77AF0031A049 = { isa = PBXGroup; children = ( + 4E579B552970650F007B89A4 /* xcode */, 4EE2123C296DBF64000D7228 /* talerwalletcore */, 4E328E9F296CC644006D0E3C /* bf */, 4E328EC9296CCC61006D0E3C /* cutils */, @@ -2600,9 +2611,6 @@ 4EE2123C296DBF64000D7228 /* talerwalletcore */ = { isa = PBXGroup; children = ( - 4E579B2B29702FFE007B89A4 /* TalerWalletcore-Bridging-Header.h */, - 4E579B1529702ACA007B89A4 /* TalerWalletcore.m */, - 4E579B1029702103007B89A4 /* TalerWalletcore.h */, 4EE2123A296DBF17000D7228 /* taler_wallet_core_lib.c */, 4EBF870C296EF4D400241F24 /* taler_wallet_core_lib.h */, ); diff --git a/TalerWalletcore.h b/TalerWalletcore.h @@ -1,21 +0,0 @@ -// -// TalerWalletcore.h -// TalerWalletcore -// -// Created by Marc Stibane on 12.01.23. -// - -#import <Foundation/Foundation.h> - -//! Project version number for TalerWalletcore. -FOUNDATION_EXPORT double TalerWalletcoreVersionNumber; - -//! Project version string for TalerWalletcore. -FOUNDATION_EXPORT const unsigned char TalerWalletcoreVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import <TalerWalletcore/PublicHeader.h> - -#import "taler_wallet_core_lib.h" - -struct TALER_WALLET_Instance * -TALER_WALLET_test(int wait); diff --git a/TalerWalletcore.m b/TalerWalletcore.m @@ -1,38 +0,0 @@ -// -// TalerWalletcore.m -// QuickJS-rt -// -// Created by Marc Stibane on 12.01.23. -// - -#import "TalerWalletcore.h" - - -static void TALER_WALLET_test_handler(void *cls, const char *message) -{ - printf("got message: %s\n", message); -} - -struct TALER_WALLET_Instance * -TALER_WALLET_test(int wait) -{ - struct TALER_WALLET_Instance *wh = TALER_WALLET_create(); - - TALER_WALLET_set_message_handler(wh, &TALER_WALLET_test_handler, NULL); - - TALER_WALLET_run(wh); - - TALER_WALLET_send_request(wh, "{\"operation\": \"init\", \"payload\": {\"skipDefaults\": true}}"); - - TALER_WALLET_send_request(wh, "{\"operation\": \"getVersion\"}"); - - //TALER_WALLET_send_request(wh, "{}"); - - if (wait) { - // Wait for wallet thread to finish. - // If we don't call this, main() exits - // and the wallet thread is killed. - TALER_WALLET_join(wh); - } - return wh; -} diff --git a/TalerWalletcore-Bridging-Header.h b/xcode/TalerWalletcore-Bridging-Header.h diff --git a/xcode/TalerWalletcore.h b/xcode/TalerWalletcore.h @@ -0,0 +1,29 @@ +/* + * This file is part of GNU Taler + * (C) 2021 Taler Systems S.A. + * + * GNU Taler is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 3, or (at your option) any later version. + * + * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +#import <Foundation/Foundation.h> + +//! Project version number for TalerWalletcore. +FOUNDATION_EXPORT double TalerWalletcoreVersionNumber; + +//! Project version string for TalerWalletcore. +FOUNDATION_EXPORT const unsigned char TalerWalletcoreVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import <TalerWalletcore/PublicHeader.h> + +#import "taler_wallet_core_lib.h" + +struct TALER_WALLET_Instance * +TALER_WALLET_test(int wait); diff --git a/xcode/TalerWalletcore.m b/xcode/TalerWalletcore.m @@ -0,0 +1,45 @@ +/* + * This file is part of GNU Taler + * (C) 2021 Taler Systems S.A. + * + * GNU Taler is free software; you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software + * Foundation; either version 3, or (at your option) any later version. + * + * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/> + */ +#import "TalerWalletcore.h" + +static void TALER_WALLET_test_handler(void *cls, const char *message) +{ + printf("got message: %s\n", message); +} + +struct TALER_WALLET_Instance * +TALER_WALLET_test(int wait) +{ + struct TALER_WALLET_Instance *wh = TALER_WALLET_create(); + + TALER_WALLET_set_message_handler(wh, &TALER_WALLET_test_handler, NULL); + + TALER_WALLET_run(wh); + + TALER_WALLET_send_request(wh, "{\"operation\": \"init\", \"payload\": {\"skipDefaults\": true}}"); + + TALER_WALLET_send_request(wh, "{\"operation\": \"getVersion\"}"); + + //TALER_WALLET_send_request(wh, "{}"); + + if (wait) { + // Wait for wallet thread to finish. + // If we don't call this, main() exits + // and the wallet thread is killed. + TALER_WALLET_join(wh); + } + return wh; +}