svn commit: r275051 - in stable/9: . gnu/lib/libdialog lib/libdpv usr.bin/dpv

Devin Teske dteske at FreeBSD.org
Tue Nov 25 16:45:43 UTC 2014


Author: dteske
Date: Tue Nov 25 16:45:40 2014
New Revision: 275051
URL: https://svnweb.freebsd.org/changeset/base/275051

Log:
  MFC r274120, r274121, r274123, r274146, r274192, r274203, r274209,
  r274226, r274270, and r274851: dpv(1,3)/figpar(3) fixes after r275047
  
  Thanks to:	ngie, ian, jelischer, shurd, bapt

Modified:
  stable/9/Makefile.inc1   (contents, props changed)
  stable/9/gnu/lib/libdialog/Makefile
  stable/9/lib/libdpv/Makefile
  stable/9/lib/libdpv/dialog_util.c
  stable/9/lib/libdpv/dialogrc.c
  stable/9/lib/libdpv/dialogrc.h
  stable/9/lib/libdpv/dpv.c
  stable/9/usr.bin/dpv/Makefile
  stable/9/usr.bin/dpv/dpv.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/gnu/lib/libdialog/   (props changed)
  stable/9/lib/libdpv/   (props changed)
  stable/9/usr.bin/dpv/   (props changed)

Modified: stable/9/Makefile.inc1
==============================================================================
--- stable/9/Makefile.inc1	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/Makefile.inc1	Tue Nov 25 16:45:40 2014	(r275051)
@@ -1353,6 +1353,7 @@ _prebuild_libs=	${_kerberos5_lib_libasn1
 		${_kerberos5_lib_libroken} \
 		lib/libbz2 lib/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 \
@@ -1363,7 +1364,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_LIBTHR} != "no"
 _lib_libthr=	lib/libthr
@@ -1443,6 +1445,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
 .if exists(${.CURDIR}/${_lib})

Modified: stable/9/gnu/lib/libdialog/Makefile
==============================================================================
--- stable/9/gnu/lib/libdialog/Makefile	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/gnu/lib/libdialog/Makefile	Tue Nov 25 16:45:40 2014	(r275051)
@@ -13,6 +13,9 @@ SRCS=		argv.c arrows.c buttons.c calenda
 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
 .PATH:		${DIALOG}
 WARNS?=		1

Modified: stable/9/lib/libdpv/Makefile
==============================================================================
--- stable/9/lib/libdpv/Makefile	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/lib/libdpv/Makefile	Tue Nov 25 16:45:40 2014	(r275051)
@@ -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/9/lib/libdpv/dialog_util.c
==============================================================================
--- stable/9/lib/libdpv/dialog_util.c	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/lib/libdpv/dialog_util.c	Tue Nov 25 16:45:40 2014	(r275051)
@@ -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/9/lib/libdpv/dialogrc.c
==============================================================================
--- stable/9/lib/libdpv/dialogrc.c	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/lib/libdpv/dialogrc.c	Tue Nov 25 16:45:40 2014	(r275051)
@@ -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/9/lib/libdpv/dialogrc.h
==============================================================================
--- stable/9/lib/libdpv/dialogrc.h	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/lib/libdpv/dialogrc.h	Tue Nov 25 16:45:40 2014	(r275051)
@@ -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/9/lib/libdpv/dpv.c
==============================================================================
--- stable/9/lib/libdpv/dpv.c	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/lib/libdpv/dpv.c	Tue Nov 25 16:45:40 2014	(r275051)
@@ -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/9/usr.bin/dpv/Makefile
==============================================================================
--- stable/9/usr.bin/dpv/Makefile	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/usr.bin/dpv/Makefile	Tue Nov 25 16:45:40 2014	(r275051)
@@ -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/9/usr.bin/dpv/dpv.c
==============================================================================
--- stable/9/usr.bin/dpv/dpv.c	Tue Nov 25 16:24:31 2014	(r275050)
+++ stable/9/usr.bin/dpv/dpv.c	Tue Nov 25 16:45:40 2014	(r275051)
@@ -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) {


More information about the svn-src-stable-9 mailing list