From 77a55d2c3b4dd48a9a608736a9ba7ebce700bae1 Mon Sep 17 00:00:00 2001 From: Alfonso Siciliano Date: Tue, 21 Dec 2021 16:06:19 +0100 Subject: [PATCH] bsddialog: import snapshot 0.0.2 --- .gitignore | 3 +- bsddialog.1 | 32 +- bsddialog.c | 38 ++- examples_library/sade.c | 42 +-- examples_utility/mixedgauge.sh | 2 +- lib/GNUMakefile | 4 +- lib/Makefile | 41 ++- lib/barbox.c | 169 ++++++++-- lib/bsddialog.3 | 562 ++++++++++++++++++++++++++++++--- lib/bsddialog.h | 17 +- lib/bsddialog_progressview.h | 54 ++++ lib/bsddialog_theme.h | 4 +- lib/formbox.c | 135 ++++---- lib/lib_util.c | 7 +- lib/lib_util.h | 7 +- lib/libbsddialog.c | 30 +- lib/menubox.c | 4 +- lib/messagebox.c | 48 ++- lib/textbox.c | 3 +- lib/theme.c | 8 +- lib/timebox.c | 3 +- 21 files changed, 951 insertions(+), 262 deletions(-) create mode 100644 lib/bsddialog_progressview.h diff --git a/.gitignore b/.gitignore index ee80e5f5a073..557ad3300d1f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ bsddialog *.o *~ +*.a examples_library/buildlist examples_library/checklist examples_library/datebox @@ -22,4 +23,4 @@ lib/libbsddialog.so* BSDDIALOG.geany BSDDIALOG.tags *.core -bsdinstall/* +freebsd-lab/ diff --git a/bsddialog.1 b/bsddialog.1 index 2846b77547a9..bfee3229bd1f 100644 --- a/bsddialog.1 +++ b/bsddialog.1 @@ -27,15 +27,25 @@ .Os .Sh NAME .Nm bsddialog -.Nd build dialogs and widgets with a TUI +.Nd terminal dialogs and widgets .Sh SYNOPSIS .Nm bsddialog -.Op Fl options -.Ar +.Fl -help +.Nm bsddialog +.Fl -version +.Nm bsddialog +.Op Fl Ar -common-opts +.Fl Ar -widget +.Fl Artext +.Fl Arheight +.Fl Arwidth +.Op Fl Ar -widget-opts .Sh DESCRIPTION The -.Nm -utility processes files ... +.Nm BSDDialog +is an utility to write a script with a Text User Interface. It can build +dialogs and widgets: to show messages, to get input and to inform about a +computation status. .\" .Sh ENVIRONMENT .\" For sections 1, 6, 7, and 8 only. .\" .Sh FILES @@ -44,9 +54,13 @@ utility processes files ... .\" .Sh EXAMPLES .\" .Sh DIAGNOSTICS .\" For sections 1, 4, 6, 7, 8, and 9 printf/stderr messages only. -.\" .Sh SEE ALSO -.\" .Xr foobar 1 +.Sh SEE ALSO +.Xr bsddialog 3 .\" .Sh HISTORY .\" .Sh AUTHORS -.\" .Sh CAVEATS -.\" .Sh BUGS +.Sh CAVEATS +autosize +compatibility text +.Sh BUGS +buildlist +forms diff --git a/bsddialog.c b/bsddialog.c index 6fc0d834a1ad..aa87dec2962b 100644 --- a/bsddialog.c +++ b/bsddialog.c @@ -66,6 +66,7 @@ enum OPTS { HLINE, IGNORE, INSECURE, + ITEM_DEPTH, ITEM_HELP, ITEM_PREFIX, MAX_INPUT, @@ -128,7 +129,7 @@ static char *nostring = ""; /* Menus flags and options */ static bool item_prefix_flag, item_bottomdesc_flag, item_output_sepnl_flag; static bool item_singlequote_flag, list_items_on_flag, item_tag_help_flag; -static bool item_always_quote_flag; +static bool item_always_quote_flag, item_depth_flag; static char *item_output_sep_flag; /* Time and calendar options */ static char *date_fmt_flag, *time_fmt_flag; @@ -227,8 +228,9 @@ void usage(void) "--exit-label