Date: Tue, 25 Nov 2014 13:47:54 +0000 (UTC) From: Devin Teske <dteske@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275040 - in stable/10: . gnu/lib/libdialog lib lib/libdpv lib/libfigpar share/mk sys/sys usr.bin usr.bin/dpv Message-ID: <201411251347.sAPDls67071916@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dteske Date: Tue Nov 25 13:47:53 2014 New Revision: 275040 URL: https://svnweb.freebsd.org/changeset/base/275040 Log: MFC r274116: Add new libraries/utilities for data throughput visualization. dpv(3): dialog progress view library dpv(1): stream data from stdin or multiple paths with dialog progress view figpar(3): configuration file parsing library MFC r274120, r274121, r274123, r274124, r274144, r274146, r274159, r274192, r274203, r274209, r274226, r274270, and r274851: Fixes following r274116 Reviews: D714 Relnotes: New libdpv/libfigpar and dpv(1) utility Reviewed by: jelischer, shurd Discussed at: MeetBSD California 2014 Vendor/Dev Summit Discussed on: -current Thanks to: ngie, ian, jelischer, shurd, bapt Added: stable/10/lib/libdpv/ - copied from r274116, head/lib/libdpv/ stable/10/lib/libfigpar/ - copied from r274116, head/lib/libfigpar/ stable/10/usr.bin/dpv/ - copied from r274116, head/usr.bin/dpv/ Modified: stable/10/Makefile.inc1 stable/10/gnu/lib/libdialog/Makefile stable/10/lib/Makefile stable/10/lib/libdpv/Makefile stable/10/lib/libdpv/dialog_util.c stable/10/lib/libdpv/dialogrc.c stable/10/lib/libdpv/dialogrc.h stable/10/lib/libdpv/dpv.c stable/10/share/mk/bsd.libnames.mk stable/10/sys/sys/param.h stable/10/usr.bin/Makefile stable/10/usr.bin/dpv/Makefile stable/10/usr.bin/dpv/dpv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Nov 25 13:29:13 2014 (r275039) +++ stable/10/Makefile.inc1 Tue Nov 25 13:47:53 2014 (r275040) @@ -1510,6 +1510,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_lib_atf} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libelf lib/libexpat \ + lib/libfigpar \ ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ @@ -1520,7 +1521,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_cddl_lib_libzfs_core} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ - ${_secure_lib_libssh} ${_secure_lib_libssl} + ${_secure_lib_libssh} ${_secure_lib_libssl} \ + gnu/lib/libdialog .if ${MK_GNUCXX} != no _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L @@ -1637,6 +1639,8 @@ _lib_libypclnt= lib/libypclnt lib/libradius__L: lib/libmd__L .endif +gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L + .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) Modified: stable/10/gnu/lib/libdialog/Makefile ============================================================================== --- stable/10/gnu/lib/libdialog/Makefile Tue Nov 25 13:29:13 2014 (r275039) +++ stable/10/gnu/lib/libdialog/Makefile Tue Nov 25 13:47:53 2014 (r275040) @@ -13,6 +13,9 @@ SRCS= argv.c arrows.c buildlist.c butto INCS= dialog.h dlg_colors.h dlg_config.h dlg_keys.h MAN= dialog.3 +DPADD= ${LIBNCURSESW} ${LIBM} +LDADD= -lncursesw -lm + CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DGCC_UNUSED=__unused .PATH: ${DIALOG} WARNS?= 1 Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Tue Nov 25 13:29:13 2014 (r275039) +++ stable/10/lib/Makefile Tue Nov 25 13:47:53 2014 (r275040) @@ -39,12 +39,14 @@ SUBDIR= ${SUBDIR_ORDERED} \ libcrypt \ libdevinfo \ libdevstat \ + libdpv \ libdwarf \ libedit \ ${_libefi} \ libexecinfo \ libexpat \ libfetch \ + libfigpar \ libgeom \ ${_libgpib} \ ${_libgssapi} \ @@ -121,7 +123,7 @@ SUBDIR_DEPEND_libc++= libcxxrt SUBDIR_DEPEND_libc= libcompiler_rt SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libdevstat= libkvm -SUBDIR_DEPEND_libdiaglog= ncurses +SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libg++= msun SUBDIR_DEPEND_libgeom= libexpat libsbuf Modified: stable/10/lib/libdpv/Makefile ============================================================================== --- head/lib/libdpv/Makefile Tue Nov 4 23:46:01 2014 (r274116) +++ stable/10/lib/libdpv/Makefile Tue Nov 25 13:47:53 2014 (r275040) @@ -6,11 +6,13 @@ INCS= dpv.h MAN= dpv.3 MLINKS= dpv.3 dpv_free.3 -CFLAGS+= -I${.CURDIR} -LDFLAGS+= -ldialog -lfigpar -lncurses -lutil +DPADD= ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL} +LDADD= -ldialog -lfigpar -lncursesw -lutil SRCS= dialog_util.c dialogrc.c dprompt.c dpv.c status.c util.c +CFLAGS+= -I${.CURDIR} + WARNS?= 6 .include <bsd.lib.mk> Modified: stable/10/lib/libdpv/dialog_util.c ============================================================================== --- head/lib/libdpv/dialog_util.c Tue Nov 4 23:46:01 2014 (r274116) +++ stable/10/lib/libdpv/dialog_util.c Tue Nov 25 13:47:53 2014 (r275040) @@ -62,7 +62,7 @@ char *title = NULL; char *backtitle = NULL; int dheight = 0; int dwidth = 0; -char *dargv[64] = { NULL }; +static char *dargv[64] = { NULL }; /* TTY/Screen characteristics */ static struct winsize *maxsize = NULL; Modified: stable/10/lib/libdpv/dialogrc.c ============================================================================== --- head/lib/libdpv/dialogrc.c Tue Nov 4 23:46:01 2014 (r274116) +++ stable/10/lib/libdpv/dialogrc.c Tue Nov 25 13:47:53 2014 (r275040) @@ -49,58 +49,58 @@ char gauge_color[STR_BUFSIZE] = "47b"; / char separator[STR_BUFSIZE] = ""; /* Function prototypes */ -static int setattr(struct config *, uint32_t, char *, char *); -static int setbool(struct config *, uint32_t, char *, char *); -static int setnum(struct config *, uint32_t, char *, char *); -static int setstr(struct config *, uint32_t, char *, char *); +static int setattr(struct fp_config *, uint32_t, char *, char *); +static int setbool(struct fp_config *, uint32_t, char *, char *); +static int setnum(struct fp_config *, uint32_t, char *, char *); +static int setstr(struct fp_config *, uint32_t, char *, char *); /* * Anatomy of DIALOGRC (~/.dialogrc by default) * NOTE: Must appear after private function prototypes (above) * NB: Brace-initialization of union requires cast to *first* member of union */ -static struct config dialogrc_config[] = { - /* TYPE Directive DEFAULT HANDLER */ - {TYPE_INT, "aspect", {(void *)0}, &setnum}, - {TYPE_STR, "separate_widget", {separator}, &setstr}, - {TYPE_INT, "tab_len", {(void *)0}, &setnum}, - {TYPE_BOOL, "visit_items", {(void *)0}, &setbool}, - {TYPE_BOOL, "use_shadow", {(void *)1}, &setbool}, - {TYPE_BOOL, "use_colors", {(void *)1}, &setbool}, - {TYPE_STR, "screen_color", {NULL}, &setattr}, - {TYPE_STR, "shadow_color", {NULL}, &setattr}, - {TYPE_STR, "dialog_color", {NULL}, &setattr}, - {TYPE_STR, "title_color", {NULL}, &setattr}, - {TYPE_STR, "border_color", {NULL}, &setattr}, - {TYPE_STR, "button_active_color", {NULL}, &setattr}, - {TYPE_STR, "button_inactive_color", {NULL}, &setattr}, - {TYPE_STR, "button_key_active_color", {NULL}, &setattr}, - {TYPE_STR, "button_key_inactive_color", {NULL}, &setattr}, - {TYPE_STR, "button_label_active_color", {NULL}, &setattr}, - {TYPE_STR, "button_label_inactive_color", {NULL}, &setattr}, - {TYPE_STR, "inputbox_color", {NULL}, &setattr}, - {TYPE_STR, "inputbox_border_color", {NULL}, &setattr}, - {TYPE_STR, "searchbox_color", {NULL}, &setattr}, - {TYPE_STR, "searchbox_title_color", {NULL}, &setattr}, - {TYPE_STR, "searchbox_border_color", {NULL}, &setattr}, - {TYPE_STR, "position_indicator_color", {NULL}, &setattr}, - {TYPE_STR, "menubox_color", {NULL}, &setattr}, - {TYPE_STR, "menubox_border_color", {NULL}, &setattr}, - {TYPE_STR, "item_color", {NULL}, &setattr}, - {TYPE_STR, "item_selected_color", {NULL}, &setattr}, - {TYPE_STR, "tag_color", {NULL}, &setattr}, - {TYPE_STR, "tag_selected_color", {NULL}, &setattr}, - {TYPE_STR, "tag_key_color", {NULL}, &setattr}, - {TYPE_STR, "tag_key_selected_color", {NULL}, &setattr}, - {TYPE_STR, "check_color", {NULL}, &setattr}, - {TYPE_STR, "check_selected_color", {NULL}, &setattr}, - {TYPE_STR, "uarrow_color", {NULL}, &setattr}, - {TYPE_STR, "darrow_color", {NULL}, &setattr}, - {TYPE_STR, "itemhelp_color", {NULL}, &setattr}, - {TYPE_STR, "form_active_text_color", {NULL}, &setattr}, - {TYPE_STR, "form_text_color", {NULL}, &setattr}, - {TYPE_STR, "form_item_readonly_color", {NULL}, &setattr}, - {TYPE_STR, "gauge_color", {gauge_color}, &setattr}, +static struct fp_config dialogrc_config[] = { + /* TYPE Directive DEFAULT HANDLER */ + {FP_TYPE_INT, "aspect", {(void *)0}, &setnum}, + {FP_TYPE_STR, "separate_widget", {separator}, &setstr}, + {FP_TYPE_INT, "tab_len", {(void *)0}, &setnum}, + {FP_TYPE_BOOL, "visit_items", {(void *)0}, &setbool}, + {FP_TYPE_BOOL, "use_shadow", {(void *)1}, &setbool}, + {FP_TYPE_BOOL, "use_colors", {(void *)1}, &setbool}, + {FP_TYPE_STR, "screen_color", {NULL}, &setattr}, + {FP_TYPE_STR, "shadow_color", {NULL}, &setattr}, + {FP_TYPE_STR, "dialog_color", {NULL}, &setattr}, + {FP_TYPE_STR, "title_color", {NULL}, &setattr}, + {FP_TYPE_STR, "border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_active_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_inactive_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_key_active_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_key_inactive_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_label_active_color", {NULL}, &setattr}, + {FP_TYPE_STR, "button_label_inactive_color",{NULL}, &setattr}, + {FP_TYPE_STR, "inputbox_color", {NULL}, &setattr}, + {FP_TYPE_STR, "inputbox_border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "searchbox_color", {NULL}, &setattr}, + {FP_TYPE_STR, "searchbox_title_color", {NULL}, &setattr}, + {FP_TYPE_STR, "searchbox_border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "position_indicator_color", {NULL}, &setattr}, + {FP_TYPE_STR, "menubox_color", {NULL}, &setattr}, + {FP_TYPE_STR, "menubox_border_color", {NULL}, &setattr}, + {FP_TYPE_STR, "item_color", {NULL}, &setattr}, + {FP_TYPE_STR, "item_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_key_color", {NULL}, &setattr}, + {FP_TYPE_STR, "tag_key_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "check_color", {NULL}, &setattr}, + {FP_TYPE_STR, "check_selected_color", {NULL}, &setattr}, + {FP_TYPE_STR, "uarrow_color", {NULL}, &setattr}, + {FP_TYPE_STR, "darrow_color", {NULL}, &setattr}, + {FP_TYPE_STR, "itemhelp_color", {NULL}, &setattr}, + {FP_TYPE_STR, "form_active_text_color", {NULL}, &setattr}, + {FP_TYPE_STR, "form_text_color", {NULL}, &setattr}, + {FP_TYPE_STR, "form_item_readonly_color", {NULL}, &setattr}, + {FP_TYPE_STR, "gauge_color", {gauge_color}, &setattr}, {0, NULL, {0}, NULL} }; @@ -108,7 +108,7 @@ static struct config dialogrc_config[] = * figpar call-back for interpreting value as .dialogrc `Attribute' */ static int -setattr(struct config *option, uint32_t line __unused, +setattr(struct fp_config *option, uint32_t line __unused, char *directive __unused, char *value) { char *cp = value; @@ -204,7 +204,7 @@ write_attrbuf: * figpar call-back for interpreting value as .dialogrc `Boolean' */ static int -setbool(struct config *option, uint32_t line __unused, +setbool(struct fp_config *option, uint32_t line __unused, char *directive __unused, char *value) { @@ -227,8 +227,8 @@ setbool(struct config *option, uint32_t * figpar call-back for interpreting value as .dialogrc `Number' */ static int -setnum(struct config *option, uint32_t line __unused, char *directive __unused, - char *value) +setnum(struct fp_config *option, uint32_t line __unused, + char *directive __unused, char *value) { if (option == NULL) { @@ -247,8 +247,8 @@ setnum(struct config *option, uint32_t l * figpar call-back for interpreting value as .dialogrc `String' */ static int -setstr(struct config *option, uint32_t line __unused, char *directive __unused, - char *value) +setstr(struct fp_config *option, uint32_t line __unused, + char *directive __unused, char *value) { size_t len; @@ -315,7 +315,7 @@ parse_dialogrc(void) } /* Process file (either $DIALOGRC if set, or `$HOME/.dialogrc') */ - res = parse_config(dialogrc_config, path, NULL, BREAK_ON_EQUALS); + res = parse_config(dialogrc_config, path, NULL, FP_BREAK_ON_EQUALS); /* Set some globals based on what we parsed */ use_shadow = dialogrc_config_option("use_shadow")->value.boolean; @@ -328,10 +328,10 @@ parse_dialogrc(void) /* * Return a pointer to the `.dialogrc' config option specific to `directive' or - * static dummy_config (full of NULLs) if none found (see get_config_option(3); - * part of figpar(3)). + * static fp_dummy_config (full of NULLs) if none found (see + * get_config_option(3); part of figpar(3)). */ -struct config * +struct fp_config * dialogrc_config_option(const char *directive) { return (get_config_option(dialogrc_config, directive)); Modified: stable/10/lib/libdpv/dialogrc.h ============================================================================== --- head/lib/libdpv/dialogrc.h Tue Nov 4 23:46:01 2014 (r274116) +++ stable/10/lib/libdpv/dialogrc.h Tue Nov 25 13:47:53 2014 (r275040) @@ -48,9 +48,9 @@ extern char gauge_color[]; extern char separator[]; __BEGIN_DECLS -void dialogrc_free(void); -int parse_dialogrc(void); -struct config *dialogrc_config_option(const char *_directive); +void dialogrc_free(void); +int parse_dialogrc(void); +struct fp_config *dialogrc_config_option(const char *_directive); __END_DECLS #endif /* !_DIALOGRC_H_ */ Modified: stable/10/lib/libdpv/dpv.c ============================================================================== --- head/lib/libdpv/dpv.c Tue Nov 4 23:46:01 2014 (r274116) +++ stable/10/lib/libdpv/dpv.c Tue Nov 25 13:47:53 2014 (r275040) @@ -77,8 +77,8 @@ char *msg_pending = NULL; /* dpv_config. char *pprompt = NULL; /* dpv_config.pprompt */ /* Status-Line format for when using dialog(3) */ -const char *status_format_custom = NULL; -char status_format_default[DPV_STATUS_FORMAT_MAX]; +static const char *status_format_custom = NULL; +static char status_format_default[DPV_STATUS_FORMAT_MAX]; /* * Takes a pointer to a dpv_config structure containing layout details and Modified: stable/10/share/mk/bsd.libnames.mk ============================================================================== --- stable/10/share/mk/bsd.libnames.mk Tue Nov 25 13:29:13 2014 (r275039) +++ stable/10/share/mk/bsd.libnames.mk Tue Nov 25 13:47:53 2014 (r275040) @@ -42,12 +42,14 @@ LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevi LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a LIBDIALOG?= ${DESTDIR}${LIBDIR}/libdialog.a LIBDNS?= ${DESTDIR}${LIBDIR}/libdns.a +LIBDPV?= ${DESTDIR}${LIBDIR}/libdpv.a LIBDTRACE?= ${DESTDIR}${LIBDIR}/libdtrace.a LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a LIBEDIT?= ${DESTDIR}${LIBDIR}/libedit.a LIBELF?= ${DESTDIR}${LIBDIR}/libelf.a LIBEXECINFO?= ${DESTDIR}${LIBDIR}/libexecinfo.a LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a +LIBFIGPAR?= ${DESTDIR}${LIBDIR}/libfigpar.a LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Tue Nov 25 13:29:13 2014 (r275039) +++ stable/10/sys/sys/param.h Tue Nov 25 13:47:53 2014 (r275040) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1001502 /* Master, propagated to newvers */ +#define __FreeBSD_version 1001503 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Tue Nov 25 13:29:13 2014 (r275039) +++ stable/10/usr.bin/Makefile Tue Nov 25 13:47:53 2014 (r275040) @@ -36,6 +36,7 @@ SUBDIR= alias \ ctlstat \ cut \ dirname \ + dpv \ du \ ee \ elf2aout \ Modified: stable/10/usr.bin/dpv/Makefile ============================================================================== --- head/usr.bin/dpv/Makefile Tue Nov 4 23:46:01 2014 (r274116) +++ stable/10/usr.bin/dpv/Makefile Tue Nov 25 13:47:53 2014 (r275040) @@ -4,8 +4,8 @@ PROG= dpv CFLAGS+= -I${.CURDIR} -DPADD+= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSES} ${LIBUTIL} -LDADD+= -ldpv -ldialog -lfigpar -lncurses -lutil +DPADD= ${LIBDPV} ${LIBDIALOG} ${LIBFIGPAR} ${LIBNCURSESW} ${LIBUTIL} ${LIBM} +LDADD= -ldpv -ldialog -lfigpar -lncursesw -lutil -lm WARNS?= 6 Modified: stable/10/usr.bin/dpv/dpv.c ============================================================================== --- head/usr.bin/dpv/dpv.c Tue Nov 4 23:46:01 2014 (r274116) +++ stable/10/usr.bin/dpv/dpv.c Tue Nov 25 13:47:53 2014 (r275040) @@ -177,7 +177,7 @@ operate_on_bytes(struct dpv_file_node *f fsync(out); } - overall_read += r; + dpv_overall_read += r; file->read += r; /* Calculate percentage of completion (if possible) */ @@ -226,7 +226,7 @@ operate_on_lines(struct dpv_file_node *f /* Process the buffer for number of lines */ for (p = buf; p != NULL && *p != '\0';) if ((p = strchr(p, '\n')) != NULL) - overall_read++, p++, file->read++; + dpv_overall_read++, p++, file->read++; /* Calculate percentage of completion (if possible) */ if (file->length >= 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411251347.sAPDls67071916>