Home GnuPG

argparse: Add support to read values from the Windows Registry.

Description

argparse: Add support to read values from the Windows Registry.

* src/argparse.c (struct variable_s): New.
(struct _gpgrt_argparse_internal_s): New fields expand, if_cond,
if_active and vartbl.
(deinitialize): Free vartbl.
(initialize): Clear new vars.
(get_var): New.
(substitute_vars): New.
(set_variable): New.
(handle_meta_if): New.
(handle_meta_let): New.
(handle_meta_getenv): New.
(handle_meta_echo): Re-implement in terms of variabale substitution.
(handle_meta_expand): New.
(handle_metacmd): Add new meta commands.
(_gpgrt_argparse): Expand values if enabled.
(_gpgrt_argparse): Take care of conditions.
(_gpgrt_argparser): Reset some state at the end of a file.
* tests/etc/t-argparse.conf: Adjust for changed system variables.
* tests/t-argparse.c (my_strusage): Add a value for a version test.
(main): Add new option "street".
* tests/t-argparse.conf: A couple if additions for the new conditions.

The whole thing is actually only for here for doing this

[let tkey HKLM\Foo\Bar\GnuPG:trusted-key-1]
[if $tkey]

trusted-key $tkey

[fi]

But we are hackers and tend to make things more complicated^Wflexible.
Documentation will be done eventually.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Oct 31 2021, 5:44 PM
Parents
rE2a32501a561a: core: new internal function _gpgrt_w32_reg_get_string.
Branches
Unknown
Tags
Unknown