1 //===-- flags_parser.h ------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef SCUDO_FLAGS_PARSER_H_
10 #define SCUDO_FLAGS_PARSER_H_
13 #include "string_utils.h"
19 enum class FlagType
: u8
{
26 void registerFlag(const char *Name
, const char *Desc
, FlagType Type
,
28 void parseString(const char *S
);
29 void printFlagDescriptions();
30 void parseStringPair(const char *Name
, const char *Value
);
33 static const u32 MaxFlags
= 20;
41 u32 NumberOfFlags
= 0;
42 const char *Buffer
= nullptr;
45 void reportFatalError(const char *Error
);
46 void skipWhitespace();
49 bool runHandler(const char *Name
, const char *Value
, char Sep
);
52 void reportUnrecognizedFlags();
56 #endif // SCUDO_FLAGS_PARSER_H_