summaryrefslogtreecommitdiff
path: root/xcode
diff options
context:
space:
mode:
authorMarc Stibane <marc@taler.net>2023-01-12 17:02:04 +0100
committerMarc Stibane <marc@taler.net>2023-01-12 17:02:04 +0100
commitff3478054f5c259eea5b2fac5c0f706627c2d35d (patch)
treeb6fb5f2bdf53f543760b37ddbc8e6564349a311a /xcode
parent8b8e2777ba9e0b0501288db90396125486c7b006 (diff)
downloadquickjs-tart-ff3478054f5c259eea5b2fac5c0f706627c2d35d.tar.gz
quickjs-tart-ff3478054f5c259eea5b2fac5c0f706627c2d35d.tar.bz2
quickjs-tart-ff3478054f5c259eea5b2fac5c0f706627c2d35d.zip
moved ObjC/Swift files into a new "xcode" folder
Diffstat (limited to 'xcode')
-rw-r--r--xcode/TalerWalletcore-Bridging-Header.h1
-rw-r--r--xcode/TalerWalletcore.h29
-rw-r--r--xcode/TalerWalletcore.m45
3 files changed, 75 insertions, 0 deletions
diff --git a/xcode/TalerWalletcore-Bridging-Header.h b/xcode/TalerWalletcore-Bridging-Header.h
new file mode 100644
index 0000000..83a9bf6
--- /dev/null
+++ b/xcode/TalerWalletcore-Bridging-Header.h
@@ -0,0 +1 @@
+#import "taler_wallet_core_lib.h"
diff --git a/xcode/TalerWalletcore.h b/xcode/TalerWalletcore.h
new file mode 100644
index 0000000..415b4d0
--- /dev/null
+++ 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
new file mode 100644
index 0000000..55a3eea
--- /dev/null
+++ 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;
+}