aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/View/highlighter.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-01-21 22:22:20 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-01-21 22:22:20 +0100
commite1198b6e085310105e8d37effe221a1363d91c41 (patch)
tree4a6c01acf79d9bc6df7dccae6928395d581eadfc /WireGuard/WireGuard/UI/macOS/View/highlighter.h
parentmacOS: Make highlighter themes static (diff)
downloadwireguard-apple-e1198b6e085310105e8d37effe221a1363d91c41.tar.xz
wireguard-apple-e1198b6e085310105e8d37effe221a1363d91c41.zip
macOS: Better highlighter default value and move c implementation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/View/highlighter.h')
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/highlighter.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/highlighter.h b/WireGuard/WireGuard/UI/macOS/View/highlighter.h
new file mode 100644
index 0000000..885db2d
--- /dev/null
+++ b/WireGuard/WireGuard/UI/macOS/View/highlighter.h
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
+ */
+
+#include <sys/types.h>
+#define MOBILE_WGQUICK_SUBSET
+
+enum highlight_type {
+ HighlightSection,
+ HighlightField,
+ HighlightPrivateKey,
+ HighlightPublicKey,
+ HighlightPresharedKey,
+ HighlightIP,
+ HighlightCidr,
+ HighlightHost,
+ HighlightPort,
+ HighlightMTU,
+ HighlightKeepalive,
+ HighlightComment,
+ HighlightDelimiter,
+#ifndef MOBILE_WGQUICK_SUBSET
+ HighlightTable,
+ HighlightFwMark,
+ HighlightSaveConfig,
+ HighlightCmd,
+#endif
+ HighlightError,
+ HighlightEnd
+};
+
+struct highlight_span {
+ enum highlight_type type;
+ size_t start, len;
+};
+
+struct highlight_span *highlight_config(const char *config);