2022-11-17 00:17:52 +00:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
2019-01-07 12:47:27 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
2019-01-09 19:59:43 +00:00
|
|
|
#define MOBILE_WGQUICK_SUBSET
|
2019-01-07 12:47:27 +00:00
|
|
|
|
|
|
|
enum highlight_type {
|
2019-01-07 17:02:23 +00:00
|
|
|
HighlightSection,
|
2019-01-09 19:59:43 +00:00
|
|
|
HighlightField,
|
2019-01-08 18:16:55 +00:00
|
|
|
HighlightPrivateKey,
|
|
|
|
HighlightPublicKey,
|
|
|
|
HighlightPresharedKey,
|
2019-01-07 17:02:23 +00:00
|
|
|
HighlightIP,
|
|
|
|
HighlightCidr,
|
|
|
|
HighlightHost,
|
|
|
|
HighlightPort,
|
|
|
|
HighlightMTU,
|
|
|
|
HighlightKeepalive,
|
|
|
|
HighlightComment,
|
|
|
|
HighlightDelimiter,
|
|
|
|
#ifndef MOBILE_WGQUICK_SUBSET
|
|
|
|
HighlightTable,
|
|
|
|
HighlightFwMark,
|
|
|
|
HighlightSaveConfig,
|
|
|
|
HighlightCmd,
|
|
|
|
#endif
|
|
|
|
HighlightError,
|
|
|
|
HighlightEnd
|
2019-01-07 12:47:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct highlight_span {
|
2019-01-07 17:02:23 +00:00
|
|
|
enum highlight_type type;
|
|
|
|
size_t start, len;
|
2019-01-07 12:47:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct highlight_span *highlight_config(const char *config);
|