Date: Sun, 13 Mar 2022 01:40:20 GMT From: "Alfonso S. Siciliano" <asiciliano@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: bce40c0242b1 - main - Merge commit '2f8d4418415511460bd7b3b3e532f6b328cf993f' Message-ID: <202203130140.22D1eKl1062261@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by asiciliano: URL: https://cgit.FreeBSD.org/src/commit/?id=bce40c0242b167a541cc051b6b0dbcc5f3d04319 commit bce40c0242b167a541cc051b6b0dbcc5f3d04319 Merge: a33ead9c9cf3 2f8d44184155 Author: Alfonso S. Siciliano <asiciliano@FreeBSD.org> AuthorDate: 2022-03-13 01:38:51 +0000 Commit: Alfonso S. Siciliano <asiciliano@FreeBSD.org> CommitDate: 2022-03-13 01:38:51 +0000 Merge commit '2f8d4418415511460bd7b3b3e532f6b328cf993f' contrib/bsddialog/.gitignore | 1 + contrib/bsddialog/CHANGELOG | 61 ++++++++ contrib/bsddialog/GNUMakefile | 2 +- contrib/bsddialog/Makefile | 8 +- contrib/bsddialog/README.md | 5 +- contrib/bsddialog/bsddialog.1 | 12 +- contrib/bsddialog/bsddialog.c | 107 +++++++------ contrib/bsddialog/examples_library/checklist.c | 3 +- contrib/bsddialog/examples_library/compile | 2 +- contrib/bsddialog/examples_library/datebox.c | 8 +- contrib/bsddialog/examples_library/form.c | 4 +- contrib/bsddialog/examples_library/formw.c | 61 ++++++++ contrib/bsddialog/examples_library/infobox.c | 3 +- contrib/bsddialog/examples_library/menu.c | 3 +- contrib/bsddialog/examples_library/mixedlist.c | 20 ++- contrib/bsddialog/examples_library/msgbox.c | 3 +- contrib/bsddialog/examples_library/pause.c | 3 +- contrib/bsddialog/examples_library/radiolist.c | 3 +- contrib/bsddialog/examples_library/rangebox.c | 3 +- contrib/bsddialog/examples_library/theme.c | 13 +- contrib/bsddialog/examples_library/timebox.c | 8 +- contrib/bsddialog/examples_library/yesno.c | 3 +- contrib/bsddialog/examples_utility/checklist.sh | 27 +++- contrib/bsddialog/examples_utility/form.sh | 27 +++- contrib/bsddialog/examples_utility/gauge.sh | 4 +- contrib/bsddialog/examples_utility/infobox.sh | 3 +- contrib/bsddialog/examples_utility/inputbox.sh | 30 +++- contrib/bsddialog/examples_utility/menu.sh | 28 +++- contrib/bsddialog/examples_utility/mixedform.sh | 36 ++++- contrib/bsddialog/examples_utility/mixedgauge.sh | 3 +- contrib/bsddialog/examples_utility/msgbox.sh | 19 ++- contrib/bsddialog/examples_utility/passwordbox.sh | 30 +++- contrib/bsddialog/examples_utility/passwordform.sh | 30 +++- contrib/bsddialog/examples_utility/pause.sh | 36 +++++ contrib/bsddialog/examples_utility/radiolist.sh | 29 +++- contrib/bsddialog/examples_utility/timebox.sh | 34 +++++ contrib/bsddialog/examples_utility/treeview.sh | 17 --- contrib/bsddialog/examples_utility/yesno.sh | 23 ++- contrib/bsddialog/lib/GNUMakefile | 5 +- contrib/bsddialog/lib/Makefile | 11 +- contrib/bsddialog/lib/barbox.c | 54 +++---- contrib/bsddialog/lib/bsddialog.3 | 43 +++--- contrib/bsddialog/lib/bsddialog.h | 7 +- contrib/bsddialog/lib/bsddialog_theme.h | 11 +- contrib/bsddialog/lib/formbox.c | 108 +++++++++----- contrib/bsddialog/lib/infobox.c | 3 - contrib/bsddialog/lib/lib_util.c | 59 ++++---- contrib/bsddialog/lib/lib_util.h | 10 +- contrib/bsddialog/lib/libbsddialog.c | 9 +- contrib/bsddialog/lib/menubox.c | 118 ++++++++------- contrib/bsddialog/lib/messagebox.c | 9 +- contrib/bsddialog/lib/textbox.c | 5 +- contrib/bsddialog/lib/theme.c | 60 ++++---- contrib/bsddialog/lib/timebox.c | 165 +++++++++++++++------ 54 files changed, 957 insertions(+), 432 deletions(-) diff --cc contrib/bsddialog/.gitignore index 557ad3300d1f,000000000000..62f7b594a708 mode 100644,000000..100644 --- a/contrib/bsddialog/.gitignore +++ b/contrib/bsddialog/.gitignore @@@ -1,26 -1,0 +1,27 @@@ +bsddialog +*.o +*~ +*.a +examples_library/buildlist +examples_library/checklist +examples_library/datebox +examples_library/form ++examples_library/formw +examples_library/menu +examples_library/mixedlist +examples_library/radiolist +examples_library/theme +examples_library/treeview +examples_library/infobox +examples_library/msgbox +examples_library/pause +examples_library/rangebox +examples_library/sade +examples_library/timebox +examples_library/yesno +*.gz +lib/libbsddialog.so* +BSDDIALOG.geany +BSDDIALOG.tags +*.core +freebsd-lab/ diff --cc contrib/bsddialog/CHANGELOG index 000000000000,22eb3342cfe2..22eb3342cfe2 mode 000000,100644..100644 --- a/contrib/bsddialog/CHANGELOG +++ b/contrib/bsddialog/CHANGELOG diff --cc contrib/bsddialog/Makefile index 2abfb9e27cd7,000000000000..5d5d0cc923a5 mode 100644,000000..100644 --- a/contrib/bsddialog/Makefile +++ b/contrib/bsddialog/Makefile @@@ -1,56 -1,0 +1,50 @@@ +# PUBLIC DOMAIN - NO WARRANTY, see: +# <http://creativecommons.org/publicdomain/zero/1.0/> +# +# Written in 2021 by Alfonso Sabato Siciliano + +OUTPUT= bsddialog +SOURCES= bsddialog.c +OBJECTS= ${SOURCES:.c=.o} +LIBPATH= ${.CURDIR}/lib +LIBBSDDIALOG= ${LIBPATH}/libbsddialog.so + - CFLAGS+= -I${LIBPATH} -std=gnu99 -Wno-format-zero-length \ - -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W \ - -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \ - -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int \ - -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value \ - -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion \ - -Wno-unused-local-typedef -Wno-address-of-packed-member -Qunused-arguments ++CFLAGS+= -I${LIBPATH} -std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter +# `make -DDEBUG` +.if defined(DEBUG) +CFLAGS= -g -Wall -I${LIBPATH} +LIBDEBUG= -DDEBUG +.endif +LDFLAGS+= -Wl,-rpath=${LIBPATH} -L${LIBPATH} -lbsddialog + +BINDIR= /usr/local/bin +MAN= ${OUTPUT}.1 +GZIP= gzip -cn +MANDIR= /usr/local/share/man/man1 + +INSTALL= install +RM= rm -f + +all : ${OUTPUT} + +${OUTPUT}: ${LIBBSDDIALOG} ${OBJECTS} + ${CC} ${LDFLAGS} ${OBJECTS} -o ${.PREFIX} + +${LIBBSDDIALOG}: + make -C ${LIBPATH} ${LIBDEBUG} + +.c.o: + ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +install: + ${INSTALL} -s -m 555 ${OUTPUT} ${BINDIR} + ${GZIP} ${MAN} > ${MAN}.gz + ${INSTALL} -m 444 ${MAN}.gz ${MANDIR} + +unistall: + ${RM} ${BINDIR}/${OUTPUT} + ${RM} ${MANDIR}/${MAN}.gz + +clean: + make -C ${LIBPATH} clean + ${RM} ${OUTPUT} *.o *~ *.core ${MAN}.gz diff --cc contrib/bsddialog/README.md index 17af3a0db8e5,000000000000..3a814b38ddb4 mode 100644,000000..100644 --- a/contrib/bsddialog/README.md +++ b/contrib/bsddialog/README.md @@@ -1,116 -1,0 +1,117 @@@ - # BSDDialog 0.1 ++# BSDDialog 0.2 + + +This project provides **bsddialog** and **libbsddialog**, an utility and a +library to build scripts and tools with TUI dialogs and widgets. + + +## Intro + +Briefly: +<https://www.freebsd.org/status/report-2021-04-2021-06/#_bsddialog_tui_widgets> + +Utility: +<https://alfonsosiciliano.gitlab.io/posts/2021-12-07-bsddialog.html> + +Library: +<https://alfonsosiciliano.gitlab.io/posts/2022-01-16-libbsddialog.html> + +Screenshots: +<https://www.flickr.com/photos/alfonsosiciliano/albums/72157720215006074> + + +## Getting Started + +FreeBSD: + +``` +% git clone https://gitlab.com/alfix/bsddialog.git +% cd bsddialog +% make +% ./bsddialog --msgbox "Hello World!" 8 20 +``` + +Output: + +![screenshot](screenshot.png) + + +## Utility + +**Dialogs:** + +--checklist, --datebox, --form, --gauge, --inputbox, --menu, --mixedform, +--mixedgauge, --msgbox, --passwordbox, --passwordform, --pause, --radiolist, +--rangebox, --textbox, --timebox, --treeview, --yesno. + +**Manual** + + - [bsddialog(1)](https://alfonsosiciliano.gitlab.io/posts/2022-01-26-manual-bsddialog.html) + + +**Examples**: + +``` +% ./bsddialog --backtitle "TITLE" --title msgbox --msgbox "Hello World!" 5 30 +% ./bsddialog --theme blackwhite --title msgbox --msgbox "Hello World!" 5 30 +% ./bsddialog --begin-y 2 --default-no --title yesno --yesno "Hello World!" 5 30 +% ./bsddialog --ascii-lines --pause "Hello World!" 8 50 10 +% ./bsddialog --checklist "Space to select" 0 0 0 Name1 Desc1 off Name2 Desc2 on +% ./bsddialog --title yesno --hline "bsddialog" --yesno "Hello World!" 5 25 +% ./bsddialog --extra-button --help-button --yesno "Hello World!" 0 0 +``` + +and [Examples](https://gitlab.com/alfix/bsddialog/-/tree/main/examples_utility) +in the _Public Domain_ to build new projects: +``` +% sh ./examples_utility/checklist.sh +% sh ./examples_utility/form.sh +% sh ./examples_utility/gauge.sh +% sh ./examples_utility/infobox.sh +% sh ./examples_utility/inputbox.sh +% sh ./examples_utility/menu.sh +% sh ./examples_utility/mixedform.sh +% sh ./examples_utility/mixedgauge.sh +% sh ./examples_utility/msgbox.sh +% sh ./examples_utility/passwordbox.sh +% sh ./examples_utility/passwordform.sh ++% sh ./examples_utility/pause.sh +% sh ./examples_utility/radiolist.sh - % sh ./examples_utility/treeview.sh ++% sh ./examples_utility/timebox.sh +% sh ./examples_utility/yesno.sh +``` + +## Library + +**API** + + - [bsddialog.h](https://gitlab.com/alfix/bsddialog/-/blob/main/lib/bsddialog.h) + - [bsddialog\_theme.h](https://gitlab.com/alfix/bsddialog/-/blob/main/lib/bsddialog_theme.h) + + +**Manual** + + - [bsddialog(3)](https://alfonsosiciliano.gitlab.io/posts/2022-01-15-manual-libbsddialog.html) + + +**Examples**: + +[Examples](https://gitlab.com/alfix/bsddialog/-/tree/main/examples_library) +in the _Public Domain_ to build new projects: +``` +% cd examples_library +% sh compile +% ./datebox +% ./form +% ./infobox +% ./menu +% ./mixedlist +% ./msgbox +% ./pause +% ./radiolist +% ./rangebox +% ./theme +% ./timebox +% ./yesno +``` + diff --cc contrib/bsddialog/examples_library/formw.c index 000000000000,edbeec98f2a3..edbeec98f2a3 mode 000000,100644..100644 --- a/contrib/bsddialog/examples_library/formw.c +++ b/contrib/bsddialog/examples_library/formw.c diff --cc contrib/bsddialog/examples_utility/pause.sh index 000000000000,225549dddffb..225549dddffb mode 000000,100755..100755 --- a/contrib/bsddialog/examples_utility/pause.sh +++ b/contrib/bsddialog/examples_utility/pause.sh diff --cc contrib/bsddialog/examples_utility/timebox.sh index 000000000000,81d24d558dc9..81d24d558dc9 mode 000000,100755..100755 --- a/contrib/bsddialog/examples_utility/timebox.sh +++ b/contrib/bsddialog/examples_utility/timebox.sh diff --cc contrib/bsddialog/lib/Makefile index d9f2ce8ed69b,000000000000..962b059b3e03 mode 100644,000000..100644 --- a/contrib/bsddialog/lib/Makefile +++ b/contrib/bsddialog/lib/Makefile @@@ -1,76 -1,0 +1,75 @@@ +# PUBLIC DOMAIN - NO WARRANTY, see: +# <http://creativecommons.org/publicdomain/zero/1.0/> +# +# Written in 2021 by Alfonso Sabato Siciliano + - VERSION = 0.1 ++VERSION = 0.2 +LIBRARY = bsddialog +LIBRARY_SO = lib${LIBRARY:=.so} +LIBRARY_A = lib${LIBRARY:=.a} +HEADERS = bsddialog.h bsddialog_theme.h bsddialog_progressview.h +SOURCES = barbox.c formbox.c infobox.c libbsddialog.c lib_util.c menubox.c \ + messagebox.c textbox.c theme.c timebox.c +OBJECTS = ${SOURCES:.c=.o} - CFLAGS += -fPIC -Wall -Wextra ++CFLAGS += -D_XOPEN_SOURCE_EXTENDED -fPIC -Wall -Wextra +LDFLAGS += -fstack-protector-strong -shared -Wl,-x -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel -Wl,-soname,${LIBRARY_SO}.${VERSION} \ + -L/usr/lib -lformw -lncursesw -ltinfow + +.if defined(DEBUG) +# `make -DDEBUG` - CFLAGS = -g -fPIC -Wall -Wextra ++CFLAGS = -g -D_XOPEN_SOURCE_EXTENDED -fPIC -Wall -Wextra +.else - CFLAGS += -O2 -pipe -std=gnu99 -Wno-format-zero-length \ - -fstack-protector-strong -Qunused-arguments ++CFLAGS += -std=gnu99 -fstack-protector-strong +.endif + +LOCALBASE = /usr/local +LN = ln -s -f +RM = rm -f +CP = cp +GZIP = gzip -cn +LDCONFIG = /sbin/ldconfig -m +MAN = ${OUTPUT}.3 +GZIP = gzip -cn +MANDIR = ${LOCALBASE}/share/man/man3 +INSTALL = install +RM = rm -f + +all : man ${LIBRARY} + +${LIBRARY}: ${LIBRARY_SO} ${LIBRARY_A} + +${LIBRARY_SO}.${VERSION}: ${OBJECTS} + ${CC} ${LDFLAGS} ${.ALLSRC} -o ${LIBRARY_SO}.${VERSION} + +${LIBRARY_SO}: ${LIBRARY_SO}.${VERSION} + ${LN} ${LIBRARY_SO}.${VERSION} ${LIBRARY_SO} + +${LIBRARY_A}: ${OBJECTS} + ${AR} cr ${.TARGET} ${OBJECTS} + ${RANLIB} ${.TARGET} + +.c.o: + ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + +man: + ${GZIP} ${LIBRARY}.3 > ${LIBRARY}.3.gz + +clean: + ${RM} ${LIBRARY_SO}* *.o *~ *.gz ${LIBRARY_A} + + +install: + ${INSTALL} -m 644 ${HEADERS} ${LOCALBASE}/include + ${INSTALL} -m 644 -s ${LIBRARY_SO}.${VERSION} ${LOCALBASE}/lib/ + ${INSTALL} -l rs ${LOCALBASE}/lib/${LIBRARY_SO}.${VERSION} ${LOCALBASE}/lib/${LIBRARY_SO} + ${INSTALL} -m 644 ${LIBRARY_A} ${LOCALBASE}/lib + ${LDCONFIG} ${LOCALBASE}/lib - ${INSTALL} -m 644 ${LIBRARY}.3.gz ${MNADIR} ++ ${INSTALL} -m 644 ${LIBRARY}.3.gz ${MANDIR} + +unistall: + ${RM} ${LOCALBASE}/include/${LIBRARY}*.h + ${RM} ${LOCALBASE}/lib/${LIBRARY_SO} + ${RM} ${LOCALBASE}/lib/${LIBRARY_SO}.${VERSION} + ${LDCONFIG} ${LOCALBASE}/lib + ${RM} ${MANDIR}/${LIBRARY}.3.gz
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203130140.22D1eKl1062261>