From 0e8f6e2aa98c212442001036fb5178cd6cd8af59 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 20 Feb 2020 10:03:11 +0100 Subject: gpg: Use gpgrt's new option parser to provide a global conf file. * common/util.h: Remove argparse.h. * common/argparse.c: Undef GPGRT_ENABLE_ARGPARSE_MACROS. * configure.ac (GPGRT_ENABLE_ARGPARSE_MACROS): Define. * agent/gpg-agent.c: Undef GPGRT_ENABLE_ARGPARSE_MACROS and include argparse.h. Do this also for all main modules which use our option parser except for gpg. Replace calls to strusage by calls to gpgrt_strusage everywhere. * g10/gpg.c (opts): Change type to gpgrt_opt_t. Flag oOptions and oNoOptions with ARGPARSE_conffile and ARGPARSE_no_conffile. (main): Change type of pargs to gpgrt_argparse_t. Rework the option parser to make use of the new gpgrt_argparser. -- This is not yet finished but a make check works. gpg has the most complex and oldest option handling and thus this is the first migration target. SE-Linux checks and version-ed config files are missing and will be added later. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch --- tools/gpg-check-pattern.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/gpg-check-pattern.c') diff --git a/tools/gpg-check-pattern.c b/tools/gpg-check-pattern.c index 43cea1dd1..be1832217 100644 --- a/tools/gpg-check-pattern.c +++ b/tools/gpg-check-pattern.c @@ -18,6 +18,9 @@ */ #include +/* We don't want to have the macros from gpgrt here until we have + * completely replaced this module by the one from gpgrt. */ +#undef GPGRT_ENABLE_ARGPARSE_MACROS #include #include @@ -44,6 +47,7 @@ #include "../common/i18n.h" #include "../common/sysutils.h" #include "../common/init.h" +#include "../common/argparse.h" /* temporary hack. */ enum cmd_and_opt_values @@ -491,4 +495,3 @@ process (FILE *fp, pattern_t *patarray) if (opt.verbose) log_info ("no input line matches the pattern - accepted\n"); } - -- cgit v1.2.3