diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-07 14:57:32 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-07 15:16:14 +0200 |
commit | 5a7b73860974384d8e00065105435403b0842ab0 (patch) | |
tree | 3f029c22f0a29a842002279bb4b5561af61a8aa8 /lib/libeclat.h | |
parent | c12cd5695cf1a6c2c44100a68762ab66356f43b8 (diff) | |
download | eclat-5a7b73860974384d8e00065105435403b0842ab0.tar.gz eclat-5a7b73860974384d8e00065105435403b0842ab0.tar.bz2 |
Re-implement confirmation support.
* doc/eclat-delete-volume.1: Update.
* doc/eclat-release-address.1: Update.
* doc/eclat.1: Update.
* doc/eclat.conf.5: New section "CONFIRMATION"
* lib/getyn.c (eclat_vgetyn): Negative default stands for no
default at all.
* lib/confirm.c (eclat_confirm_mode): Remove.
(eclat_confirm): Change signature. Act according to the
first argument.
* lib/libeclat.h (eclat_confirm_mode): New enum.
(eclat_confirm): Change signature.
* src/cmdline.opt: Change handling of -Y and -N options.
* src/config.c: New statement "confirm".
* src/cretags.c: Remove call to eclat_confirm. This is done by
the caller.
* src/delvol.c: Likewise.
* src/reladdr.c: Likewise.
* src/eclat.c (confirm_mode): New variable.
(command) <flags>: New member.
(cmdtab): Mark commands with appropriate flags.
(main): Call eclat_confirm to confirm the command.
* src/eclat.h (confirm_mode): New extern.
(set_command_confirmation): New proto.
* etc/eclat.cfin: Set a reasonably safe confirmation default.
* lib/forlan.c (strtots): Remove unused variable.
Diffstat (limited to 'lib/libeclat.h')
-rw-r--r-- | lib/libeclat.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/libeclat.h b/lib/libeclat.h index 35d2538..a558dae 100644 --- a/lib/libeclat.h +++ b/lib/libeclat.h @@ -110,8 +110,16 @@ char *eclat_getans(char *prompt, char *dfl, int pass); int eclat_getyn(int dfl, const char *prompt, ...); int eclat_vgetyn(int dfl, const char *prompt, va_list ap); -extern int eclat_confirm_mode; -int eclat_confirm(const char *prompt, ...); +enum eclat_confirm_mode +{ + eclat_confirm_unspecified, + eclat_confirm_positive, + eclat_confirm_negative, + eclat_confirm_tty, + eclat_confirm_always +}; + +int eclat_confirm(enum eclat_confirm_mode mode, const char *prompt, ...); #define ECLAT_MAP_OPEN 0x01 |