dialog: import dialog 1.3-20210117

This commit is contained in:
Baptiste Daroussin 2021-02-26 10:16:49 +01:00
commit a96ef45019
233 changed files with 14165 additions and 10027 deletions

View File

@ -1,9 +1,222 @@
-- $Id: CHANGES,v 1.619 2018/06/21 09:19:45 tom Exp $ -- $Id: CHANGES,v 1.723 2021/01/17 20:21:41 tom Exp $
-- Thomas E. Dickey <dickey@invisible-island.net> -- Thomas E. Dickey <dickey@invisible-island.net>
This version of dialog was originally from a Debian snapshot. I've done this This version of dialog was originally from a Debian snapshot. I've done this
to it: to it:
2021/01/17
+ updated dialog.pot
+ add option --no-hot-list, to allow suppressing the hotkey feature
from lists.
+ increase minimum height of inputbox to avoid input field overlapping
with the button-box (report by Victor Ananjevsky).
+ modify options-parsing to permit a "no" on any boolean option and
deprecating the "no" options without a "-" , e.g., generalizing on
"--nook" equivalence to "--no-ok".
2021/01/12
+ minor spelling fixes, per codespell
+ update configure macros, for quoting/escaping fixes per shellcheck
+ update config.guess, config.sub
2020/11/26
+ modify configure script's compiler check to work around Xcode's
useless aliases for standard C.
+ enable keep-tite feature for NetBSD 8 and up; earlier releases would
dump core.
> new features/fixes (Glenn Herteg)
+ add option "--cursor-off-label"
+ add option "--erase-on-exit"
+ fix errata in manpage.
+ fix logic: dlg_button_to_char() would return wrong value if no
uppercase was found
2020/11/25
+ add DIALOG_TIMEOUT to sample scripts, and use report-button more
consistently to handle unexpected exit-status values.
2020/11/24
+ add dlg_getenv_num() and dlg_getenv_str().
+ add DLG_EXIT_TIMEOUT to allow scripts to exit on an expired timeout
with an exit-status different from DLG_EXIT_ERROR or DLG_EXIT_ESC
(patch by Norbert Koch).
2020/11/23
+ modify dlg_ok_label() and dlg_ok_labels() to ignore --no-ok if all
buttons would be omitted.
+ add/use dlg_der_window() to account for derived windows just like
subwindows, to fix regression in dlg_getc() in fselect/dselect
widget.
+ modify several widgets to make their handling of --no-ok consistent
with the majority of the widgets: editbox.c, menubox.c, msgbox.c,
rangebox.c, textbox.c, timebox.c
+ add ^D as binding for new virtual key DLGK_LEAVE, which will close
the current dialog by activating the currently-selected button.
+ improve manual-page description of --no-ok option (reports by
Hans Mueller, Gil Delescluse).
+ modify configure script to make Solaris -R rpath feature work
2020/11/21
+ fix regression in dlg_getc() caused by not taking into account
subwindows used for input (report by Michael Wihl).
2020/11/20
+ add validity-checks for window pointer (report/testcase by Michael
Wihl).
+ improve configure macros:
CF_CLANG_COMPILER: apply compiler-flags needed for test.
CF_WITH_SCREEN_PDCURSES: use this to reduce X11-checks.
2020/11/17
+ amend initialization for dlg_getc to fix regression in pause widget
from 2020/03/27 changes (reports by Aidan Tessier, Norbert Koch,
Josmar Pierri).
+ improve configure macros:
CF_CLANG_COMPILER: split-out check for -Qunused-arguments to ensure
that clang supports it. IBM xlclang does not.
CF_MIXEDCASE_FILENAMES: when cross-compiling to darwin (macOS),
assume the filesystem doesn't support mixed-case
2020/09/21
+ modify init_dialog's initialization of tab_len and aspect_ratio to
avoid overwriting initialization done in process_common_options
(report/patch by Rainer Weikusat, Debian #970508).
2020/09/13
+ fix out-of-order description for --tailbox vs --rangebox in manpage
(report by Glenn Herteg).
+ updated configure-macros: compiler-warnings and shared-library
options. Changed configure --with-warnings to --enable-warnings for
consistency.
+ update config.guess
2020/04/01
+ updated sq.po from
http://translationproject.org/latest/dialog/
2020/03/27
+ add clarification in manual page to show when the single/double
quotes may be needed (prompted by discussion with Danilo G Baio).
+ fix an extra ".exe" in makefile.in which prevented Cygwin build.
+ fix most cppcheck warnings
+ tailbox/tailboxbg's exit-button now works with mouse-clicks
+ fix repainting while resizing for the editbox widget.
+ add configure-check for curses_exit() from ncurses 6.2
+ fix a few memory leaks in fselect.c, mixedgauge.c when resizing.
+ fix inconsistency in dlg_string_to_argv() which made the checklist9
example not work.
+ add empty-string check in dlg_print_listitem() to avoid indexing past
the end of the array of character-offsets.
+ improve handling of KEY_RESIZE by repainting the backtitle after
clearing the screen (integrated patch by Rainer Weikusat, Debian
#954185).
+ improve logic for wtimeout() calls which are used to set temporary
non-blocking reads (prompted by patch by Rainer Weikusat, Debian
#954220).
+ add "make check" rule.
+ updated configure-macros.
2020/02/28
+ updated configure-macros, to work around ncurses vs xcode's c99 -W
+ update config.guess
2019/12/31
+ updated configure-macros.
+ update config.guess
2019/12/10
+ correct rc-file lookup of "default" color (report by Grady Martin,
cf: 2019/09/24).
+ fix several issues in the sample scripts reported by shellcheck.
+ fix a few spelling errors reported by codespell (report by Jens
Schleusener).
+ correct check for return-value of isblank(), which is not necessarily
0/1 (report/patch by Paul Cercueil, Peter Korsgaard, cf: 2018/05/31).
2019/12/09
+ amend change for parsing command-options before calling init_dialog,
to handle --no-shadow, etc., which are initialized in init_dialog
(report by Paul Cercueil, cf: 2018/06/21).
+ add dlg_trace_va_msg to manpage, symbol files.
2019/11/10
+ improve layout of several widgets' data area when maximizing.
+ modify dselect/fselect to work with autosizing (Debian #915949).
+ add error messages from dlg_exiterr() to trace file.
+ improve manual page description of escaping in key-bindings.
+ modify inputmenu to recognize the "Cancel" button and keys bound to
that feature while editing a renamed menu item.
+ revert one change, in form.c to the --last-key feature (Debian
#942025).
+ correct ordering of libraries in configure-script, which appended
in a case where it should have prepended.
+ update config.guess, config.sub
2019/09/26
+ improve dialog-config script's filtering of -L options using the
linker default directories.
+ improve dialog-config script, adding a -L option corresponding to
the configure --libdir option if it would be a duplicate (report by
Andrew Kosteltsev).
+ build-fix for configure --disable-trace
+ updated pt.po from
http://translationproject.org/latest/dialog/
2019/09/24
+ allow for underline- and reverse-video flags in the ".rc" file
(integrated patch by Richard Robbins).
2019/08/08
+ amend change to --last-key feature to eliminate an unnecessary
separator (report by Gabriele Balducci).
2019/08/06
+ extend --last-key feature to the remaining widgets which have
ok/cancel buttons, and add logic to map keys which happen to be
bound to ok/extra/cancel/help to simulate a button-press on the
corresponding button (report by "sgewrk").
2019/08/01
+ further fixes for dialog-config.in (report by Andrew Kosteltsev).
2019/07/28
+ modify dialog-config.in so that setting prefix or exec-prefix to
a given value with --prefix=VALUE or --exec-prefix=VALUE has the
expected result of changing bindir, etc.
+ correct substitution for $LIBS value in dialog-config.in (report by
Andrew Kosteltsev).
2019/07/24
+ modify dlg_will_resize() and dlg_result_key() functions to reduce
the chance that dialog exits on a SIGWINCH (Debian #930775).
+ make test-package for the development headers/library
+ add --libs-only-L, etc., to dialog-config script (prompted by
discussion with Andrew Kosteltsev).
+ fix a memory leak in gauge widget (Andrew Kosteltsev).
+ minor fix for CF_GCC_WARNINGS
+ update config.guess, config.sub
2019/02/11
+ modify to work with ncurses' threaded-library, which does not allow
assignment to LINES/COLS (report by Marcus Roeckrath).
+ correct clearing after text in progressbox from 2018/06/21 changes
for resizing (reports by David Boyd, Alan Somers).
+ improved configure macros CF_GNU_SOURCE, CF_POSIX_C_SOURCE,
CF_XOPEN_SOURCE
+ update config.guess, config.sub
2018/11/07
+ convert ja.po to UTF-8 for consistency (suggested by Stanislav
Brabec).
+ repair mis-encoded hi.po (report/analysis by Stanislav Brabec).
2018/10/22
+ improved configure macros CF_CC_ENV_FLAGS, CF_LD_RPATH_OPT,
CF_LIBRARY_PATH, CF_SHARED_OPTS, CF_WITH_MAN2HTML,
CF_WITH_VERSIONED_SYMS from ncurses
+ add ast.po, from
http://translationproject.org/latest/dialog/
2018/06/21 2018/06/21
+ improve file-offset computation in textbox.c (Werner Fink). + improve file-offset computation in textbox.c (Werner Fink).
+ fix an overlooked case with real_auto_size() to maximize when + fix an overlooked case with real_auto_size() to maximize when
@ -370,7 +583,7 @@ to it:
2012/12/30 - release 1.2 2012/12/30 - release 1.2
+ improve some older changelog entries to help with HTML'izing content. + improve some older changelog entries to help with HTML'izing content.
+ various fixes/improvments for scrollbar appearance. + various fixes/improvements for scrollbar appearance.
+ add mappings for some equivalent options provided by whiptail; + add mappings for some equivalent options provided by whiptail;
add configure option --disable-whiptail to allow suppressing these. add configure option --disable-whiptail to allow suppressing these.
+ add configure option --disable-Xdialog2 to allow suppressing the + add configure option --disable-Xdialog2 to allow suppressing the

View File

@ -38,11 +38,11 @@ For the future, if any volunteer want, the way to evolve cdialog is to
multithreading. multithreading.
2) add an option that could permit to read commands (--options) from a 2) add an option that could permit to read commands (--options) from a
file, like as in a normal programming language, but maintaining file, like as in a normal programming language, but maintaining
compatiblity with older version of dialog. compatibility with older version of dialog.
I no longer could maintain cdialog... I no longer could maintain cdialog...
Executable and library name of cdialog are the same of dialog, for Executable and library name of cdialog are the same of dialog, for
compatiblity. compatibility.
I think that only one directive should be follow: don't use a resource I think that only one directive should be follow: don't use a resource
like stdin, stdout when you'll write new options for cdialog; these like stdin, stdout when you'll write new options for cdialog; these

View File

@ -1 +1 @@
15:0:0 1.3 20180621 15:0:0 1.3 20210117

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/* /*
* $Id: argv.c,v 1.12 2018/06/12 22:47:23 tom Exp $ * $Id: argv.c,v 1.13 2020/03/26 02:55:37 tom Exp $
* *
* argv - Reusable functions for argv-parsing. * argv - Reusable functions for argv-parsing.
* *
* Copyright 2011-2017,2018 Thomas E. Dickey * Copyright 2011-2018,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -60,37 +60,38 @@ dlg_string_to_argv(char *blob)
for (pass = 0; pass < 2; ++pass) { for (pass = 0; pass < 2; ++pass) {
bool inparm = FALSE; bool inparm = FALSE;
bool quoted = FALSE; bool quoted = FALSE;
bool escape = FALSE;
char *param = blob; char *param = blob;
size_t count = 0; size_t count = 0;
for (n = 0; n < length; ++n) { for (n = 0; n < length; ++n) {
if (escape) { if (quoted && blob[n] == '"') {
;
} else if (quoted && blob[n] == '"') {
quoted = FALSE; quoted = FALSE;
} else if (blob[n] == '"') { } else if (blob[n] == '"') {
quoted = TRUE; quoted = TRUE;
if (!inparm) { if (!inparm) {
if (pass) if (pass) {
result[count] = param; result[count] = param;
}
++count; ++count;
inparm = TRUE; inparm = TRUE;
} }
} else if (!quoted && isspace(UCH(blob[n]))) { } else if (!quoted && isspace(UCH(blob[n]))) {
if (inparm) { if (inparm) {
if (pass) { if (pass) {
*param++ = '\0'; *param = '\0';
} }
++param;
inparm = FALSE; inparm = FALSE;
} }
} else { } else {
if (blob[n] == '\\') { if (blob[n] == '\\') {
if (n + 1 == length) { size_t n1 = (n + 1);
bool ignore = FALSE;
if (n1 == length) {
break; /* The string is terminated by a backslash */ break; /* The string is terminated by a backslash */
} else if ((blob[n + 1] == '\\') || } else if ((blob[n1] == '\\') ||
(blob[n + 1] == '"') || (blob[n1] == '"') ||
(!quoted && blob[n + 1] == '\n')) { (ignore = (blob[n1] == '\n'))) {
/* eat the backslash */ /* eat the backslash */
if (pass) { if (pass) {
--length; --length;
@ -98,33 +99,35 @@ dlg_string_to_argv(char *blob)
blob[k] = blob[k + 1]; blob[k] = blob[k + 1];
blob[length] = '\0'; blob[length] = '\0';
} else { } else {
escape = TRUE; ++param; /* pretend I ate it */
continue;
} }
if (ignore)
continue;
} }
} }
if (!inparm) { if (!inparm) {
if (pass) if (pass) {
result[count] = param; result[count] = param;
}
++count; ++count;
inparm = TRUE; inparm = TRUE;
} }
if (pass) { if (pass) {
*param++ = blob[n]; *param = blob[n];
} }
++param;
} }
escape = FALSE;
} }
if (!pass) { if (pass) {
*param = '\0';
} else {
if (count) { if (count) {
result = dlg_calloc(char *, count + 1); result = dlg_calloc(char *, count + 1);
assert_ptr(result, "string_to_argv"); assert_ptr(result, "string_to_argv");
} else { } else {
break; /* no tokens found */ break; /* no tokens found */
} }
} else {
*param = '\0';
} }
} }
#ifdef HAVE_DLG_TRACE #ifdef HAVE_DLG_TRACE

View File

@ -1,9 +1,9 @@
/* /*
* $Id: arrows.c,v 1.52 2018/06/18 22:10:54 tom Exp $ * $Id: arrows.c,v 1.53 2019/07/24 23:04:14 tom Exp $
* *
* arrows.c -- draw arrows to indicate end-of-range for lists * arrows.c -- draw arrows to indicate end-of-range for lists
* *
* Copyright 2000-2013,2018 Thomas E. Dickey * Copyright 2000-2018,2019 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -70,7 +70,6 @@ merge_colors(chtype foreground, chtype background)
void void
dlg_draw_helpline(WINDOW *win, bool decorations) dlg_draw_helpline(WINDOW *win, bool decorations)
{ {
int cur_x, cur_y;
int bottom; int bottom;
if (dialog_vars.help_line != 0 if (dialog_vars.help_line != 0
@ -83,6 +82,8 @@ dlg_draw_helpline(WINDOW *win, bool decorations)
int limit = dlg_count_real_columns(dialog_vars.help_line) + 2; int limit = dlg_count_real_columns(dialog_vars.help_line) + 2;
if (limit < avail) { if (limit < avail) {
int cur_x, cur_y;
getyx(win, cur_y, cur_x); getyx(win, cur_y, cur_x);
other = decorations ? ON_LEFT : 0; other = decorations ? ON_LEFT : 0;
(void) wmove(win, bottom, other + (avail - limit) / 2); (void) wmove(win, bottom, other + (avail - limit) / 2);
@ -165,9 +166,6 @@ dlg_draw_scrollbar(WINDOW *win,
chtype attr, chtype attr,
chtype borderattr) chtype borderattr)
{ {
char buffer[80];
int percent;
int len;
int oldy, oldx; int oldy, oldx;
chtype save = dlg_get_attrs(win); chtype save = dlg_get_attrs(win);
@ -178,6 +176,10 @@ dlg_draw_scrollbar(WINDOW *win,
dlg_draw_helpline(win, TRUE); dlg_draw_helpline(win, TRUE);
if (bottom_arrow || top_arrow || dialog_state.use_scrollbar) { if (bottom_arrow || top_arrow || dialog_state.use_scrollbar) {
char buffer[80];
int percent;
int len;
percent = (!total_data percent = (!total_data
? 100 ? 100
: (int) ((next_data * 100) : (int) ((next_data * 100)
@ -209,7 +211,6 @@ dlg_draw_scrollbar(WINDOW *win,
int all_diff = (int) (total_data + 1); int all_diff = (int) (total_data + 1);
int bar_diff = (int) (next_data + 1 - this_data); int bar_diff = (int) (next_data + 1 - this_data);
int bar_high; int bar_high;
int bar_y;
bar_high = ORDSIZE(bar_diff); bar_high = ORDSIZE(bar_diff);
if (bar_high <= 0) if (bar_high <= 0)
@ -217,6 +218,7 @@ dlg_draw_scrollbar(WINDOW *win,
if (bar_high < all_high) { if (bar_high < all_high) {
int bar_last = BARSIZE(next_data); int bar_last = BARSIZE(next_data);
int bar_y;
wmove(win, top + 1, right); wmove(win, top + 1, right);

View File

@ -1,9 +1,9 @@
/* /*
* $Id: buildlist.c,v 1.83 2018/06/19 22:57:01 tom Exp $ * $Id: buildlist.c,v 1.94 2020/11/23 00:37:17 tom Exp $
* *
* buildlist.c -- implements the buildlist dialog * buildlist.c -- implements the buildlist dialog
* *
* Copyright 2012-2017,2018 Thomas E. Dickey * Copyright 2012-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA. * Boston, MA 02110, USA.
*/ */
#include <dialog.h> #include <dlg_internals.h>
#include <dlg_keys.h> #include <dlg_keys.h>
/* /*
@ -77,9 +77,10 @@ index2row(ALL_DATA * all, int choice, int selected)
{ {
MY_DATA *data = all->list + selected; MY_DATA *data = all->list + selected;
int result = -1; int result = -1;
int row;
if (okIndex(all, choice)) { if (okIndex(all, choice)) {
int row;
for (row = 0; row < all->item_no; ++row) { for (row = 0; row < all->item_no; ++row) {
TRACE(("!... choice %d: %p vs row %d: %p\n", TRACE(("!... choice %d: %p vs row %d: %p\n",
choice, all->items + choice, choice, all->items + choice,
@ -270,9 +271,10 @@ first_item(ALL_DATA * all, int selected)
{ {
MY_DATA *data = all->list + selected; MY_DATA *data = all->list + selected;
int result = -1; int result = -1;
int n;
if (myItem(data, 0) != 0) { if (myItem(data, 0) != 0) {
int n;
for (n = 0; n < all->item_no; ++n) { for (n = 0; n < all->item_no; ++n) {
if (myItem(data, 0) == &all->items[n]) { if (myItem(data, 0) == &all->items[n]) {
result = n; result = n;
@ -309,9 +311,10 @@ skip_rows(ALL_DATA * all, int row, int skip, int selected)
{ {
MY_DATA *data = all->list + selected; MY_DATA *data = all->list + selected;
int result = row; int result = row;
int n;
if (skip > 0) { if (skip > 0) {
int n;
for (n = row + 1; (n < all->item_no) && (n <= row + skip); ++n) { for (n = row + 1; (n < all->item_no) && (n <= row + skip); ++n) {
if (myItem(data, n) == 0) if (myItem(data, n) == 0)
break; break;
@ -550,11 +553,10 @@ dlg_buildlist(const char *title,
ALL_DATA all; ALL_DATA all;
MY_DATA *data = all.list; MY_DATA *data = all.list;
int i, j, k, key2, found, x, y, cur_x, cur_y; int i, j, k, key2, found, x, y, cur_x, cur_y;
int key = 0, fkey; int key, fkey;
bool save_visit = dialog_state.visit_items; bool save_visit = dialog_state.visit_items;
int button; int button;
int cur_item; int cur_item;
int was_mouse;
int name_width, text_width, full_width, list_width; int name_width, text_width, full_width, list_width;
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
int num_states; int num_states;
@ -650,8 +652,7 @@ dlg_buildlist(const char *title,
* After displaying the prompt, we know how much space we really have. * After displaying the prompt, we know how much space we really have.
* Limit the list to avoid overwriting the ok-button. * Limit the list to avoid overwriting the ok-button.
*/ */
if (all.use_height + MIN_HIGH > height - cur_y) all.use_height = height - MIN_HIGH - cur_y;
all.use_height = height - MIN_HIGH - cur_y;
if (all.use_height <= 0) if (all.use_height <= 0)
all.use_height = 1; all.use_height = 1;
@ -742,6 +743,7 @@ dlg_buildlist(const char *title,
int at_top = index2row(&all, moi->top_index, which); int at_top = index2row(&all, moi->top_index, which);
int at_end = index2row(&all, -1, which); int at_end = index2row(&all, -1, which);
int at_bot = skip_rows(&all, at_top, all.use_height, which); int at_bot = skip_rows(&all, at_top, all.use_height, which);
int was_mouse;
DLG_TRACE(("# ** state %d:%d top %d (%d:%d:%d) %s\n", DLG_TRACE(("# ** state %d:%d top %d (%d:%d:%d) %s\n",
cur_item, item_no - 1, cur_item, item_no - 1,
@ -769,8 +771,10 @@ dlg_buildlist(const char *title,
} }
key = dlg_mouse_wgetch(dialog, &fkey); key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
was_mouse = (fkey && is_DLGK_MOUSE(key)); was_mouse = (fkey && is_DLGK_MOUSE(key));
if (was_mouse) if (was_mouse)
@ -1090,6 +1094,9 @@ dlg_buildlist(const char *title,
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_enter_buttoncode(button); result = dlg_enter_buttoncode(button);
break; break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:
dlg_will_resize(dialog); dlg_will_resize(dialog);
@ -1097,9 +1104,7 @@ dlg_buildlist(const char *title,
height = old_height; height = old_height;
width = old_width; width = old_width;
free(prompt); free(prompt);
dlg_clear(); _dlg_resize_cleanup(dialog);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */ /* repaint */
first = TRUE; first = TRUE;
goto retry; goto retry;
@ -1113,7 +1118,7 @@ dlg_buildlist(const char *title,
beep(); beep();
} }
} }
} else { } else if (key > 0) {
beep(); beep();
} }
} }
@ -1232,7 +1237,6 @@ dialog_buildlist(const char *title,
if ((show_status = dialog_vars.help_status)) { if ((show_status = dialog_vars.help_status)) {
if (separate_output) { if (separate_output) {
dlg_add_string(help_result); dlg_add_string(help_result);
dlg_add_separator();
} else { } else {
dlg_add_quoted(help_result); dlg_add_quoted(help_result);
} }
@ -1245,17 +1249,16 @@ dialog_buildlist(const char *title,
if (show_status) { if (show_status) {
for (i = 0; i < item_no; i++) { for (i = 0; i < item_no; i++) {
if (listitems[i].state) { if (listitems[i].state) {
if (dlg_need_separator())
dlg_add_separator();
if (separate_output) { if (separate_output) {
dlg_add_string(listitems[i].name); dlg_add_string(listitems[i].name);
dlg_add_separator();
} else { } else {
if (dlg_need_separator())
dlg_add_separator();
dlg_add_quoted(listitems[i].name); dlg_add_quoted(listitems[i].name);
} }
} }
} }
dlg_add_last_key(-1); AddLastKey();
} }
dlg_free_columns(&listitems[0].text, (int) sizeof(DIALOG_LISTITEM), item_no); dlg_free_columns(&listitems[0].text, (int) sizeof(DIALOG_LISTITEM), item_no);

View File

@ -1,9 +1,9 @@
/* /*
* $Id: buttons.c,v 1.99 2018/06/18 22:11:16 tom Exp $ * $Id: buttons.c,v 1.106 2021/01/17 17:03:16 tom Exp $
* *
* buttons.c -- draw buttons, e.g., OK/Cancel * buttons.c -- draw buttons, e.g., OK/Cancel
* *
* Copyright 2000-2017,2018 Thomas E. Dickey * Copyright 2000-2020,2021 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -35,11 +35,11 @@ static void
center_label(char *buffer, int longest, const char *label) center_label(char *buffer, int longest, const char *label)
{ {
int len = dlg_count_columns(label); int len = dlg_count_columns(label);
int left = 0, right = 0; int right = 0;
*buffer = 0; *buffer = 0;
if (len < longest) { if (len < longest) {
left = (longest - len) / 2; int left = (longest - len) / 2;
right = (longest - len - left); right = (longest - len - left);
if (left > 0) if (left > 0)
sprintf(buffer, "%*s", left, " "); sprintf(buffer, "%*s", left, " ");
@ -60,14 +60,16 @@ string_to_char(const char **stringp)
#ifdef USE_WIDE_CURSES #ifdef USE_WIDE_CURSES
const char *string = *stringp; const char *string = *stringp;
size_t have = strlen(string); size_t have = strlen(string);
size_t check;
size_t len; size_t len;
wchar_t cmp2[2]; wchar_t cmp2[2];
mbstate_t state; mbstate_t state;
memset(&state, 0, sizeof(state)); memset(&state, 0, sizeof(state));
len = mbrlen(string, have, &state); len = mbrlen(string, have, &state);
if ((int) len > 0 && len <= have) { if ((int) len > 0 && len <= have) {
size_t check;
memset(&state, 0, sizeof(state)); memset(&state, 0, sizeof(state));
memset(cmp2, 0, sizeof(cmp2)); memset(cmp2, 0, sizeof(cmp2));
check = mbrtowc(cmp2, string, len, &state); check = mbrtowc(cmp2, string, len, &state);
@ -132,9 +134,10 @@ get_hotkeys(const char **labels)
{ {
int *result = 0; int *result = 0;
size_t count = count_labels(labels); size_t count = count_labels(labels);
size_t n;
if ((result = dlg_calloc(int, count + 1)) != 0) { if ((result = dlg_calloc(int, count + 1)) != 0) {
size_t n;
for (n = 0; n < count; ++n) { for (n = 0; n < count; ++n) {
const char *label = labels[n]; const char *label = labels[n];
const int *indx = dlg_index_wchars(label); const int *indx = dlg_index_wchars(label);
@ -222,7 +225,9 @@ print_button(WINDOW *win, char *label, int hotkey, int y, int x, int selected)
? button_active_attr ? button_active_attr
: button_inactive_attr); : button_inactive_attr);
(void) waddstr(win, ">"); (void) waddstr(win, ">");
(void) wmove(win, y, x + ((int) (strspn) (label, " ")) + 1); if (!dialog_vars.cursor_off_label) {
(void) wmove(win, y, x + ((int) (strspn) (label, " ")) + 1);
}
} }
/* /*
@ -281,12 +286,13 @@ dlg_button_x_step(const char **labels, int limit, int *gap, int *margin, int *st
int count = dlg_button_count(labels); int count = dlg_button_count(labels);
int longest; int longest;
int length; int length;
int unused;
int used;
int result; int result;
*margin = 0; *margin = 0;
if (count != 0) { if (count != 0) {
int unused;
int used;
dlg_button_sizes(labels, FALSE, &longest, &length); dlg_button_sizes(labels, FALSE, &longest, &length);
used = (length + (count * 2)); used = (length + (count * 2));
unused = limit - used; unused = limit - used;
@ -312,10 +318,11 @@ dlg_button_x_step(const char **labels, int limit, int *gap, int *margin, int *st
void void
dlg_button_layout(const char **labels, int *limit) dlg_button_layout(const char **labels, int *limit)
{ {
int width = 1;
int gap, margin, step; int gap, margin, step;
if (labels != 0 && dlg_button_count(labels)) { if (labels != 0 && dlg_button_count(labels)) {
int width = 1;
while (!dlg_button_x_step(labels, width, &gap, &margin, &step)) while (!dlg_button_x_step(labels, width, &gap, &margin, &step))
++width; ++width;
width += (4 * MARGIN); width += (4 * MARGIN);
@ -338,7 +345,6 @@ dlg_draw_buttons(WINDOW *win,
int limit) int limit)
{ {
chtype save = dlg_get_attrs(win); chtype save = dlg_get_attrs(win);
int n;
int step = 0; int step = 0;
int length; int length;
int longest; int longest;
@ -347,7 +353,6 @@ dlg_draw_buttons(WINDOW *win,
int gap; int gap;
int margin; int margin;
size_t need; size_t need;
char *buffer;
dlg_mouse_setbase(getbegx(win), getbegy(win)); dlg_mouse_setbase(getbegx(win), getbegy(win));
@ -368,7 +373,10 @@ dlg_draw_buttons(WINDOW *win,
*/ */
need = (size_t) longest; need = (size_t) longest;
if (need != 0) { if (need != 0) {
char *buffer;
int n;
int *hotkeys = get_hotkeys(labels); int *hotkeys = get_hotkeys(labels);
assert_ptr(hotkeys, "dlg_draw_buttons"); assert_ptr(hotkeys, "dlg_draw_buttons");
for (n = 0; labels[n] != 0; ++n) { for (n = 0; labels[n] != 0; ++n) {
@ -414,19 +422,21 @@ dlg_draw_buttons(WINDOW *win,
int int
dlg_match_char(int ch, const char *string) dlg_match_char(int ch, const char *string)
{ {
if (string != 0) { if (!dialog_vars.no_hot_list) {
int cmp2 = string_to_char(&string); if (string != 0) {
int cmp2 = string_to_char(&string);
#ifdef USE_WIDE_CURSES #ifdef USE_WIDE_CURSES
wint_t cmp1 = dlg_toupper(ch); wint_t cmp1 = dlg_toupper(ch);
if (cmp2 != 0 && (wchar_t) cmp1 == (wchar_t) dlg_toupper(cmp2)) { if (cmp2 != 0 && (wchar_t) cmp1 == (wchar_t) dlg_toupper(cmp2)) {
return TRUE;
}
#else
if (ch > 0 && ch < 256) {
if (dlg_toupper(ch) == dlg_toupper(cmp2))
return TRUE; return TRUE;
} }
#else
if (ch > 0 && ch < 256) {
if (dlg_toupper(ch) == dlg_toupper(cmp2))
return TRUE;
}
#endif #endif
}
} }
return FALSE; return FALSE;
} }
@ -441,8 +451,9 @@ dlg_button_to_char(const char *label)
int cmp = -1; int cmp = -1;
while (*label != 0) { while (*label != 0) {
cmp = string_to_char(&label); int ch = string_to_char(&label);
if (dlg_isupper(cmp)) { if (dlg_isupper(ch)) {
cmp = ch;
break; break;
} }
} }
@ -461,11 +472,12 @@ dlg_char_to_button(int ch, const char **labels)
if (labels != 0) { if (labels != 0) {
int *hotkeys = get_hotkeys(labels); int *hotkeys = get_hotkeys(labels);
int j;
ch = (int) dlg_toupper(dlg_last_getc()); ch = (int) dlg_toupper(dlg_last_getc());
if (hotkeys != 0) { if (hotkeys != 0) {
int j;
for (j = 0; labels[j] != 0; ++j) { for (j = 0; labels[j] != 0; ++j) {
if (ch == hotkeys[j]) { if (ch == hotkeys[j]) {
dlg_flush_getc(); dlg_flush_getc();
@ -586,23 +598,42 @@ dlg_exit_buttoncode(int button)
return result; return result;
} }
static const char **
finish_ok_label(const char **labels, int n)
{
if (n == 0) {
labels[n++] = my_ok_label();
dialog_vars.nook = FALSE;
dlg_trace_msg("# ignore --nook, since at least one button is needed\n");
}
labels[n] = NULL;
return labels;
}
/*
* Return a list of button labels for the OK (no Cancel) group, used in msgbox
* and progressbox.
*/
const char ** const char **
dlg_ok_label(void) dlg_ok_label(void)
{ {
static const char *labels[4]; static const char *labels[4];
int n = 0; int n = 0;
labels[n++] = my_ok_label(); if (!dialog_vars.nook)
labels[n++] = my_ok_label();
if (dialog_vars.extra_button) if (dialog_vars.extra_button)
labels[n++] = my_extra_label(); labels[n++] = my_extra_label();
if (dialog_vars.help_button) if (dialog_vars.help_button)
labels[n++] = my_help_label(); labels[n++] = my_help_label();
labels[n] = 0;
return labels; return finish_ok_label(labels, n);
} }
/* /*
* Return a list of button labels for the OK/Cancel group. * Return a list of button labels for the OK/Cancel group, used in most widgets
* that select an option or data.
*/ */
const char ** const char **
dlg_ok_labels(void) dlg_ok_labels(void)
@ -618,8 +649,8 @@ dlg_ok_labels(void)
labels[n++] = my_cancel_label(); labels[n++] = my_cancel_label();
if (dialog_vars.help_button) if (dialog_vars.help_button)
labels[n++] = my_help_label(); labels[n++] = my_help_label();
labels[n] = 0;
return labels; return finish_ok_label(labels, n);
} }
/* /*
@ -640,7 +671,8 @@ dlg_ok_buttoncode(int button)
} else if (dialog_vars.help_button && (button == n)) { } else if (dialog_vars.help_button && (button == n)) {
result = DLG_EXIT_HELP; result = DLG_EXIT_HELP;
} }
DLG_TRACE(("# dlg_ok_buttoncode(%d) = %d\n", button, result)); DLG_TRACE(("# dlg_ok_buttoncode(%d) = %d:%s\n",
button, result, dlg_exitcode2s(result)));
return result; return result;
} }
@ -702,10 +734,11 @@ dlg_defaultno_button(void)
int int
dlg_default_button(void) dlg_default_button(void)
{ {
int i, n;
int result = 0; int result = 0;
if (dialog_vars.default_button >= 0) { if (dialog_vars.default_button >= 0) {
int i, n;
for (i = 0; (n = dlg_ok_buttoncode(i)) >= 0; i++) { for (i = 0; (n = dlg_ok_buttoncode(i)) >= 0; i++) {
if (n == dialog_vars.default_button) { if (n == dialog_vars.default_button) {
result = i; result = i;

View File

@ -1,9 +1,9 @@
/* /*
* $Id: calendar.c,v 1.97 2018/06/19 22:57:01 tom Exp $ * $Id: calendar.c,v 1.106 2020/11/23 09:03:49 tom Exp $
* *
* calendar.c -- implements the calendar box * calendar.c -- implements the calendar box
* *
* Copyright 2001-2017,2018 Thomas E. Dickey * Copyright 2001-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA. * Boston, MA 02110, USA.
*/ */
#include <dialog.h> #include <dlg_internals.h>
#include <dlg_keys.h> #include <dlg_keys.h>
#include <time.h> #include <time.h>
@ -75,16 +75,6 @@ static const char *
nameOfDayOfWeek(int n) nameOfDayOfWeek(int n)
{ {
static bool shown[MAX_DAYS]; static bool shown[MAX_DAYS];
static const char *posix_days[MAX_DAYS] =
{
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
};
while (n < 0) { while (n < 0) {
n += MAX_DAYS; n += MAX_DAYS;
@ -101,7 +91,17 @@ nameOfDayOfWeek(int n)
} }
#endif #endif
if (cached_days[n] == 0) { if (cached_days[n] == 0) {
size_t len, limit = MON_WIDE - 1; static const char *posix_days[MAX_DAYS] =
{
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
};
size_t limit = MON_WIDE - 1;
char *value = dlg_strclone(posix_days[n]); char *value = dlg_strclone(posix_days[n]);
/* /*
@ -111,7 +111,7 @@ nameOfDayOfWeek(int n)
* double-width cell. For now (2016/01/26), handle too-long names only * double-width cell. For now (2016/01/26), handle too-long names only
* for POSIX values. * for POSIX values.
*/ */
if ((len = strlen(value)) > limit) if (strlen(value) > limit)
value[limit] = '\0'; value[limit] = '\0';
cached_days[n] = value; cached_days[n] = value;
} }
@ -126,21 +126,6 @@ static const char *
nameOfMonth(int n) nameOfMonth(int n)
{ {
static bool shown[MAX_MONTHS]; static bool shown[MAX_MONTHS];
static const char *posix_mons[MAX_MONTHS] =
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
while (n < 0) { while (n < 0) {
n += MAX_MONTHS; n += MAX_MONTHS;
@ -158,6 +143,21 @@ nameOfMonth(int n)
} }
#endif #endif
if (cached_months[n] == 0) { if (cached_months[n] == 0) {
static const char *posix_mons[MAX_MONTHS] =
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
};
cached_months[n] = dlg_strclone(posix_mons[n]); cached_months[n] = dlg_strclone(posix_mons[n]);
} }
if (!shown[n]) { if (!shown[n]) {
@ -301,7 +301,6 @@ iso_week(int year, int month, int day)
if (365 + isleap(year) - diy < MAX_DAYS if (365 + isleap(year) - diy < MAX_DAYS
&& new_years_eve_dow >= dow && new_years_eve_dow >= dow
&& new_years_eve_dow < thursday) { && new_years_eve_dow < thursday) {
++year;
week = 1; week = 1;
} }
return week; return week;
@ -371,7 +370,7 @@ static int
draw_day(BOX * data, struct tm *current) draw_day(BOX * data, struct tm *current)
{ {
int cell_wide = MON_WIDE; int cell_wide = MON_WIDE;
int y, x, this_x = 0; int y, x, this_x;
int save_y = 0, save_x = 0; int save_y = 0, save_x = 0;
int day = current->tm_mday; int day = current->tm_mday;
int mday; int mday;
@ -513,12 +512,11 @@ init_object(BOX * data,
data->box_draw = box_draw; data->box_draw = box_draw;
data->week_start = key_offset; data->week_start = key_offset;
data->window = derwin(data->parent, data->window = dlg_der_window(data->parent,
data->height, data->width, data->height, data->width,
data->y, data->x); data->y, data->x);
if (data->window == 0) if (data->window == 0)
return -1; return -1;
(void) keypad(data->window, TRUE);
dlg_mouse_setbase(getbegx(parent), getbegy(parent)); dlg_mouse_setbase(getbegx(parent), getbegy(parent));
if (code == 'D') { if (code == 'D') {
@ -715,14 +713,13 @@ dialog_calendar(const char *title,
#endif #endif
BOX dy_box, mn_box, yr_box; BOX dy_box, mn_box, yr_box;
int fkey; int fkey;
int key = 0; int key;
int key2;
int step; int step;
int button; int button;
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
int week_start; int week_start;
WINDOW *dialog; WINDOW *dialog;
time_t now_time = time((time_t *) 0); time_t now_time;
struct tm current; struct tm current;
int state = dlg_default_button(); int state = dlg_default_button();
const char **buttons = dlg_ok_labels(); const char **buttons = dlg_ok_labels();
@ -746,7 +743,7 @@ dialog_calendar(const char *title,
dlg_does_output(); dlg_does_output();
/* /*
* Unless overrridden, the current time/date is our starting point. * Unless overridden, the current time/date is our starting point.
*/ */
now_time = time((time_t *) 0); now_time = time((time_t *) 0);
current = *localtime(&now_time); current = *localtime(&now_time);
@ -871,6 +868,7 @@ dialog_calendar(const char *title,
dlg_trace_win(dialog); dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int key2;
BOX *obj = (state == sDAY ? &dy_box BOX *obj = (state == sDAY ? &dy_box
: (state == sMONTH ? &mn_box : : (state == sMONTH ? &mn_box :
(state == sYEAR ? &yr_box : 0))); (state == sYEAR ? &yr_box : 0)));
@ -881,9 +879,10 @@ dialog_calendar(const char *title,
dlg_set_focus(dialog, obj->window); dlg_set_focus(dialog, obj->window);
key = dlg_mouse_wgetch(dialog, &fkey); key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
#define Mouse2Key(key) (key - M_EVENT) #define Mouse2Key(key) (key - M_EVENT)
if (fkey && (key >= DLGK_MOUSE(KEY_MIN) && key <= DLGK_MOUSE(KEY_MAX))) { if (fkey && (key >= DLGK_MOUSE(KEY_MIN) && key <= DLGK_MOUSE(KEY_MAX))) {
key = dlg_lookup_key(dialog, Mouse2Key(key), &fkey); key = dlg_lookup_key(dialog, Mouse2Key(key), &fkey);
@ -907,6 +906,9 @@ dialog_calendar(const char *title,
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_enter_buttoncode(button); result = dlg_enter_buttoncode(button);
break; break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
case DLGK_FIELD_PREV: case DLGK_FIELD_PREV:
state = dlg_prev_ok_buttonindex(state, sMONTH); state = dlg_prev_ok_buttonindex(state, sMONTH);
break; break;
@ -920,9 +922,7 @@ dialog_calendar(const char *title,
height = old_height; height = old_height;
width = old_width; width = old_width;
free(prompt); free(prompt);
dlg_clear(); _dlg_resize_cleanup(dialog);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */ /* repaint */
goto retry; goto retry;
#endif #endif
@ -1010,8 +1010,7 @@ dialog_calendar(const char *title,
DefaultFormat(buffer, current); DefaultFormat(buffer, current);
dlg_add_result(buffer); dlg_add_result(buffer);
dlg_add_separator(); AddLastKey();
dlg_add_last_key(-1);
return CleanupResult(result, dialog, prompt, &save_vars); return CleanupResult(result, dialog, prompt, &save_vars);
} }

View File

@ -1,9 +1,9 @@
/* /*
* $Id: checklist.c,v 1.160 2018/06/19 22:57:01 tom Exp $ * $Id: checklist.c,v 1.167 2020/11/23 00:37:47 tom Exp $
* *
* checklist.c -- implements the checklist box * checklist.c -- implements the checklist box
* *
* Copyright 2000-2016,2018 Thomas E. Dickey * Copyright 2000-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -192,12 +192,11 @@ dlg_checklist(const char *title,
#endif #endif
ALL_DATA all; ALL_DATA all;
int i, j, key2, found, x, y, cur_x, cur_y; int i, j, key2, found, x, y, cur_x, cur_y;
int key = 0, fkey; int key, fkey;
int button = dialog_state.visit_items ? -1 : dlg_default_button(); int button = dialog_state.visit_items ? -1 : dlg_default_button();
int choice = dlg_default_listitem(items); int choice = dlg_default_listitem(items);
int scrollamt = 0; int scrollamt = 0;
int max_choice; int max_choice;
int was_mouse;
int use_width, list_width, name_width, text_width; int use_width, list_width, name_width, text_width;
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
int num_states; int num_states;
@ -304,8 +303,7 @@ dlg_checklist(const char *title,
* After displaying the prompt, we know how much space we really have. * After displaying the prompt, we know how much space we really have.
* Limit the list to avoid overwriting the ok-button. * Limit the list to avoid overwriting the ok-button.
*/ */
if (all.use_height + MIN_HIGH > height - cur_y) all.use_height = height - MIN_HIGH - cur_y;
all.use_height = height - MIN_HIGH - cur_y;
if (all.use_height <= 0) if (all.use_height <= 0)
all.use_height = 1; all.use_height = 1;
@ -379,13 +377,18 @@ dlg_checklist(const char *title,
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width); dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
dlg_trace_win(dialog); dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int was_mouse;
if (button < 0) /* --visit-items */ if (button < 0) /* --visit-items */
wmove(dialog, all.box_y + choice + 1, all.box_x + all.check_x + 2); wmove(dialog, all.box_y + choice + 1, all.box_x + all.check_x + 2);
key = dlg_mouse_wgetch(dialog, &fkey); key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
was_mouse = (fkey && is_DLGK_MOUSE(key)); was_mouse = (fkey && is_DLGK_MOUSE(key));
if (was_mouse) if (was_mouse)
@ -560,6 +563,9 @@ dlg_checklist(const char *title,
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_enter_buttoncode(button); result = dlg_enter_buttoncode(button);
break; break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
case DLGK_FIELD_PREV: case DLGK_FIELD_PREV:
button = dlg_prev_button(buttons, button); button = dlg_prev_button(buttons, button);
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
@ -577,9 +583,7 @@ dlg_checklist(const char *title,
height = old_height; height = old_height;
width = old_width; width = old_width;
free(prompt); free(prompt);
dlg_clear(); _dlg_resize_cleanup(dialog);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */ /* repaint */
goto retry; goto retry;
#endif #endif
@ -592,7 +596,7 @@ dlg_checklist(const char *title,
beep(); beep();
} }
} }
} else { } else if (key > 0) {
beep(); beep();
} }
} }

View File

@ -1,9 +1,9 @@
/* /*
* $Id: columns.c,v 1.10 2011/10/20 20:53:55 tom Exp $ * $Id: columns.c,v 1.11 2019/07/25 00:06:38 tom Exp $
* *
* columns.c -- implements column-alignment * columns.c -- implements column-alignment
* *
* Copyright 2008-2010,2011 Thomas E. Dickey * Copyright 2008-2011,2019 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -93,8 +93,6 @@ split_row(char *source, unsigned *offsets, unsigned *widths)
void void
dlg_align_columns(char **target, int per_row, int num_rows) dlg_align_columns(char **target, int per_row, int num_rows)
{ {
int row;
if (column_separator()) { if (column_separator()) {
char **value; char **value;
unsigned numcols = 1; unsigned numcols = 1;
@ -104,6 +102,7 @@ dlg_align_columns(char **target, int per_row, int num_rows)
unsigned *maxwidth; unsigned *maxwidth;
unsigned realwidth; unsigned realwidth;
unsigned n; unsigned n;
int row;
/* first allocate arrays for workspace */ /* first allocate arrays for workspace */
for (each(row, value)) { for (each(row, value)) {
@ -164,10 +163,10 @@ dlg_align_columns(char **target, int per_row, int num_rows)
void void
dlg_free_columns(char **target, int per_row, int num_rows) dlg_free_columns(char **target, int per_row, int num_rows)
{ {
int row;
char **value;
if (column_separator()) { if (column_separator()) {
int row;
char **value;
for (each(row, value)) { for (each(row, value)) {
free(*value); free(*value);
} }

View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright 1992-2018 Free Software Foundation, Inc. # Copyright 1992-2020 Free Software Foundation, Inc.
timestamp='2018-05-19' timestamp='2020-08-17'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright 1992-2018 Free Software Foundation, Inc. Copyright 1992-2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -84,8 +84,6 @@ if test $# != 0; then
exit 1 exit 1
fi fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires # compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a # temporary files to be created and, as you can see below, it is a
@ -96,34 +94,40 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team. # Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build=' tmp=
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; # shellcheck disable=SC2172
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || set_cc_for_build() {
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || # prevent multiple calls if $tmp is already set
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || test "$tmp" && return 0
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; : "${TMPDIR=/tmp}"
dummy=$tmp/dummy ; # shellcheck disable=SC2039
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
,,) echo "int x;" > "$dummy.c" ; { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
for c in cc gcc c89 c99 ; do { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then dummy=$tmp/dummy
CC_FOR_BUILD="$c"; break ; case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
fi ; ,,) echo "int x;" > "$dummy.c"
done ; for driver in cc gcc c89 c99 ; do
if test x"$CC_FOR_BUILD" = x ; then if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=no_compiler_found ; CC_FOR_BUILD="$driver"
fi break
;; fi
,,*) CC_FOR_BUILD=$CC ;; done
,*,*) CC_FOR_BUILD=$HOST_CC ;; if test x"$CC_FOR_BUILD" = x ; then
esac ; set_cc_for_build= ;' CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24) # (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH PATH=$PATH:/.attbin ; export PATH
fi fi
@ -138,7 +142,7 @@ Linux|GNU|GNU/*)
# We could probably try harder. # We could probably try harder.
LIBC=gnu LIBC=gnu
eval "$set_cc_for_build" set_cc_for_build
cat <<-EOF > "$dummy.c" cat <<-EOF > "$dummy.c"
#include <features.h> #include <features.h>
#if defined(__UCLIBC__) #if defined(__UCLIBC__)
@ -199,7 +203,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
os=netbsdelf os=netbsdelf
;; ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax) arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval "$set_cc_for_build" set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__ | grep -q __ELF__
then then
@ -260,6 +264,9 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:SolidBSD:*:*) *:SolidBSD:*:*)
echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
exit ;; exit ;;
*:OS108:*:*)
echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*) macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd"$UNAME_RELEASE" echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;; exit ;;
@ -269,12 +276,15 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:Sortix:*:*) *:Sortix:*:*)
echo "$UNAME_MACHINE"-unknown-sortix echo "$UNAME_MACHINE"-unknown-sortix
exit ;; exit ;;
*:Twizzler:*:*)
echo "$UNAME_MACHINE"-unknown-twizzler
exit ;;
*:Redox:*:*) *:Redox:*:*)
echo "$UNAME_MACHINE"-unknown-redox echo "$UNAME_MACHINE"-unknown-redox
exit ;; exit ;;
mips:OSF1:*.*) mips:OSF1:*.*)
echo mips-dec-osf1 echo mips-dec-osf1
exit ;; exit ;;
alpha:OSF1:*:*) alpha:OSF1:*:*)
case $UNAME_RELEASE in case $UNAME_RELEASE in
*4.0) *4.0)
@ -389,12 +399,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo i386-pc-auroraux"$UNAME_RELEASE" echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;; exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval "$set_cc_for_build" set_cc_for_build
SUN_ARCH=i386 SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects. # If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers. # This test works for both compilers.
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null grep IS_64BIT_ARCH >/dev/null
@ -482,7 +492,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
echo clipper-intergraph-clix"$UNAME_RELEASE" echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;; exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos) mips:*:*:UMIPS | mips:*:*:RISCos)
eval "$set_cc_for_build" set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c" sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus #ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */ #include <stdio.h> /* for printf() prototype */
@ -534,10 +544,10 @@ EOF
AViiON:dgux:*:*) AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures # DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then then
if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
[ "$TARGET_BINARY_INTERFACE"x = x ] test "$TARGET_BINARY_INTERFACE"x = x
then then
echo m88k-dg-dgux"$UNAME_RELEASE" echo m88k-dg-dgux"$UNAME_RELEASE"
else else
@ -570,7 +580,7 @@ EOF
echo i386-ibm-aix echo i386-ibm-aix
exit ;; exit ;;
ia64:AIX:*:*) ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel` IBM_REV=`/usr/bin/oslevel`
else else
IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
@ -579,7 +589,7 @@ EOF
exit ;; exit ;;
*:AIX:2:3) *:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval "$set_cc_for_build" set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c" sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h> #include <sys/systemcfg.h>
@ -610,7 +620,7 @@ EOF
else else
IBM_ARCH=powerpc IBM_ARCH=powerpc
fi fi
if [ -x /usr/bin/lslpp ] ; then if test -x /usr/bin/lslpp ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else else
@ -645,7 +655,7 @@ EOF
9000/31?) HP_ARCH=m68000 ;; 9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;; 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9]) 9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "$sc_cpu_version" in case "$sc_cpu_version" in
@ -659,8 +669,8 @@ EOF
esac ;; esac ;;
esac esac
fi fi
if [ "$HP_ARCH" = "" ]; then if test "$HP_ARCH" = ""; then
eval "$set_cc_for_build" set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c" sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE #define _HPUX_SOURCE
@ -698,9 +708,9 @@ EOF
test -z "$HP_ARCH" && HP_ARCH=hppa test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;; fi ;;
esac esac
if [ "$HP_ARCH" = hppa2.0w ] if test "$HP_ARCH" = hppa2.0w
then then
eval "$set_cc_for_build" set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@ -726,7 +736,7 @@ EOF
echo ia64-hp-hpux"$HPUX_REV" echo ia64-hp-hpux"$HPUX_REV"
exit ;; exit ;;
3050*:HI-UX:*:*) 3050*:HI-UX:*:*)
eval "$set_cc_for_build" set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c" sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h> #include <unistd.h>
int int
@ -772,7 +782,7 @@ EOF
echo hppa1.0-hp-osf echo hppa1.0-hp-osf
exit ;; exit ;;
i*86:OSF1:*:*) i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then if test -x /usr/sbin/sysversion ; then
echo "$UNAME_MACHINE"-unknown-osf1mk echo "$UNAME_MACHINE"-unknown-osf1mk
else else
echo "$UNAME_MACHINE"-unknown-osf1 echo "$UNAME_MACHINE"-unknown-osf1
@ -840,6 +850,17 @@ EOF
*:BSD/OS:*:*) *:BSD/OS:*:*)
echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
exit ;; exit ;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
else
echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
fi
exit ;;
*:FreeBSD:*:*) *:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p` UNAME_PROCESSOR=`/usr/bin/uname -p`
case "$UNAME_PROCESSOR" in case "$UNAME_PROCESSOR" in
@ -881,7 +902,7 @@ EOF
echo "$UNAME_MACHINE"-pc-uwin echo "$UNAME_MACHINE"-pc-uwin
exit ;; exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin echo x86_64-pc-cygwin
exit ;; exit ;;
prep*:SunOS:5.*:*) prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
@ -894,8 +915,8 @@ EOF
# other systems with GNU libc and userland # other systems with GNU libc and userland
echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
exit ;; exit ;;
i*86:Minix:*:*) *:Minix:*:*)
echo "$UNAME_MACHINE"-pc-minix echo "$UNAME_MACHINE"-unknown-minix
exit ;; exit ;;
aarch64:Linux:*:*) aarch64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@ -905,7 +926,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;; exit ;;
alpha:Linux:*:*) alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;; EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;; EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;; PCA56) UNAME_MACHINE=alphapca56 ;;
@ -922,7 +943,7 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;; exit ;;
arm*:Linux:*:*) arm*:Linux:*:*)
eval "$set_cc_for_build" set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__ | grep -q __ARM_EABI__
then then
@ -971,23 +992,51 @@ EOF
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;; exit ;;
mips:Linux:*:* | mips64:Linux:*:*) mips:Linux:*:* | mips64:Linux:*:*)
eval "$set_cc_for_build" set_cc_for_build
IS_GLIBC=0
test x"${LIBC}" = xgnu && IS_GLIBC=1
sed 's/^ //' << EOF > "$dummy.c" sed 's/^ //' << EOF > "$dummy.c"
#undef CPU #undef CPU
#undef ${UNAME_MACHINE} #undef mips
#undef ${UNAME_MACHINE}el #undef mipsel
#undef mips64
#undef mips64el
#if ${IS_GLIBC} && defined(_ABI64)
LIBCABI=gnuabi64
#else
#if ${IS_GLIBC} && defined(_ABIN32)
LIBCABI=gnuabin32
#else
LIBCABI=${LIBC}
#endif
#endif
#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa64r6
#else
#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa32r6
#else
#if defined(__mips64)
CPU=mips64
#else
CPU=mips
#endif
#endif
#endif
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el MIPS_ENDIAN=el
#else #else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE} MIPS_ENDIAN=
#else #else
CPU= MIPS_ENDIAN=
#endif #endif
#endif #endif
EOF EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;; ;;
mips64el:Linux:*:*) mips64el:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@ -1046,7 +1095,17 @@ EOF
echo "$UNAME_MACHINE"-dec-linux-"$LIBC" echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;; exit ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
echo "$UNAME_MACHINE"-pc-linux-"$LIBC" set_cc_for_build
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
then
LIBCABI="$LIBC"x32
fi
fi
echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
exit ;; exit ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@ -1100,7 +1159,7 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;; *Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac esac
echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
exit ;; exit ;;
i*86:*:3.2:*) i*86:*:3.2:*)
if test -f /usr/options/cb.name; then if test -f /usr/options/cb.name; then
@ -1235,7 +1294,7 @@ EOF
echo mips-sony-newsos6 echo mips-sony-newsos6
exit ;; exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then if test -d /usr/nec; then
echo mips-nec-sysv"$UNAME_RELEASE" echo mips-nec-sysv"$UNAME_RELEASE"
else else
echo mips-unknown-sysv"$UNAME_RELEASE" echo mips-unknown-sysv"$UNAME_RELEASE"
@ -1283,39 +1342,43 @@ EOF
*:Rhapsody:*:*) *:Rhapsody:*:*)
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;; exit ;;
arm64:Darwin:*:*)
echo aarch64-apple-darwin"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*) *:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown UNAME_PROCESSOR=`uname -p`
eval "$set_cc_for_build" case $UNAME_PROCESSOR in
if test "$UNAME_PROCESSOR" = unknown ; then unknown) UNAME_PROCESSOR=powerpc ;;
UNAME_PROCESSOR=powerpc esac
if command -v xcode-select > /dev/null 2> /dev/null && \
! xcode-select --print-path > /dev/null 2> /dev/null ; then
# Avoid executing cc if there is no toolchain installed as
# cc will be a stub that puts up a graphical alert
# prompting the user to install developer tools.
CC_FOR_BUILD=no_compiler_found
else
set_cc_for_build
fi fi
if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if test "$CC_FOR_BUILD" != no_compiler_found; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null
grep IS_64BIT_ARCH >/dev/null then
then case $UNAME_PROCESSOR in
case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;;
i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;; esac
esac fi
fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null
grep IS_PPC >/dev/null then
then UNAME_PROCESSOR=powerpc
UNAME_PROCESSOR=powerpc
fi
fi fi
elif test "$UNAME_PROCESSOR" = i386 ; then elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub # uname -m returns i386 or x86_64
# that puts up a graphical alert prompting to install UNAME_PROCESSOR=$UNAME_MACHINE
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi fi
echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;; exit ;;
@ -1358,6 +1421,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386 # "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86 # is converted to i386 for consistency with other x86
# operating systems. # operating systems.
# shellcheck disable=SC2154
if test "$cputype" = 386; then if test "$cputype" = 386; then
UNAME_MACHINE=i386 UNAME_MACHINE=i386
else else
@ -1414,8 +1478,148 @@ EOF
amd64:Isilon\ OneFS:*:*) amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs echo x86_64-unknown-onefs
exit ;; exit ;;
*:Unleashed:*:*)
echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
exit ;;
esac esac
# No uname command or uname output not recognized.
set_cc_for_build
cat > "$dummy.c" <<EOF
#ifdef _SEQUENT_
#include <sys/types.h>
#include <sys/utsname.h>
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include <signal.h>
#if defined(_SIZE_T_) || defined(SIGLOST)
#include <sys/utsname.h>
#endif
#endif
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
#include <sys/param.h>
#if defined (BSD)
#if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
#else
#if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#endif
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#else
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname un;
uname (&un);
printf ("vax-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname *un;
uname (&un);
printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("mips-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2 echo "$0: unable to guess system type" >&2
case "$UNAME_MACHINE:$UNAME_SYSTEM" in case "$UNAME_MACHINE:$UNAME_SYSTEM" in
@ -1438,6 +1642,12 @@ copies of config.guess and config.sub with the latest versions from:
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and and
https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
EOF
year=`echo $timestamp | sed 's,-.*,,'`
# shellcheck disable=SC2003
if test "`expr "\`date +%Y\`" - "$year"`" -lt 3 ; then
cat >&2 <<EOF
If $0 has already been updated, send the following data and any If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to information you think might be pertinent to config-patches@gnu.org to
@ -1465,6 +1675,7 @@ UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION" UNAME_VERSION = "$UNAME_VERSION"
EOF EOF
fi
exit 1 exit 1

File diff suppressed because it is too large Load Diff

13788
contrib/dialog/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
dnl $Id: configure.in,v 1.92 2018/06/18 08:59:49 tom Exp $ dnl $Id: configure.in,v 1.101 2020/11/26 16:21:27 tom Exp $
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
dnl Copyright 1999-2016,2018 -- Thomas E. Dickey dnl Copyright 1999-2019,2020 -- Thomas E. Dickey
dnl dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the dnl copy of this software and associated documentation files (the
@ -27,7 +27,7 @@ dnl holders shall not be used in advertising or otherwise to promote the
dnl sale, use or other dealings in this Software without prior written dnl sale, use or other dealings in this Software without prior written
dnl authorization. dnl authorization.
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20170501) AC_PREREQ(2.52.20200802)
AC_INIT(dialog.h) AC_INIT(dialog.h)
AC_CONFIG_HEADER(dlg_config.h:config.hin) AC_CONFIG_HEADER(dlg_config.h:config.hin)
@ -63,7 +63,8 @@ CF_XOPEN_SOURCE
CF_LARGEFILE CF_LARGEFILE
CF_WITH_INSTALL_PREFIX CF_WITH_INSTALL_PREFIX
CF_WITH_WARNINGS CF_WITH_SCREEN_PDCURSES
CF_ENABLE_WARNINGS(,yes)
CF_PKG_CONFIG CF_PKG_CONFIG
dnl dnl
@ -113,13 +114,12 @@ CF_ARG_MSG_ENABLE([if you want --trace option],
[EXTRAOBJS="$EXTRAOBJS trace\$o" [EXTRAOBJS="$EXTRAOBJS trace\$o"
AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes) AC_DEFINE(HAVE_DLG_TRACE,1,[Define to 1 to support --trace option])],,yes)
CF_ENABLE_RPATH
CF_LD_RPATH_OPT CF_LD_RPATH_OPT
CF_WITH_SHARED_OR_LIBTOOL(DIALOG,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`) CF_WITH_SHARED_OR_LIBTOOL(DIALOG,${VERSION_MAJOR}.${VERSION_MINOR},`echo "$VERSION" |sed -e 's/:/./g'`)
CF_WITH_CURSES_DIR CF_WITH_CURSES_DIR
CF_ENABLE_RPATH
CF_WITH_NCURSES_ETC CF_WITH_NCURSES_ETC
CF_WIDEC_CURSES CF_WIDEC_CURSES
@ -129,11 +129,20 @@ CF_ARG_MSG_ENABLE([if you want extra dialogs],
[ --disable-extras do not include extra dialogs], [ --disable-extras do not include extra dialogs],
[cf_all_widgets=yes],[cf_all_widgets=no],yes) [cf_all_widgets=yes],[cf_all_widgets=no],yes)
cf_use_dialogrc=yes
CF_ARG_MSG_ENABLE([if you want config-file support], CF_ARG_MSG_ENABLE([if you want config-file support],
rc-file, rc-file,
[ --disable-rc-file do not include config-file support], [ --disable-rc-file do not include config-file support],
[EXTRAOBJS="$EXTRAOBJS rc\$o" [EXTRAOBJS="$EXTRAOBJS rc\$o"
AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],,$cf_all_widgets) AC_DEFINE(HAVE_RC_FILE,1,[Define to 1 to include config-file support])],cf_use_dialogrc=no,$cf_all_widgets)
cf_use_dialogrc2=yes
if test "$cf_use_dialogrc" = yes; then
CF_ARG_MSG_ENABLE([if you want extra attributes in config-file],
rc-file2,
[ --disable-rc-file2 do not use extra attributes in config-file],
[AC_DEFINE(HAVE_RC_FILE2,1,[Define to 1 to use extra attributes in config-file])],cf_use_dialogrc2=no,$cf_all_widgets)
fi
CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs], CF_ARG_MSG_ENABLE([if you want Xdialog-style dialogs],
Xdialog, Xdialog,
@ -195,7 +204,7 @@ dnl
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_TIME AC_HEADER_TIME
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_CHECK_HEADERS(search.h stdint.h unistd.h) AC_CHECK_HEADERS(search.h stdint.h sys/param.h unistd.h)
CF_CURSES_TERM_H CF_CURSES_TERM_H
dnl dnl
@ -203,7 +212,6 @@ dnl Checks for library functions.
dnl dnl
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_FUNCS(\ AC_CHECK_FUNCS(\
_nc_free_and_exit \
btowc \ btowc \
mblen \ mblen \
mbrlen \ mbrlen \
@ -241,6 +249,8 @@ wget_wch \
wsyncup \ wsyncup \
) )
CF_CURSES_EXIT
AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])]) AC_CHECK_FUNC(start_color,[AC_DEFINE(HAVE_COLOR,1,[Define to 1 if (n)curses has start_color function])])
CF_CURSES_CHTYPE CF_CURSES_CHTYPE
CF_CURSES_WACS_SYMBOLS CF_CURSES_WACS_SYMBOLS
@ -254,9 +264,11 @@ CF_HEADERS_SH(DLG,dlg_config.h)
AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])]) AC_TRY_LINK([#include <locale.h>],[setlocale(LC_ALL, "")],[AC_DEFINE(HAVE_SETLOCALE,1,[Define to 1 if locale feature can be enabled])])
CF_NL_LANGINFO_1STDAY CF_NL_LANGINFO_1STDAY
CF_MERGE_EXTRA_CFLAGS
CF_DISABLE_RPATH_HACK CF_DISABLE_RPATH_HACK
CF__DEFINE_SHLIB_VARS CF__DEFINE_SHLIB_VARS
CF_LD_SEARCHPATH
AC_OUTPUT( AC_OUTPUT(
dialog-config dialog-config

View File

@ -1,7 +1,7 @@
#!@SHELL@ #!@SHELL@
# $Id: dialog-config.in,v 1.6 2012/10/06 14:29:45 tom Exp $ # $Id: dialog-config.in,v 1.13 2019/09/26 00:50:46 tom Exp $
############################################################################## ##############################################################################
# Copyright (c) 2007-2011,2012 Thomas E. Dickey # # Copyright (c) 2007-2012,2019 Thomas E. Dickey #
# # # #
# Permission is hereby granted, free of charge, to any person obtaining a # # Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), # # copy of this software and associated documentation files (the "Software"), #
@ -32,16 +32,79 @@ prefix="@prefix@"
exec_prefix="@exec_prefix@" exec_prefix="@exec_prefix@"
datarootdir="@datarootdir@" datarootdir="@datarootdir@"
bindir="@bindir@" same_prefix=yes
libdir="@libdir@" same_exec_prefix=yes
datadir="@datadir@"
mandir="@mandir@"
THIS="@PACKAGE@" THIS="@PACKAGE@"
test $# = 0 && exec @SHELL@ $0 --error test $# = 0 && exec @SHELL@ "$0" --error
while test $# -gt 0; do while test $# -gt 0; do
# (re)evaluate symbols that may depend upon $prefix
if [ "x$same_prefix" != "xyes" ]
then
eval exec_prefix='@exec_prefix@'
eval datarootdir='@datarootdir@'
elif [ "x$same_exec_prefix" != "xyes" ]
then
eval datarootdir='@datarootdir@'
fi
eval bindir='"@bindir@"'
eval includedir='"@includedir@"'
eval libdir='"@libdir@"'
eval datadir='"@datadir@"'
eval mandir='"@mandir@"'
[ -z "$includedir" ] && includedir="${prefix}/include"
eval LDFLAGS='"@LDFLAGS@"'
eval LIBS='"@LIBS@"'
LIBS="-l${THIS} $LIBS"
# If the directory given by --libdir is not in the LDFLAGS+LIBS set,
# prepend it to LDFLAGS to help link this application's library.
found=no
for opt in $LDFLAGS $LIBS
do
if [ "x$-L${libdir}" = "x$opt" ]
then
found=yes
break
fi
done
if [ $found = no ]
then
[ -n "$LFLAGS" ] && LDFLAGS=" $LFDLAGS"
LDFLAGS="-L${libdir}$LDFLAGS"
fi
[ -z "$LDFLAGS" ] && LDFLAGS="-L${exec_prefix}/lib"
# Ignore -L options which do not correspond to an actual directory,
# or which are standard library directories (i.e., the linker is
# supposed to search those directories).
#
# There is no portable way to find the list of standard library
# directories. Require a POSIX shell anyway, to keep this simple.
lib_flags=
for opt in $LDFLAGS $LIBS
do
case $opt in
-L*)
[ -d ${opt##-L} ] || continue
case ${opt##-L} in
@LD_SEARCHPATH@) # skip standard libdir
continue
;;
*)
;;
esac
;;
esac
lib_flags="$lib_flags $opt"
done
case "$1" in case "$1" in
-*=*) -*=*)
ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ARG=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
@ -56,30 +119,81 @@ while test $# -gt 0; do
--prefix=*) --prefix=*)
prefix="$ARG" prefix="$ARG"
test -z "$exec_prefix" && exec_prefix="$ARG" test -z "$exec_prefix" && exec_prefix="$ARG"
same_prefix=no
;; ;;
--prefix) --prefix)
echo "$prefix" echo "$prefix"
;; ;;
--exec-prefix=*) --exec-prefix=*)
exec_prefix="$ARG" exec_prefix="$ARG"
same_exec_prefix=no
;; ;;
--exec-prefix) --exec-prefix)
echo "$exec_prefix" echo "$exec_prefix"
;; ;;
# compile/link # compile/link
--cflags) --cflags|--cflags-only-I)
INCS= INCS=
if test "${prefix}/include" != /usr/include ; then if test "$includedir" != /usr/include ; then
INCS="-I${prefix}/include" INCS="-I$includedir"
fi fi
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
$INCS $INCS
ENDECHO ENDECHO
;; ;;
--cflags-only-other)
# no -D/-U options should be needed
echo
;;
--libs) --libs)
sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO OPTS=
-L${exec_prefix}/lib -l${THIS} @LIBS@ for opt in $lib_flags
ENDECHO do
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
done
printf "%s\n" "$OPTS"
;;
--libs-only-L)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-L*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf "%s\n" "$OPTS"
;;
--libs-only-l)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-l*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf "%s\n" "$OPTS"
;;
--libs-only-other)
OPTS=
for opt in $lib_flags
do
case "x$opt" in
x-[lL]*)
;;
*)
[ -n "$OPTS" ] && OPTS="$OPTS "
OPTS="${OPTS}${opt}"
;;
esac
done
printf "%s\n" "$OPTS"
;; ;;
# identification # identification
--version) --version)
@ -115,19 +229,23 @@ Options:
--cflags echos the C compiler flags needed to compile with ${THIS} --cflags echos the C compiler flags needed to compile with ${THIS}
--libs echos the libraries needed to link with ${THIS} --libs echos the libraries needed to link with ${THIS}
--libs-only-L echos -L linker options (search path) for ${THIS}
--libs-only-l echos -l linker options (libraries) for ${THIS}
--libs-only-other echos linker options other than -L/-l
--version echos the release+patchdate version of ${THIS} --version echos the release+patchdate version of ${THIS}
--abi-version echos the ABI version of ${THIS} --abi-version echos the ABI version of ${THIS}
--bindir echos the directory containing ${THIS} programs --bindir echos the directory containing ${THIS} programs
--datadir echos the directory containing ${THIS} data --datadir echos the directory containing ${THIS} data
--libdir echos the directory containing ${THIS} libraries --libdir echos the directory containing ${THIS} libraries
--mandir echos the directory containing ${THIS} manpages --mandir echos the directory containing ${THIS} manual pages
--help prints this message --help prints this message
ENDHELP ENDHELP
;; ;;
--error|*) --error|*)
@SHELL@ $0 --help 1>&2 @SHELL@ "$0" --help 1>&2
exit 1 exit 1
;; ;;
esac esac

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
/* /*
* $Id: dialog.h,v 1.283 2018/06/19 22:52:11 tom Exp $ * $Id: dialog.h,v 1.304 2021/01/17 16:58:22 tom Exp $
* *
* dialog.h -- common declarations for all dialog modules * dialog.h -- common declarations for all dialog modules
* *
* Copyright 2000-2017,2018 Thomas E. Dickey * Copyright 2000-2020,2021 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -126,14 +126,27 @@
#define USE_SHADOW TRUE #define USE_SHADOW TRUE
#define USE_COLORS TRUE #define USE_COLORS TRUE
/*
* These allow using the print-formatting code before curses is initialized.
*/
#define DLG_COLS (COLS ? COLS : dialog_state.screen_width)
#define DLG_LINES (LINES ? LINES : dialog_state.screen_height)
/*
* Define the usable size of a window, discounting the area needed for shadow.
*/
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
#define SCOLS (COLS - (dialog_state.use_shadow ? SHADOW_COLS : 0)) #define SCOLS (DLG_COLS - (dialog_state.use_shadow ? SHADOW_COLS : 0))
#define SLINES (LINES - (dialog_state.use_shadow ? SHADOW_ROWS : 0)) #define SLINES (DLG_LINES - (dialog_state.use_shadow ? SHADOW_ROWS : 0))
#else #else
#define SCOLS COLS #define SCOLS COLS
#define SLINES LINES #define SLINES LINES
#endif #endif
/*
* These are the default values for exit-codes, which can be overridden by
* environment variables, e.g., $DIALOG_CANCEL for DLG_EXIT_CANCEL.
*/
#define DLG_EXIT_ESC 255 #define DLG_EXIT_ESC 255
#define DLG_EXIT_UNKNOWN -2 /* never return this (internal use) */ #define DLG_EXIT_UNKNOWN -2 /* never return this (internal use) */
#define DLG_EXIT_ERROR -1 /* the shell sees this as 255 */ #define DLG_EXIT_ERROR -1 /* the shell sees this as 255 */
@ -142,19 +155,21 @@
#define DLG_EXIT_HELP 2 #define DLG_EXIT_HELP 2
#define DLG_EXIT_EXTRA 3 #define DLG_EXIT_EXTRA 3
#define DLG_EXIT_ITEM_HELP 4 /* actually DLG_EXIT_HELP */ #define DLG_EXIT_ITEM_HELP 4 /* actually DLG_EXIT_HELP */
#define DLG_EXIT_TIMEOUT 5
#define DLG_CTRL(n) ((n) & 0x1f) /* CTRL is preferred, but conflicts */ #define DLG_CTRL(n) ((n) & 0x1f) /* CTRL is preferred, but conflicts */
#define CHR_LEAVE DLG_CTRL('D')
#define CHR_HELP DLG_CTRL('E') #define CHR_HELP DLG_CTRL('E')
#define CHR_BACKSPACE DLG_CTRL('H') #define CHR_BACKSPACE DLG_CTRL('H')
#define CHR_REPAINT DLG_CTRL('L') #define CHR_REPAINT DLG_CTRL('L')
#define CHR_KILL DLG_CTRL('U')
#define CHR_LITERAL DLG_CTRL('V')
#define CHR_DELETE 127
#define CHR_NEXT DLG_CTRL('N') #define CHR_NEXT DLG_CTRL('N')
#define CHR_PREVIOUS DLG_CTRL('P') #define CHR_PREVIOUS DLG_CTRL('P')
#define CHR_KILL DLG_CTRL('U')
#define CHR_TRACE DLG_CTRL('T') #define CHR_TRACE DLG_CTRL('T')
#define CHR_LITERAL DLG_CTRL('V')
#define CHR_SPACE ' ' #define CHR_SPACE ' '
#define CHR_DELETE 127
#define ESC 27 #define ESC 27
#define TAB DLG_CTRL('I') #define TAB DLG_CTRL('I')
@ -179,6 +194,7 @@
/* how many spaces is a tab long (default)? */ /* how many spaces is a tab long (default)? */
#define TAB_LEN 8 #define TAB_LEN 8
#define WTIMEOUT_VAL 10 /* minimum amount of time needed for curses */ #define WTIMEOUT_VAL 10 /* minimum amount of time needed for curses */
#define WTIMEOUT_OFF -1 /* value to disable timeout */
#ifndef A_CHARTEXT #ifndef A_CHARTEXT
#define A_CHARTEXT 0xff #define A_CHARTEXT 0xff
@ -429,6 +445,7 @@ typedef struct _dlg_windows {
struct _dlg_windows *next; struct _dlg_windows *next;
WINDOW *normal; WINDOW *normal;
WINDOW *shadow; WINDOW *shadow;
int getc_timeout;
} DIALOG_WINDOWS; } DIALOG_WINDOWS;
/* /*
@ -467,6 +484,13 @@ typedef struct {
bool text_only; /* option "--print-text-only", etc. */ bool text_only; /* option "--print-text-only", etc. */
int text_height; int text_height;
int text_width; int text_width;
/* 1.3-20190211 */
int screen_height;
int screen_width;
#ifdef KEY_RESIZE
/* 1.3-20190724 */
bool had_resize; /* ERR may follow KEY_RESIZE when polling */
#endif
} DIALOG_STATE; } DIALOG_STATE;
extern DIALOG_STATE dialog_state; extern DIALOG_STATE dialog_state;
@ -552,6 +576,13 @@ typedef struct {
bool iso_week; /* option "--iso-week" */ bool iso_week; /* option "--iso-week" */
/* 1.3-20170131 */ /* 1.3-20170131 */
bool reorder; /* option "--reorder" */ bool reorder; /* option "--reorder" */
/* 1.3-20201117 */
int pause_secs; /* used by pause widget */
/* 1.3-20201126 */
bool erase_on_exit; /* option "--erase-on-exit" */
bool cursor_off_label; /* option "--cursor-off-label" */
/* 1.3-20210117 */
bool no_hot_list; /* option "--no-hot-list" */
} DIALOG_VARS; } DIALOG_VARS;
#define USE_ITEM_HELP(s) (dialog_vars.item_help && (s) != 0) #define USE_ITEM_HELP(s) (dialog_vars.item_help && (s) != 0)
@ -595,12 +626,16 @@ extern DIALOG_VARS dialog_vars;
* Table for attribute- and color-values. * Table for attribute- and color-values.
*/ */
typedef struct { typedef struct {
chtype atr; chtype atr; /* attribute corresponding to fg, bg, etc */
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
int fg; int fg; /* foreground color-number */
int bg; int bg; /* background color-number */
int hilite; int hilite; /* true if bold */
#endif #ifdef HAVE_RC_FILE2
int ul; /* true if underline */
int rv; /* true if reverse */
#endif /* HAVE_RC_FILE2 */
#endif /* HAVE_COLOR */
#ifdef HAVE_RC_FILE #ifdef HAVE_RC_FILE
const char *name; const char *name;
const char *comment; const char *comment;
@ -768,16 +803,20 @@ extern void dlg_remove_callback(DIALOG_CALLBACK * /*p*/);
extern void dlg_killall_bg(int *retval); extern void dlg_killall_bg(int *retval);
/* util.c */ /* util.c */
extern DIALOG_WINDOWS * _dlg_find_window(WINDOW * /* win */);
extern WINDOW * dlg_der_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern WINDOW * dlg_new_modal_window(WINDOW * /*parent*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/); extern WINDOW * dlg_new_modal_window(WINDOW * /*parent*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern WINDOW * dlg_new_window(int /*height*/, int /*width*/, int /*y*/, int /*x*/); extern WINDOW * dlg_new_window(int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern WINDOW * dlg_sub_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/); extern WINDOW * dlg_sub_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern bool dlg_need_separator(void); extern bool dlg_need_separator(void);
extern char * dlg_getenv_str(const char * /*name*/);
extern char * dlg_set_result(const char * /*string*/); extern char * dlg_set_result(const char * /*string*/);
extern char * dlg_strclone(const char * /*cprompt*/); extern char * dlg_strclone(const char * /*cprompt*/);
extern char * dlg_strempty(void); extern char * dlg_strempty(void);
extern chtype dlg_asciibox(chtype /*ch*/); extern chtype dlg_asciibox(chtype /*ch*/);
extern chtype dlg_boxchar(chtype /*ch*/); extern chtype dlg_boxchar(chtype /*ch*/);
extern chtype dlg_get_attrs(WINDOW * /*win*/); extern chtype dlg_get_attrs(WINDOW * /*win*/);
extern const char * dlg_exitcode2s(int /*code*/);
extern const char * dlg_print_line(WINDOW * /*win*/, chtype * /*attr*/, const char * /*prompt*/, int /*lm*/, int /*rm*/, int * /*x*/); extern const char * dlg_print_line(WINDOW * /*win*/, chtype * /*attr*/, const char * /*prompt*/, int /*lm*/, int /*rm*/, int * /*x*/);
extern int dlg_box_x_ordinate(int /*width*/); extern int dlg_box_x_ordinate(int /*width*/);
extern int dlg_box_y_ordinate(int /*height*/); extern int dlg_box_y_ordinate(int /*height*/);
@ -789,8 +828,11 @@ extern int dlg_default_item(char ** /*items*/, int /*llen*/);
extern int dlg_default_listitem(DIALOG_LISTITEM * /*items*/); extern int dlg_default_listitem(DIALOG_LISTITEM * /*items*/);
extern int dlg_defaultno_button(void); extern int dlg_defaultno_button(void);
extern int dlg_default_button(void); extern int dlg_default_button(void);
extern int dlg_exitname2n(const char * /*name*/);
extern int dlg_getenv_num(const char * /*name*/, int * /* value */);
extern int dlg_max_input(int /*max_len*/); extern int dlg_max_input(int /*max_len*/);
extern int dlg_print_scrolled(WINDOW * /* win */, const char * /* prompt */, int /* offset */, int /* height */, int /* width */, int /* pauseopt */); extern int dlg_print_scrolled(WINDOW * /* win */, const char * /* prompt */, int /* offset */, int /* height */, int /* width */, int /* pauseopt */);
extern int dlg_set_timeout(WINDOW * /* win */, bool /* will_getc */);
extern void dlg_add_help_formitem(int * /* result */, char ** /* tag */, DIALOG_FORMITEM * /* item */); extern void dlg_add_help_formitem(int * /* result */, char ** /* tag */, DIALOG_FORMITEM * /* item */);
extern void dlg_add_help_listitem(int * /* result */, char ** /* tag */, DIALOG_LISTITEM * /* item */); extern void dlg_add_help_listitem(int * /* result */, char ** /* tag */, DIALOG_LISTITEM * /* item */);
extern void dlg_add_quoted(char * /*string*/); extern void dlg_add_quoted(char * /*string*/);
@ -814,11 +856,13 @@ extern void dlg_draw_box2(WINDOW * /*win*/, int /*y*/, int /*x*/, int /*height*/
extern void dlg_draw_title(WINDOW *win, const char *title); extern void dlg_draw_title(WINDOW *win, const char *title);
extern void dlg_exit(int /*code*/) GCC_NORETURN; extern void dlg_exit(int /*code*/) GCC_NORETURN;
extern void dlg_item_help(const char * /*txt*/); extern void dlg_item_help(const char * /*txt*/);
extern void dlg_keep_tite(FILE * /*output */);
extern void dlg_print_autowrap(WINDOW * /*win*/, const char * /*prompt*/, int /*height*/, int /*width*/); extern void dlg_print_autowrap(WINDOW * /*win*/, const char * /*prompt*/, int /*height*/, int /*width*/);
extern void dlg_print_listitem(WINDOW * /*win*/, const char * /*text*/, int /*climit*/, bool /*first*/, int /*selected*/); extern void dlg_print_listitem(WINDOW * /*win*/, const char * /*text*/, int /*climit*/, bool /*first*/, int /*selected*/);
extern void dlg_print_size(int /*height*/, int /*width*/); extern void dlg_print_size(int /*height*/, int /*width*/);
extern void dlg_print_text(WINDOW * /*win*/, const char * /*txt*/, int /*len*/, chtype * /*attr*/); extern void dlg_print_text(WINDOW * /*win*/, const char * /*txt*/, int /*len*/, chtype * /*attr*/);
extern void dlg_put_backtitle(void); extern void dlg_put_backtitle(void);
extern void dlg_reset_timeout(WINDOW * /* win */);
extern void dlg_restore_vars(DIALOG_VARS * /* save */); extern void dlg_restore_vars(DIALOG_VARS * /* save */);
extern void dlg_save_vars(DIALOG_VARS * /* save */); extern void dlg_save_vars(DIALOG_VARS * /* save */);
extern void dlg_set_focus(WINDOW * /*parent*/, WINDOW * /*win*/); extern void dlg_set_focus(WINDOW * /*parent*/, WINDOW * /*win*/);
@ -845,6 +889,7 @@ extern int dlg_strcmp(const char * /*a*/, const char * /*b*/);
#ifdef HAVE_DLG_TRACE #ifdef HAVE_DLG_TRACE
#define DLG_TRACE(params) dlg_trace_msg params #define DLG_TRACE(params) dlg_trace_msg params
extern void dlg_trace_msg(const char *fmt, ...) GCC_PRINTFLIKE(1,2); extern void dlg_trace_msg(const char *fmt, ...) GCC_PRINTFLIKE(1,2);
extern void dlg_trace_va_msg(const char *fmt, va_list ap);
#define DLG_TRACE2S(name,value) dlg_trace_2s (name,value) #define DLG_TRACE2S(name,value) dlg_trace_2s (name,value)
#define DLG_TRACE2N(name,value) dlg_trace_2n (name,value) #define DLG_TRACE2N(name,value) dlg_trace_2n (name,value)
extern void dlg_trace_2s(const char * /*name*/, const char * /*value*/); extern void dlg_trace_2s(const char * /*name*/, const char * /*value*/);
@ -856,12 +901,14 @@ extern void dlg_trace(const char * /*fname*/);
#define DLG_TRACE(params) /* nothing */ #define DLG_TRACE(params) /* nothing */
#define DLG_TRACE2S(name,value) /* nothing */ #define DLG_TRACE2S(name,value) /* nothing */
#define DLG_TRACE2N(name,value) /* nothing */ #define DLG_TRACE2N(name,value) /* nothing */
#define dlg_trace_va_msg(fmt, ap) /* nothing */
#define dlg_trace_win(win) /* nothing */ #define dlg_trace_win(win) /* nothing */
#define dlg_trace_chr(ch,fkey) /* nothing */ #define dlg_trace_chr(ch,fkey) /* nothing */
#define dlg_trace(fname) /* nothing */ #define dlg_trace(fname) /* nothing */
#endif #endif
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
extern void _dlg_resize_cleanup(WINDOW * /*win*/);
extern void dlg_move_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/); extern void dlg_move_window(WINDOW * /*win*/, int /*height*/, int /*width*/, int /*y*/, int /*x*/);
extern void dlg_will_resize(WINDOW * /*win*/); extern void dlg_will_resize(WINDOW * /*win*/);
#endif #endif
@ -937,10 +984,15 @@ extern int dlg_mouse_wgetch_nowait (WINDOW * /*win*/, int * /*fkey*/);
*/ */
#ifdef NO_LEAKS #ifdef NO_LEAKS
extern void _dlg_inputstr_leaks(void); extern void _dlg_inputstr_leaks(void);
#if defined(NCURSES_VERSION) && defined(HAVE__NC_FREE_AND_EXIT) #if defined(NCURSES_VERSION)
#if defined(HAVE_CURSES_EXIT)
/* just use curses_exit() */
#elif defined(HAVE__NC_FREE_AND_EXIT)
extern void _nc_free_and_exit(int); /* nc_alloc.h normally not installed */ extern void _nc_free_and_exit(int); /* nc_alloc.h normally not installed */
#define curses_exit(code) _nc_free_and_exit(code)
#endif #endif
#endif #endif /* NCURSES_VERSION */
#endif /* NO_LEAKS */
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -1,9 +1,9 @@
/* /*
* $Id: dlg_colors.h,v 1.17 2011/10/14 21:19:59 tom Exp $ * $Id: dlg_colors.h,v 1.18 2019/09/23 09:14:30 tom Exp $
* *
* colors.h -- color attribute definitions * colors.h -- color attribute definitions
* *
* Copyright 2000-2007,2011 Thomas E. Dickey * Copyright 2000-2011,2019 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -35,158 +35,236 @@
* DLGC_FG_xxx = foreground for "xxx" * DLGC_FG_xxx = foreground for "xxx"
* DLGC_BG_xxx = background for "xxx" * DLGC_BG_xxx = background for "xxx"
* DLGC_HL_xxx = highlight for "xxx" * DLGC_HL_xxx = highlight for "xxx"
* DLGC_UL_xxx = underline for "xxx"
* DLGC_RV_xxx = reverse for "xxx"
*/ */
#define DLGC_FG_SCREEN COLOR_CYAN #define DLGC_FG_SCREEN COLOR_CYAN
#define DLGC_BG_SCREEN COLOR_BLUE #define DLGC_BG_SCREEN COLOR_BLUE
#define DLGC_HL_SCREEN TRUE #define DLGC_HL_SCREEN TRUE
#define DLGC_UL_SCREEN FALSE
#define DLGC_RV_SCREEN FALSE
#define DLGC_FG_SHADOW COLOR_BLACK #define DLGC_FG_SHADOW COLOR_BLACK
#define DLGC_BG_SHADOW COLOR_BLACK #define DLGC_BG_SHADOW COLOR_BLACK
#define DLGC_HL_SHADOW TRUE #define DLGC_HL_SHADOW TRUE
#define DLGC_UL_SHADOW FALSE
#define DLGC_RV_SHADOW FALSE
#define DLGC_FG_DIALOG COLOR_BLACK #define DLGC_FG_DIALOG COLOR_BLACK
#define DLGC_BG_DIALOG COLOR_WHITE #define DLGC_BG_DIALOG COLOR_WHITE
#define DLGC_HL_DIALOG FALSE #define DLGC_HL_DIALOG FALSE
#define DLGC_UL_DIALOG FALSE
#define DLGC_RV_DIALOG FALSE
#define DLGC_FG_TITLE COLOR_BLUE #define DLGC_FG_TITLE COLOR_BLUE
#define DLGC_BG_TITLE COLOR_WHITE #define DLGC_BG_TITLE COLOR_WHITE
#define DLGC_HL_TITLE TRUE #define DLGC_HL_TITLE TRUE
#define DLGC_UL_TITLE FALSE
#define DLGC_RV_TITLE FALSE
#define DLGC_FG_BORDER COLOR_WHITE #define DLGC_FG_BORDER COLOR_WHITE
#define DLGC_BG_BORDER COLOR_WHITE #define DLGC_BG_BORDER COLOR_WHITE
#define DLGC_HL_BORDER TRUE #define DLGC_HL_BORDER TRUE
#define DLGC_UL_BORDER FALSE
#define DLGC_RV_BORDER FALSE
#define DLGC_FG_BORDER2 DLGC_FG_DIALOG #define DLGC_FG_BORDER2 DLGC_FG_DIALOG
#define DLGC_BG_BORDER2 DLGC_BG_DIALOG #define DLGC_BG_BORDER2 DLGC_BG_DIALOG
#define DLGC_HL_BORDER2 DLGC_HL_DIALOG #define DLGC_HL_BORDER2 DLGC_HL_DIALOG
#define DLGC_UL_BORDER2 FALSE
#define DLGC_RV_BORDER2 FALSE
#define DLGC_FG_BUTTON_ACTIVE COLOR_WHITE #define DLGC_FG_BUTTON_ACTIVE COLOR_WHITE
#define DLGC_BG_BUTTON_ACTIVE COLOR_BLUE #define DLGC_BG_BUTTON_ACTIVE COLOR_BLUE
#define DLGC_HL_BUTTON_ACTIVE TRUE #define DLGC_HL_BUTTON_ACTIVE TRUE
#define DLGC_UL_BUTTON_ACTIVE FALSE
#define DLGC_RV_BUTTON_ACTIVE FALSE
#define DLGC_FG_BUTTON_INACTIVE COLOR_BLACK #define DLGC_FG_BUTTON_INACTIVE COLOR_BLACK
#define DLGC_BG_BUTTON_INACTIVE COLOR_WHITE #define DLGC_BG_BUTTON_INACTIVE COLOR_WHITE
#define DLGC_HL_BUTTON_INACTIVE FALSE #define DLGC_HL_BUTTON_INACTIVE FALSE
#define DLGC_UL_BUTTON_INACTIVE FALSE
#define DLGC_RV_BUTTON_INACTIVE FALSE
#define DLGC_FG_BUTTON_KEY_ACTIVE COLOR_WHITE #define DLGC_FG_BUTTON_KEY_ACTIVE COLOR_WHITE
#define DLGC_BG_BUTTON_KEY_ACTIVE COLOR_BLUE #define DLGC_BG_BUTTON_KEY_ACTIVE COLOR_BLUE
#define DLGC_HL_BUTTON_KEY_ACTIVE TRUE #define DLGC_HL_BUTTON_KEY_ACTIVE TRUE
#define DLGC_UL_BUTTON_KEY_ACTIVE FALSE
#define DLGC_RV_BUTTON_KEY_ACTIVE FALSE
#define DLGC_FG_BUTTON_KEY_INACTIVE COLOR_RED #define DLGC_FG_BUTTON_KEY_INACTIVE COLOR_RED
#define DLGC_BG_BUTTON_KEY_INACTIVE COLOR_WHITE #define DLGC_BG_BUTTON_KEY_INACTIVE COLOR_WHITE
#define DLGC_HL_BUTTON_KEY_INACTIVE FALSE #define DLGC_HL_BUTTON_KEY_INACTIVE FALSE
#define DLGC_UL_BUTTON_KEY_INACTIVE FALSE
#define DLGC_RV_BUTTON_KEY_INACTIVE FALSE
#define DLGC_FG_BUTTON_LABEL_ACTIVE COLOR_YELLOW #define DLGC_FG_BUTTON_LABEL_ACTIVE COLOR_YELLOW
#define DLGC_BG_BUTTON_LABEL_ACTIVE COLOR_BLUE #define DLGC_BG_BUTTON_LABEL_ACTIVE COLOR_BLUE
#define DLGC_HL_BUTTON_LABEL_ACTIVE TRUE #define DLGC_HL_BUTTON_LABEL_ACTIVE TRUE
#define DLGC_UL_BUTTON_LABEL_ACTIVE FALSE
#define DLGC_RV_BUTTON_LABEL_ACTIVE FALSE
#define DLGC_FG_BUTTON_LABEL_INACTIVE COLOR_BLACK #define DLGC_FG_BUTTON_LABEL_INACTIVE COLOR_BLACK
#define DLGC_BG_BUTTON_LABEL_INACTIVE COLOR_WHITE #define DLGC_BG_BUTTON_LABEL_INACTIVE COLOR_WHITE
#define DLGC_HL_BUTTON_LABEL_INACTIVE TRUE #define DLGC_HL_BUTTON_LABEL_INACTIVE TRUE
#define DLGC_UL_BUTTON_LABEL_INACTIVE FALSE
#define DLGC_RV_BUTTON_LABEL_INACTIVE FALSE
#define DLGC_FG_FORM_ITEM_READONLY COLOR_CYAN #define DLGC_FG_FORM_ITEM_READONLY COLOR_CYAN
#define DLGC_BG_FORM_ITEM_READONLY COLOR_WHITE #define DLGC_BG_FORM_ITEM_READONLY COLOR_WHITE
#define DLGC_HL_FORM_ITEM_READONLY TRUE #define DLGC_HL_FORM_ITEM_READONLY TRUE
#define DLGC_UL_FORM_ITEM_READONLY FALSE
#define DLGC_RV_FORM_ITEM_READONLY FALSE
#define DLGC_FG_INPUTBOX COLOR_BLACK #define DLGC_FG_INPUTBOX COLOR_BLACK
#define DLGC_BG_INPUTBOX COLOR_WHITE #define DLGC_BG_INPUTBOX COLOR_WHITE
#define DLGC_HL_INPUTBOX FALSE #define DLGC_HL_INPUTBOX FALSE
#define DLGC_UL_INPUTBOX FALSE
#define DLGC_RV_INPUTBOX FALSE
#define DLGC_FG_INPUTBOX_BORDER COLOR_BLACK #define DLGC_FG_INPUTBOX_BORDER COLOR_BLACK
#define DLGC_BG_INPUTBOX_BORDER COLOR_WHITE #define DLGC_BG_INPUTBOX_BORDER COLOR_WHITE
#define DLGC_HL_INPUTBOX_BORDER FALSE #define DLGC_HL_INPUTBOX_BORDER FALSE
#define DLGC_UL_INPUTBOX_BORDER FALSE
#define DLGC_RV_INPUTBOX_BORDER FALSE
#define DLGC_FG_INPUTBOX_BORDER2 DLGC_FG_INPUTBOX #define DLGC_FG_INPUTBOX_BORDER2 DLGC_FG_INPUTBOX
#define DLGC_BG_INPUTBOX_BORDER2 DLGC_BG_INPUTBOX #define DLGC_BG_INPUTBOX_BORDER2 DLGC_BG_INPUTBOX
#define DLGC_HL_INPUTBOX_BORDER2 DLGC_HL_INPUTBOX #define DLGC_HL_INPUTBOX_BORDER2 DLGC_HL_INPUTBOX
#define DLGC_UL_INPUTBOX_BORDER2 FALSE
#define DLGC_RV_INPUTBOX_BORDER2 FALSE
#define DLGC_FG_SEARCHBOX COLOR_BLACK #define DLGC_FG_SEARCHBOX COLOR_BLACK
#define DLGC_BG_SEARCHBOX COLOR_WHITE #define DLGC_BG_SEARCHBOX COLOR_WHITE
#define DLGC_HL_SEARCHBOX FALSE #define DLGC_HL_SEARCHBOX FALSE
#define DLGC_UL_SEARCHBOX FALSE
#define DLGC_RV_SEARCHBOX FALSE
#define DLGC_FG_SEARCHBOX_TITLE COLOR_BLUE #define DLGC_FG_SEARCHBOX_TITLE COLOR_BLUE
#define DLGC_BG_SEARCHBOX_TITLE COLOR_WHITE #define DLGC_BG_SEARCHBOX_TITLE COLOR_WHITE
#define DLGC_HL_SEARCHBOX_TITLE TRUE #define DLGC_HL_SEARCHBOX_TITLE TRUE
#define DLGC_UL_SEARCHBOX_TITLE FALSE
#define DLGC_RV_SEARCHBOX_TITLE FALSE
#define DLGC_FG_SEARCHBOX_BORDER COLOR_WHITE #define DLGC_FG_SEARCHBOX_BORDER COLOR_WHITE
#define DLGC_BG_SEARCHBOX_BORDER COLOR_WHITE #define DLGC_BG_SEARCHBOX_BORDER COLOR_WHITE
#define DLGC_HL_SEARCHBOX_BORDER TRUE #define DLGC_HL_SEARCHBOX_BORDER TRUE
#define DLGC_UL_SEARCHBOX_BORDER FALSE
#define DLGC_RV_SEARCHBOX_BORDER FALSE
#define DLGC_FG_SEARCHBOX_BORDER2 DLGC_FG_SEARCHBOX #define DLGC_FG_SEARCHBOX_BORDER2 DLGC_FG_SEARCHBOX
#define DLGC_BG_SEARCHBOX_BORDER2 DLGC_BG_SEARCHBOX #define DLGC_BG_SEARCHBOX_BORDER2 DLGC_BG_SEARCHBOX
#define DLGC_HL_SEARCHBOX_BORDER2 DLGC_HL_SEARCHBOX #define DLGC_HL_SEARCHBOX_BORDER2 DLGC_HL_SEARCHBOX
#define DLGC_UL_SEARCHBOX_BORDER2 FALSE
#define DLGC_RV_SEARCHBOX_BORDER2 FALSE
#define DLGC_FG_POSITION_INDICATOR COLOR_BLUE #define DLGC_FG_POSITION_INDICATOR COLOR_BLUE
#define DLGC_BG_POSITION_INDICATOR COLOR_WHITE #define DLGC_BG_POSITION_INDICATOR COLOR_WHITE
#define DLGC_HL_POSITION_INDICATOR TRUE #define DLGC_HL_POSITION_INDICATOR TRUE
#define DLGC_UL_POSITION_INDICATOR FALSE
#define DLGC_RV_POSITION_INDICATOR FALSE
#define DLGC_FG_MENUBOX COLOR_BLACK #define DLGC_FG_MENUBOX COLOR_BLACK
#define DLGC_BG_MENUBOX COLOR_WHITE #define DLGC_BG_MENUBOX COLOR_WHITE
#define DLGC_HL_MENUBOX FALSE #define DLGC_HL_MENUBOX FALSE
#define DLGC_UL_MENUBOX FALSE
#define DLGC_RV_MENUBOX FALSE
#define DLGC_FG_MENUBOX_BORDER COLOR_WHITE #define DLGC_FG_MENUBOX_BORDER COLOR_WHITE
#define DLGC_BG_MENUBOX_BORDER COLOR_WHITE #define DLGC_BG_MENUBOX_BORDER COLOR_WHITE
#define DLGC_HL_MENUBOX_BORDER TRUE #define DLGC_HL_MENUBOX_BORDER TRUE
#define DLGC_UL_MENUBOX_BORDER FALSE
#define DLGC_RV_MENUBOX_BORDER FALSE
#define DLGC_FG_MENUBOX_BORDER2 DLGC_FG_MENUBOX #define DLGC_FG_MENUBOX_BORDER2 DLGC_FG_MENUBOX
#define DLGC_BG_MENUBOX_BORDER2 DLGC_BG_MENUBOX #define DLGC_BG_MENUBOX_BORDER2 DLGC_BG_MENUBOX
#define DLGC_HL_MENUBOX_BORDER2 DLGC_HL_MENUBOX #define DLGC_HL_MENUBOX_BORDER2 DLGC_HL_MENUBOX
#define DLGC_UL_MENUBOX_BORDER2 FALSE
#define DLGC_RV_MENUBOX_BORDER2 FALSE
#define DLGC_FG_ITEM COLOR_BLACK #define DLGC_FG_ITEM COLOR_BLACK
#define DLGC_BG_ITEM COLOR_WHITE #define DLGC_BG_ITEM COLOR_WHITE
#define DLGC_HL_ITEM FALSE #define DLGC_HL_ITEM FALSE
#define DLGC_UL_ITEM FALSE
#define DLGC_RV_ITEM FALSE
#define DLGC_FG_ITEM_SELECTED COLOR_WHITE #define DLGC_FG_ITEM_SELECTED COLOR_WHITE
#define DLGC_BG_ITEM_SELECTED COLOR_BLUE #define DLGC_BG_ITEM_SELECTED COLOR_BLUE
#define DLGC_HL_ITEM_SELECTED TRUE #define DLGC_HL_ITEM_SELECTED TRUE
#define DLGC_UL_ITEM_SELECTED FALSE
#define DLGC_RV_ITEM_SELECTED FALSE
#define DLGC_FG_TAG COLOR_BLUE #define DLGC_FG_TAG COLOR_BLUE
#define DLGC_BG_TAG COLOR_WHITE #define DLGC_BG_TAG COLOR_WHITE
#define DLGC_HL_TAG TRUE #define DLGC_HL_TAG TRUE
#define DLGC_UL_TAG FALSE
#define DLGC_RV_TAG FALSE
#define DLGC_FG_TAG_SELECTED COLOR_YELLOW #define DLGC_FG_TAG_SELECTED COLOR_YELLOW
#define DLGC_BG_TAG_SELECTED COLOR_BLUE #define DLGC_BG_TAG_SELECTED COLOR_BLUE
#define DLGC_HL_TAG_SELECTED TRUE #define DLGC_HL_TAG_SELECTED TRUE
#define DLGC_UL_TAG_SELECTED FALSE
#define DLGC_RV_TAG_SELECTED FALSE
#define DLGC_FG_TAG_KEY COLOR_RED #define DLGC_FG_TAG_KEY COLOR_RED
#define DLGC_BG_TAG_KEY COLOR_WHITE #define DLGC_BG_TAG_KEY COLOR_WHITE
#define DLGC_HL_TAG_KEY FALSE #define DLGC_HL_TAG_KEY FALSE
#define DLGC_UL_TAG_KEY FALSE
#define DLGC_RV_TAG_KEY FALSE
#define DLGC_FG_TAG_KEY_SELECTED COLOR_RED #define DLGC_FG_TAG_KEY_SELECTED COLOR_RED
#define DLGC_BG_TAG_KEY_SELECTED COLOR_BLUE #define DLGC_BG_TAG_KEY_SELECTED COLOR_BLUE
#define DLGC_HL_TAG_KEY_SELECTED TRUE #define DLGC_HL_TAG_KEY_SELECTED TRUE
#define DLGC_UL_TAG_KEY_SELECTED FALSE
#define DLGC_RV_TAG_KEY_SELECTED FALSE
#define DLGC_FG_CHECK COLOR_BLACK #define DLGC_FG_CHECK COLOR_BLACK
#define DLGC_BG_CHECK COLOR_WHITE #define DLGC_BG_CHECK COLOR_WHITE
#define DLGC_HL_CHECK FALSE #define DLGC_HL_CHECK FALSE
#define DLGC_UL_CHECK FALSE
#define DLGC_RV_CHECK FALSE
#define DLGC_FG_CHECK_SELECTED COLOR_WHITE #define DLGC_FG_CHECK_SELECTED COLOR_WHITE
#define DLGC_BG_CHECK_SELECTED COLOR_BLUE #define DLGC_BG_CHECK_SELECTED COLOR_BLUE
#define DLGC_HL_CHECK_SELECTED TRUE #define DLGC_HL_CHECK_SELECTED TRUE
#define DLGC_UL_CHECK_SELECTED FALSE
#define DLGC_RV_CHECK_SELECTED FALSE
#define DLGC_FG_UARROW COLOR_GREEN #define DLGC_FG_UARROW COLOR_GREEN
#define DLGC_BG_UARROW COLOR_WHITE #define DLGC_BG_UARROW COLOR_WHITE
#define DLGC_HL_UARROW TRUE #define DLGC_HL_UARROW TRUE
#define DLGC_UL_UARROW FALSE
#define DLGC_RV_UARROW FALSE
#define DLGC_FG_DARROW COLOR_GREEN #define DLGC_FG_DARROW COLOR_GREEN
#define DLGC_BG_DARROW COLOR_WHITE #define DLGC_BG_DARROW COLOR_WHITE
#define DLGC_HL_DARROW TRUE #define DLGC_HL_DARROW TRUE
#define DLGC_UL_DARROW FALSE
#define DLGC_RV_DARROW FALSE
#define DLGC_FG_ITEMHELP COLOR_WHITE #define DLGC_FG_ITEMHELP COLOR_WHITE
#define DLGC_BG_ITEMHELP COLOR_BLACK #define DLGC_BG_ITEMHELP COLOR_BLACK
#define DLGC_HL_ITEMHELP FALSE #define DLGC_HL_ITEMHELP FALSE
#define DLGC_UL_ITEMHELP FALSE
#define DLGC_RV_ITEMHELP FALSE
#define DLGC_FG_FORM_ACTIVE_TEXT COLOR_WHITE #define DLGC_FG_FORM_ACTIVE_TEXT COLOR_WHITE
#define DLGC_BG_FORM_ACTIVE_TEXT COLOR_BLUE #define DLGC_BG_FORM_ACTIVE_TEXT COLOR_BLUE
#define DLGC_HL_FORM_ACTIVE_TEXT TRUE #define DLGC_HL_FORM_ACTIVE_TEXT TRUE
#define DLGC_UL_FORM_ACTIVE_TEXT FALSE
#define DLGC_RV_FORM_ACTIVE_TEXT FALSE
#define DLGC_FG_FORM_TEXT COLOR_WHITE #define DLGC_FG_FORM_TEXT COLOR_WHITE
#define DLGC_BG_FORM_TEXT COLOR_CYAN #define DLGC_BG_FORM_TEXT COLOR_CYAN
#define DLGC_HL_FORM_TEXT TRUE #define DLGC_HL_FORM_TEXT TRUE
#define DLGC_UL_FORM_TEXT FALSE
#define DLGC_RV_FORM_TEXT FALSE
#define DLGC_FG_GAUGE COLOR_BLUE #define DLGC_FG_GAUGE COLOR_BLUE
#define DLGC_BG_GAUGE COLOR_WHITE #define DLGC_BG_GAUGE COLOR_WHITE
#define DLGC_HL_GAUGE TRUE #define DLGC_HL_GAUGE TRUE
#define DLGC_UL_GAUGE FALSE
#define DLGC_RV_GAUGE FALSE
/* End of default color definitions */ /* End of default color definitions */

View File

@ -0,0 +1,47 @@
/*
* $Id: dlg_internals.h,v 1.3 2019/08/08 21:29:41 tom Exp $
*
* dlg_internals.h -- runtime binding support for dialog
*
* Copyright 2019 Thomas E. Dickey
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to
* Free Software Foundation, Inc.
* 51 Franklin St., Fifth Floor
* Boston, MA 02110, USA.
*/
#ifndef DLG_INTERNALS_H_included
#define DLG_INTERNALS_H_included 1
#include <dialog.h>
#define TableSize(name) (sizeof(name)/sizeof((name)[0]))
/* *INDENT-OFF* */
#define resizeit(name, NAME) \
name = ((NAME >= old_##NAME) \
? (NAME - (old_##NAME - old_##name)) \
: old_##name)
#define AddLastKey() \
if (dialog_vars.last_key) { \
if (dlg_need_separator()) \
dlg_add_separator(); \
dlg_add_last_key(-1); \
}
/* *INDENT-ON* */
#endif /* DLG_INTERNALS_H_included */

View File

@ -1,9 +1,9 @@
/* /*
* $Id: dlg_keys.c,v 1.45 2018/05/28 17:27:10 tom Exp $ * $Id: dlg_keys.c,v 1.58 2020/11/26 17:11:56 Glenn.Herteg Exp $
* *
* dlg_keys.c -- runtime binding support for dialog * dlg_keys.c -- runtime binding support for dialog
* *
* Copyright 2006-2017,2018 Thomas E. Dickey * Copyright 2006-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -23,12 +23,12 @@
#include <dialog.h> #include <dialog.h>
#include <dlg_keys.h> #include <dlg_keys.h>
#include <dlg_internals.h>
#define LIST_BINDINGS struct _list_bindings #define LIST_BINDINGS struct _list_bindings
#define CHR_BACKSLASH '\\' #define CHR_BACKSLASH '\\'
#define IsOctal(ch) ((ch) >= '0' && (ch) <= '7') #define IsOctal(ch) ((ch) >= '0' && (ch) <= '7')
#define TableSize(name) (sizeof(name)/sizeof(name[0]))
LIST_BINDINGS { LIST_BINDINGS {
LIST_BINDINGS *link; LIST_BINDINGS *link;
@ -129,6 +129,10 @@ dlg_register_buttons(WINDOW *win, const char *name, const char **buttons)
for (n = 0; buttons[n] != 0; ++n) { for (n = 0; buttons[n] != 0; ++n) {
int curses_key = dlg_button_to_char(buttons[n]); int curses_key = dlg_button_to_char(buttons[n]);
/* ignore binding if there is no key to bind */
if (curses_key < 0)
continue;
/* ignore multibyte characters */ /* ignore multibyte characters */
if (curses_key >= KEY_MIN) if (curses_key >= KEY_MIN)
continue; continue;
@ -274,12 +278,26 @@ dlg_result_key(int dialog_key, int fkey GCC_UNUSED, int *resultp)
{ {
int done = FALSE; int done = FALSE;
DLG_TRACE(("# dlg_result_key(dialog_key=%d, fkey=%d)\n", dialog_key, fkey));
#ifdef KEY_RESIZE
if (dialog_state.had_resize) {
if (dialog_key == ERR) {
dialog_key = 0;
} else {
dialog_state.had_resize = FALSE;
}
} else if (fkey && dialog_key == KEY_RESIZE) {
dialog_state.had_resize = TRUE;
}
#endif
#ifdef HAVE_RC_FILE #ifdef HAVE_RC_FILE
if (fkey) { if (fkey) {
switch ((DLG_KEYS_ENUM) dialog_key) { switch ((DLG_KEYS_ENUM) dialog_key) {
case DLGK_OK: case DLGK_OK:
*resultp = DLG_EXIT_OK; if (!dialog_vars.nook) {
done = TRUE; *resultp = DLG_EXIT_OK;
done = TRUE;
}
break; break;
case DLGK_CANCEL: case DLGK_CANCEL:
if (!dialog_vars.nocancel) { if (!dialog_vars.nocancel) {
@ -319,6 +337,70 @@ dlg_result_key(int dialog_key, int fkey GCC_UNUSED, int *resultp)
return done; return done;
} }
/*
* If a key was bound to one of the button-codes in dlg_result_key(), fake
* a button-value and an "Enter" key to cause the calling widget to return
* the corresponding status.
*
* See dlg_ok_buttoncode(), which maps settings for ok/extra/help and button
* number into exit-code.
*/
int
dlg_button_key(int exit_code, int *button, int *dialog_key, int *fkey)
{
int changed = FALSE;
switch (exit_code) {
case DLG_EXIT_OK:
if (!dialog_vars.nook) {
*button = 0;
changed = TRUE;
}
break;
case DLG_EXIT_EXTRA:
if (dialog_vars.extra_button) {
*button = dialog_vars.nook ? 0 : 1;
changed = TRUE;
}
break;
case DLG_EXIT_CANCEL:
if (!dialog_vars.nocancel) {
*button = dialog_vars.nook ? 1 : 2;
changed = TRUE;
}
break;
case DLG_EXIT_HELP:
if (dialog_vars.help_button) {
int cancel = dialog_vars.nocancel ? 0 : 1;
int extra = dialog_vars.extra_button ? 1 : 0;
int okay = dialog_vars.nook ? 0 : 1;
*button = okay + extra + cancel;
changed = TRUE;
}
break;
}
if (changed) {
DLG_TRACE(("# dlg_button_key(%d:%s) button %d\n",
exit_code, dlg_exitcode2s(exit_code), *button));
*dialog_key = *fkey = DLGK_ENTER;
}
return changed;
}
int
dlg_ok_button_key(int exit_code, int *button, int *dialog_key, int *fkey)
{
int result;
DIALOG_VARS save;
dlg_save_vars(&save);
dialog_vars.nocancel = TRUE;
result = dlg_button_key(exit_code, button, dialog_key, fkey);
dlg_restore_vars(&save);
return result;
}
#ifdef HAVE_RC_FILE #ifdef HAVE_RC_FILE
typedef struct { typedef struct {
const char *name; const char *name;
@ -463,7 +545,8 @@ static const CODENAME dialog_names[] =
DIALOG_NAME(SELECT), DIALOG_NAME(SELECT),
DIALOG_NAME(HELPFILE), DIALOG_NAME(HELPFILE),
DIALOG_NAME(TRACE), DIALOG_NAME(TRACE),
DIALOG_NAME(TOGGLE) DIALOG_NAME(TOGGLE),
DIALOG_NAME(LEAVE)
}; };
#define MAP2(letter,actual) { letter, actual } #define MAP2(letter,actual) { letter, actual }
@ -563,13 +646,13 @@ make_binding(char *widget, int curses_key, int is_function, int dialog_key)
LIST_BINDINGS *entry = 0; LIST_BINDINGS *entry = 0;
DLG_KEYS_BINDING *data = 0; DLG_KEYS_BINDING *data = 0;
char *name; char *name;
LIST_BINDINGS *p, *q;
DLG_KEYS_BINDING *result = find_binding(widget, curses_key); DLG_KEYS_BINDING *result = find_binding(widget, curses_key);
if (result == 0 if (result == 0
&& (entry = dlg_calloc(LIST_BINDINGS, 1)) != 0 && (entry = dlg_calloc(LIST_BINDINGS, 1)) != 0
&& (data = dlg_calloc(DLG_KEYS_BINDING, 2)) != 0 && (data = dlg_calloc(DLG_KEYS_BINDING, 2)) != 0
&& (name = dlg_strclone(widget)) != 0) { && (name = dlg_strclone(widget)) != 0) {
LIST_BINDINGS *p, *q;
entry->name = name; entry->name = name;
entry->binding = data; entry->binding = data;
@ -606,7 +689,6 @@ make_binding(char *widget, int curses_key, int is_function, int dialog_key)
static int static int
decode_escaped(char **string) decode_escaped(char **string)
{ {
unsigned n;
int result = 0; int result = 0;
if (IsOctal(**string)) { if (IsOctal(**string)) {
@ -617,6 +699,8 @@ decode_escaped(char **string)
result = (result << 3) | (ch - '0'); result = (result << 3) | (ch - '0');
} }
} else { } else {
unsigned n;
for (n = 0; n < TableSize(escaped_letters); ++n) { for (n = 0; n < TableSize(escaped_letters); ++n) {
if (**string == escaped_letters[n].letter) { if (**string == escaped_letters[n].letter) {
*string += 1; *string += 1;
@ -663,13 +747,8 @@ int
dlg_parse_bindkey(char *params) dlg_parse_bindkey(char *params)
{ {
char *p = skip_white(params); char *p = skip_white(params);
char *q;
bool escaped = FALSE;
int modified = 0;
int result = FALSE; int result = FALSE;
unsigned xx;
char *widget; char *widget;
int is_function = FALSE;
int curses_key; int curses_key;
int dialog_key; int dialog_key;
@ -679,6 +758,12 @@ dlg_parse_bindkey(char *params)
p = skip_black(p); p = skip_black(p);
if (p != widget && *p != '\0') { if (p != widget && *p != '\0') {
char *q;
unsigned xx;
bool escaped = FALSE;
int modified = 0;
int is_function = FALSE;
*p++ = '\0'; *p++ = '\0';
p = skip_white(p); p = skip_white(p);
q = p; q = p;
@ -715,7 +800,7 @@ dlg_parse_bindkey(char *params)
char fprefix[2]; char fprefix[2];
char check[2]; char check[2];
int keynumber; int keynumber;
if (sscanf(q, "%[Ff]%d%c", fprefix, &keynumber, check) == 2) { if (sscanf(q, "%1[Ff]%d%c", fprefix, &keynumber, check) == 2) {
curses_key = KEY_F(keynumber); curses_key = KEY_F(keynumber);
is_function = TRUE; is_function = TRUE;
} else { } else {

View File

@ -1,9 +1,9 @@
/* /*
* $Id: dlg_keys.h,v 1.36 2016/08/28 21:23:17 tom Exp $ * $Id: dlg_keys.h,v 1.39 2020/11/22 23:19:24 tom Exp $
* *
* dlg_keys.h -- runtime binding support for dialog * dlg_keys.h -- runtime binding support for dialog
* *
* Copyright 2005-2012,2016 Thomas E. Dickey * Copyright 2005-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -97,7 +97,8 @@ typedef enum {
DLGK_SELECT, DLGK_SELECT,
DLGK_HELPFILE, DLGK_HELPFILE,
DLGK_TRACE, DLGK_TRACE,
DLGK_TOGGLE DLGK_TOGGLE,
DLGK_LEAVE
} DLG_KEYS_ENUM; } DLG_KEYS_ENUM;
#define is_DLGK_MOUSE(code) ((code) >= M_EVENT) #define is_DLGK_MOUSE(code) ((code) >= M_EVENT)
@ -111,7 +112,8 @@ typedef enum {
#define ENTERKEY_BINDINGS \ #define ENTERKEY_BINDINGS \
DLG_KEYS_DATA( DLGK_ENTER, '\n' ), \ DLG_KEYS_DATA( DLGK_ENTER, '\n' ), \
DLG_KEYS_DATA( DLGK_ENTER, '\r' ), \ DLG_KEYS_DATA( DLGK_ENTER, '\r' ), \
DLG_KEYS_DATA( DLGK_ENTER, KEY_ENTER ) DLG_KEYS_DATA( DLGK_ENTER, KEY_ENTER ), \
DLG_KEYS_DATA( DLGK_LEAVE, CHR_LEAVE )
/* ^U == 21 */ /* ^U == 21 */
#define INPUTSTR_BINDINGS \ #define INPUTSTR_BINDINGS \
@ -158,7 +160,9 @@ typedef enum {
#define TOGGLEKEY_BINDINGS \ #define TOGGLEKEY_BINDINGS \
DLG_KEYS_DATA( DLGK_TOGGLE, CHR_SPACE ) DLG_KEYS_DATA( DLGK_TOGGLE, CHR_SPACE )
extern int dlg_button_key(int /*exit_code*/, int * /*button*/, int * /*dialog_key*/, int * /*fkey*/);
extern int dlg_lookup_key(WINDOW * /*win*/, int /*curses_key*/, int * /*dialog_key*/); extern int dlg_lookup_key(WINDOW * /*win*/, int /*curses_key*/, int * /*dialog_key*/);
extern int dlg_ok_button_key(int /*exit_code*/, int * /*button*/, int * /*dialog_key*/, int * /*fkey*/);
extern int dlg_result_key(int /*dialog_key*/, int /*fkey*/, int * /*resultp*/); extern int dlg_result_key(int /*dialog_key*/, int /*fkey*/, int * /*resultp*/);
extern void dlg_register_buttons(WINDOW * /*win*/, const char * /*name*/, const char ** /*buttons*/); extern void dlg_register_buttons(WINDOW * /*win*/, const char * /*name*/, const char ** /*buttons*/);
extern void dlg_register_window(WINDOW * /*win*/, const char * /*name*/, DLG_KEYS_BINDING * /*binding*/); extern void dlg_register_window(WINDOW * /*win*/, const char * /*name*/, DLG_KEYS_BINDING * /*binding*/);

View File

@ -1,12 +1,13 @@
/* /*
* $Id: editbox.c,v 1.70 2018/06/19 22:57:01 tom Exp $ * $Id: editbox.c,v 1.80 2020/11/23 00:27:21 tom Exp $
* *
* editbox.c -- implements the edit box * editbox.c -- implements the edit box
* *
* Copyright 2007-2016,2018 Thomas E. Dickey * Copyright 2007-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
* as published by the Free Software Foundation.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
@ -54,11 +55,8 @@ grow_list(char ***list, int *have, int want)
static void static void
load_list(const char *file, char ***list, int *rows) load_list(const char *file, char ***list, int *rows)
{ {
FILE *fp;
char *blob = 0; char *blob = 0;
struct stat sb; struct stat sb;
unsigned n, pass;
unsigned need;
size_t size; size_t size;
*list = 0; *list = 0;
@ -72,6 +70,9 @@ load_list(const char *file, char ***list, int *rows)
if ((blob = dlg_malloc(char, size + 2)) == 0) { if ((blob = dlg_malloc(char, size + 2)) == 0) {
fail_list(); fail_list();
} else { } else {
FILE *fp;
unsigned n, pass;
blob[size] = '\0'; blob[size] = '\0';
if ((fp = fopen(file, "r")) == 0) if ((fp = fopen(file, "r")) == 0)
@ -89,7 +90,8 @@ load_list(const char *file, char ***list, int *rows)
for (pass = 0; pass < 2; ++pass) { for (pass = 0; pass < 2; ++pass) {
int first = TRUE; int first = TRUE;
need = 0; unsigned need = 0;
for (n = 0; n < size; ++n) { for (n = 0; n < size; ++n) {
if (first && pass) { if (first && pass) {
(*list)[need] = blob + n; (*list)[need] = blob + n;
@ -273,7 +275,8 @@ col_to_chr_offset(const char *text, int col)
return result; return result;
} }
#define SCROLL_TO(target) show_all = scroll_to(pagesize, listsize, &base_row, &thisrow, target) #define Scroll_To(target) scroll_to(pagesize, listsize, &base_row, &thisrow, target)
#define SCROLL_TO(target) show_all = Scroll_To(target)
#define PREV_ROW (*list)[thisrow - 1] #define PREV_ROW (*list)[thisrow - 1]
#define THIS_ROW (*list)[thisrow] #define THIS_ROW (*list)[thisrow]
@ -285,9 +288,10 @@ static int
widest_line(char **list) widest_line(char **list)
{ {
int result = MAX_LEN; int result = MAX_LEN;
char *value;
if (list != 0) { if (list != 0) {
char *value;
while ((value = *list++) != 0) { while ((value = *list++) != 0) {
int check = (int) strlen(value); int check = (int) strlen(value);
if (check > result) if (check > result)
@ -355,8 +359,8 @@ dlg_editbox(const char *title,
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
int state; int state;
size_t max_len = (size_t) dlg_max_input(widest_line(*list)); size_t max_len = (size_t) dlg_max_input(widest_line(*list));
char *input, *buffer; char *buffer;
bool show_all, show_one, was_mouse; bool show_all, show_one;
bool first_trace = TRUE; bool first_trace = TRUE;
WINDOW *dialog; WINDOW *dialog;
WINDOW *editing; WINDOW *editing;
@ -436,7 +440,8 @@ dlg_editbox(const char *title,
pagesize = getmaxy(editing); pagesize = getmaxy(editing);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int edit = 0; bool was_mouse;
char *input;
if (show_all) { if (show_all) {
display_all(editing, *list, thisrow, base_row, listsize, chr_offset); display_all(editing, *list, thisrow, base_row, listsize, chr_offset);
@ -510,8 +515,10 @@ dlg_editbox(const char *title,
break; break;
} }
if (state != sTEXT) { if (state != sTEXT) {
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &code, &key, &fkey))
break;
}
} }
was_mouse = (fkey && is_DLGK_MOUSE(key)); was_mouse = (fkey && is_DLGK_MOUSE(key));
@ -552,6 +559,8 @@ dlg_editbox(const char *title,
} }
if (state == sTEXT) { /* editing box selected */ if (state == sTEXT) { /* editing box selected */
int edit = 0;
/* /*
* Intercept scrolling keys that dlg_edit_string() does not * Intercept scrolling keys that dlg_edit_string() does not
* understand. * understand.
@ -608,7 +617,7 @@ dlg_editbox(const char *title,
} }
--listsize; --listsize;
--thisrow; --thisrow;
SCROLL_TO(thisrow); (void) Scroll_To(thisrow);
show_all = TRUE; show_all = TRUE;
} }
@ -687,24 +696,26 @@ dlg_editbox(const char *title,
chr_offset = 0; chr_offset = 0;
col_offset = 0; col_offset = 0;
THIS_ROW = tmp; THIS_ROW = tmp;
SCROLL_TO(thisrow); (void) Scroll_To(thisrow);
show_all = TRUE; show_all = TRUE;
} else { } else {
result = dlg_ok_buttoncode(state); result = dlg_enter_buttoncode(state);
} }
break; break;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:
dlg_will_resize(dialog); dlg_will_resize(dialog);
/* reset data */ /* reset data */
height = old_height; height = old_height;
width = old_width; width = old_width;
dlg_clear();
dlg_unregister_window(editing);
dlg_del_window(editing);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */ /* repaint */
dlg_del_window(editing);
dlg_unregister_window(editing);
_dlg_resize_cleanup(dialog);
goto retry; goto retry;
#endif #endif
case DLGK_TOGGLE: case DLGK_TOGGLE:
@ -718,7 +729,7 @@ dlg_editbox(const char *title,
beep(); beep();
break; break;
} }
} else { } else if (key > 0) {
beep(); beep();
} }
} }

View File

@ -1,9 +1,9 @@
/* /*
* $Id: formbox.c,v 1.95 2018/06/21 08:23:31 tom Exp $ * $Id: formbox.c,v 1.103 2021/01/17 22:19:05 tom Exp $
* *
* formbox.c -- implements the form (i.e., some pairs label/editbox) * formbox.c -- implements the form (i.e., some pairs label/editbox)
* *
* Copyright 2003-2016,2018 Thomas E. Dickey * Copyright 2003-2020,2021 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -151,12 +151,13 @@ static int
set_choice(DIALOG_FORMITEM item[], int choice, int item_no, bool * noneditable) set_choice(DIALOG_FORMITEM item[], int choice, int item_no, bool * noneditable)
{ {
int result = -1; int result = -1;
int i;
*noneditable = FALSE; *noneditable = FALSE;
if (!is_readonly(&item[choice])) { if (!is_readonly(&item[choice])) {
result = choice; result = choice;
} else { } else {
int i;
for (i = 0; i < item_no; i++) { for (i = 0; i < item_no; i++) {
if (!is_readonly(&(item[i]))) { if (!is_readonly(&(item[i]))) {
result = i; result = i;
@ -292,7 +293,6 @@ scroll_next(WINDOW *win, DIALOG_FORMITEM item[], int stepsize, int *choice, int
int old_scroll = *scrollamt; int old_scroll = *scrollamt;
int old_row = MIN(item[old_choice].text_y, item[old_choice].name_y); int old_row = MIN(item[old_choice].text_y, item[old_choice].name_y);
int target = old_scroll + stepsize; int target = old_scroll + stepsize;
int n;
if (stepsize < 0) { if (stepsize < 0) {
if (old_row != old_scroll) if (old_row != old_scroll)
@ -309,6 +309,8 @@ scroll_next(WINDOW *win, DIALOG_FORMITEM item[], int stepsize, int *choice, int
} }
if (result) { if (result) {
int n;
for (n = 0; item[n].name != 0; ++n) { for (n = 0; item[n].name != 0; ++n) {
if (item[n].text_flen > 0) { if (item[n].text_flen > 0) {
int new_row = MIN(item[n].text_y, item[n].name_y); int new_row = MIN(item[n].text_y, item[n].name_y);
@ -392,7 +394,6 @@ make_FORM_ELTs(DIALOG_FORMITEM * item,
sprintf(item[i].text, "%.*s", item[i].text_ilen, old_text); sprintf(item[i].text, "%.*s", item[i].text_ilen, old_text);
if (item[i].text_free) { if (item[i].text_free) {
item[i].text_free = FALSE;
free(old_text); free(old_text);
} }
item[i].text_free = TRUE; item[i].text_free = TRUE;
@ -500,7 +501,6 @@ dlg_form(const char *title,
: sTEXT); : sTEXT);
int x, y, cur_x, cur_y, box_x, box_y; int x, y, cur_x, cur_y, box_x, box_y;
int code; int code;
int key = 0;
int fkey; int fkey;
int choice = dlg_default_formitem(items); int choice = dlg_default_formitem(items);
int new_choice, new_scroll; int new_choice, new_scroll;
@ -608,6 +608,7 @@ dlg_form(const char *title,
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int edit = FALSE; int edit = FALSE;
int key;
if (scroll_changed) { if (scroll_changed) {
print_form(form, items, item_no, scrollamt, choice); print_form(form, items, item_no, scrollamt, choice);
@ -658,8 +659,9 @@ dlg_form(const char *title,
} }
key = dlg_mouse_wgetch((state == sTEXT) ? form : dialog, &fkey); key = dlg_mouse_wgetch((state == sTEXT) ? form : dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; break;
}
/* handle non-functionkeys */ /* handle non-functionkeys */
if (!fkey) { if (!fkey) {
@ -697,6 +699,10 @@ dlg_form(const char *title,
dlg_del_window(dialog); dlg_del_window(dialog);
result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK; result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
continue; continue;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
case DLGK_GRID_LEFT: case DLGK_GRID_LEFT:
if (state == sTEXT) if (state == sTEXT)
@ -780,10 +786,8 @@ dlg_form(const char *title,
height = old_height; height = old_height;
width = old_width; width = old_width;
free(prompt); free(prompt);
dlg_clear(); _dlg_resize_cleanup(dialog);
dlg_unregister_window(form); dlg_unregister_window(form);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */ /* repaint */
goto retry; goto retry;
#endif #endif

View File

@ -1,9 +1,9 @@
/* /*
* $Id: fselect.c,v 1.102 2018/06/21 23:28:04 tom Exp $ * $Id: fselect.c,v 1.115 2021/01/16 17:19:15 tom Exp $
* *
* fselect.c -- implements the file-selector box * fselect.c -- implements the file-selector box
* *
* Copyright 2000-2017,2018 Thomas E. Dickey * Copyright 2000-2020,2021 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA. * Boston, MA 02110, USA.
*/ */
#include <dialog.h> #include <dlg_internals.h>
#include <dlg_keys.h> #include <dlg_keys.h>
#include <sys/types.h> #include <sys/types.h>
@ -125,9 +125,9 @@ data_of(LIST * list)
static void static void
free_list(LIST * list, int reinit) free_list(LIST * list, int reinit)
{ {
int n;
if (list->data != 0) { if (list->data != 0) {
int n;
for (n = 0; list->data[n] != 0; n++) for (n = 0; list->data[n] != 0; n++)
free(list->data[n]); free(list->data[n]);
free(list->data); free(list->data);
@ -173,13 +173,14 @@ keep_visible(LIST * list)
static int static int
find_choice(char *target, LIST * list) find_choice(char *target, LIST * list)
{ {
int n;
int choice = list->choice; int choice = list->choice;
int len_1, len_2, cmp_1, cmp_2;
if (*target == 0) { if (*target == 0) {
list->choice = 0; list->choice = 0;
} else { } else {
int n;
int len_1, cmp_1;
/* find the match with the longest length. If more than one has the /* find the match with the longest length. If more than one has the
* same length, choose the one with the closest match of the final * same length, choose the one with the closest match of the final
* character. * character.
@ -189,6 +190,7 @@ find_choice(char *target, LIST * list)
for (n = 0; n < list->length; n++) { for (n = 0; n < list->length; n++) {
char *a = target; char *a = target;
char *b = list->data[n]; char *b = list->data[n];
int len_2, cmp_2;
len_2 = 0; len_2 = 0;
while ((*a != 0) && (*b != 0) && (*a == *b)) { while ((*a != 0) && (*b != 0) && (*a == *b)) {
@ -216,13 +218,13 @@ find_choice(char *target, LIST * list)
static void static void
display_list(LIST * list) display_list(LIST * list)
{ {
int n;
int x;
int y;
int top;
int bottom;
if (list->win != 0) { if (list->win != 0) {
int n;
int x;
int y;
int top;
int bottom;
dlg_attr_clear(list->win, getmaxy(list->win), getmaxx(list->win), item_attr); dlg_attr_clear(list->win, getmaxy(list->win), getmaxx(list->win), item_attr);
for (n = list->offset; n < list->length && list->data[n]; n++) { for (n = list->offset; n < list->length && list->data[n]; n++) {
y = n - list->offset; y = n - list->offset;
@ -264,16 +266,17 @@ display_list(LIST * list)
* that is really required is that they're distinct, so we can put them in a * that is really required is that they're distinct, so we can put them in a
* switch statement. * switch statement.
*/ */
#if USE_MOUSE
static void static void
fix_arrows(LIST * list) fix_arrows(LIST * list)
{ {
int x;
int y;
int top;
int right;
int bottom;
if (list->win != 0) { if (list->win != 0) {
int x;
int y;
int top;
int right;
int bottom;
getparyx(list->win, y, x); getparyx(list->win, y, x);
top = y - 1; top = y - 1;
right = getmaxx(list->win); right = getmaxx(list->win);
@ -290,6 +293,10 @@ fix_arrows(LIST * list)
} }
} }
#else
#define fix_arrows(list) /* nothing */
#endif
static bool static bool
show_list(char *target, LIST * list, bool keep) show_list(char *target, LIST * list, bool keep)
{ {
@ -356,18 +363,29 @@ match(char *name, LIST * d_list, LIST * f_list, MATCH * match_list)
size_t test_len = strlen(test); size_t test_len = strlen(test);
char **matches = dlg_malloc(char *, (size_t) (d_list->length + f_list->length)); char **matches = dlg_malloc(char *, (size_t) (d_list->length + f_list->length));
size_t data_len = 0; size_t data_len = 0;
int i;
for (i = 2; i < d_list->length; i++) { if (matches != 0) {
if (strncmp(test, d_list->data[i], test_len) == 0) { int i;
matches[data_len++] = d_list->data[i]; char **new_ptr;
for (i = 2; i < d_list->length; i++) {
if (strncmp(test, d_list->data[i], test_len) == 0) {
matches[data_len++] = d_list->data[i];
}
}
for (i = 0; i < f_list->length; i++) {
if (strncmp(test, f_list->data[i], test_len) == 0) {
matches[data_len++] = f_list->data[i];
}
}
if ((new_ptr = dlg_realloc(char *, data_len + 1, matches)) != 0) {
matches = new_ptr;
} else {
free(matches);
matches = 0;
data_len = 0;
} }
} }
for (i = 0; i < f_list->length; i++) {
if (strncmp(test, f_list->data[i], test_len) == 0) {
matches[data_len++] = f_list->data[i];
}
}
matches = dlg_realloc(char *, data_len + 1, matches);
match_list->data = matches; match_list->data = matches;
match_list->length = (int) data_len; match_list->length = (int) data_len;
} }
@ -386,11 +404,11 @@ complete(char *name, LIST * d_list, LIST * f_list, char **buff_ptr)
char *test; char *test;
size_t test_len; size_t test_len;
size_t i; size_t i;
int j;
char *buff; char *buff;
match(name, d_list, f_list, &match_list); match(name, d_list, f_list, &match_list);
if (match_list.length == 0) { if (match_list.length == 0) {
free(match_list.data);
*buff_ptr = NULL; *buff_ptr = NULL;
return 0; return 0;
} }
@ -406,6 +424,8 @@ complete(char *name, LIST * d_list, LIST * f_list, char **buff_ptr)
i++; i++;
} }
} else { } else {
int j;
for (i = 0; i < test_len; i++) { for (i = 0; i < test_len; i++) {
char test_char = test[i]; char test_char = test[i];
if (test_char == '\0') if (test_char == '\0')
@ -433,12 +453,9 @@ fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
{ {
bool result = TRUE; bool result = TRUE;
bool rescan = FALSE; bool rescan = FALSE;
DIR *dp;
DIRENT *de;
struct stat sb; struct stat sb;
int n; int n;
char path[MAX_LEN + 1]; char path[MAX_LEN + 1];
char *leaf;
/* check if we've updated the lists */ /* check if we've updated the lists */
for (n = 0; current[n] && input[n]; n++) { for (n = 0; current[n] && input[n]; n++) {
@ -457,7 +474,9 @@ fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
} }
if (rescan) { if (rescan) {
DIR *dp;
size_t have = strlen(input); size_t have = strlen(input);
char *leaf;
if (have > MAX_LEN) if (have > MAX_LEN)
have = MAX_LEN; have = MAX_LEN;
@ -477,6 +496,8 @@ fill_lists(char *current, char *input, LIST * d_list, LIST * f_list, bool keep)
} }
DLG_TRACE(("opendir '%s'\n", path)); DLG_TRACE(("opendir '%s'\n", path));
if ((dp = opendir(path)) != 0) { if ((dp = opendir(path)) != 0) {
DIRENT *de;
while ((de = readdir(dp)) != 0) { while ((de = readdir(dp)) != 0) {
size_t len = NAMLEN(de); size_t len = NAMLEN(de);
if (len == 0 || (len + have + 2) >= MAX_LEN) if (len == 0 || (len + have + 2) >= MAX_LEN)
@ -624,10 +645,8 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
retry: retry:
#endif #endif
dlg_auto_size(title, (char *) 0, &height, &width, 6, 25); dlg_auto_size(title, "", &height, &width, MIN_HIGH + min_items, min_wide);
height += MIN_HIGH + min_items;
if (width < min_wide)
width = min_wide;
dlg_print_size(height, width); dlg_print_size(height, width);
dlg_ctl_size(height, width); dlg_ctl_size(height, width);
@ -651,13 +670,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
tbox_y = height - (BTN_HIGH * 2) + MARGIN; tbox_y = height - (BTN_HIGH * 2) + MARGIN;
tbox_x = (width - tbox_width) / 2; tbox_x = (width - tbox_width) / 2;
w_text = derwin(dialog, tbox_height, tbox_width, tbox_y, tbox_x); w_text = dlg_der_window(dialog, tbox_height, tbox_width, tbox_y, tbox_x);
if (w_text == 0) { if (w_text == 0) {
result = DLG_EXIT_ERROR; result = DLG_EXIT_ERROR;
goto finish; goto finish;
} }
(void) keypad(w_text, TRUE);
dlg_draw_box(dialog, tbox_y - MARGIN, tbox_x - MARGIN, dlg_draw_box(dialog, tbox_y - MARGIN, tbox_x - MARGIN,
(2 * MARGIN + 1), tbox_width + (MARGIN + EXT_WIDE), (2 * MARGIN + 1), tbox_width + (MARGIN + EXT_WIDE),
menubox_border_attr, menubox_border2_attr); menubox_border_attr, menubox_border2_attr);
@ -678,13 +696,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
dbox_y = (2 * MARGIN + 1); dbox_y = (2 * MARGIN + 1);
dbox_x = tbox_x; dbox_x = tbox_x;
w_work = derwin(dialog, dbox_height, dbox_width, dbox_y, dbox_x); w_work = dlg_der_window(dialog, dbox_height, dbox_width, dbox_y, dbox_x);
if (w_work == 0) { if (w_work == 0) {
result = DLG_EXIT_ERROR; result = DLG_EXIT_ERROR;
goto finish; goto finish;
} }
(void) keypad(w_work, TRUE);
(void) mvwaddstr(dialog, dbox_y - (MARGIN + 1), dbox_x - MARGIN, d_label); (void) mvwaddstr(dialog, dbox_y - (MARGIN + 1), dbox_x - MARGIN, d_label);
dlg_draw_box(dialog, dlg_draw_box(dialog,
dbox_y - MARGIN, dbox_x - MARGIN, dbox_y - MARGIN, dbox_x - MARGIN,
@ -699,13 +716,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
fbox_y = dbox_y; fbox_y = dbox_y;
fbox_x = tbox_x + dbox_width + (2 * MARGIN); fbox_x = tbox_x + dbox_width + (2 * MARGIN);
w_work = derwin(dialog, fbox_height, fbox_width, fbox_y, fbox_x); w_work = dlg_der_window(dialog, fbox_height, fbox_width, fbox_y, fbox_x);
if (w_work == 0) { if (w_work == 0) {
result = DLG_EXIT_ERROR; result = DLG_EXIT_ERROR;
goto finish; goto finish;
} }
(void) keypad(w_work, TRUE);
(void) mvwaddstr(dialog, fbox_y - (MARGIN + 1), fbox_x - MARGIN, f_label); (void) mvwaddstr(dialog, fbox_y - (MARGIN + 1), fbox_x - MARGIN, f_label);
dlg_draw_box(dialog, dlg_draw_box(dialog,
fbox_y - MARGIN, fbox_x - MARGIN, fbox_y - MARGIN, fbox_x - MARGIN,
@ -763,8 +779,10 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
fix_arrows(&d_list); fix_arrows(&d_list);
fix_arrows(&f_list); fix_arrows(&f_list);
key = dlg_mouse_wgetch((state == sTEXT) ? w_text : dialog, &fkey); key = dlg_mouse_wgetch((state == sTEXT) ? w_text : dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
} }
if (key == DLGK_TOGGLE) { if (key == DLGK_TOGGLE) {
@ -851,6 +869,10 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
case DLGK_ENTER: case DLGK_ENTER:
result = (state > 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK; result = (state > 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
continue; continue;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:
dlg_will_resize(dialog); dlg_will_resize(dialog);
@ -861,10 +883,9 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
*current = 0; *current = 0;
resized = TRUE; resized = TRUE;
/* repaint */ /* repaint */
dlg_clear(); free_list(&d_list, FALSE);
dlg_del_window(dialog); free_list(&f_list, FALSE);
refresh(); _dlg_resize_cleanup(dialog);
dlg_mouse_free_regions();
goto retry; goto retry;
#endif #endif
default: default:
@ -903,12 +924,12 @@ dlg_fselect(const char *title, const char *path, int height, int width, int dsel
first = FALSE; first = FALSE;
state = sTEXT; state = sTEXT;
} }
} else if (state >= 0 && } else if ((code = dlg_char_to_button(key, buttons)) >= 0) {
(code = dlg_char_to_button(key, buttons)) >= 0) {
result = dlg_ok_buttoncode(code); result = dlg_ok_buttoncode(code);
break; break;
} }
} }
AddLastKey();
dlg_unregister_window(w_text); dlg_unregister_window(w_text);
dlg_del_window(dialog); dlg_del_window(dialog);

View File

@ -1,9 +1,9 @@
/* /*
* $Id: guage.c,v 1.76 2018/06/21 08:23:43 tom Exp $ * $Id: guage.c,v 1.83 2020/03/27 20:54:43 tom Exp $
* *
* guage.c -- implements the gauge dialog * guage.c -- implements the gauge dialog
* *
* Copyright 2000-2015,2018 Thomas E. Dickey * Copyright 2000-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -119,9 +119,10 @@ static void
repaint_text(MY_OBJ * obj) repaint_text(MY_OBJ * obj)
{ {
WINDOW *dialog = obj->obj.win; WINDOW *dialog = obj->obj.win;
int i, x;
if (dialog != 0) { if (dialog != 0) {
int i, x;
(void) werase(dialog); (void) werase(dialog);
dlg_draw_box2(dialog, 0, 0, obj->height, obj->width, dialog_attr, dlg_draw_box2(dialog, 0, 0, obj->height, obj->width, dialog_attr,
border_attr, border2_attr); border_attr, border2_attr);
@ -301,7 +302,7 @@ dlg_reallocate_gauge(void *objptr,
int percent) int percent)
{ {
char *prompt = dlg_strclone(cprompt); char *prompt = dlg_strclone(cprompt);
MY_OBJ *obj = objptr; MY_OBJ *obj;
bool save_finish_string = dialog_state.finish_string; bool save_finish_string = dialog_state.finish_string;
dialog_state.finish_string = TRUE; dialog_state.finish_string = TRUE;
@ -377,6 +378,10 @@ dlg_free_gauge(void *objptr)
MY_OBJ *obj = (MY_OBJ *) objptr; MY_OBJ *obj = (MY_OBJ *) objptr;
if (valid(obj)) { if (valid(obj)) {
if (obj->title)
free(obj->title);
if (obj->prompt)
free(obj->prompt);
obj->obj.keep_win = FALSE; obj->obj.keep_win = FALSE;
dlg_remove_callback(&(obj->obj)); dlg_remove_callback(&(obj->obj));
delink(obj); delink(obj);
@ -422,7 +427,6 @@ dialog_gauge(const char *title,
MY_OBJ *oldobj = obj; MY_OBJ *oldobj = obj;
dlg_will_resize(obj->obj.win); dlg_will_resize(obj->obj.win);
dlg_mouse_free_regions();
obj = dlg_allocate_gauge(title, obj = dlg_allocate_gauge(title,
cprompt, cprompt,
@ -436,9 +440,8 @@ dialog_gauge(const char *title,
oldobj->obj.keep_win = FALSE; oldobj->obj.keep_win = FALSE;
/* remove the old version of the gauge */ /* remove the old version of the gauge */
dlg_clear(); _dlg_resize_cleanup(oldobj->obj.win);
dlg_remove_callback(&(oldobj->obj)); dlg_remove_callback(&(oldobj->obj));
refresh();
dlg_add_callback_ref((DIALOG_CALLBACK **) & obj, my_cleanup); dlg_add_callback_ref((DIALOG_CALLBACK **) & obj, my_cleanup);
dlg_update_gauge(obj, obj->percent); dlg_update_gauge(obj, obj->percent);

View File

@ -1,9 +1,9 @@
/* /*
* $Id: inputbox.c,v 1.84 2018/06/21 23:29:35 tom Exp $ * $Id: inputbox.c,v 1.93 2021/01/17 16:36:37 tom Exp $
* *
* inputbox.c -- implements the input box * inputbox.c -- implements the input box
* *
* Copyright 2000-2016,2018 Thomas E. Dickey * Copyright 2000-2020,2021 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -24,7 +24,7 @@
* Savio Lam (lam836@cs.cuhk.hk) * Savio Lam (lam836@cs.cuhk.hk)
*/ */
#include <dialog.h> #include <dlg_internals.h>
#include <dlg_keys.h> #include <dlg_keys.h>
#define sTEXT -1 #define sTEXT -1
@ -37,6 +37,11 @@
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ), \ DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_LEFT ), \
DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP ) DLG_KEYS_DATA( DLGK_FIELD_PREV, KEY_UP )
#define BTN_HIGH 1
#define HDR_HIGH 1
#define MIN_HIGH (HDR_HIGH + (MARGIN * 2 + 1) + (BTN_HIGH + MARGIN * 2))
#define MIN_WIDE 26
/* /*
* Display a dialog box for entering a string * Display a dialog box for entering a string
*/ */
@ -107,13 +112,13 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
key = fkey = 0; key = fkey = 0;
if (init != NULL) { if (init != NULL) {
dlg_auto_size(title, prompt, &height, &width, 5, dlg_auto_size(title, prompt, &height, &width, MIN_HIGH,
MIN(MAX(dlg_count_columns(init) + 7, 26), MIN(MAX(dlg_count_columns(init) + 7, MIN_WIDE),
SCOLS - (dialog_vars.begin_set ? SCOLS - (dialog_vars.begin_set ?
dialog_vars.begin_x : 0))); dialog_vars.begin_x : 0)));
chr_offset = (int) strlen(init); chr_offset = (int) strlen(init);
} else { } else {
dlg_auto_size(title, prompt, &height, &width, 5, 26); dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
} }
dlg_button_layout(buttons, &width); dlg_button_layout(buttons, &width);
dlg_print_size(height, width); dlg_print_size(height, width);
@ -156,9 +161,8 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
wsyncup(editor); wsyncup(editor);
wcursyncup(editor); wcursyncup(editor);
} }
while (result == DLG_EXIT_UNKNOWN) {
int edit = 0;
while (result == DLG_EXIT_UNKNOWN) {
/* /*
* The last field drawn determines where the cursor is shown: * The last field drawn determines where the cursor is shown:
*/ */
@ -178,8 +182,10 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
wcursyncup(editor); wcursyncup(editor);
} }
key = dlg_mouse_wgetch((state == sTEXT) ? editor : dialog, &fkey); key = dlg_mouse_wgetch((state == sTEXT) ? editor : dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &code, &key, &fkey))
break;
}
} }
/* /*
@ -194,7 +200,7 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
} }
if (state == sTEXT) { /* Input box selected */ if (state == sTEXT) { /* Input box selected */
edit = dlg_edit_string(input, &chr_offset, key, fkey, first); int edit = dlg_edit_string(input, &chr_offset, key, fkey, first);
if (edit) { if (edit) {
dlg_show_string(editor, input, chr_offset, inputbox_attr, dlg_show_string(editor, input, chr_offset, inputbox_attr,
@ -236,6 +242,10 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
dlg_del_window(dialog); dlg_del_window(dialog);
result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK; result = (state >= 0) ? dlg_enter_buttoncode(state) : DLG_EXIT_OK;
break; break;
case DLGK_LEAVE:
if (state >= 0)
result = dlg_ok_buttoncode(state);
break;
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:
dlg_will_resize(dialog); dlg_will_resize(dialog);
@ -243,20 +253,18 @@ dialog_inputbox(const char *title, const char *cprompt, int height, int width,
height = old_height; height = old_height;
width = old_width; width = old_width;
/* repaint */ /* repaint */
dlg_clear(); _dlg_resize_cleanup(dialog);
dlg_del_window(dialog);
refresh();
dlg_mouse_free_regions();
goto retry; goto retry;
#endif #endif
default: default:
beep(); beep();
break; break;
} }
} else { } else if (key > 0) {
beep(); beep();
} }
} }
AddLastKey();
dlg_unregister_window(editor); dlg_unregister_window(editor);
dlg_del_window(dialog); dlg_del_window(dialog);

View File

@ -1,9 +1,9 @@
/* /*
* $Id: inputstr.c,v 1.88 2018/06/18 22:10:54 tom Exp $ * $Id: inputstr.c,v 1.91 2021/01/17 22:19:05 tom Exp $
* *
* inputstr.c -- functions for input/display of a string * inputstr.c -- functions for input/display of a string
* *
* Copyright 2000-2017,2018 Thomas E. Dickey * Copyright 2000-2019,2021 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -204,7 +204,6 @@ static CACHE my_cache;
static bool static bool
same_cache2(CACHE * cache, const char *string, unsigned i_len) same_cache2(CACHE * cache, const char *string, unsigned i_len)
{ {
unsigned need;
size_t s_len = strlen(string); size_t s_len = strlen(string);
bool result = TRUE; bool result = TRUE;
@ -212,8 +211,8 @@ same_cache2(CACHE * cache, const char *string, unsigned i_len)
|| cache->s_len < s_len || cache->s_len < s_len
|| cache->list == 0 || cache->list == 0
|| !SAME_CACHE(cache, string, (size_t) s_len)) { || !SAME_CACHE(cache, string, (size_t) s_len)) {
unsigned need = (i_len + 1);
need = (i_len + 1);
if (cache->list == 0) { if (cache->list == 0) {
cache->list = dlg_malloc(int, need); cache->list = dlg_malloc(int, need);
} else if (cache->i_len < i_len) { } else if (cache->i_len < i_len) {
@ -322,10 +321,11 @@ dlg_count_wchars(const char *string)
mbstate_t state; mbstate_t state;
int part = dlg_count_wcbytes(cache->string, len); int part = dlg_count_wcbytes(cache->string, len);
char save = cache->string[part]; char save = cache->string[part];
size_t code;
wchar_t *temp = dlg_calloc(wchar_t, len + 1); wchar_t *temp = dlg_calloc(wchar_t, len + 1);
if (temp != 0) { if (temp != 0) {
size_t code;
cache->string[part] = '\0'; cache->string[part] = '\0';
memset(&state, 0, sizeof(state)); memset(&state, 0, sizeof(state));
code = mbsrtowcs(temp, &src, (size_t) part, &state); code = mbsrtowcs(temp, &src, (size_t) part, &state);
@ -353,11 +353,11 @@ const int *
dlg_index_wchars(const char *string) dlg_index_wchars(const char *string)
{ {
unsigned len = (unsigned) dlg_count_wchars(string); unsigned len = (unsigned) dlg_count_wchars(string);
unsigned inx;
CACHE *cache = load_cache(cInxWideChars, string); CACHE *cache = load_cache(cInxWideChars, string);
if (!same_cache2(cache, string, len)) { if (!same_cache2(cache, string, len)) {
const char *current = string; const char *current = string;
unsigned inx;
cache->list[0] = 0; cache->list[0] = 0;
for (inx = 1; inx <= len; ++inx) { for (inx = 1; inx <= len; ++inx) {
@ -407,25 +407,27 @@ const int *
dlg_index_columns(const char *string) dlg_index_columns(const char *string)
{ {
unsigned len = (unsigned) dlg_count_wchars(string); unsigned len = (unsigned) dlg_count_wchars(string);
unsigned inx;
CACHE *cache = load_cache(cInxCols, string); CACHE *cache = load_cache(cInxCols, string);
if (!same_cache2(cache, string, len)) { if (!same_cache2(cache, string, len)) {
cache->list[0] = 0; cache->list[0] = 0;
#ifdef USE_WIDE_CURSES #ifdef USE_WIDE_CURSES
if (have_locale()) { if (have_locale()) {
unsigned inx;
size_t num_bytes = strlen(string); size_t num_bytes = strlen(string);
const int *inx_wchars = dlg_index_wchars(string); const int *inx_wchars = dlg_index_wchars(string);
mbstate_t state; mbstate_t state;
for (inx = 0; inx < len; ++inx) { for (inx = 0; inx < len; ++inx) {
wchar_t temp[2];
size_t check;
int result; int result;
if (string[inx_wchars[inx]] == TAB) { if (string[inx_wchars[inx]] == TAB) {
result = ((cache->list[inx] | 7) + 1) - cache->list[inx]; result = ((cache->list[inx] | 7) + 1) - cache->list[inx];
} else { } else {
wchar_t temp[2];
size_t check;
memset(&state, 0, sizeof(state)); memset(&state, 0, sizeof(state));
memset(temp, 0, sizeof(temp)); memset(temp, 0, sizeof(temp));
check = mbrtowc(temp, check = mbrtowc(temp,
@ -452,6 +454,8 @@ dlg_index_columns(const char *string)
} else } else
#endif /* USE_WIDE_CURSES */ #endif /* USE_WIDE_CURSES */
{ {
unsigned inx;
for (inx = 0; inx < len; ++inx) { for (inx = 0; inx < len; ++inx) {
chtype ch = UCH(string[inx]); chtype ch = UCH(string[inx]);

View File

@ -1,7 +1,7 @@
# $Id: makefile.in,v 1.97 2018/06/09 01:05:18 tom Exp $ # $Id: makefile.in,v 1.103 2021/01/11 09:03:36 tom Exp $
# template makefile for DIALOG # template makefile for DIALOG
############################################################################## ##############################################################################
# Copyright (c) 1999-2017,2018 Thomas E. Dickey # # Copyright (c) 1999-2020,2021 Thomas E. Dickey #
# # # #
# Permission is hereby granted, free of charge, to any person obtaining a # # Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), # # copy of this software and associated documentation files (the "Software"), #
@ -102,6 +102,7 @@ LINT_OPTS = @LINT_OPTS@
CTAGS = @CTAGS@ CTAGS = @CTAGS@
ETAGS = @ETAGS@ ETAGS = @ETAGS@
RPATH_LIST = @RPATH_LIST@
LIBTOOL = @LIBTOOL@ @ECHO_LT@ LIBTOOL = @LIBTOOL@ @ECHO_LT@
LIBTOOL_OPTS = @LIBTOOL_OPTS@ LIBTOOL_OPTS = @LIBTOOL_OPTS@
LIBTOOL_CLEAN = @LIB_CLEAN@ LIBTOOL_CLEAN = @LIB_CLEAN@
@ -141,7 +142,7 @@ PROG = @PACKAGE@$x
@ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $< @ECHO_CC@$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) -c $<
@NROFF_NOTE@.1.txt : @NROFF_NOTE@.1.txt :
@NROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -Tascii -man | col -bx" >$@ @NROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | nroff -rHY=0 -Tascii -man | col -bx" >$@
@MAN2HTML_NOTE@.1.html : @MAN2HTML_NOTE@.1.html :
@MAN2HTML_NOTE@ ./@MAN2HTML_TEMP@ $* 1 man >$@ @MAN2HTML_NOTE@ ./@MAN2HTML_TEMP@ $* 1 man >$@
@ -203,7 +204,7 @@ all :: $(ALL)
dialog$o \ dialog$o \
$(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION $(OBJECTS) : $(srcdir)/dialog.h $(srcdir)/dlg_keys.h dlg_config.h VERSION
$(PROG)$x : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@ $(PROG) : $(LIB) dialog$o @INTLDIR_MAKE@ @INTLLIBS@
$(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(CFLAGS) $(LDFLAGS) $(LIBS) $(LINK) -o $@ dialog$o -L. -l@PACKAGE@ $(CFLAGS) $(LDFLAGS) $(LIBS)
clean \ clean \
@ -232,6 +233,10 @@ distclean :: clean
$(RM) man2html.* $(RM) man2html.*
$(RM) dialog-config $(RM) dialog-config
check :
@echo "Verify that create-rc works"
$(SHELL) -c "DIALOG=./$(PROG) ./run_test.sh $(srcdir)/samples"
install :: install-bin install-man install :: install-bin install-man
@echo "made $@" @echo "made $@"

View File

@ -1,9 +1,9 @@
/* /*
* $Id: menubox.c,v 1.159 2018/06/21 23:28:56 tom Exp $ * $Id: menubox.c,v 1.171 2020/11/23 21:03:11 tom Exp $
* *
* menubox.c -- implements the menu box * menubox.c -- implements the menu box
* *
* Copyright 2000-2016,2018 Thomas E. Dickey * Copyright 2000-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public Licens, version 2.1e * it under the terms of the GNU Lesser General Public Licens, version 2.1e
@ -24,7 +24,7 @@
* Savio Lam (lam836@cs.cuhk.hk) * Savio Lam (lam836@cs.cuhk.hk)
*/ */
#include <dialog.h> #include <dlg_internals.h>
#include <dlg_keys.h> #include <dlg_keys.h>
typedef enum { typedef enum {
@ -68,7 +68,6 @@ print_item(ALL_DATA * data,
bool is_inputmenu) bool is_inputmenu)
{ {
chtype save = dlg_get_attrs(win); chtype save = dlg_get_attrs(win);
int n;
int climit = (data->item_x - data->tag_x - GUTTER); int climit = (data->item_x - data->tag_x - GUTTER);
int my_width = data->menu_width; int my_width = data->menu_width;
int my_x = data->item_x; int my_x = data->item_x;
@ -95,6 +94,8 @@ print_item(ALL_DATA * data,
/* Clear 'residue' of last item and mark current current item */ /* Clear 'residue' of last item and mark current current item */
if (is_inputmenu) { if (is_inputmenu) {
int n;
dlg_attrset(win, (selected != Unselected) ? item_selected_attr : item_attr); dlg_attrset(win, (selected != Unselected) ? item_selected_attr : item_attr);
for (n = my_y - 1; n < my_y + INPUT_ROWS - 1; n++) { for (n = my_y - 1; n < my_y + INPUT_ROWS - 1; n++) {
wmove(win, n, 0); wmove(win, n, 0);
@ -165,8 +166,18 @@ input_menu_edit(ALL_DATA * data,
/* taken out of inputbox.c - but somewhat modified */ /* taken out of inputbox.c - but somewhat modified */
for (;;) { for (;;) {
if (!first) if (!first) {
int check = DLG_EXIT_UNKNOWN;
key = dlg_mouse_wgetch(data->menu, &fkey); key = dlg_mouse_wgetch(data->menu, &fkey);
if (dlg_result_key(key, fkey, &check)) {
if (check == DLG_EXIT_CANCEL) {
code = FALSE;
break;
} else {
flash();
}
}
}
if (dlg_edit_string(result, &offset, key, fkey, first)) { if (dlg_edit_string(result, &offset, key, fkey, first)) {
dlg_show_string(data->menu, result, offset, inputbox_attr, dlg_show_string(data->menu, result, offset, inputbox_attr,
y, y,
@ -203,6 +214,7 @@ handle_button(int code, DIALOG_LISTITEM * items, int choice)
dlg_add_string(help_result); dlg_add_string(help_result);
break; break;
} }
AddLastKey();
return code; return code;
} }
@ -215,6 +227,7 @@ dlg_renamed_menutext(DIALOG_LISTITEM * items, int current, char *newtext)
dlg_add_string(items[current].name); dlg_add_string(items[current].name);
dlg_add_result(" "); dlg_add_result(" ");
dlg_add_string(newtext); dlg_add_string(newtext);
AddLastKey();
return DLG_EXIT_EXTRA; return DLG_EXIT_EXTRA;
} }
@ -338,13 +351,12 @@ dlg_menu(const char *title,
#endif #endif
ALL_DATA all; ALL_DATA all;
int i, j, x, y, cur_x, cur_y; int i, j, x, y, cur_x, cur_y;
int key = 0, fkey; int fkey;
int button = dialog_state.visit_items ? -1 : dlg_default_button(); int button = dialog_state.visit_items ? -1 : dlg_default_button();
int choice = dlg_default_listitem(items); int choice = dlg_default_listitem(items);
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
int scrollamt = 0; int scrollamt = 0;
int max_choice; int max_choice;
int found;
int use_width, name_width, text_width, list_width; int use_width, name_width, text_width, list_width;
WINDOW *dialog, *menu; WINDOW *dialog, *menu;
char *prompt = 0; char *prompt = 0;
@ -360,7 +372,6 @@ dlg_menu(const char *title,
DLG_TRACE2N("lheight", menu_height); DLG_TRACE2N("lheight", menu_height);
DLG_TRACE2N("llength", item_no); DLG_TRACE2N("llength", item_no);
/* FIXME dump the items[][] too */ /* FIXME dump the items[][] too */
DLG_TRACE2N("current", *current_item);
DLG_TRACE2N("rename", rename_menutext != 0); DLG_TRACE2N("rename", rename_menutext != 0);
dialog_state.plain_buttons = TRUE; dialog_state.plain_buttons = TRUE;
@ -420,8 +431,7 @@ dlg_menu(const char *title,
* After displaying the prompt, we know how much space we really have. * After displaying the prompt, we know how much space we really have.
* Limit the list to avoid overwriting the ok-button. * Limit the list to avoid overwriting the ok-button.
*/ */
if (all.menu_height + MIN_HIGH > height - cur_y) all.menu_height = height - MIN_HIGH - cur_y;
all.menu_height = height - MIN_HIGH - cur_y;
if (all.menu_height <= 0) if (all.menu_height <= 0)
all.menu_height = 1; all.menu_height = 1;
@ -510,15 +520,20 @@ dlg_menu(const char *title,
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width); dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
dlg_trace_win(dialog); dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int key, found;
if (button < 0) /* --visit-items */ if (button < 0) /* --visit-items */
wmove(dialog, wmove(dialog,
all.box_y + ItemToRow(choice) + 1, all.box_y + ItemToRow(choice) + 1,
all.box_x + all.tag_x + 1); all.box_x + all.tag_x + 1);
key = dlg_mouse_wgetch(dialog, &fkey); key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
found = FALSE; found = FALSE;
if (fkey) { if (fkey) {
@ -654,17 +669,19 @@ dlg_menu(const char *title,
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
FALSE, width); FALSE, width);
break; break;
case DLGK_FIELD_NEXT: case DLGK_FIELD_NEXT:
button = dlg_next_button(buttons, button); button = dlg_next_button(buttons, button);
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, dlg_draw_buttons(dialog, height - 2, 0, buttons, button,
FALSE, width); FALSE, width);
break; break;
case DLGK_TOGGLE: case DLGK_TOGGLE:
case DLGK_ENTER: case DLGK_ENTER:
if (is_inputmenu) case DLGK_LEAVE:
result = dlg_ok_buttoncode(button); result = ((key == DLGK_LEAVE)
else ? dlg_ok_buttoncode(button)
result = dlg_enter_buttoncode(button); : dlg_enter_buttoncode(button));
/* /*
* If dlg_menu() is called from dialog_menu(), we want to * If dlg_menu() is called from dialog_menu(), we want to
@ -723,16 +740,10 @@ dlg_menu(const char *title,
case KEY_RESIZE: case KEY_RESIZE:
dlg_will_resize(dialog); dlg_will_resize(dialog);
/* reset data */ /* reset data */
#define resizeit(name, NAME) \
name = ((NAME >= old_##NAME) \
? (NAME - (old_##NAME - old_##name)) \
: old_##name)
resizeit(height, LINES); resizeit(height, LINES);
resizeit(width, COLS); resizeit(width, COLS);
free(prompt); free(prompt);
dlg_clear(); _dlg_resize_cleanup(dialog);
dlg_del_window(dialog);
dlg_mouse_free_regions();
/* repaint */ /* repaint */
goto retry; goto retry;
#endif #endif
@ -749,6 +760,8 @@ dlg_menu(const char *title,
free(prompt); free(prompt);
*current_item = scrollamt + choice; *current_item = scrollamt + choice;
DLG_TRACE2N("current", *current_item);
return result; return result;
} }

View File

@ -1,9 +1,9 @@
/* /*
* $Id: mixedgauge.c,v 1.34 2018/06/18 22:09:31 tom Exp $ * $Id: mixedgauge.c,v 1.37 2021/01/16 17:19:15 tom Exp $
* *
* mixedgauge.c -- implements the mixedgauge dialog * mixedgauge.c -- implements the mixedgauge dialog
* *
* Copyright 2007-2012,2018 Thomas E. Dickey * Copyright 2007-2020,2021 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -110,7 +110,6 @@ myprint_status(DIALOG_MIXEDGAUGE * dlg)
int limit_y = dlg->height; int limit_y = dlg->height;
int limit_x = dlg->width; int limit_x = dlg->width;
int y = MARGIN;
int item; int item;
int cells = dlg->len_text - 2; int cells = dlg->len_text - 2;
int lm = limit_x - dlg->len_text - 1; int lm = limit_x - dlg->len_text - 1;
@ -118,21 +117,23 @@ myprint_status(DIALOG_MIXEDGAUGE * dlg)
int last_y = 0, last_x = 0; int last_y = 0, last_x = 0;
int j, xxx; int j, xxx;
float percent; float percent;
const char *status = "";
char *freeMe = 0; char *freeMe = 0;
bm -= (2 * MARGIN); bm -= (2 * MARGIN);
getyx(win, last_y, last_x); getyx(win, last_y, last_x);
for (item = 0; item < dlg->item_no; ++item) { for (item = 0; item < dlg->item_no; ++item) {
const char *status = "";
chtype attr = A_NORMAL; chtype attr = A_NORMAL;
int y = item + MARGIN + 1;
y = item + MARGIN + 1;
if (y > bm) if (y > bm)
break; break;
status = status_string(dlg->list[item].text, &freeMe); status = status_string(dlg->list[item].text, &freeMe);
if (status == 0 || *status == 0) if (status == 0 || *status == 0) {
free(freeMe);
continue; continue;
}
(void) wmove(win, y, 2 * MARGIN); (void) wmove(win, y, 2 * MARGIN);
dlg_attrset(win, dialog_attr); dlg_attrset(win, dialog_attr);
@ -266,9 +267,11 @@ dlg_begin_mixedgauge(DIALOG_MIXEDGAUGE * dlg,
int aItemNo, int aItemNo,
char **items) char **items)
{ {
int n, y, x; int y, x;
if (!*began) { if (!*began) {
int n;
curs_set(0); curs_set(0);
memset(dlg, 0, sizeof(*dlg)); memset(dlg, 0, sizeof(*dlg));
@ -367,6 +370,8 @@ dlg_finish_mixedgauge(DIALOG_MIXEDGAUGE * dlg, int status)
#endif #endif
curs_set(1); curs_set(1);
dlg_del_window(dlg->dialog); dlg_del_window(dlg->dialog);
free(dlg->prompt);
free(dlg->list);
return status; return status;
} }

View File

@ -1,9 +1,9 @@
/* /*
* $Id: mousewget.c,v 1.24 2017/01/31 00:27:21 tom Exp $ * $Id: mousewget.c,v 1.25 2019/07/25 00:06:38 tom Exp $
* *
* mousewget.c -- mouse/wgetch support for dialog * mousewget.c -- mouse/wgetch support for dialog
* *
* Copyright 2000-2016,2017 Thomas E. Dickey * Copyright 2000-2017,2019 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -39,9 +39,10 @@ mouse_wgetch(WINDOW *win, int *fkey, bool ignore_errs)
mouse_err = FALSE; mouse_err = FALSE;
if (key == KEY_MOUSE) { if (key == KEY_MOUSE) {
MEVENT event; MEVENT event;
mseRegion *p;
if (getmouse(&event) != ERR) { if (getmouse(&event) != ERR) {
mseRegion *p;
DLG_TRACE(("# mouse-click abs %d,%d (rel %d,%d)\n", DLG_TRACE(("# mouse-click abs %d,%d (rel %d,%d)\n",
event.y, event.x, event.y, event.x,
event.y - getbegy(win), event.y - getbegy(win),

View File

@ -1,9 +1,9 @@
/* /*
* $Id: msgbox.c,v 1.81 2018/06/21 23:29:59 tom Exp $ * $Id: msgbox.c,v 1.89 2020/11/23 00:32:02 tom Exp $
* *
* msgbox.c -- implements the message box and info box * msgbox.c -- implements the message box and info box
* *
* Copyright 2000-2012,2018 Thomas E. Dickey * Copyright 2000-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -45,15 +45,14 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
}; };
/* *INDENT-ON* */ /* *INDENT-ON* */
int x, y, last = 0, page; int x, y, page;
int button; int button;
int key = 0, fkey; int key, fkey;
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
WINDOW *dialog = 0; WINDOW *dialog = 0;
char *prompt; char *prompt;
const char **buttons = dlg_ok_label(); const char **buttons = dlg_ok_label();
int offset = 0; int offset = 0;
int check;
bool show = TRUE; bool show = TRUE;
int min_width = (pauseopt == 1 ? 12 : 0); int min_width = (pauseopt == 1 ? 12 : 0);
bool save_nocancel = dialog_vars.nocancel; bool save_nocancel = dialog_vars.nocancel;
@ -91,16 +90,10 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
x = dlg_box_x_ordinate(width); x = dlg_box_x_ordinate(width);
y = dlg_box_y_ordinate(height); y = dlg_box_y_ordinate(height);
#ifdef KEY_RESIZE dialog = dlg_new_window(height, width, y, x);
if (dialog != 0) dlg_register_window(dialog, "msgbox", binding);
dlg_move_window(dialog, height, width, y, x); dlg_register_buttons(dialog, "msgbox", buttons);
else
#endif
{
dialog = dlg_new_window(height, width, y, x);
dlg_register_window(dialog, "msgbox", binding);
dlg_register_buttons(dialog, "msgbox", buttons);
}
page = height - (1 + 3 * MARGIN); page = height - (1 + 3 * MARGIN);
dlg_mouse_setbase(x, y); dlg_mouse_setbase(x, y);
@ -111,12 +104,16 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
dlg_attrset(dialog, dialog_attr); dlg_attrset(dialog, dialog_attr);
if (pauseopt) { if (pauseopt) {
int last = 0;
dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr); dlg_draw_bottom_box2(dialog, border_attr, border2_attr, dialog_attr);
mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n'); mouse_mkbutton(height - 2, width / 2 - 4, 6, '\n');
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width); dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
dlg_draw_helpline(dialog, FALSE); dlg_draw_helpline(dialog, FALSE);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int check;
if (show) { if (show) {
last = dlg_print_scrolled(dialog, prompt, offset, last = dlg_print_scrolled(dialog, prompt, offset,
page, width, pauseopt); page, width, pauseopt);
@ -124,9 +121,10 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
show = FALSE; show = FALSE;
} }
key = dlg_mouse_wgetch(dialog, &fkey); key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) { if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) {
result = dlg_ok_buttoncode(check); result = dlg_ok_buttoncode(check);
break; break;
@ -137,11 +135,11 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:
dlg_will_resize(dialog); dlg_will_resize(dialog);
dlg_clear();
free(prompt); free(prompt);
height = req_high; height = req_high;
width = req_wide; width = req_wide;
show = TRUE; show = TRUE;
_dlg_resize_cleanup(dialog);
goto restart; goto restart;
#endif #endif
case DLGK_FIELD_NEXT: case DLGK_FIELD_NEXT:
@ -163,6 +161,9 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
FALSE, width); FALSE, width);
break; break;
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button); result = dlg_ok_buttoncode(button);
break; break;
default: default:
@ -180,7 +181,7 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
} }
break; break;
} }
} else { } else if (key > 0) {
beep(); beep();
} }
} }
@ -191,6 +192,7 @@ dialog_msgbox(const char *title, const char *cprompt, int height, int width,
dlg_trace_win(dialog); dlg_trace_win(dialog);
result = DLG_EXIT_OK; result = DLG_EXIT_OK;
} }
dlg_add_last_key(-1);
dlg_del_window(dialog); dlg_del_window(dialog);
dlg_mouse_free_regions(); dlg_mouse_free_regions();

View File

@ -1,3 +1,111 @@
cdialog (20210117) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Wed, 13 Jan 2021 19:58:21 -0500
cdialog (20210112) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 11 Jan 2021 03:53:05 -0500
cdialog (20201126) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 26 Jul 2020 11:17:16 -0400
cdialog (20200327) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 19 Mar 2020 05:02:12 -0400
cdialog (20200228) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 28 Feb 2020 20:31:15 -0500
cdialog (20191231) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 31 Dec 2019 15:37:41 -0500
cdialog (20191210) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 10 Dec 2019 17:19:19 -0500
cdialog (20191209) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 09 Dec 2019 04:14:47 -0500
cdialog (20191110) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 10 Nov 2019 17:48:23 -0500
cdialog (20190926) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Wed, 25 Sep 2019 04:37:53 -0400
cdialog (20190924) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 23 Sep 2019 05:13:54 -0400
cdialog (20190808) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 08 Aug 2019 16:54:08 -0400
cdialog (20190806) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Thu, 01 Aug 2019 20:16:04 -0400
cdialog (20190728) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 28 Jul 2019 18:04:47 -0400
cdialog (20190724) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 22 Jul 2019 19:20:18 -0400
cdialog (20190211) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Mon, 11 Feb 2019 15:47:42 -0500
cdialog (20181107) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Wed, 07 Nov 2018 20:38:14 -0500
cdialog (20181022) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 28 Oct 2018 10:53:29 -0400
cdialog (20180621) unstable; urgency=low cdialog (20180621) unstable; urgency=low
* maintenance updates * maintenance updates

View File

@ -1 +1 @@
5 10

View File

@ -22,3 +22,12 @@ Description: dialog - display dialog boxes from shell scripts
tailboxbg, textbox, timebox, treeview, and yesno (yes/no). tailboxbg, textbox, timebox, treeview, and yesno (yes/no).
. .
This package installs as "cdialog" to avoid conflict with other packages. This package installs as "cdialog" to avoid conflict with other packages.
Package: cdialog-dev
Architecture: any
Depends: libc6 (>= 2.11), libncursesw5 (>= 5.3)
Description: dialog - display dialog boxes from shell scripts
Dialog is a program that will let you present a variety of questions or
display messages using dialog boxes from a shell script. These types
This package provides headers and documentation for the library used
by "cdialog".

View File

@ -4,7 +4,7 @@ Current dialog upstream maintainer: Thomas Dickey <dickey@invisible-island.net>
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Files: *.c *.h Files: *.c *.h
Copyright 2000-2017,2018 Thomas E. Dickey Copyright 2000-2020,2021 Thomas E. Dickey
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License, version 2.1 it under the terms of the GNU Lesser General Public License, version 2.1
@ -27,7 +27,7 @@ Files: *.c *.h
Files: aclocal.m4 Files: aclocal.m4
Licence: other-BSD Licence: other-BSD
Copyright: 1999-2017,2018 by Thomas E. Dickey Copyright: 1999-2020,2021 by Thomas E. Dickey
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including "Software"), to deal in the Software without restriction, including
@ -88,7 +88,7 @@ Licence: other-BSD
shared with many OS's install programs. shared with many OS's install programs.
Files: debian/* Files: debian/*
Copyright: 2010-2012,2013 Thomas E. Dickey Copyright: 2010-2020,2021 Thomas E. Dickey
Licence: other-BSD Licence: other-BSD
Permission to use, copy, modify, and distribute this software and its Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, documentation for any purpose and without fee is hereby granted,

View File

@ -1,4 +1,5 @@
#!/usr/bin/make -f #!/usr/bin/make -f
# $Id: rules,v 1.11 2019/07/24 00:53:35 tom Exp $
# Made with the aid of dh_make, by Craig Small # Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# Some lines taken from debmake, by Cristoph Lameter. # Some lines taken from debmake, by Cristoph Lameter.
@ -15,7 +16,16 @@ CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS := $(shell dpkg-buildflags --get CFLAGS) CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
TMP = $(CURDIR)/debian/tmp
ACTUAL_PROG = cdialog ACTUAL_PROG = cdialog
DEV_PACKAGE = $(ACTUAL_PROG)-dev
BINDIR = /usr/bin
LIBDIR = /usr/lib
LOCALE = /usr/share/locale
MANDIR = /usr/share/man
HEADER = /usr/include
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0 CFLAGS += -O0
@ -77,7 +87,31 @@ install-stamp: build-stamp
dh_clean -k dh_clean -k
dh_installdirs dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/${ACTUAL_PROG} $(MAKE) install-full DESTDIR=$(TMP)
dh_install -p${ACTUAL_PROG} $(BINDIR)/$(ACTUAL_PROG)
dh_install -p${ACTUAL_PROG} $(LIBDIR)
dh_install -p${ACTUAL_PROG} $(LOCALE)
dh_install -p${ACTUAL_PROG} $(MANDIR)/man1
dh_install -p${DEV_PACKAGE} $(BINDIR)/$(ACTUAL_PROG)-config
dh_install -p${DEV_PACKAGE} $(MANDIR)/man3
dh_install -p${DEV_PACKAGE} $(HEADER)
echo FIXME
for P in lib${ACTUAL_PROG}.so*; \
do \
[ -L "$$P" ] || continue; \
case "$$P" in \
*.so) \
echo "DEV: $$P"; \
dh_link -p${DEV_PACKAGE} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
;; \
*) \
echo "BIN: $$P"; \
dh_link -p${ACTUAL_PROG} $(LIBDIR)/`readlink $$P` $(LIBDIR)/$$P ; \
;; \
esac; \
done
touch install-stamp touch install-stamp

View File

@ -1,4 +1,4 @@
# $Id: dialog.map,v 1.7 2018/06/21 00:32:55 tom Exp $ # $Id: dialog.map,v 1.13 2020/11/26 18:09:52 tom Exp $
# script for shared library symbol-versioning using ld # script for shared library symbol-versioning using ld
# #
# This file was generated by ncu-mapsyms # This file was generated by ncu-mapsyms
@ -17,6 +17,18 @@
# Configure options (1.3.20180620) # Configure options (1.3.20180620)
# --disable-leaks --enable-trace # --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec # --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20190806)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20191209)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20200326)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20201126)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
DIALOG_1.0.20040721 { DIALOG_1.0.20040721 {
global: global:
@ -220,3 +232,32 @@ DIALOG_1.3.20180620 {
dlg_ttysize; dlg_ttysize;
dlg_will_resize; dlg_will_resize;
} DIALOG_1.3.20160126; } DIALOG_1.3.20160126;
DIALOG_1.3.20190806 {
global:
dlg_button_key;
dlg_exitcode2s;
dlg_exitname2n;
dlg_ok_button_key;
} DIALOG_1.3.20180620;
DIALOG_1.3.20191209 {
global:
dlg_trace_va_msg;
} DIALOG_1.3.20190806;
DIALOG_1.3.20200326 {
global:
dlg_reset_timeout;
dlg_set_timeout;
} DIALOG_1.3.20191209;
DIALOG_1.3.20201126 {
global:
dlg_der_window;
dlg_getenv_num;
dlg_getenv_str;
dlg_keep_tite;
local:
_*;
} DIALOG_1.3.20200326;

View File

@ -1,9 +1,9 @@
Summary: dialog - display dialog boxes from shell scripts Summary: dialog - display dialog boxes from shell scripts
%define AppProgram dialog %define AppProgram dialog
%define AppVersion 1.3 %define AppVersion 1.3
%define AppRelease 20180621 %define AppRelease 20210117
%define ActualProg c%{AppProgram} %define ActualProg c%{AppProgram}
# $XTermId: dialog.spec,v 1.108 2018/06/21 09:19:45 tom Exp $ # $XTermId: dialog.spec,v 1.146 2021/01/16 16:21:23 tom Exp $
Name: %{ActualProg} Name: %{ActualProg}
Version: %{AppVersion} Version: %{AppVersion}
Release: %{AppRelease} Release: %{AppRelease}
@ -13,6 +13,10 @@ URL: ftp://ftp.invisible-island.net/%{AppProgram}
Source0: %{AppProgram}-%{AppVersion}-%{AppRelease}.tgz Source0: %{AppProgram}-%{AppVersion}-%{AppRelease}.tgz
Packager: Thomas Dickey <dickey@invisible-island.net> Packager: Thomas Dickey <dickey@invisible-island.net>
%package devel
Summary: Development headers/library for the dialog package.
Requires: %{ActualProg}, ncurses-devel
%description %description
Dialog is a program that will let you present a variety of questions or Dialog is a program that will let you present a variety of questions or
display messages using dialog boxes from a shell script. These types display messages using dialog boxes from a shell script. These types
@ -26,6 +30,10 @@ into dialog):
tailboxbg, textbox, timebox, treeview, and yesno (yes/no). tailboxbg, textbox, timebox, treeview, and yesno (yes/no).
This package installs as "cdialog" to avoid conflict with other packages. This package installs as "cdialog" to avoid conflict with other packages.
%description devel
This is the development package "cdialog", which includes the header files,
the linkage information and library documentation.
%prep %prep
%define debug_package %{nil} %define debug_package %{nil}
@ -38,27 +46,27 @@ cp -v package/dialog.map package/%{ActualProg}.map
INSTALL_PROGRAM='${INSTALL}' \ INSTALL_PROGRAM='${INSTALL}' \
%configure \ %configure \
--target %{_target_platform} \ --target %{_target_platform} \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
--bindir=%{_bindir} \ --bindir=%{_bindir} \
--libdir=%{_libdir} \ --libdir=%{_libdir} \
--mandir=%{_mandir} \ --mandir=%{_mandir} \
--with-package=%{ActualProg} \ --with-package=%{ActualProg} \
--enable-header-subdir \ --enable-header-subdir \
--enable-nls \ --enable-nls \
--enable-widec \ --enable-widec \
--with-shared \ --with-shared \
--with-ncursesw \ --with-ncursesw \
--with-versioned-syms \ --with-versioned-syms \
--disable-rpath-hack --disable-rpath-hack
make make
%install %install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT
make install-full DESTDIR=$RPM_BUILD_ROOT make install-full DESTDIR=$RPM_BUILD_ROOT
strip $RPM_BUILD_ROOT%{_bindir}/%{ActualProg} strip $RPM_BUILD_ROOT%{_bindir}/%{ActualProg}
chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib%{ActualProg}.so.* chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib%{ActualProg}.so.*
@ -69,19 +77,26 @@ chmod 755 $RPM_BUILD_ROOT%{_libdir}/lib%{ActualProg}.so.*
%files %files
%defattr(-,root,root) %defattr(-,root,root)
%{_bindir}/%{ActualProg} %{_bindir}/%{ActualProg}
%{_bindir}/%{ActualProg}-config
%{_mandir}/man1/%{ActualProg}.* %{_mandir}/man1/%{ActualProg}.*
%{_mandir}/man3/%{ActualProg}.* %{_libdir}/lib%{ActualProg}.so.*
%{_datadir}/locale/*/LC_MESSAGES/%{ActualProg}.mo
%files devel
%defattr(-,root,root)
%{_bindir}/%{ActualProg}-config
%{_includedir}/%{ActualProg}.h %{_includedir}/%{ActualProg}.h
%{_includedir}/%{ActualProg}/dlg_colors.h %{_includedir}/%{ActualProg}/dlg_colors.h
%{_includedir}/%{ActualProg}/dlg_config.h %{_includedir}/%{ActualProg}/dlg_config.h
%{_includedir}/%{ActualProg}/dlg_keys.h %{_includedir}/%{ActualProg}/dlg_keys.h
%{_libdir}/lib%{ActualProg}.* %{_libdir}/lib%{ActualProg}.so
%{_datadir}/locale/*/LC_MESSAGES/%{ActualProg}.mo %{_mandir}/man3/%{ActualProg}.*
%changelog %changelog
# each patch should add its ChangeLog entries here # each patch should add its ChangeLog entries here
* Wed Jul 24 2019 Thomas Dickey
- split-out "-devel" package
* Sat Dec 09 2017 Thomas Dickey * Sat Dec 09 2017 Thomas Dickey
- update ftp url - update ftp url

View File

@ -1,4 +1,4 @@
# $Id: dialog.sym,v 1.7 2018/06/21 00:32:55 tom Exp $ # $Id: dialog.sym,v 1.12 2020/11/26 18:08:18 tom Exp $
# script for shared library symbol-visibility using libtool # script for shared library symbol-visibility using libtool
# #
# This file was generated by ncu-mapsyms # This file was generated by ncu-mapsyms
@ -17,6 +17,18 @@
# Configure options (1.3.20180620) # Configure options (1.3.20180620)
# --disable-leaks --enable-trace # --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec # --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20190806)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20191209)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20200326)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
# Configure options (1.3.20201126)
# --disable-leaks --enable-trace
# --disable-leaks --enable-trace --enable-widec
dialog_buildlist dialog_buildlist
dialog_calendar dialog_calendar
dialog_checklist dialog_checklist
@ -64,6 +76,7 @@ dlg_box_y_ordinate
dlg_boxchar dlg_boxchar
dlg_buildlist dlg_buildlist
dlg_button_count dlg_button_count
dlg_button_key
dlg_button_layout dlg_button_layout
dlg_button_sizes dlg_button_sizes
dlg_button_to_char dlg_button_to_char
@ -92,6 +105,7 @@ dlg_default_item
dlg_default_listitem dlg_default_listitem
dlg_defaultno_button dlg_defaultno_button
dlg_del_window dlg_del_window
dlg_der_window
dlg_does_output dlg_does_output
dlg_draw_arrows dlg_draw_arrows
dlg_draw_arrows2 dlg_draw_arrows2
@ -114,7 +128,9 @@ dlg_editbox
dlg_exit dlg_exit
dlg_exit_buttoncode dlg_exit_buttoncode
dlg_exit_label dlg_exit_label
dlg_exitcode2s
dlg_exiterr dlg_exiterr
dlg_exitname2n
dlg_find_index dlg_find_index
dlg_finish_string dlg_finish_string
dlg_flush_getc dlg_flush_getc
@ -125,9 +141,12 @@ dlg_free_gauge
dlg_get_attrs dlg_get_attrs
dlg_getc dlg_getc
dlg_getc_callbacks dlg_getc_callbacks
dlg_getenv_num
dlg_getenv_str
dlg_index_columns dlg_index_columns
dlg_index_wchars dlg_index_wchars
dlg_item_help dlg_item_help
dlg_keep_tite
dlg_killall_bg dlg_killall_bg
dlg_last_getc dlg_last_getc
dlg_limit_columns dlg_limit_columns
@ -150,6 +169,7 @@ dlg_new_modal_window
dlg_new_window dlg_new_window
dlg_next_button dlg_next_button
dlg_next_ok_buttonindex dlg_next_ok_buttonindex
dlg_ok_button_key
dlg_ok_buttoncode dlg_ok_buttoncode
dlg_ok_label dlg_ok_label
dlg_ok_labels dlg_ok_labels
@ -172,11 +192,13 @@ dlg_register_buttons
dlg_register_window dlg_register_window
dlg_remove_callback dlg_remove_callback
dlg_renamed_menutext dlg_renamed_menutext
dlg_reset_timeout
dlg_restore_vars dlg_restore_vars
dlg_result_key dlg_result_key
dlg_save_vars dlg_save_vars
dlg_set_focus dlg_set_focus
dlg_set_result dlg_set_result
dlg_set_timeout
dlg_show_string dlg_show_string
dlg_strclone dlg_strclone
dlg_strempty dlg_strempty
@ -188,6 +210,7 @@ dlg_trace_2n
dlg_trace_2s dlg_trace_2s
dlg_trace_chr dlg_trace_chr
dlg_trace_msg dlg_trace_msg
dlg_trace_va_msg
dlg_trace_win dlg_trace_win
dlg_treeview dlg_treeview
dlg_trim_string dlg_trim_string

View File

@ -7,7 +7,7 @@
# #
PORTNAME= cdialog PORTNAME= cdialog
PORTVERSION= 1.3.20180621 PORTVERSION= 1.3.20210117
PORTEPOCH= 1 PORTEPOCH= 1
CATEGORIES= devel CATEGORIES= devel
MASTER_SITES= ftp://ftp.invisible-island.net/${PORTNAME:S|^c||}/ MASTER_SITES= ftp://ftp.invisible-island.net/${PORTNAME:S|^c||}/

View File

@ -1,9 +1,9 @@
/* /*
* $Id: pause.c,v 1.39 2018/06/19 22:57:01 tom Exp $ * $Id: pause.c,v 1.48 2020/11/23 00:38:19 tom Exp $
* *
* pause.c -- implements the pause dialog * pause.c -- implements the pause dialog
* *
* Copyright 2004-2012,2018 Thomas E. Dickey * Copyright 2004-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -72,7 +72,7 @@ dialog_pause(const char *title,
const char **buttons = dlg_ok_labels(); const char **buttons = dlg_ok_labels();
bool have_buttons = (dlg_button_count(buttons) != 0); bool have_buttons = (dlg_button_count(buttons) != 0);
bool first; bool first;
int key = 0, fkey; int key, fkey;
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
int button_high = (have_buttons ? BTN_HIGH : MARGIN); int button_high = (have_buttons ? BTN_HIGH : MARGIN);
int gauge_y; int gauge_y;
@ -88,8 +88,9 @@ dialog_pause(const char *title,
curs_set(0); curs_set(0);
dialog_vars.timeout_secs = 0;
seconds_orig = (seconds > 0) ? seconds : 1; seconds_orig = (seconds > 0) ? seconds : 1;
dialog_vars.pause_secs = seconds_orig;
dialog_vars.timeout_secs = 0;
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
retry: retry:
@ -194,8 +195,8 @@ dialog_pause(const char *title,
key = dlg_mouse_wgetch_nowait(dialog, &fkey); key = dlg_mouse_wgetch_nowait(dialog, &fkey);
if (key == ERR) { if (key == ERR) {
; /* ignore errors in nodelay mode */ ; /* ignore errors in nodelay mode */
} else { } else if (dlg_result_key(key, fkey, &result)) {
if (dlg_result_key(key, fkey, &result)) if (!dlg_button_key(result, &button, &key, &fkey))
break; break;
} }
@ -203,12 +204,10 @@ dialog_pause(const char *title,
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
case KEY_RESIZE: case KEY_RESIZE:
dlg_will_resize(dialog); dlg_will_resize(dialog);
dlg_clear(); /* fill the background */
dlg_del_window(dialog); /* delete this window */
height = old_height; height = old_height;
width = old_width; width = old_width;
free(prompt); free(prompt);
refresh(); /* get it all onto the terminal */ _dlg_resize_cleanup(dialog);
goto retry; goto retry;
#endif #endif
case DLGK_FIELD_NEXT: case DLGK_FIELD_NEXT:
@ -232,6 +231,9 @@ dialog_pause(const char *title,
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_enter_buttoncode(button); result = dlg_enter_buttoncode(button);
break; break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button);
break;
case ERR: case ERR:
break; break;
default: default:
@ -244,6 +246,7 @@ dialog_pause(const char *title,
} }
} }
} while ((result == DLG_EXIT_UNKNOWN) && (seconds-- > 0)); } while ((result == DLG_EXIT_UNKNOWN) && (seconds-- > 0));
dlg_add_last_key(-1);
curs_set(1); curs_set(1);
dlg_mouse_free_regions(); dlg_mouse_free_regions();

115
contrib/dialog/po/ast.po Normal file
View File

@ -0,0 +1,115 @@
# Asturian translation for dialog
# Dialog
# This file is distributed under the same license as the dialog package.
# Copyright 2003-2007,2008 # Thomas Dickey
#
# enolp <enolp@softastur.org>, 2018.
msgid ""
msgstr ""
"Project-Id-Version: dialog 1.1.20080819\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-06-18 18:26-0400\n"
"PO-Revision-Date: 2018-07-16 01:09+0100\n"
"Last-Translator: enolp <enolp@softastur.org>\n"
"Language-Team: Asturian <ubuntu-l10n-ast@lists.ubuntu.com>\n"
"Language: ast\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Lokalize 2.0\n"
#: buttons.c:385
msgid "Yes"
msgstr "Sí"
#: buttons.c:393
msgid "No"
msgstr "Non"
#: buttons.c:401
msgid "OK"
msgstr "Aceutar"
#: buttons.c:409
msgid "Cancel"
msgstr "Encaboxar"
#: buttons.c:417
msgid "EXIT"
msgstr "COLAR"
#: buttons.c:425
msgid "Extra"
msgstr "Adicional"
#: buttons.c:433
msgid "Help"
msgstr "Ayuda"
#. Headline "Month"
#: calendar.c:273
msgid "Month"
msgstr "Mes"
#. Headline "Year"
#: calendar.c:293
msgid "Year"
msgstr "Añu"
#: dialog.c:741
msgid "Rename"
msgstr "Renomar"
#: fselect.c:550
msgid "Directories"
msgstr "Direutorios"
#: fselect.c:551
msgid "Files"
msgstr "Ficheros"
#: mixedgauge.c:58
msgid "Succeeded"
msgstr "Tuvo ésitu"
#: mixedgauge.c:61
msgid "Failed"
msgstr "Falló"
#: mixedgauge.c:64
msgid "Passed"
msgstr "Posóse"
#: mixedgauge.c:67
msgid "Completed"
msgstr "Completóse"
#: mixedgauge.c:70
msgid "Checked"
msgstr "Conseñóse"
#: mixedgauge.c:73
msgid "Done"
msgstr "Fecho"
#: mixedgauge.c:76
msgid "Skipped"
msgstr "Saltóse"
#: mixedgauge.c:79
msgid "In Progress"
msgstr "En cursu"
#: mixedgauge.c:85
msgid "N/A"
msgstr "N/D"
#: mixedgauge.c:193
msgid "Overall Progress"
msgstr "Progresu xeneral"
#: textbox.c:489
msgid "Search"
msgstr "Guetar"

View File

@ -1,12 +1,12 @@
# Dialog # Dialog
# Copyright 2003-2014,2015 # Thomas Dickey # Copyright 2003-2020,2021 # Thomas Dickey
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: dialog 1.2.20150510\n" "Project-Id-Version: dialog 1.3.20210117\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-10 21:00-0400\n" "POT-Creation-Date: 2021-01-17 15:18-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -15,53 +15,63 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: buttons.c:480 #: buttons.c:500
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""
#: buttons.c:488 #: buttons.c:508
msgid "No" msgid "No"
msgstr "" msgstr ""
#: buttons.c:496 #: buttons.c:516
msgid "OK" msgid "OK"
msgstr "" msgstr ""
#: buttons.c:504 #: buttons.c:524
msgid "Cancel" msgid "Cancel"
msgstr "" msgstr ""
#: buttons.c:512 #: buttons.c:532
msgid "EXIT" msgid "EXIT"
msgstr "" msgstr ""
#: buttons.c:520 #: buttons.c:540
msgid "Extra" msgid "Extra"
msgstr "" msgstr ""
#: buttons.c:528 #: buttons.c:548
msgid "Help" msgid "Help"
msgstr "" msgstr ""
#. Headline "Month" #. Headline "Month"
#: calendar.c:300 #: calendar.c:463
msgid "Month" msgid "Month"
msgstr "" msgstr ""
#. Headline "Year" #. Headline "Year"
#: calendar.c:322 #: calendar.c:485
msgid "Year" msgid "Year"
msgstr "" msgstr ""
#: dialog.c:728 #: dialog.c:744
#, c-format
msgid "Expected %d arguments, found only %d"
msgstr ""
#: dialog.c:748
#, c-format
msgid "Expected %d arguments, found extra %d"
msgstr ""
#: dialog.c:907
msgid "Rename" msgid "Rename"
msgstr "" msgstr ""
#: fselect.c:596 #: fselect.c:623
msgid "Directories" msgid "Directories"
msgstr "" msgstr ""
#: fselect.c:597 #: fselect.c:624
msgid "Files" msgid "Files"
msgstr "" msgstr ""
@ -101,10 +111,10 @@ msgstr ""
msgid "N/A" msgid "N/A"
msgstr "" msgstr ""
#: mixedgauge.c:190 #: mixedgauge.c:193
msgid "Overall Progress" msgid "Overall Progress"
msgstr "" msgstr ""
#: textbox.c:502 #: textbox.c:515
msgid "Search" msgid "Search"
msgstr "" msgstr ""

View File

@ -9,6 +9,7 @@ msgstr ""
"PO-Revision-Date: 2007-07-18 11:06+0200\n" "PO-Revision-Date: 2007-07-18 11:06+0200\n"
"Last-Translator: Deepika Mangla <deepika.mangla@gmail.com>\n" "Last-Translator: Deepika Mangla <deepika.mangla@gmail.com>\n"
"Language-Team: <elinks@knopper.net>\n" "Language-Team: <elinks@knopper.net>\n"
"Language: hi\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
@ -19,94 +20,94 @@ msgstr ""
#: buttons.c:385 #: buttons.c:385
msgid "Yes" msgid "Yes"
msgstr "à€¹à€Ÿà€" msgstr "हाँ"
#: buttons.c:393 #: buttons.c:393
msgid "No" msgid "No"
msgstr "à€šà€¹à¥€à€‚" msgstr "नहीं"
#: buttons.c:401 #: buttons.c:401
msgid "OK" msgid "OK"
msgstr "à€ à¥€à€•" msgstr "ठीक"
#: buttons.c:409 #: buttons.c:409
msgid "Cancel" msgid "Cancel"
msgstr "à€°à€Šà¥à€Š à€•à€°à¥‡à€‚" msgstr "रद्द करें"
#: buttons.c:417 #: buttons.c:417
msgid "EXIT" msgid "EXIT"
msgstr "à€šà€¿à€°à¥à€—à€®" msgstr "निर्गम"
#: buttons.c:425 #: buttons.c:425
msgid "Extra" msgid "Extra"
msgstr "à€…à€€à€¿à€°à€¿à€•à¥à€€" msgstr "अतिरिक्त"
#: buttons.c:433 #: buttons.c:433
msgid "Help" msgid "Help"
msgstr "à€®à€Šà€Š" msgstr "मदद"
#. Headline "Month" #. Headline "Month"
#: calendar.c:273 #: calendar.c:273
msgid "Month" msgid "Month"
msgstr "à€®à€¹à¥€à€šà€Ÿ" msgstr "महीना"
#. Headline "Year" #. Headline "Year"
#: calendar.c:293 #: calendar.c:293
msgid "Year" msgid "Year"
msgstr "à€µà€°à¥à€·" msgstr "वर्ष"
#: dialog.c:741 #: dialog.c:741
msgid "Rename" msgid "Rename"
msgstr "à€ªà¥à€šà€ƒà€šà€Ÿà€®à€•à€°à€£" msgstr "पुनःनामकरण"
#: fselect.c:550 #: fselect.c:550
msgid "Directories" msgid "Directories"
msgstr "à€šà€¿à€°à¥à€Šà¥‡à€¶à€¿à€•à€Ÿ" msgstr "निर्देशिका"
#: fselect.c:551 #: fselect.c:551
msgid "Files" msgid "Files"
msgstr "à€žà€‚à€šà€¿à€•à€Ÿ" msgstr "संचिका"
#: mixedgauge.c:58 #: mixedgauge.c:58
msgid "Succeeded" msgid "Succeeded"
msgstr "à€žà€«à€²" msgstr "सफल"
#: mixedgauge.c:61 #: mixedgauge.c:61
msgid "Failed" msgid "Failed"
msgstr "à€žà€«à€²" msgstr "सफल"
#: mixedgauge.c:64 #: mixedgauge.c:64
msgid "Passed" msgid "Passed"
msgstr "à€ªà€Ÿà€ž" msgstr "पास"
#: mixedgauge.c:67 #: mixedgauge.c:67
msgid "Completed" msgid "Completed"
msgstr "à€žà€®à¥à€ªà¥‚à€°à€¿à€€" msgstr "सम्पूरित"
#: mixedgauge.c:70 #: mixedgauge.c:70
msgid "Checked" msgid "Checked"
msgstr "à€…à€µà€°à¥à€Šà¥à€§" msgstr "अवरुद्ध"
#: mixedgauge.c:73 #: mixedgauge.c:73
msgid "Done" msgid "Done"
msgstr "à€žà€«à€² " msgstr "सफल "
#: mixedgauge.c:76 #: mixedgauge.c:76
msgid "Skipped" msgid "Skipped"
msgstr "à€›à¥‹à€¡à€Œ à€Šà€¿à€¯à€Ÿ" msgstr "छोड़ दिया"
#: mixedgauge.c:79 #: mixedgauge.c:79
msgid "In Progress" msgid "In Progress"
msgstr "à€ªà¥à€°à€—à€€à€¿ à€®à¥‡à€‚ à€¹à¥ˆ" msgstr "प्रगति में है"
#: mixedgauge.c:85 #: mixedgauge.c:85
msgid "N/A" msgid "N/A"
msgstr "à€²à€Ÿà€—à¥‚ à€šà€¹à¥€à€‚" msgstr "लागू नहीं"
#: mixedgauge.c:193 #: mixedgauge.c:193
msgid "Overall Progress" msgid "Overall Progress"
msgstr "à€žà€®à€—à¥à€° à€ªà¥à€°à€—à€€à€¿" msgstr "समग्र प्रगति"
#: textbox.c:489 #: textbox.c:489
msgid "Search" msgid "Search"
msgstr "à€…à€šà¥à€žà€šà¥à€§à€Ÿà€š" msgstr "अनुसन्धान"

View File

@ -14,99 +14,99 @@ msgstr ""
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n" "Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
"Language: ja\n" "Language: ja\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=EUC-JP\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: buttons.c:387 #: buttons.c:387
msgid "Yes" msgid "Yes"
msgstr "はい" msgstr "はい"
#: buttons.c:395 #: buttons.c:395
msgid "No" msgid "No"
msgstr "いいえ" msgstr "いいえ"
#: buttons.c:403 #: buttons.c:403
msgid "OK" msgid "OK"
msgstr "了解" msgstr "了解"
#: buttons.c:411 #: buttons.c:411
msgid "Cancel" msgid "Cancel"
msgstr "取消" msgstr "取消"
#: buttons.c:419 #: buttons.c:419
msgid "EXIT" msgid "EXIT"
msgstr "終了" msgstr "終了"
#: buttons.c:427 #: buttons.c:427
msgid "Extra" msgid "Extra"
msgstr "拡張" msgstr "拡張"
#: buttons.c:435 #: buttons.c:435
msgid "Help" msgid "Help"
msgstr "ヘルプ" msgstr "ヘルプ"
#. Headline "Month" #. Headline "Month"
#: calendar.c:298 #: calendar.c:298
msgid "Month" msgid "Month"
msgstr "月" msgstr "月"
#. Headline "Year" #. Headline "Year"
#: calendar.c:318 #: calendar.c:318
msgid "Year" msgid "Year"
msgstr "年" msgstr "年"
#: dialog.c:756 #: dialog.c:756
msgid "Rename" msgid "Rename"
msgstr "名前変更" msgstr "名前変更"
#: fselect.c:571 #: fselect.c:571
msgid "Directories" msgid "Directories"
msgstr "ディレクトリ" msgstr "ディレクトリ"
#: fselect.c:572 #: fselect.c:572
msgid "Files" msgid "Files"
msgstr "ファイル" msgstr "ファイル"
#: mixedgauge.c:58 #: mixedgauge.c:58
msgid "Succeeded" msgid "Succeeded"
msgstr "成功" msgstr "成功"
#: mixedgauge.c:61 #: mixedgauge.c:61
msgid "Failed" msgid "Failed"
msgstr "失敗" msgstr "失敗"
#: mixedgauge.c:64 #: mixedgauge.c:64
msgid "Passed" msgid "Passed"
msgstr "パス" msgstr "パス"
#: mixedgauge.c:67 #: mixedgauge.c:67
msgid "Completed" msgid "Completed"
msgstr "完了" msgstr "完了"
#: mixedgauge.c:70 #: mixedgauge.c:70
msgid "Checked" msgid "Checked"
msgstr "確認終了" msgstr "確認終了"
#: mixedgauge.c:73 #: mixedgauge.c:73
msgid "Done" msgid "Done"
msgstr "終了" msgstr "終了"
#: mixedgauge.c:76 #: mixedgauge.c:76
msgid "Skipped" msgid "Skipped"
msgstr "スキップ" msgstr "スキップ"
#: mixedgauge.c:79 #: mixedgauge.c:79
msgid "In Progress" msgid "In Progress"
msgstr "処理中" msgstr "処理中"
#: mixedgauge.c:85 #: mixedgauge.c:85
msgid "N/A" msgid "N/A"
msgstr "無効" msgstr "無効"
#: mixedgauge.c:193 #: mixedgauge.c:193
msgid "Overall Progress" msgid "Overall Progress"
msgstr "全体の進行状況" msgstr "全体の進行状況"
#: textbox.c:468 #: textbox.c:468
msgid "Search" msgid "Search"
msgstr "調査" msgstr "調査"

View File

@ -1,18 +1,23 @@
# Portuguese translation of Dialog. # Portuguese (Portugal) Translation for the dialog Package
# Copyright (C) 2001 Thomas Dickey. # This file is distributed under the same license as the dialog package.
# Frédéric L. W. Meunier <0 @ pervalidus.net>, 2001. # Copyright 2003-2007,2008 Thomas Dickey
# This file is distributed under the same license as the dialog package.
# Pedro Albuquerque <palbuquerque73@gmail.com>, 2019.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Dialog 0.9a-20020814\n" "Project-Id-Version: dialog 1.1.20080819\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-06-18 18:26-0400\n" "POT-Creation-Date: 2008-06-18 18:26-0400\n"
"PO-Revision-Date: 2002-09-04 19:12-0300\n" "PO-Revision-Date: 2019-09-25 07:33+0100\n"
"Last-Translator: Frédéric L. W. Meunier <0 @ pervalidus.net>\n" "Last-Translator: Pedro Albuquerque <palbuquerque73@gmail.com>\n"
"Language-Team: Portuguese <pt @ li.org>\n" "Language-Team: Portuguese <translation-team-pt@lists.sourceforge.net>\n"
"Language: pt\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: buttons.c:385 #: buttons.c:385
msgid "Yes" msgid "Yes"
@ -32,11 +37,11 @@ msgstr "Cancelar"
#: buttons.c:417 #: buttons.c:417
msgid "EXIT" msgid "EXIT"
msgstr "Sair" msgstr "SAIR"
#: buttons.c:425 #: buttons.c:425
msgid "Extra" msgid "Extra"
msgstr "" msgstr "Extra"
#: buttons.c:433 #: buttons.c:433
msgid "Help" msgid "Help"
@ -54,11 +59,11 @@ msgstr "Ano"
#: dialog.c:741 #: dialog.c:741
msgid "Rename" msgid "Rename"
msgstr "" msgstr "Renomear"
#: fselect.c:550 #: fselect.c:550
msgid "Directories" msgid "Directories"
msgstr "Directorias" msgstr "Pastas"
#: fselect.c:551 #: fselect.c:551
msgid "Files" msgid "Files"
@ -66,46 +71,44 @@ msgstr "Ficheiros"
#: mixedgauge.c:58 #: mixedgauge.c:58
msgid "Succeeded" msgid "Succeeded"
msgstr "" msgstr "Sucesso"
#: mixedgauge.c:61 #: mixedgauge.c:61
#, fuzzy
msgid "Failed" msgid "Failed"
msgstr "Ficheiros" msgstr "Falha"
#: mixedgauge.c:64 #: mixedgauge.c:64
msgid "Passed" msgid "Passed"
msgstr "" msgstr "Passou"
#: mixedgauge.c:67 #: mixedgauge.c:67
msgid "Completed" msgid "Completed"
msgstr "" msgstr "Concluído"
#: mixedgauge.c:70 #: mixedgauge.c:70
msgid "Checked" msgid "Checked"
msgstr "" msgstr "Verificado"
#: mixedgauge.c:73 #: mixedgauge.c:73
msgid "Done" msgid "Done"
msgstr "" msgstr "Feito"
#: mixedgauge.c:76 #: mixedgauge.c:76
msgid "Skipped" msgid "Skipped"
msgstr "" msgstr "Ignorado"
#: mixedgauge.c:79 #: mixedgauge.c:79
msgid "In Progress" msgid "In Progress"
msgstr "" msgstr "Em Curso"
#: mixedgauge.c:85 #: mixedgauge.c:85
msgid "N/A" msgid "N/A"
msgstr "" msgstr "N/D"
#: mixedgauge.c:193 #: mixedgauge.c:193
msgid "Overall Progress" msgid "Overall Progress"
msgstr "" msgstr "Progresso geral"
#: textbox.c:489 #: textbox.c:489
#, fuzzy
msgid "Search" msgid "Search"
msgstr "Busca" msgstr "Procurar"

View File

@ -14,7 +14,6 @@ msgstr ""
"Last-Translator: Mihai Cristescu <mihai.cristescu@archlinux.info>\n" "Last-Translator: Mihai Cristescu <mihai.cristescu@archlinux.info>\n"
"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n" "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
"Language: ro\n" "Language: ro\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"

View File

@ -1,111 +1,113 @@
# Albanian translation of Dialog. # Translation of dialog to Albanian
# This file is distributed under the same license as the dialog package. # This file is distributed under the same license as the dialog package.
# Copyright (C) 2005 Thomas Dickey. # Copyright 2003-2007,2008 # Thomas Dickey
# Elian Myftiu <elian@lycos.com>, 2004. # Besnik Bleta <besnik@programeshqip.org>, 2004,2008,2015, 2019, 2020.
#
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Dialog 1.0-20050116\n" "Project-Id-Version: dialog-1.1.20080819\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-01-16 17:57-0500\n" "POT-Creation-Date: 2008-06-18 18:26-0400\n"
"PO-Revision-Date: 2004-11-18 02:28+0100\n" "PO-Revision-Date: 2020-04-01 15:04+0300\n"
"Last-Translator: Elian Myftiu <elian@lycos.com>\n" "Last-Translator: Besnik Bleta <besnik@programeshqip.org>\n"
"Language-Team: Albanian <gnome-albanian-perkthyesit@lists.sourceforge.net>\n" "Language-Team: Albanian <translation-team-sq@lists.sourceforge.net>\n"
"Language: sq\n" "Language: sq\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.2\n"
#: buttons.c:387 #: buttons.c:385
msgid "Yes" msgid "Yes"
msgstr "Po" msgstr "Po"
#: buttons.c:395 #: buttons.c:393
msgid "No" msgid "No"
msgstr "Jo" msgstr "Jo"
#: buttons.c:403 #: buttons.c:401
msgid "OK" msgid "OK"
msgstr "mirë" msgstr "OK"
#: buttons.c:411 #: buttons.c:409
msgid "Cancel" msgid "Cancel"
msgstr "Anullo" msgstr "Anuloje"
#: buttons.c:419 #: buttons.c:417
msgid "EXIT" msgid "EXIT"
msgstr "Dal" msgstr "DALJE"
#: buttons.c:427 #: buttons.c:425
msgid "Extra" msgid "Extra"
msgstr "" msgstr "Ekstra"
#: buttons.c:435 #: buttons.c:433
msgid "Help" msgid "Help"
msgstr "" msgstr "Ndihmë"
#. Headline "Month" #. Headline "Month"
#: calendar.c:298 #: calendar.c:273
msgid "Month" msgid "Month"
msgstr "" msgstr "Muaj"
#. Headline "Year" #. Headline "Year"
#: calendar.c:318 #: calendar.c:293
msgid "Year" msgid "Year"
msgstr "" msgstr "Vit"
#: dialog.c:756 #: dialog.c:741
msgid "Rename" msgid "Rename"
msgstr "" msgstr "Riemërtoje"
#: fselect.c:571 #: fselect.c:550
msgid "Directories" msgid "Directories"
msgstr "" msgstr "Drejtori"
#: fselect.c:572 #: fselect.c:551
msgid "Files" msgid "Files"
msgstr "" msgstr "Kartela"
#: mixedgauge.c:58 #: mixedgauge.c:58
msgid "Succeeded" msgid "Succeeded"
msgstr "" msgstr "Doli me sukses"
#: mixedgauge.c:61 #: mixedgauge.c:61
msgid "Failed" msgid "Failed"
msgstr "" msgstr "Dështoi"
#: mixedgauge.c:64 #: mixedgauge.c:64
msgid "Passed" msgid "Passed"
msgstr "" msgstr "Kaloi"
#: mixedgauge.c:67 #: mixedgauge.c:67
msgid "Completed" msgid "Completed"
msgstr "" msgstr "U plotësua"
#: mixedgauge.c:70 #: mixedgauge.c:70
msgid "Checked" msgid "Checked"
msgstr "" msgstr "U kontrollua"
#: mixedgauge.c:73 #: mixedgauge.c:73
msgid "Done" msgid "Done"
msgstr "" msgstr "U bë"
#: mixedgauge.c:76 #: mixedgauge.c:76
msgid "Skipped" msgid "Skipped"
msgstr "" msgstr "U anashkalua"
#: mixedgauge.c:79 #: mixedgauge.c:79
msgid "In Progress" msgid "In Progress"
msgstr "" msgstr "Në ecuri e sipër"
#: mixedgauge.c:85 #: mixedgauge.c:85
msgid "N/A" msgid "N/A"
msgstr "" msgstr "N/A"
#: mixedgauge.c:193 #: mixedgauge.c:193
msgid "Overall Progress" msgid "Overall Progress"
msgstr "" msgstr "Ecuri Gjithsej"
#: textbox.c:468 #: textbox.c:489
msgid "Search" msgid "Search"
msgstr "" msgstr "Kērko"

View File

@ -1,9 +1,9 @@
/* /*
* $Id: prgbox.c,v 1.13 2016/01/27 01:37:26 tom Exp $ * $Id: prgbox.c,v 1.14 2019/07/25 00:07:15 tom Exp $
* *
* prgbox.c -- implements the prg box * prgbox.c -- implements the prg box
* *
* Copyright 2011-2014,2016 Thomas E. Dickey * Copyright 2011-2016,2019 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -37,10 +37,10 @@ dlg_popen(const char *command, const char *type)
{ {
FILE *result = 0; FILE *result = 0;
int fd[2]; int fd[2];
char *blob;
char **argv;
if ((*type == 'r' || *type != 'w') && pipe(fd) == 0) { if ((*type == 'r' || *type == 'w') && pipe(fd) == 0) {
char *blob;
switch (fork()) { switch (fork()) {
case -1: /* Error. */ case -1: /* Error. */
(void) close(fd[0]); (void) close(fd[0]);
@ -68,6 +68,7 @@ dlg_popen(const char *command, const char *type)
* tokens. * tokens.
*/ */
if ((blob = malloc(10 + strlen(command))) != 0) { if ((blob = malloc(10 + strlen(command))) != 0) {
char **argv;
sprintf(blob, "sh -c \"%s\"", command); sprintf(blob, "sh -c \"%s\"", command);
argv = dlg_string_to_argv(blob); argv = dlg_string_to_argv(blob);
execvp("sh", argv); execvp("sh", argv);

View File

@ -1,15 +1,14 @@
/* /*
* $Id: progressbox.c,v 1.47 2018/06/21 09:14:47 tom Exp $ * $Id: progressbox.c,v 1.54 2020/11/22 15:48:27 tom Exp $
* *
* progressbox.c -- implements the progress box * progressbox.c -- implements the progress box
* *
* Copyright 2006-2014,2018 Thomas E. Dickey * Copyright 2006-2019,2020 Thomas E. Dickey
* Copyright 2005 Valery Reznic * Copyright 2005 Valery Reznic
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as * it under the terms of the GNU Lesser General Public License, version 2.1
* published by the Free Software Foundation; either version 2.1 of the * as published by the Free Software Foundation.
* License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
@ -69,6 +68,7 @@ free_obj(MY_OBJ * obj)
free(obj); free(obj);
} }
#ifdef KEY_RESIZE
static void static void
restart_obj(MY_OBJ * obj) restart_obj(MY_OBJ * obj)
{ {
@ -78,12 +78,12 @@ restart_obj(MY_OBJ * obj)
dlg_clear(); dlg_clear();
dlg_del_window(obj->obj.win); dlg_del_window(obj->obj.win);
} }
#endif
static void static void
start_obj(MY_OBJ * obj, const char *title, const char *cprompt) start_obj(MY_OBJ * obj, const char *title, const char *cprompt)
{ {
int y, x, thigh; int y, x, thigh;
int i;
obj->prompt = dlg_strclone(cprompt); obj->prompt = dlg_strclone(cprompt);
dlg_tab_correct_str(obj->prompt); dlg_tab_correct_str(obj->prompt);
@ -108,6 +108,7 @@ start_obj(MY_OBJ * obj, const char *title, const char *cprompt)
dlg_draw_helpline(obj->obj.win, FALSE); dlg_draw_helpline(obj->obj.win, FALSE);
if (obj->prompt[0] != '\0') { if (obj->prompt[0] != '\0') {
int i;
int y2, x2; int y2, x2;
dlg_attrset(obj->obj.win, dialog_attr); dlg_attrset(obj->obj.win, dialog_attr);
@ -145,12 +146,12 @@ get_line(MY_OBJ * obj, int *restart)
{ {
FILE *fp = obj->obj.input; FILE *fp = obj->obj.input;
int col = 0; int col = 0;
int j, tmpint, ch; int j, tmpint;
char *result = obj->line; char *result = obj->line;
*restart = 0; *restart = 0;
for (;;) { for (;;) {
ch = getc(fp); int ch = getc(fp);
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
/* SIGWINCH may have interrupted this - try to ignore if resizable */ /* SIGWINCH may have interrupted this - try to ignore if resizable */
if (ferror(fp)) { if (ferror(fp)) {
@ -207,7 +208,7 @@ get_line(MY_OBJ * obj, int *restart)
} }
nodelay(win, TRUE); nodelay(win, TRUE);
if ((ch = wgetch(win)) == KEY_RESIZE) { if (wgetch(win) == KEY_RESIZE) {
*restart = 1; *restart = 1;
} }
nodelay(win, FALSE); nodelay(win, FALSE);
@ -227,7 +228,9 @@ print_line(MY_OBJ * obj, const char *line, int row)
(void) wmove(obj->text, row, 0); /* move cursor to correct line */ (void) wmove(obj->text, row, 0); /* move cursor to correct line */
wprintw(obj->text, " %.*s", limit, line); wprintw(obj->text, " %.*s", limit, line);
wclrtoeol(obj->text); while (++limit < width) {
waddch(obj->text, ' ');
}
} }
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
@ -284,13 +287,15 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
/* *INDENT-ON* */ /* *INDENT-ON* */
int button; int button;
int key = 0, fkey; int key, fkey;
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
const char **buttons = dlg_ok_label(); const char **buttons = dlg_ok_label();
int check;
bool save_nocancel = dialog_vars.nocancel; bool save_nocancel = dialog_vars.nocancel;
bool redraw = TRUE; bool redraw = TRUE;
(void) title;
(void) cprompt;
dialog_vars.nocancel = TRUE; dialog_vars.nocancel = TRUE;
button = dlg_default_button(); button = dlg_default_button();
@ -304,6 +309,8 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
dlg_draw_bottom_box2(obj->obj.win, border_attr, border2_attr, dialog_attr); dlg_draw_bottom_box2(obj->obj.win, border_attr, border2_attr, dialog_attr);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int check;
if (redraw) { if (redraw) {
redraw = FALSE; redraw = FALSE;
if (button < 0) if (button < 0)
@ -315,8 +322,10 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
} }
key = dlg_mouse_wgetch(obj->obj.win, &fkey); key = dlg_mouse_wgetch(obj->obj.win, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) { if (!fkey && (check = dlg_char_to_button(key, buttons)) >= 0) {
result = dlg_ok_buttoncode(check); result = dlg_ok_buttoncode(check);
@ -356,10 +365,12 @@ pause_for_ok(MY_OBJ * obj, const char *title, const char *cprompt)
break; break;
} }
} else { } else if (key > 0) {
beep(); beep();
} }
} }
dlg_add_last_key(-1);
dlg_mouse_free_regions(); dlg_mouse_free_regions();
dlg_unregister_window(obj->obj.win); dlg_unregister_window(obj->obj.win);

View File

@ -1,9 +1,9 @@
/* /*
* $Id: rangebox.c,v 1.24 2018/06/19 22:57:01 tom Exp $ * $Id: rangebox.c,v 1.32 2020/11/22 23:25:09 tom Exp $
* *
* rangebox.c -- implements the rangebox dialog * rangebox.c -- implements the rangebox dialog
* *
* Copyright 2012-2017,2018 Thomas E. Dickey * Copyright 2012-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -21,7 +21,7 @@
* Boston, MA 02110, USA. * Boston, MA 02110, USA.
*/ */
#include <dialog.h> #include <dlg_internals.h>
#include <dlg_keys.h> #include <dlg_keys.h>
#define ONE_HIGH 1 #define ONE_HIGH 1
@ -29,19 +29,6 @@
#define MIN_HIGH (ONE_HIGH + 1 + (4 * MARGIN)) #define MIN_HIGH (ONE_HIGH + 1 + (4 * MARGIN))
#define MIN_WIDE (10 + 2 + (2 * MARGIN)) #define MIN_WIDE (10 + 2 + (2 * MARGIN))
struct _box;
typedef struct _box {
WINDOW *parent;
WINDOW *window;
int x;
int y;
int width;
int height;
int period;
int value;
} BOX;
typedef struct { typedef struct {
/* window in which the value and slider are drawn */ /* window in which the value and slider are drawn */
WINDOW *window; WINDOW *window;
@ -209,7 +196,7 @@ dialog_rangebox(const char *title,
int old_width = width; int old_width = width;
#endif #endif
VALUE data; VALUE data;
int key = 0, key2, fkey; int key, fkey;
int button; int button;
int result = DLG_EXIT_UNKNOWN; int result = DLG_EXIT_UNKNOWN;
WINDOW *dialog; WINDOW *dialog;
@ -245,11 +232,8 @@ dialog_rangebox(const char *title,
#endif #endif
prompt = dlg_strclone(cprompt); prompt = dlg_strclone(cprompt);
dlg_auto_size(title, prompt, &height, &width, 0, 0); dlg_auto_size(title, prompt, &height, &width, MIN_HIGH, MIN_WIDE);
height += MIN_HIGH;
if (width < MIN_WIDE)
width = MIN_WIDE;
dlg_button_layout(buttons, &width); dlg_button_layout(buttons, &width);
dlg_print_size(height, width); dlg_print_size(height, width);
dlg_ctl_size(height, width); dlg_ctl_size(height, width);
@ -313,7 +297,10 @@ dialog_rangebox(const char *title,
dlg_print_autowrap(dialog, prompt, height, width); dlg_print_autowrap(dialog, prompt, height, width);
dlg_trace_win(dialog); dlg_trace_win(dialog);
while (result == DLG_EXIT_UNKNOWN) { while (result == DLG_EXIT_UNKNOWN) {
int key2;
draw_value(&data, cur_value); draw_value(&data, cur_value);
button = (state < 0) ? 0 : state; button = (state < 0) ? 0 : state;
dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width); dlg_draw_buttons(dialog, height - 2, 0, buttons, button, FALSE, width);
@ -323,8 +310,10 @@ dialog_rangebox(const char *title,
} }
key = dlg_mouse_wgetch(dialog, &fkey); key = dlg_mouse_wgetch(dialog, &fkey);
if (dlg_result_key(key, fkey, &result)) if (dlg_result_key(key, fkey, &result)) {
break; if (!dlg_button_key(result, &button, &key, &fkey))
break;
}
if ((key2 = dlg_char_to_button(key, buttons)) >= 0) { if ((key2 = dlg_char_to_button(key, buttons)) >= 0) {
result = key2; result = key2;
@ -334,6 +323,9 @@ dialog_rangebox(const char *title,
switch (key) { switch (key) {
case DLGK_TOGGLE: case DLGK_TOGGLE:
case DLGK_ENTER: case DLGK_ENTER:
result = dlg_enter_buttoncode(button);
break;
case DLGK_LEAVE:
result = dlg_ok_buttoncode(button); result = dlg_ok_buttoncode(button);
break; break;
case DLGK_FIELD_PREV: case DLGK_FIELD_PREV:
@ -392,9 +384,7 @@ dialog_rangebox(const char *title,
width = old_width; width = old_width;
/* repaint */ /* repaint */
free(prompt); free(prompt);
dlg_clear(); _dlg_resize_cleanup(dialog);
dlg_del_window(dialog);
dlg_mouse_free_regions();
goto retry; goto retry;
#endif #endif
case DLGK_MOUSE('i'): case DLGK_MOUSE('i'):
@ -421,8 +411,7 @@ dialog_rangebox(const char *title,
sprintf(buffer, "%d", cur_value); sprintf(buffer, "%d", cur_value);
dlg_add_result(buffer); dlg_add_result(buffer);
dlg_add_separator(); AddLastKey();
dlg_add_last_key(-1);
dlg_del_window(dialog); dlg_del_window(dialog);
dlg_mouse_free_regions(); dlg_mouse_free_regions();

View File

@ -1,9 +1,9 @@
/* /*
* $Id: rc.c,v 1.53 2018/05/31 20:32:15 tom Exp $ * $Id: rc.c,v 1.60 2020/11/25 00:06:40 tom Exp $
* *
* rc.c -- routines for processing the configuration file * rc.c -- routines for processing the configuration file
* *
* Copyright 2000-2012,2018 Thomas E. Dickey * Copyright 2000-2019,2020 Thomas E. Dickey
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License, version 2.1 * it under the terms of the GNU Lesser General Public License, version 2.1
@ -30,6 +30,19 @@
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
#include <dlg_colors.h> #include <dlg_colors.h>
#include <dlg_internals.h>
#define L_PAREN '('
#define R_PAREN ')'
#define MIN_TOKEN 3
#ifdef HAVE_RC_FILE2
#define MAX_TOKEN 5
#else
#define MAX_TOKEN MIN_TOKEN
#endif
#define UNKNOWN_COLOR -2
/* /*
* For matching color names with color values * For matching color names with color values
@ -48,7 +61,7 @@ static const color_names_st color_names[] =
{"CYAN", COLOR_CYAN}, {"CYAN", COLOR_CYAN},
{"WHITE", COLOR_WHITE}, {"WHITE", COLOR_WHITE},
}; /* color names */ }; /* color names */
#define COLOR_COUNT (sizeof(color_names) / sizeof(color_names[0])) #define COLOR_COUNT TableSize(color_names)
#endif /* HAVE_COLOR */ #endif /* HAVE_COLOR */
#define GLOBALRC "/etc/dialogrc" #define GLOBALRC "/etc/dialogrc"
@ -67,7 +80,7 @@ typedef enum {
} PARSE_LINE; } PARSE_LINE;
/* number of configuration variables */ /* number of configuration variables */
#define VAR_COUNT (sizeof(vars) / sizeof(vars_st)) #define VAR_COUNT TableSize(vars)
/* check if character is string quoting characters */ /* check if character is string quoting characters */
#define isquote(c) ((c) == '"' || (c) == '\'') #define isquote(c) ((c) == '"' || (c) == '\'')
@ -140,6 +153,52 @@ skip_keyword(char *str, int n)
return n; return n;
} }
static void
trim_token(char **tok)
{
char *tmp = *tok + skip_whitespace(*tok, 0);
*tok = tmp;
while (*tmp != '\0' && !isblank(UCH(*tmp)))
tmp++;
*tmp = '\0';
}
static int
from_boolean(const char *str)
{
int code = -1;
if (str != NULL && *str != '\0') {
if (!dlg_strcmp(str, "ON")) {
code = 1;
} else if (!dlg_strcmp(str, "OFF")) {
code = 0;
}
}
return code;
}
static int
from_color_name(const char *str)
{
int code = UNKNOWN_COLOR;
if (str != NULL && *str != '\0') {
size_t i;
for (i = 0; i < COLOR_COUNT; ++i) {
if (!dlg_strcmp(str, color_names[i].name)) {
code = color_names[i].value;
break;
}
}
}
return code;
}
static int static int
find_vars(char *name) find_vars(char *name)
{ {
@ -172,55 +231,58 @@ find_color(char *name)
return result; return result;
} }
/* static const char *
* Convert an attribute to a string representation like this: to_color_name(int code)
*
* "(foreground,background,highlight)"
*/
static char *
attr_to_str(char *str, int fg, int bg, int hl)
{ {
int i; const char *result = "?";
size_t n;
for (n = 0; n < TableSize(color_names); ++n) {
if (code == color_names[n].value) {
result = color_names[n].name;
break;
}
}
return result;
}
strcpy(str, "("); static const char *
/* foreground */ to_boolean(int code)
for (i = 0; fg != color_names[i].value; i++) ; {
strcat(str, color_names[i].name); return code ? "ON" : "OFF";
strcat(str, ",");
/* background */
for (i = 0; bg != color_names[i].value; i++) ;
strcat(str, color_names[i].name);
/* highlight */
strcat(str, hl ? ",ON)" : ",OFF)");
return str;
} }
/* /*
* Extract the foreground, background and highlight values from an attribute * Extract the foreground, background and highlight values from an attribute
* represented as a string in one of two forms: * represented as a string in one of these forms:
* *
* "(foreground,background,highlight,underline,reverse)"
* "(foreground,background,highlight,underline)"
* "(foreground,background,highlight)" * "(foreground,background,highlight)"
" "xxxx_color" * "xxxx_color"
*/ */
static int static int
str_to_attr(char *str, int *fg, int *bg, int *hl) str_to_attr(char *str, DIALOG_COLORS * result)
{ {
int i = 0, get_fg = 1; char *tokens[MAX_TOKEN + 1];
unsigned j; char tempstr[MAX_LEN + 1];
char tempstr[MAX_LEN + 1], *part;
size_t have; size_t have;
size_t i = 0;
size_t tok_count = 0;
if (str[0] != '(' || lastch(str) != ')') { memset(result, 0, sizeof(*result));
if ((i = find_color(str)) >= 0) { result->fg = -1;
*fg = dlg_color_table[i].fg; result->bg = -1;
*bg = dlg_color_table[i].bg; result->hilite = -1;
*hl = dlg_color_table[i].hilite;
if (str[0] != L_PAREN || lastch(str) != R_PAREN) {
int ret;
if ((ret = find_color(str)) >= 0) {
*result = dlg_color_table[ret];
return 0; return 0;
} }
return -1; /* invalid representation */ /* invalid representation */
return -1;
} }
/* remove the parenthesis */ /* remove the parenthesis */
@ -233,64 +295,41 @@ str_to_attr(char *str, int *fg, int *bg, int *hl)
memcpy(tempstr, str + 1, have); memcpy(tempstr, str + 1, have);
tempstr[have] = '\0'; tempstr[have] = '\0';
/* get foreground and background */ /* parse comma-separated tokens, allow up to
* one more than max tokens to detect extras */
while (tok_count < TableSize(tokens)) {
while (1) { tokens[tok_count++] = &tempstr[i];
/* skip white space before fg/bg string */
i = skip_whitespace(tempstr, i);
if (tempstr[i] == '\0')
return -1; /* invalid representation */
part = tempstr + i; /* set 'part' to start of fg/bg string */
/* find end of fg/bg string */ while (tempstr[i] != '\0' && tempstr[i] != ',')
while (!isblank(UCH(tempstr[i])) && tempstr[i] != ','
&& tempstr[i] != '\0')
i++; i++;
if (tempstr[i] == '\0') if (tempstr[i] == '\0')
return -1; /* invalid representation */
else if (isblank(UCH(tempstr[i]))) { /* not yet ',' */
tempstr[i++] = '\0';
/* skip white space before ',' */
i = skip_whitespace(tempstr, i);
if (tempstr[i] != ',')
return -1; /* invalid representation */
}
tempstr[i++] = '\0'; /* skip the ',' */
for (j = 0; j < COLOR_COUNT && dlg_strcmp(part, color_names[j].name);
j++) ;
if (j == COLOR_COUNT) /* invalid color name */
return -1;
if (get_fg) {
*fg = color_names[j].value;
get_fg = 0; /* next we have to get the background */
} else {
*bg = color_names[j].value;
break; break;
}
} /* got foreground and background */
/* get highlight */ tempstr[i++] = '\0';
}
/* skip white space before highlight string */ if (tok_count < MIN_TOKEN || tok_count > MAX_TOKEN) {
i = skip_whitespace(tempstr, i); /* invalid representation */
if (tempstr[i] == '\0') return -1;
return -1; /* invalid representation */ }
part = tempstr + i; /* set 'part' to start of highlight string */
/* trim trailing white space from highlight string */ for (i = 0; i < tok_count; ++i)
i = (int) strlen(part) - 1; trim_token(&tokens[i]);
while (isblank(UCH(part[i])) && i > 0)
i--;
part[i + 1] = '\0';
if (!dlg_strcmp(part, "ON")) /* validate */
*hl = TRUE; if (UNKNOWN_COLOR == (result->fg = from_color_name(tokens[0]))
else if (!dlg_strcmp(part, "OFF")) || UNKNOWN_COLOR == (result->bg = from_color_name(tokens[1]))
*hl = FALSE; || UNKNOWN_COLOR == (result->hilite = from_boolean(tokens[2]))
else #ifdef HAVE_RC_FILE2
return -1; /* invalid highlight value */ || (tok_count >= 4 && (result->ul = from_boolean(tokens[3])) == -1)
|| (tok_count >= 5 && (result->rv = from_boolean(tokens[4])) == -1)
#endif /* HAVE_RC_FILE2 */
) {
/* invalid representation */
return -1;
}
return 0; return 0;
} }
@ -410,9 +449,14 @@ dlg_create_rc(const char *filename)
# String - \"string\"\n\ # String - \"string\"\n\
# Boolean - <ON|OFF>\n" # Boolean - <ON|OFF>\n"
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
#ifdef HAVE_RC_FILE2
"\
# Attribute - (foreground,background,highlight?,underline?,reverse?)\n"
#else /* HAVE_RC_FILE2 */
"\ "\
# Attribute - (foreground,background,highlight?)\n" # Attribute - (foreground,background,highlight?)\n"
#endif #endif /* HAVE_RC_FILE2 */
#endif /* HAVE_COLOR */
); );
/* Print an entry for each configuration variable */ /* Print an entry for each configuration variable */
@ -435,7 +479,6 @@ dlg_create_rc(const char *filename)
} }
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
for (i = 0; i < (unsigned) dlg_color_count(); ++i) { for (i = 0; i < (unsigned) dlg_color_count(); ++i) {
char buffer[MAX_LEN + 1];
unsigned j; unsigned j;
bool repeat = FALSE; bool repeat = FALSE;
@ -453,11 +496,17 @@ dlg_create_rc(const char *filename)
} }
if (!repeat) { if (!repeat) {
fprintf(rc_file, "%s = %s\n", dlg_color_table[i].name, fprintf(rc_file, "%s = %c", dlg_color_table[i].name, L_PAREN);
attr_to_str(buffer, fprintf(rc_file, "%s", to_color_name(dlg_color_table[i].fg));
dlg_color_table[i].fg, fprintf(rc_file, ",%s", to_color_name(dlg_color_table[i].bg));
dlg_color_table[i].bg, fprintf(rc_file, ",%s", to_boolean(dlg_color_table[i].hilite));
dlg_color_table[i].hilite)); #ifdef HAVE_RC_FILE2
if (dlg_color_table[i].ul || dlg_color_table[i].rv)
fprintf(rc_file, ",%s", to_boolean(dlg_color_table[i].ul));
if (dlg_color_table[i].rv)
fprintf(rc_file, ",%s", to_boolean(dlg_color_table[i].rv));
#endif /* HAVE_RC_FILE2 */
fprintf(rc_file, "%c\n", R_PAREN);
} }
} }
#endif /* HAVE_COLOR */ #endif /* HAVE_COLOR */
@ -466,6 +515,13 @@ dlg_create_rc(const char *filename)
(void) fclose(rc_file); (void) fclose(rc_file);
} }
static void
report_error(const char *filename, int line_no, const char *msg)
{
fprintf(stderr, "%s:%d: %s\n", filename, line_no, msg);
dlg_trace_msg("%s:%d: %s\n", filename, line_no, msg);
}
/* /*
* Parse the configuration file and set up variables * Parse the configuration file and set up variables
*/ */
@ -478,7 +534,7 @@ dlg_parse_rc(void)
char str[MAX_LEN + 1]; char str[MAX_LEN + 1];
char *var; char *var;
char *value; char *value;
char *tempptr; char *filename;
int result = 0; int result = 0;
FILE *rc_file = 0; FILE *rc_file = 0;
char *params; char *params;
@ -499,36 +555,35 @@ dlg_parse_rc(void)
*/ */
/* try step (a) */ /* try step (a) */
if ((tempptr = getenv("DIALOGRC")) != NULL) if ((filename = dlg_getenv_str("DIALOGRC")) != NULL)
rc_file = fopen(tempptr, "rt"); rc_file = fopen(filename, "rt");
if (rc_file == NULL) { /* step (a) failed? */ if (rc_file == NULL) { /* step (a) failed? */
/* try step (b) */ /* try step (b) */
if ((tempptr = getenv("HOME")) != NULL if ((filename = dlg_getenv_str("HOME")) != NULL
&& strlen(tempptr) < MAX_LEN - (sizeof(DIALOGRC) + 3)) { && strlen(filename) < MAX_LEN - (sizeof(DIALOGRC) + 3)) {
if (tempptr[0] == '\0' || lastch(tempptr) == '/') if (filename[0] == '\0' || lastch(filename) == '/')
sprintf(str, "%s%s", tempptr, DIALOGRC); sprintf(str, "%s%s", filename, DIALOGRC);
else else
sprintf(str, "%s/%s", tempptr, DIALOGRC); sprintf(str, "%s/%s", filename, DIALOGRC);
rc_file = fopen(tempptr = str, "rt"); rc_file = fopen(filename = str, "rt");
} }
} }
if (rc_file == NULL) { /* step (b) failed? */ if (rc_file == NULL) { /* step (b) failed? */
/* try step (c) */ /* try step (c) */
strcpy(str, GLOBALRC); strcpy(str, GLOBALRC);
if ((rc_file = fopen(tempptr = str, "rt")) == NULL) if ((rc_file = fopen(filename = str, "rt")) == NULL)
return 0; /* step (c) failed, use default values */ return 0; /* step (c) failed, use default values */
} }
DLG_TRACE(("# opened rc file \"%s\"\n", tempptr)); DLG_TRACE(("# opened rc file \"%s\"\n", filename));
/* Scan each line and set variables */ /* Scan each line and set variables */
while ((result == 0) && (fgets(str, MAX_LEN, rc_file) != NULL)) { while ((result == 0) && (fgets(str, MAX_LEN, rc_file) != NULL)) {
DLG_TRACE(("#\t%s", str)); DLG_TRACE(("#\t%s", str));
if (*str == '\0' || lastch(str) != '\n') { if (*str == '\0' || lastch(str) != '\n') {
/* ignore rest of file if line too long */ /* ignore rest of file if line too long */
fprintf(stderr, "\nParse error: line %d of configuration" report_error(filename, l, "line too long");
" file too long.\n", l);
result = -1; /* parse aborted */ result = -1; /* parse aborted */
break; break;
} }
@ -536,7 +591,7 @@ dlg_parse_rc(void)
lastch(str) = '\0'; lastch(str) = '\0';
if (begins_with(str, "bindkey", &params)) { if (begins_with(str, "bindkey", &params)) {
if (!dlg_parse_bindkey(params)) { if (!dlg_parse_bindkey(params)) {
fprintf(stderr, "\nParse error: line %d of configuration\n", l); report_error(filename, l, "invalid bindkey");
result = -1; result = -1;
} }
continue; continue;
@ -556,9 +611,7 @@ dlg_parse_rc(void)
case VAL_STR: case VAL_STR:
if (!isquote(value[0]) || !isquote(lastch(value)) if (!isquote(value[0]) || !isquote(lastch(value))
|| strlen(value) < 2) { || strlen(value) < 2) {
fprintf(stderr, "\nParse error: string value " report_error(filename, l, "expected string value");
"expected at line %d of configuration "
"file.\n", l);
result = -1; /* parse aborted */ result = -1; /* parse aborted */
} else { } else {
/* remove the (") quotes */ /* remove the (") quotes */
@ -573,38 +626,34 @@ dlg_parse_rc(void)
else if (!dlg_strcmp(value, "OFF")) else if (!dlg_strcmp(value, "OFF"))
*((bool *) vars[i].var) = FALSE; *((bool *) vars[i].var) = FALSE;
else { else {
fprintf(stderr, "\nParse error: boolean value " report_error(filename, l, "expected boolean value");
"expected at line %d of configuration "
"file (found %s).\n", l, value);
result = -1; /* parse aborted */ result = -1; /* parse aborted */
} }
break; break;
} }
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
} else if ((i = find_color(var)) >= 0) { } else if ((i = find_color(var)) >= 0) {
int fg = 0; DIALOG_COLORS temp;
int bg = 0; if (str_to_attr(value, &temp) == -1) {
int hl = 0; report_error(filename, l, "expected attribute value");
if (str_to_attr(value, &fg, &bg, &hl) == -1) {
fprintf(stderr, "\nParse error: attribute "
"value expected at line %d of configuration "
"file.\n", l);
result = -1; /* parse aborted */ result = -1; /* parse aborted */
} else { } else {
dlg_color_table[i].fg = fg; dlg_color_table[i].fg = temp.fg;
dlg_color_table[i].bg = bg; dlg_color_table[i].bg = temp.bg;
dlg_color_table[i].hilite = hl; dlg_color_table[i].hilite = temp.hilite;
#ifdef HAVE_RC_FILE2
dlg_color_table[i].ul = temp.ul;
dlg_color_table[i].rv = temp.rv;
#endif /* HAVE_RC_FILE2 */
} }
} else { } else {
#endif /* HAVE_COLOR */ #endif /* HAVE_COLOR */
fprintf(stderr, "\nParse error: unknown variable " report_error(filename, l, "unknown variable");
"at line %d of configuration file:\n\t%s\n", l, var);
result = -1; /* parse aborted */ result = -1; /* parse aborted */
} }
break; break;
case LINE_ERROR: case LINE_ERROR:
fprintf(stderr, "\nParse error: syntax error at line %d of " report_error(filename, l, "syntax error");
"configuration file.\n", l);
result = -1; /* parse aborted */ result = -1; /* parse aborted */
break; break;
} }

View File

@ -1,7 +1,7 @@
#! /bin/sh #!/bin/sh
# $Id: headers.sh,v 1.3 2007/02/25 20:37:56 tom Exp $ # $Id: run_test.sh,v 1.1 2020/03/20 12:08:00 tom Exp $
############################################################################## ##############################################################################
# Copyright (c) 2004,2007 Thomas E. Dickey # # Copyright (c) 2020 Thomas E. Dickey #
# # # #
# Permission is hereby granted, free of charge, to any person obtaining a # # Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), # # copy of this software and associated documentation files (the "Software"), #
@ -27,77 +27,32 @@
# use or other dealings in this Software without prior written # # use or other dealings in this Software without prior written #
# authorization. # # authorization. #
############################################################################## ##############################################################################
#
# Adjust includes for header files that reside in a subdirectory of
# /usr/include, etc.
#
# Parameters (the first case creates the sed script):
# $1 is the target directory
# $2 is the source directory
# or (the second case does the install, using the sed script):
# $1 is the script to use for installing
# $2 is the target directory
# $3 is the source directory
# $4 is the file to install, editing source/target/etc.
PACKAGE=DIALOG failed() {
PKGNAME=DLG echo "? $*" >&2
CONFIGH=dlg_config.h exit 1
}
TMPSED=headers.sed : ${DIALOG=./dialog}
CONFIG=samples
INPUTS=inputs.rc
OUTPUT=output.rc
if test $# = 2 ; then [ $# != 0 ] && CONFIG="$1"
rm -f $TMPSED
DST=$1
REF=$2
LEAF=`basename $DST`
case $DST in
/*/include/$LEAF)
END=`basename $DST`
for i in $REF/*.h
do
NAME=`basename $i`
echo "s/<$NAME>/<$END\/$NAME>/g" >> $TMPSED
done
;;
*)
echo "" >> $TMPSED
;;
esac
for name in `
egrep '^#define[ ][ ]*[_ABCDEFGHIJKLMNOPQRSTUVWXYZ]' $REF/$CONFIGH \
| sed -e 's/^#define[ ][ ]*//' \
-e 's/[ ].*//' \
| egrep -v "^${PACKAGE}_" \
| sort -u \
| egrep -v "^${PKGNAME}_"`
do
echo "s/\\<$name\\>/${PKGNAME}_$name/g" >>$TMPSED
done
else
PRG=""
while test $# != 3
do
PRG="$PRG $1"; shift
done
DST=$1 [ -f "$DIALOG" ] || failed "no such file: $DIALOG"
REF=$2 [ -d "$CONFIG" ] || failed "no such directory: $CONFIG"
SRC=$3
SHOW=`basename $SRC` for rcfile in $CONFIG/*.rc
TMPSRC=${TMPDIR-/tmp}/${SHOW}$$ do
echo "** $rcfile"
DIALOGRC="$rcfile" $DIALOG --create-rc $OUTPUT
sed -e '/^#/d' "$OUTPUT" >"$INPUTS"
mv -f $INPUTS $OUTPUT
sed -e '/^#/d' "$rcfile" >"$INPUTS"
diff -u $INPUTS $OUTPUT | \
sed -e "s,$INPUTS,$rcfile," \
-e "s,$OUTPUT,$rcfile-test,"
done
echo " ... $SHOW" rm -f $INPUTS $OUTPUT
test -f $REF/$SRC && SRC="$REF/$SRC"
rm -f $TMPSRC
sed -f $TMPSED $SRC > $TMPSRC
NAME=`basename $SRC`
# Just in case someone gzip'd manpages, remove the conflicting copy.
test -f $DST/$NAME.gz && rm -f $DST/$NAME.gz
eval $PRG $TMPSRC $DST/$NAME
rm -f $TMPSRC
fi

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: buildlist,v 1.2 2012/12/04 11:45:21 tom Exp $ # $Id: buildlist,v 1.3 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -15,6 +15,6 @@ $DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \
"5" "Item number 5" "off" \ "5" "Item number 5" "off" \
"6" "Item number 6" "on" 2> $tempfile "6" "Item number 6" "on" 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: buildlist2,v 1.6 2012/12/23 22:28:12 tom Exp $ # $Id: buildlist2,v 1.8 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -23,10 +23,10 @@ do
esac esac
case "x$DIALOGOPTS" in case "x$DIALOGOPTS" in
*--no-items*|*--noitem*) *--no-items*|*--noitem*)
echo $filename $state >>$input echo "$filename $state" >>$input
;; ;;
*) *)
echo $count $filename $state >>$input echo "$count $filename $state" >>$input
;; ;;
esac esac
count=`expr $count + 1` count=`expr $count + 1`
@ -34,9 +34,9 @@ done
$DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \ $DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \
--visit-items --scrollbar --separator "|" \ --visit-items --scrollbar --separator "|" \
--buildlist "hello, this is a --buildlist..." 0 0 10 `cat $input` 2> $output --buildlist "hello, this is a --buildlist..." 0 0 10 `cat "$input"` 2> $output
retval=$? returncode=$?
tempfile=$output tempfile=$output
. ./report-tempfile . ./report-tempfile

View File

@ -0,0 +1,22 @@
#!/bin/sh
# $Id: buildlist4,v 1.2 2020/11/26 00:03:58 tom Exp $
. ./setup-vars
. ./setup-tempfile
$DIALOG --title "BUILDLIST DEMO" --backtitle "A user-built list" \
--separator "|" \
--help-button \
--item-help \
--buildlist "hello, this is a --buildlist..." 0 0 0 \
"1" "Item number 1" "on" first \
"2" "Item number 2" "off" second \
"3" "Item number 3" "on" third \
"4" "Item number 4" "on" fourth \
"5" "Item number 5" "off" fifth \
"6" "Item number 6" "on" sixth 2> $tempfile
returncode=$?
. ./report-tempfile

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
# $Id: calendar,v 1.9 2010/01/13 10:20:33 tom Exp $ # $Id: calendar,v 1.11 2020/11/26 00:09:12 tom Exp $
. ./setup-vars . ./setup-vars
exec 3>&1 exec 3>&1
RESULT=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3` returntext=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
retval=$? returncode=$?
exec 3>&- exec 3>&-
. ./report-string . ./report-string

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: calendar-stdout,v 1.6 2010/01/13 10:20:03 tom Exp $ # $Id: calendar-stdout,v 1.8 2020/11/26 00:09:12 tom Exp $
. ./setup-vars . ./setup-vars
RESULT=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981` returntext=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981`
retval=$? returncode=$?
. ./report-string . ./report-string

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
# $Id: calendar2,v 1.8 2010/01/13 10:20:03 tom Exp $ # $Id: calendar2,v 1.10 2020/11/26 00:09:12 tom Exp $
. ./setup-vars . ./setup-vars
exec 3>&1 exec 3>&1
RESULT=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 2>&1 1>&3` returntext=`$DIALOG --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 2>&1 1>&3`
retval=$? returncode=$?
exec 3>&- exec 3>&-
. ./report-string . ./report-string

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: calendar2-stdout,v 1.6 2010/01/13 10:20:03 tom Exp $ # $Id: calendar2-stdout,v 1.8 2020/11/26 00:09:12 tom Exp $
. ./setup-vars . ./setup-vars
RESULT=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0` returntext=`$DIALOG --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0`
retval=$? returncode=$?
. ./report-string . ./report-string

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
# $Id: calendar3,v 1.9 2010/01/13 10:20:03 tom Exp $ # $Id: calendar3,v 1.11 2020/11/26 00:09:12 tom Exp $
. ./setup-vars . ./setup-vars
exec 3>&1 exec 3>&1
RESULT=`$DIALOG --extra-button --extra-label "Hold" --help-button --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3` returntext=`$DIALOG --extra-button --extra-label "Hold" --help-button --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981 2>&1 1>&3`
retval=$? returncode=$?
exec 3>&- exec 3>&-
. ./report-string . ./report-string

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
# $Id: calendar3-stdout,v 1.6 2010/01/13 10:20:03 tom Exp $ # $Id: calendar3-stdout,v 1.8 2020/11/26 00:09:12 tom Exp $
. ./setup-vars . ./setup-vars
RESULT=`$DIALOG --extra-button --extra-label "Hold" --help-button --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981` returntext=`$DIALOG --extra-button --extra-label "Hold" --help-button --stdout --title "CALENDAR" "$@" --calendar "Please choose a date..." 0 0 7 7 1981`
retval=$? returncode=$?
. ./report-string . ./report-string

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist,v 1.14 2010/01/13 10:20:03 tom Exp $ # $Id: checklist,v 1.15 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On \ "Fish" "Cats like fish." On \
"Lemon" "You know how it tastes." on 2> $tempfile "Lemon" "You know how it tastes." on 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist-8bit,v 1.8 2010/01/13 10:20:03 tom Exp $ # $Id: checklist-8bit,v 1.10 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -17,14 +17,14 @@ UP/DOWN arrow keys, the first letter of the choice as a \n\
hot key, or the number keys 1-9 to choose an option. \n\ hot key, or the number keys 1-9 to choose an option. \n\
Press SPACE to toggle an option on/off. \n\n\ Press SPACE to toggle an option on/off. \n\n\
Which of the following are fruits?" 20 61 5 \ Which of the following are fruits?" 20 61 5 \
"`./rotated-data 0 $SAMPLE`" "It's an `./rotated-data 0 $SAMPLE`." off \ "`./rotated-data 0 "$SAMPLE"`" "It's an `./rotated-data 0 "$SAMPLE"`." off \
"`./rotated-data 1 $SAMPLE`" "No, that's not my `./rotated-data 1 $SAMPLE`." ON \ "`./rotated-data 1 "$SAMPLE"`" "No, that's not my `./rotated-data 1 "$SAMPLE"`." ON \
"`./rotated-data 2 $SAMPLE`" "Yeah, that's `./rotated-data 2 $SAMPLE`." off \ "`./rotated-data 2 "$SAMPLE"`" "Yeah, that's `./rotated-data 2 "$SAMPLE"`." off \
"`./rotated-data 3 $SAMPLE`" "Normally not a `./rotated-data 3 $SAMPLE`." off \ "`./rotated-data 3 "$SAMPLE"`" "Normally not a `./rotated-data 3 "$SAMPLE"`." off \
"`./rotated-data 4 $SAMPLE`" "No, never put a `./rotated-data 4 $SAMPLE` there!" oN \ "`./rotated-data 4 "$SAMPLE"`" "No, never put a `./rotated-data 4 "$SAMPLE"` there!" oN \
"`./rotated-data 5 $SAMPLE`" "Cats like `./rotated-data 5 $SAMPLE`." On \ "`./rotated-data 5 "$SAMPLE"`" "Cats like `./rotated-data 5 "$SAMPLE"`." On \
"`./rotated-data 6 $SAMPLE`" "You `./rotated-data 6 $SAMPLE` how it is." on 2> $tempfile "`./rotated-data 6 "$SAMPLE"`" "You `./rotated-data 6 "$SAMPLE"` how it is." on 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist-utf8,v 1.12 2010/01/13 10:20:03 tom Exp $ # $Id: checklist-utf8,v 1.13 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -25,6 +25,6 @@ Press SPACE to toggle an option on/off. \n\n\
"" "Cats like ." On \ "" "Cats like ." On \
"" "You how it ." on 2> $tempfile "" "You how it ." on 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist1,v 1.10 2010/01/13 10:20:03 tom Exp $ # $Id: checklist1,v 1.11 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On \ "Fish" "Cats like fish." On \
"Lemon" "You know how it tastes." on 2> $tempfile "Lemon" "You know how it tastes." on 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist10,v 1.9 2010/01/13 10:20:03 tom Exp $ # $Id: checklist10,v 1.10 2020/11/26 00:03:58 tom Exp $
# zero-width column # zero-width column
. ./setup-vars . ./setup-vars
@ -25,6 +25,6 @@ Press SPACE to toggle an option on/off. \n\n\
Noninteractive "" on \ Noninteractive "" on \
2> $tempfile 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist11,v 1.1 2010/01/17 23:04:01 tom Exp $ # $Id: checklist11,v 1.2 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -28,6 +28,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On \ "Fish" "Cats like fish." On \
"Lemon" "You know how it tastes." on 2> $tempfile "Lemon" "You know how it tastes." on 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist12,v 1.3 2012/12/23 22:27:51 tom Exp $ # $Id: checklist12,v 1.5 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -23,7 +23,7 @@ $CUT >$input <<-EOF
Fish:Cats like fish.:On Fish:Cats like fish.:On
Lemon:You know how it tastes.:on Lemon:You know how it tastes.:on
EOF EOF
cat $input | sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' >$output sed -e 's/^/"/' -e 's/:/" "/g' -e 's/$/"/' <$input >$output
cat $output >$input cat $output >$input
$DIALOG --backtitle "No Such Organization" \ $DIALOG --backtitle "No Such Organization" \
@ -38,7 +38,7 @@ Press SPACE to toggle an option on/off. \n\n\
Which of the following are fruits?" 20 61 5 \ Which of the following are fruits?" 20 61 5 \
--file $input 2> $output --file $input 2> $output
retval=$? returncode=$?
tempfile=$output tempfile=$output
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist2,v 1.11 2010/01/13 10:20:03 tom Exp $ # $Id: checklist2,v 1.12 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish." On "not a fruit" \ "Fish" "Cats like fish." On "not a fruit" \
"Lemon" "You know how it tastes." on "the only one you wouldn't eat" 2> $tempfile "Lemon" "You know how it tastes." on "the only one you wouldn't eat" 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist3,v 1.11 2010/01/13 10:20:03 tom Exp $ # $Id: checklist3,v 1.12 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \ "Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile "Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist4,v 1.12 2010/01/13 10:20:03 tom Exp $ # $Id: checklist4,v 1.13 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -23,6 +23,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \ "Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile "Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist5,v 1.11 2010/01/13 10:20:03 tom Exp $ # $Id: checklist5,v 1.12 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -24,6 +24,6 @@ Press SPACE to toggle an option on/off. \n\n\
"Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \ "Fish" "Cats like fish. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile "Lemon" "You know how it tastes. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist6,v 1.11 2010/01/13 10:20:03 tom Exp $ # $Id: checklist6,v 1.12 2020/11/26 00:03:58 tom Exp $
# example showing the --colors option # example showing the --colors option
. ./setup-vars . ./setup-vars
@ -25,6 +25,6 @@ Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
"Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \ "Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile "Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist7,v 1.11 2010/01/13 10:20:03 tom Exp $ # $Id: checklist7,v 1.12 2020/11/26 00:03:58 tom Exp $
# "checklist6" with --separate-output # "checklist6" with --separate-output
. ./setup-vars . ./setup-vars
@ -29,6 +29,6 @@ Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
"Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \ "Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On "not a fruit" \
"Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile "Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on "the only one you wouldn't eat" 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist8,v 1.10 2010/01/13 10:20:03 tom Exp $ # $Id: checklist8,v 1.11 2020/11/26 00:03:58 tom Exp $
# "checklist7" without --item-help # "checklist7" without --item-help
. ./setup-vars . ./setup-vars
@ -28,6 +28,6 @@ Press \Zb\ZrSPACE\Zn to toggle an option on/off. \n\n\
"Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On \ "Fish" "Cats like \Z4fish\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" On \
"Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on 2> $tempfile "Lemon" "You know how it \Zr\Zb\Z3tastes\Zn. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" on 2> $tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: checklist9,v 1.8 2010/01/13 10:20:03 tom Exp $ # $Id: checklist9,v 1.9 2020/11/26 00:03:58 tom Exp $
# "checklist8" using --file # "checklist8" using --file
. ./setup-vars . ./setup-vars
@ -8,6 +8,6 @@
$DIALOG "$@" --file checklist9.txt 2>$tempfile $DIALOG "$@" --file checklist9.txt 2>$tempfile
retval=$? returncode=$?
. ./report-tempfile . ./report-tempfile

View File

@ -17,7 +17,7 @@ packer /usr/bin/zip $F $P
# Maximum arcmail file size, will start new arcmail file if exceeds # Maximum arcmail file size, will start new arcmail file if exceeds
maxfsize 65000 maxfsize 65000
# Maximum packet size, ifmail/ifnews will start new packet if exeeds. # Maximum packet size, ifmail/ifnews will start new packet if exceeds.
# .out files are NOT created if nonzero specified, you must run ifpack # .out files are NOT created if nonzero specified, you must run ifpack
# to make packets out. (unimplemented) # to make packets out. (unimplemented)
maxpsize 65000 maxpsize 65000
@ -60,7 +60,7 @@ msgidbm /tmp/ifmsgids
# \D untranslated telephone no. (send strings only) # \D untranslated telephone no. (send strings only)
# ModemPort present a blank-separated list of ports with possible speed # ModemPort present a blank-separated list of ports with possible speed
# extention (separated by colon); if speed is prefixed with 'L', it is # extension (separated by colon); if speed is prefixed with 'L', it is
# a "locked" port speed, otherwise it is a maximum speed to be set, while # a "locked" port speed, otherwise it is a maximum speed to be set, while
# actual speed is taken from the nodelist. If speed is omitted (or set # actual speed is taken from the nodelist. If speed is omitted (or set
# to zero), previous port speed is not changed. # to zero), previous port speed is not changed.

View File

@ -7,13 +7,13 @@ ModemError NO\sDIAL
ModemError RING\r ModemError RING\r
ModemError ERROR ModemError ERROR
# Call options (time, address and nodelist flag dependant) # Call options (time, address and nodelist flag dependent)
# All matching are applied in the order they are specified. # All matching are applied in the order they are specified.
# Possible options are "[No]Call", "[No]Hold", "[No]PUA", "[No]EMSI", # Possible options are "[No]Call", "[No]Hold", "[No]PUA", "[No]EMSI",
# "[No]WaZOO", "[No]Freqs", "[No]Zmodem", "[No]ZedZap", "[No]Janus", # "[No]WaZOO", "[No]Freqs", "[No]Zmodem", "[No]ZedZap", "[No]Janus",
# "[No]Hydra". Here, WaZOO stands for YooHoo/2U2 handshake, not for # "[No]Hydra". Here, WaZOO stands for YooHoo/2U2 handshake, not for
# the transfer scheme. FTS-0001 handshake and DietIFNA scheme cannot # the transfer scheme. FTS-0001 handshake and DietIFNA scheme cannot
# be disallowed (because they are mandatory by standart). "Hold" # be disallowed (because they are mandatory by standard). "Hold"
# means really hold "hold" type packets and files: do not send them # means really hold "hold" type packets and files: do not send them
# if our system initiated the session, "NoHold" means send "hold" # if our system initiated the session, "NoHold" means send "hold"
# packets when our system initiated the session. "NoPUA" stands for # packets when our system initiated the session. "NoPUA" stands for

View File

@ -1,5 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
# $Id: dialog.py,v 1.4 2012/06/29 09:33:18 tom Exp $ # $Id: dialog.py,v 1.5 2019/12/10 22:52:52 tom Exp $
# Module: dialog.py # Module: dialog.py
# Copyright (c) 2000 Robb Shecter <robb@acm.org> # Copyright (c) 2000 Robb Shecter <robb@acm.org>
# All rights reserved. # All rights reserved.
@ -252,11 +252,11 @@ def scrollbox(self, text, height=20, width=60, title=''):
def gauge_start(self, perc=0, text='', height=8, width=54, title=''): def gauge_start(self, perc=0, text='', height=8, width=54, title=''):
""" """
Display gauge output window. Display gauge output window.
Gauge normal usage (assuming that there is an instace of 'Dialog' Gauge normal usage (assuming that there is an instance of 'Dialog'
class named 'd'): class named 'd'):
d.gauge_start() d.gauge_start()
# do something # do something
d.gauge_iterate(10) # passed throgh 10% d.gauge_iterate(10) # passed through 10%
# ... # ...
d.gauge_iterate(100, 'any text here') # work is done d.gauge_iterate(100, 'any text here') # work is done
d.stop_gauge() # clean-up actions d.stop_gauge() # clean-up actions

View File

@ -1,11 +1,11 @@
#!/bin/sh #!/bin/sh
# $Id: dselect,v 1.7 2016/01/26 22:52:53 tom Exp $ # $Id: dselect,v 1.10 2020/11/26 00:09:12 tom Exp $
. ./setup-vars . ./setup-vars
exec 3>&1 exec 3>&1
RESULT=`$DIALOG --title "Please choose a file" "$@" --dselect $HOME/ 14 48 2>&1 1>&3` returntext=`$DIALOG --title "Please choose a file" "$@" --dselect "$HOME/" 14 48 2>&1 1>&3`
retval=$? returncode=$?
exec 3>&- exec 3>&-
. ./report-string . ./report-string

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: editbox,v 1.13 2010/01/13 10:20:03 tom Exp $ # $Id: editbox,v 1.14 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -40,6 +40,6 @@ EOF
$DIALOG --title "EDIT BOX" \ $DIALOG --title "EDIT BOX" \
--fixed-font "$@" --editbox $input 0 0 2>$output --fixed-font "$@" --editbox $input 0 0 2>$output
retval=$? returncode=$?
. ./report-edit . ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: editbox-utf8,v 1.9 2010/01/13 10:20:03 tom Exp $ # $Id: editbox-utf8,v 1.10 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -30,6 +30,6 @@ EOF
$DIALOG --title "EDIT BOX" \ $DIALOG --title "EDIT BOX" \
--fixed-font "$@" --editbox $input 0 0 2>$output --fixed-font "$@" --editbox $input 0 0 2>$output
retval=$? returncode=$?
. ./report-edit . ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: editbox2,v 1.7 2010/01/13 10:20:03 tom Exp $ # $Id: editbox2,v 1.8 2020/11/26 00:03:58 tom Exp $
# example with extra- and help-buttons # example with extra- and help-buttons
. ./setup-vars . ./setup-vars
@ -40,6 +40,6 @@ $DIALOG --title "EDIT BOX" \
--extra-button \ --extra-button \
--help-button \ --help-button \
--fixed-font "$@" --editbox $input 0 0 2>$output --fixed-font "$@" --editbox $input 0 0 2>$output
retval=$? returncode=$?
. ./report-edit . ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: editbox3,v 1.7 2010/01/13 10:20:03 tom Exp $ # $Id: editbox3,v 1.8 2020/11/26 00:03:58 tom Exp $
# example with extra- and help-buttons # example with extra- and help-buttons
. ./setup-vars . ./setup-vars
@ -13,6 +13,6 @@ $DIALOG --title "EDIT BOX" \
--extra-button \ --extra-button \
--help-button \ --help-button \
--fixed-font "$@" --editbox $input 0 0 2>$output --fixed-font "$@" --editbox $input 0 0 2>$output
retval=$? returncode=$?
. ./report-edit . ./report-edit

View File

@ -1,5 +1,5 @@
#!/bin/sh #!/bin/sh
# $Id: editbox4,v 1.1 2010/01/17 22:29:50 tom Exp $ # $Id: editbox4,v 1.2 2020/11/26 00:03:58 tom Exp $
. ./setup-vars . ./setup-vars
@ -40,6 +40,6 @@ EOF
$DIALOG --title "EDIT BOX" \ $DIALOG --title "EDIT BOX" \
--fixed-font "$@" --editbox $input 20 40 2>$output --fixed-font "$@" --editbox $input 20 40 2>$output
retval=$? returncode=$?
. ./report-edit . ./report-edit

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form1,v 1.15 2011/10/04 23:36:53 tom Exp $ # $Id: form1,v 1.18 2020/11/26 00:34:39 tom Exp $
. ./setup-vars . ./setup-vars
@ -19,7 +19,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--backtitle "$backtitle" "$@" \ --backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \ --form "Here is a possible piece of a configuration program." \
20 50 0 \ 20 50 0 \
@ -31,7 +31,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -63,16 +63,8 @@ $show" 10 40
echo "Button 3 (Extra) pressed." echo "Button 3 (Extra) pressed."
exit exit
;; ;;
$DIALOG_ERROR)
echo "ERROR!$value"
exit
;;
$DIALOG_ESC)
echo "ESC pressed."
exit
;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form1-both,v 1.5 2010/01/13 10:47:35 tom Exp $ # $Id: form1-both,v 1.8 2020/11/26 00:34:22 tom Exp $
. ./setup-vars . ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--extra-button --help-button \ --extra-button --help-button \
--backtitle "$backtitle" "$@" \ --backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \ --form "Here is a possible piece of a configuration program." \
@ -29,7 +29,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -53,16 +53,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\ --msgbox "Resulting data:\n\
$show" 10 40 $show" 10 40
;; ;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form1-extra,v 1.5 2010/01/13 10:47:35 tom Exp $ # $Id: form1-extra,v 1.8 2020/11/26 00:34:05 tom Exp $
. ./setup-vars . ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--extra-button \ --extra-button \
--backtitle "$backtitle" "$@" \ --backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \ --form "Here is a possible piece of a configuration program." \
@ -29,7 +29,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -53,16 +53,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\ --msgbox "Resulting data:\n\
$show" 10 40 $show" 10 40
;; ;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form1-help,v 1.5 2010/01/13 10:47:35 tom Exp $ # $Id: form1-help,v 1.8 2020/11/26 00:33:42 tom Exp $
. ./setup-vars . ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--help-button \ --help-button \
--backtitle "$backtitle" "$@" \ --backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \ --form "Here is a possible piece of a configuration program." \
@ -29,7 +29,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -53,16 +53,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\ --msgbox "Resulting data:\n\
$show" 10 40 $show" 10 40
;; ;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form1-utf8,v 1.7 2010/01/13 10:47:35 tom Exp $ # $Id: form1-utf8,v 1.10 2020/11/26 00:33:23 tom Exp $
. ./setup-vars . ./setup-vars
@ -18,7 +18,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--backtitle "$backtitle" \ --backtitle "$backtitle" \
--insecure "$@" \ --insecure "$@" \
--form "Here is a possible piece of a configuration program." \ --form "Here is a possible piece of a configuration program." \
@ -31,7 +31,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -55,16 +55,8 @@ show=`echo "$value" |sed -e 's/^/ /'`
--msgbox "Resulting data:\n\ --msgbox "Resulting data:\n\
$show" 10 40 $show" 10 40
;; ;;
$DIALOG_HELP)
echo "Button 2 (Help) pressed."
exit
;;
$DIALOG_EXTRA)
echo "Button 3 (Extra) pressed."
exit
;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form2,v 1.9 2010/01/13 10:53:11 tom Exp $ # $Id: form2,v 1.12 2020/11/26 00:33:02 tom Exp $
. ./setup-vars . ./setup-vars
@ -16,7 +16,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--backtitle "$backtitle" "$@" \ --backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \ --form "Here is a possible piece of a configuration program." \
0 0 10 \ 0 0 10 \
@ -52,7 +52,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -77,7 +77,7 @@ show=`echo "$value" |sed -e 's/^/ /'`
$show" 0 0 $show" 0 0
;; ;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form3,v 1.6 2010/01/13 10:49:52 tom Exp $ # $Id: form3,v 1.9 2020/11/26 00:32:45 tom Exp $
# form1 with --help-button # form1 with --help-button
. ./setup-vars . ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--help-button \ --help-button \
--backtitle "$backtitle" "$@" \ --backtitle "$backtitle" "$@" \
--form "Here is a possible piece of a configuration program." \ --form "Here is a possible piece of a configuration program." \
@ -30,7 +30,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -62,7 +62,7 @@ $show" 10 40
$show" 10 40 $show" 10 40
;; ;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form4,v 1.6 2010/01/13 10:49:52 tom Exp $ # $Id: form4,v 1.9 2020/11/26 00:32:31 tom Exp $
# form3 with --item-help # form3 with --item-help
. ./setup-vars . ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--help-button \ --help-button \
--item-help \ --item-help \
--backtitle "$backtitle" "$@" \ --backtitle "$backtitle" "$@" \
@ -31,7 +31,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -63,7 +63,7 @@ $show" 10 40
$show" 10 40 $show" 10 40
;; ;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form5,v 1.6 2010/01/13 10:49:52 tom Exp $ # $Id: form5,v 1.9 2020/11/26 00:32:17 tom Exp $
# form4 with --help-status # form4 with --help-status
. ./setup-vars . ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--help-status \ --help-status \
--help-button \ --help-button \
--item-help \ --item-help \
@ -32,7 +32,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -64,7 +64,7 @@ $show" 10 40
$show" 10 40 $show" 10 40
;; ;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

View File

@ -1,5 +1,5 @@
#! /bin/sh #! /bin/sh
# $Id: form6,v 1.5 2010/01/13 10:49:52 tom Exp $ # $Id: form6,v 1.8 2020/11/26 00:31:55 tom Exp $
# form4 with --help-status # form4 with --help-status
. ./setup-vars . ./setup-vars
@ -17,7 +17,7 @@ returncode=0
while test $returncode != 1 && test $returncode != 250 while test $returncode != 1 && test $returncode != 250
do do
exec 3>&1 exec 3>&1
value=`$DIALOG --ok-label "Submit" \ returntext=`$DIALOG --ok-label "Submit" \
--help-status \ --help-status \
--help-button \ --help-button \
--item-help \ --item-help \
@ -32,7 +32,7 @@ value=`$DIALOG --ok-label "Submit" \
returncode=$? returncode=$?
exec 3>&- exec 3>&-
show=`echo "$value" |sed -e 's/^/ /'` show=`echo "$returntext" |sed -e 's/^/ /'`
case $returncode in case $returncode in
$DIALOG_CANCEL) $DIALOG_CANCEL)
@ -64,7 +64,7 @@ $show" 10 40
$show" 10 40 $show" 10 40
;; ;;
*) *)
echo "Return code was $returncode" . ./report-button
exit exit
;; ;;
esac esac

Some files were not shown because too many files have changed in this diff Show More