From ce63eaa4f8f3f41aafcaddd8d658dacd522334a8 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 13 Jun 2022 17:35:05 +0200 Subject: common: New function parse_compatibility_flags. * common/miscellaneous.c (parse_compatibility_flags): New. * common/util.h (struct compatibility_flags_s): New. -- This is similar to parse_debug_flags but does not support specifying a value. This way we can more easily change the internal values or re-use them for other purposes. --- common/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'common/util.h') diff --git a/common/util.h b/common/util.h index 4327153bc..62e5af51d 100644 --- a/common/util.h +++ b/common/util.h @@ -372,6 +372,15 @@ struct debug_flags_s int parse_debug_flag (const char *string, unsigned int *debugvar, const struct debug_flags_s *flags); +struct compatibility_flags_s +{ + unsigned int flag; + const char *name; + const char *desc; +}; +int parse_compatibility_flags (const char *string, unsigned int *flagvar, + const struct compatibility_flags_s *flags); + /*-- Simple replacement functions. */ -- cgit v1.2.3