diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-01-05 17:02:14 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-01-23 14:29:44 +0100 |
commit | ee880389866b44acb4fae64f9885ada7d964b738 (patch) | |
tree | 3d84a56a915a8b851fc0a41a070c16f802131077 /contrib/highlighter/highlighter.h | |
parent | global: normalize -> clamp (diff) | |
download | wireguard-tools-ee880389866b44acb4fae64f9885ada7d964b738.tar.xz wireguard-tools-ee880389866b44acb4fae64f9885ada7d964b738.zip |
contrib: introduce simple highlighter library
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r-- | contrib/highlighter/highlighter.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/highlighter/highlighter.h b/contrib/highlighter/highlighter.h new file mode 100644 index 0000000..c004e12 --- /dev/null +++ b/contrib/highlighter/highlighter.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. + */ + +#include <sys/types.h> + +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); |