mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpgscm: Make the verbose setting more useful.
* tests/gpgscm/ffi.c (do_get_verbose): New function. (do_set_verbose): Likewise. (ffi_init): Turn *verbose* into a function, add *set-verbose!*. * tests/gpgscm/tests.scm (call): Adapt accordingly. (call-with-io): Dump output if *verbose* is high. (pipe-do): Adapt accordingly. * tests/openpgp/defs.scm: Set verbosity according to environment. * tests/openpgp/run-tests.scm (test): Adapt accordingly. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
b3610badf6
commit
f17aecbcd9
4 changed files with 39 additions and 5 deletions
|
@ -1051,6 +1051,30 @@ do_glob (scheme *sc, pointer args)
|
|||
FFI_RETURN_POINTER (sc, result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static pointer
|
||||
do_get_verbose (scheme *sc, pointer args)
|
||||
{
|
||||
FFI_PROLOG ();
|
||||
FFI_ARGS_DONE_OR_RETURN (sc, args);
|
||||
FFI_RETURN_INT (sc, verbose);
|
||||
}
|
||||
|
||||
static pointer
|
||||
do_set_verbose (scheme *sc, pointer args)
|
||||
{
|
||||
FFI_PROLOG ();
|
||||
int new_verbosity, old;
|
||||
FFI_ARG_OR_RETURN (sc, int, new_verbosity, number, args);
|
||||
FFI_ARGS_DONE_OR_RETURN (sc, args);
|
||||
|
||||
old = verbose;
|
||||
verbose = new_verbosity;
|
||||
|
||||
FFI_RETURN_INT (sc, old);
|
||||
}
|
||||
|
||||
|
||||
gpg_error_t
|
||||
ffi_list2argv (scheme *sc, pointer list, char ***argv, size_t *len)
|
||||
|
@ -1260,7 +1284,8 @@ ffi_init (scheme *sc, const char *argv0, int argc, const char **argv)
|
|||
ffi_define_function (sc, prompt);
|
||||
|
||||
/* Configuration. */
|
||||
ffi_define (sc, "*verbose*", sc->vptr->mk_integer (sc, verbose));
|
||||
ffi_define_function_name (sc, "*verbose*", get_verbose);
|
||||
ffi_define_function_name (sc, "*set-verbose!*", set_verbose);
|
||||
|
||||
ffi_define (sc, "*argv0*", sc->vptr->mk_string (sc, argv0));
|
||||
for (i = argc - 1; i >= 0; i--)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue