svn commit: r296500 - in vendor/NetBSD/libedit: 2016-02-27 dist dist/TEST dist/readline

Pedro F. Giffuni pfg at FreeBSD.org
Tue Mar 8 14:55:53 UTC 2016


Author: pfg
Date: Tue Mar  8 14:55:50 2016
New Revision: 296500
URL: https://svnweb.freebsd.org/changeset/base/296500

Log:
  Rollback to libedit 2016-01-16.
  
  This synks us back with current and will make it easier to cherry-pick
  fixes. While here, disable keyword expansion as recommended by the
  Subversion Primer.

Deleted:
  vendor/NetBSD/libedit/2016-02-27/
Modified:
  vendor/NetBSD/libedit/dist/Makefile
  vendor/NetBSD/libedit/dist/TEST/Makefile
  vendor/NetBSD/libedit/dist/TEST/rl1.c
  vendor/NetBSD/libedit/dist/TEST/tc1.c
  vendor/NetBSD/libedit/dist/TEST/wtc1.c
  vendor/NetBSD/libedit/dist/chared.c
  vendor/NetBSD/libedit/dist/chared.h
  vendor/NetBSD/libedit/dist/chartype.c
  vendor/NetBSD/libedit/dist/chartype.h
  vendor/NetBSD/libedit/dist/common.c
  vendor/NetBSD/libedit/dist/config.h
  vendor/NetBSD/libedit/dist/editline.3
  vendor/NetBSD/libedit/dist/el.c
  vendor/NetBSD/libedit/dist/el.h
  vendor/NetBSD/libedit/dist/eln.c
  vendor/NetBSD/libedit/dist/emacs.c
  vendor/NetBSD/libedit/dist/filecomplete.c
  vendor/NetBSD/libedit/dist/hist.c
  vendor/NetBSD/libedit/dist/hist.h
  vendor/NetBSD/libedit/dist/histedit.h
  vendor/NetBSD/libedit/dist/history.c
  vendor/NetBSD/libedit/dist/keymacro.c
  vendor/NetBSD/libedit/dist/makelist
  vendor/NetBSD/libedit/dist/map.c
  vendor/NetBSD/libedit/dist/parse.c
  vendor/NetBSD/libedit/dist/prompt.c
  vendor/NetBSD/libedit/dist/prompt.h
  vendor/NetBSD/libedit/dist/read.c
  vendor/NetBSD/libedit/dist/read.h
  vendor/NetBSD/libedit/dist/readline.c
  vendor/NetBSD/libedit/dist/readline/Makefile
  vendor/NetBSD/libedit/dist/readline/readline.h
  vendor/NetBSD/libedit/dist/refresh.c
  vendor/NetBSD/libedit/dist/refresh.h
  vendor/NetBSD/libedit/dist/search.c
  vendor/NetBSD/libedit/dist/search.h
  vendor/NetBSD/libedit/dist/sig.c
  vendor/NetBSD/libedit/dist/sig.h
  vendor/NetBSD/libedit/dist/sys.h
  vendor/NetBSD/libedit/dist/terminal.c
  vendor/NetBSD/libedit/dist/terminal.h
  vendor/NetBSD/libedit/dist/tokenizer.c
  vendor/NetBSD/libedit/dist/tty.c
  vendor/NetBSD/libedit/dist/tty.h
  vendor/NetBSD/libedit/dist/vi.c

Modified: vendor/NetBSD/libedit/dist/Makefile
==============================================================================
--- vendor/NetBSD/libedit/dist/Makefile	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/Makefile	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.55 2016/02/24 14:25:38 christos Exp $
+#	$NetBSD: Makefile,v 1.53 2015/01/29 20:30:02 joerg Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=	yes
@@ -15,7 +15,7 @@ COPTS+=	-Wunused-parameter
 CWARNFLAGS.gcc+=	-Wconversion
 CWARNFLAGS.clang+=	-Wno-cast-qual
 
-OSRCS=	chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \
+OSRCS=	chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
 	hist.c keymacro.c map.c chartype.c \
 	parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c
 
@@ -37,6 +37,7 @@ MLINKS=	editline.3 el_init.3 editline.3 
 SRCS=	editline.c readline.c tokenizer.c history.c
 
 .if ${WIDECHAR} == "yes"
+OSRCS += eln.c
 SRCS += tokenizern.c historyn.c
 CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c
 CPPFLAGS+=-DWIDECHAR
@@ -51,12 +52,12 @@ CLEANFILES+=editline.c
 CLEANFILES+=common.h.tmp editline.c.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp
 CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp tc1.o tc1
 CLEANFILES+=tokenizern.c.tmp tokenizern.c tokenizerw.c.tmp tokenizerw.c
-CPPFLAGS+=-I. -I${LIBEDITDIR}
+CPPFLAGS+=-I. -I${LIBEDITDIR} 
 CPPFLAGS+=-I. -I${.CURDIR}
 CPPFLAGS+=#-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
 CPPFLAGS+=#-DDEBUG_PASTE -DDEBUG_EDIT
 
-AHDR=vi.h emacs.h common.h
+AHDR=vi.h emacs.h common.h 
 ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c
 
 DPSRCS+=	${AHDR} fcns.h help.h fcns.c help.c
@@ -119,7 +120,7 @@ historyn.c: makelist Makefile
 
 tc1.o:	${LIBEDITDIR}/TEST/tc1.c
 
-tc1:	libedit.a tc1.o
+tc1:	libedit.a tc1.o 
 	${_MKTARGET_LINK}
 	${CC} ${LDFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} -ltermlib
 

Modified: vendor/NetBSD/libedit/dist/TEST/Makefile
==============================================================================
--- vendor/NetBSD/libedit/dist/TEST/Makefile	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/TEST/Makefile	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,6 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2016/02/15 21:38:07 christos Exp $
-
-WIDECHAR ?= yes
+# $NetBSD: Makefile,v 1.5 2010/02/03 15:34:43 roy Exp $
 
 NOMAN=1
 PROG=wtc1
@@ -8,10 +6,6 @@ CPPFLAGS=-I${.CURDIR}/..
 LDADD+=-ledit -ltermlib
 DPADD+=${LIBEDIT} ${LIBTERMLIB}
 
-.if "${WIDECHAR}" == "yes"
-CPPFLAGS+=-DWIDECHAR
-.endif
-
 .ifdef DEBUG
 CPPFLAGS+=-DDEBUG
 .endif

Modified: vendor/NetBSD/libedit/dist/TEST/rl1.c
==============================================================================
--- vendor/NetBSD/libedit/dist/TEST/rl1.c	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/TEST/rl1.c	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-/*	$NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $	*/
+/*	$NetBSD: rl1.c,v 1.2 2016/02/29 00:54:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -15,13 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -38,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: rl1.c,v 1.1 2010/09/16 20:08:51 christos Exp $");
+__RCSID("$NetBSD: rl1.c,v 1.2 2016/02/29 00:54:19 christos Exp $");
 #endif /* not lint  */
 
 /*

Modified: vendor/NetBSD/libedit/dist/TEST/tc1.c
==============================================================================
--- vendor/NetBSD/libedit/dist/TEST/tc1.c	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/TEST/tc1.c	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-/*	$NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $	*/
+/*	$NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -42,22 +42,22 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 19
 #if 0
 static char sccsid[] = "@(#)test.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: tc1.c,v 1.7 2016/02/17 19:47:49 christos Exp $");
+__RCSID("$NetBSD: tc1.c,v 1.6 2014/06/18 20:12:15 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
 /*
  * test.c: A little test program
  */
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
 #include <sys/wait.h>
 #include <ctype.h>
-#include <dirent.h>
-#include <locale.h>
-#include <signal.h>
-#include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <unistd.h>
+#include <dirent.h>
+#include <locale.h>
 
 #include "histedit.h"
 
@@ -157,7 +157,7 @@ main(int argc, char *argv[])
 					/* Add a user-defined function	*/
 	el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete);
 
-					/* Bind tab to it		*/
+					/* Bind tab to it 		*/
 	el_set(el, EL_BIND, "^I", "ed-complete", NULL);
 
 	/*

Modified: vendor/NetBSD/libedit/dist/TEST/wtc1.c
==============================================================================
--- vendor/NetBSD/libedit/dist/TEST/wtc1.c	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/TEST/wtc1.c	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,14 +1,14 @@
+#include <stdio.h>
+#include <string.h>
+#include <signal.h>
 #include <sys/wait.h>
+#include <err.h>
 #include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <dirent.h>
-#include <err.h>
 #include <limits.h>
 #include <locale.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
 
 #include "../histedit.h"
 

Modified: vendor/NetBSD/libedit/dist/chared.c
==============================================================================
--- vendor/NetBSD/libedit/dist/chared.c	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/chared.c	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-/*	$NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $	*/
+/*	$NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,19 +37,15 @@
 #if 0
 static char sccsid[] = "@(#)chared.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: chared.c,v 1.49 2016/02/24 14:29:21 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
 /*
  * chared.c: Character editor utilities
  */
-#include <ctype.h>
 #include <stdlib.h>
-#include <string.h>
-
 #include "el.h"
-#include "common.h"
 
 private void ch__clearmacro (EditLine *);
 
@@ -203,7 +199,7 @@ c_delbefore1(EditLine *el)
  *	Return if p is part of a word according to emacs
  */
 protected int
-ce__isword(wint_t p)
+ce__isword(Int p)
 {
 	return Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL;
 }
@@ -213,7 +209,7 @@ ce__isword(wint_t p)
  *	Return if p is part of a word according to vi
  */
 protected int
-cv__isword(wint_t p)
+cv__isword(Int p)
 {
 	if (Isalnum(p) || p == '_')
 		return 1;
@@ -227,7 +223,7 @@ cv__isword(wint_t p)
  *	Return if p is part of a big word according to vi
  */
 protected int
-cv__isWord(wint_t p)
+cv__isWord(Int p)
 {
 	return !Isspace(p);
 }
@@ -237,7 +233,7 @@ cv__isWord(wint_t p)
  *	Find the previous word
  */
 protected Char *
-c__prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t))
+c__prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
 {
 	p--;
 
@@ -261,7 +257,7 @@ c__prev_word(Char *p, Char *low, int n, 
  *	Find the next word
  */
 protected Char *
-c__next_word(Char *p, Char *high, int n, int (*wtest)(wint_t))
+c__next_word(Char *p, Char *high, int n, int (*wtest)(Int))
 {
 	while (n--) {
 		while ((p < high) && !(*wtest)(*p))
@@ -279,7 +275,7 @@ c__next_word(Char *p, Char *high, int n,
  *	Find the next word vi style
  */
 protected Char *
-cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(wint_t))
+cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(Int))
 {
 	int test;
 
@@ -308,7 +304,7 @@ cv_next_word(EditLine *el, Char *p, Char
  *	Find the previous word vi style
  */
 protected Char *
-cv_prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t))
+cv_prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
 {
 	int test;
 
@@ -372,7 +368,7 @@ cv_delfini(EditLine *el)
  *	Go to the end of this word according to vi
  */
 protected Char *
-cv__endword(Char *p, Char *high, int n, int (*wtest)(wint_t))
+cv__endword(Char *p, Char *high, int n, int (*wtest)(Int))
 {
 	int test;
 
@@ -526,7 +522,7 @@ ch_enlargebufs(EditLine *el, size_t addl
 
 	/* zero the newly added memory, leave old data in */
 	(void) memset(&newbuffer[sz], 0, (newsz - sz) * sizeof(*newbuffer));
-
+	    
 	oldbuf = el->el_line.buffer;
 
 	el->el_line.buffer = newbuffer;
@@ -575,7 +571,7 @@ ch_enlargebufs(EditLine *el, size_t addl
 	el->el_chared.c_redo.lim = newbuffer +
 			(el->el_chared.c_redo.lim - el->el_chared.c_redo.buf);
 	el->el_chared.c_redo.buf = newbuffer;
-
+	
 	if (!hist_enlargebuf(el, sz, newsz))
 		return 0;
 
@@ -675,9 +671,9 @@ out:
 protected int
 c_gets(EditLine *el, Char *buf, const Char *prompt)
 {
-	wchar_t wch;
+	Char ch;
 	ssize_t len;
-	Char *cp = el->el_line.buffer, ch;
+	Char *cp = el->el_line.buffer;
 
 	if (prompt) {
 		len = (ssize_t)Strlen(prompt);
@@ -692,28 +688,26 @@ c_gets(EditLine *el, Char *buf, const Ch
 		el->el_line.lastchar = cp + 1;
 		re_refresh(el);
 
-		if (el_wgetc(el, &wch) != 1) {
+		if (FUN(el,getc)(el, &ch) != 1) {
 			ed_end_of_file(el, 0);
 			len = -1;
 			break;
 		}
-		ch = (Char)wch;
 
 		switch (ch) {
 
-		case L'\b':	/* Delete and backspace */
+		case 0010:	/* Delete and backspace */
 		case 0177:
 			if (len == 0) {
 				len = -1;
 				break;
 			}
-			len--;
 			cp--;
 			continue;
 
 		case 0033:	/* ESC */
-		case L'\r':	/* Newline */
-		case L'\n':
+		case '\r':	/* Newline */
+		case '\n':
 			buf[len] = ch;
 			break;
 

Modified: vendor/NetBSD/libedit/dist/chared.h
==============================================================================
--- vendor/NetBSD/libedit/dist/chared.h	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/chared.h	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-/*	$NetBSD: chared.h,v 1.27 2016/02/16 22:53:14 christos Exp $	*/
+/*	$NetBSD: chared.h,v 1.22 2014/06/18 18:12:28 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -40,6 +40,11 @@
 #ifndef _h_el_chared
 #define	_h_el_chared
 
+#include <ctype.h>
+#include <string.h>
+
+#include "histedit.h"
+
 #define	EL_MAXMACRO	10
 
 /*
@@ -134,18 +139,24 @@ typedef struct el_chared_t {
 #define	MODE_REPLACE	1
 #define	MODE_REPLACE_1	2
 
+#include "common.h"
+#include "vi.h"
+#include "emacs.h"
+#include "search.h"
+#include "fcns.h"
+
 
-protected int	 cv__isword(wint_t);
-protected int	 cv__isWord(wint_t);
+protected int	 cv__isword(Int);
+protected int	 cv__isWord(Int);
 protected void	 cv_delfini(EditLine *);
-protected Char	*cv__endword(Char *, Char *, int, int (*)(wint_t));
-protected int	 ce__isword(wint_t);
+protected Char	*cv__endword(Char *, Char *, int, int (*)(Int));
+protected int	 ce__isword(Int);
 protected void	 cv_undo(EditLine *);
 protected void	 cv_yank(EditLine *, const Char *, int);
-protected Char	*cv_next_word(EditLine*, Char *, Char *, int, int (*)(wint_t));
-protected Char	*cv_prev_word(Char *, Char *, int, int (*)(wint_t));
-protected Char	*c__next_word(Char *, Char *, int, int (*)(wint_t));
-protected Char	*c__prev_word(Char *, Char *, int, int (*)(wint_t));
+protected Char	*cv_next_word(EditLine*, Char *, Char *, int, int (*)(Int));
+protected Char	*cv_prev_word(Char *, Char *, int, int (*)(Int));
+protected Char	*c__next_word(Char *, Char *, int, int (*)(Int));
+protected Char	*c__prev_word(Char *, Char *, int, int (*)(Int));
 protected void	 c_insert(EditLine *, int);
 protected void	 c_delbefore(EditLine *, int);
 protected void	 c_delbefore1(EditLine *);

Modified: vendor/NetBSD/libedit/dist/chartype.c
==============================================================================
--- vendor/NetBSD/libedit/dist/chartype.c	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/chartype.c	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -12,6 +12,13 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -31,14 +38,10 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.23 2016/02/28 23:02:24 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.12 2015/02/22 02:16:19 christos Exp $");
 #endif /* not lint && not SCCSID */
-
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-
 #include "el.h"
+#include <stdlib.h>
 
 #define CT_BUFSIZ ((size_t)1024)
 
@@ -69,7 +72,7 @@ ct_conv_wbuff_resize(ct_buffer_t *conv, 
 {
 	void *p;
 
-	if (wsize <= conv->wsize)
+	if (wsize <= conv->wsize) 
 		return 0;
 
 	conv->wsize = wsize;
@@ -207,28 +210,6 @@ ct_encode_char(char *dst, size_t len, Ch
 	}
 	return l;
 }
-
-size_t
-ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
-{
-	mbstate_t mbs;
-	/* This only works because UTF-8 is stateless */
-	memset(&mbs, 0, sizeof(mbs));
-	return mbrtowc(wc, s, n, &mbs);
-}
-
-#else
-
-size_t
-ct_mbrtowc(wchar_t *wc, const char *s, size_t n)
-	if (s == NULL)
-		return 0;
-	if (n == 0)
-		return (size_t)-2;
-	if (wc != NULL)
-		*wc = *s;
-	return *s != '\0';
-}
 #endif
 
 protected const Char *
@@ -352,7 +333,7 @@ ct_visual_char(Char *dst, size_t len, Ch
 		return c > 0xffff ? 8 : 7;
 #else
 		*dst++ = '\\';
-#define tooctaldigit(v) (Char)((v) + '0')
+#define tooctaldigit(v) ((v) + '0')
 		*dst++ = tooctaldigit(((unsigned int) c >> 6) & 0x7);
 		*dst++ = tooctaldigit(((unsigned int) c >> 3) & 0x7);
 		*dst++ = tooctaldigit(((unsigned int) c     ) & 0x7);

Modified: vendor/NetBSD/libedit/dist/chartype.h
==============================================================================
--- vendor/NetBSD/libedit/dist/chartype.h	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/chartype.h	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.h,v 1.23 2016/02/24 17:20:01 christos Exp $	*/
+/*	$NetBSD: chartype.h,v 1.15 2015/05/17 13:14:41 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -37,6 +37,7 @@
 #define _h_chartype_f
 
 
+
 #ifdef WIDECHAR
 
 /* Ideally we should also test the value of the define to see if it
@@ -59,18 +60,21 @@
 #warning Build environment does not support non-BMP characters
 #endif
 
-#define ct_wctob             wctob
+#define ct_mbtowc            mbtowc
+#define ct_mbtowc_reset      mbtowc(0,0,(size_t)0)
 #define ct_wctomb            wctomb
 #define ct_wctomb_reset      wctomb(0,0)
 #define ct_wcstombs          wcstombs
 #define ct_mbstowcs          mbstowcs
 
 #define Char			wchar_t
+#define Int			wint_t
 #define FUN(prefix,rest)	prefix ## _w ## rest
 #define FUNW(type)		type ## _w
 #define TYPE(type)		type ## W
+#define FCHAR			"%lc"
 #define FSTR			"%ls"
-#define STR(x)			L ## x
+#define STR(x) 			L ## x
 #define UC(c)			c
 #define Isalpha(x)  iswalpha(x)
 #define Isalnum(x)  iswalnum(x)
@@ -111,18 +115,21 @@ Width(wchar_t c)
 
 #else /* NARROW */
 
-#define ct_wctob(w)          ((int)(w))
+#define ct_mbtowc            error
+#define ct_mbtowc_reset      
 #define ct_wctomb            error
-#define ct_wctomb_reset
+#define ct_wctomb_reset      
 #define ct_wcstombs(a, b, c)    (strncpy(a, b, c), strlen(a))
 #define ct_mbstowcs(a, b, c)    (strncpy(a, b, c), strlen(a))
 
 #define Char			char
+#define Int			int
 #define FUN(prefix,rest)	prefix ## _ ## rest
 #define FUNW(type)		type
 #define TYPE(type)		type
+#define FCHAR			"%c"
 #define FSTR			"%s"
-#define STR(x)			x
+#define STR(x) 			x
 #define UC(c)			(unsigned char)(c)
 
 #define Isalpha(x)  isalpha((unsigned char)x)
@@ -211,7 +218,7 @@ protected size_t ct_enc_width(Char);
 #define VISUAL_WIDTH_MAX ((size_t)8)
 
 /* The terminal is thought of in terms of X columns by Y lines. In the cases
- * where a wide character takes up more than one column, the adjacent
+ * where a wide character takes up more than one column, the adjacent 
  * occupied column entries will contain this faux character. */
 #define MB_FILL_CHAR ((Char)-1)
 
@@ -243,7 +250,5 @@ protected const Char *ct_visual_string(c
 protected int ct_chr_class(Char c);
 #endif
 
-size_t	ct_mbrtowc(wchar_t *, const char *, size_t);
-
 
 #endif /* _chartype_f */

Modified: vendor/NetBSD/libedit/dist/common.c
==============================================================================
--- vendor/NetBSD/libedit/dist/common.c	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/common.c	Tue Mar  8 14:55:50 2016	(r296500)
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $	*/
+/*	$NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,20 +37,14 @@
 #if 0
 static char sccsid[] = "@(#)common.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: common.c,v 1.39 2016/02/24 14:25:38 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.29 2012/03/24 20:08:43 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
 /*
  * common.c: Common Editor functions
  */
-#include <ctype.h>
-#include <string.h>
-
 #include "el.h"
-#include "common.h"
-#include "parse.h"
-#include "vi.h"
 
 /* ed_end_of_file():
  *	Indicate end of file
@@ -58,7 +52,7 @@ __RCSID("$NetBSD: common.c,v 1.39 2016/0
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_end_of_file(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_end_of_file(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	re_goto_bottom(el);
@@ -72,7 +66,7 @@ ed_end_of_file(EditLine *el, wint_t c __
  *	Insert a character [bound to all insert keys]
  */
 protected el_action_t
-ed_insert(EditLine *el, wint_t c)
+ed_insert(EditLine *el, Int c)
 {
 	int count = el->el_state.argument;
 
@@ -91,14 +85,14 @@ ed_insert(EditLine *el, wint_t c)
 		    || el->el_line.cursor >= el->el_line.lastchar)
 			c_insert(el, 1);
 
-		*el->el_line.cursor++ = (Char)c;
+		*el->el_line.cursor++ = c;
 		re_fastaddc(el);		/* fast refresh for one char. */
 	} else {
 		if (el->el_state.inputmode != MODE_REPLACE_1)
 			c_insert(el, el->el_state.argument);
 
 		while (count-- && el->el_line.cursor < el->el_line.lastchar)
-			*el->el_line.cursor++ = (Char)c;
+			*el->el_line.cursor++ = c;
 		re_refresh(el);
 	}
 
@@ -115,7 +109,7 @@ ed_insert(EditLine *el, wint_t c)
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_delete_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__)))
 {
 	Char *cp, *p, *kp;
 
@@ -143,7 +137,7 @@ ed_delete_prev_word(EditLine *el, wint_t
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_delete_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
 {
 #ifdef DEBUG_EDIT
 #define	EL	el->el_line
@@ -190,7 +184,7 @@ ed_delete_next_char(EditLine *el, wint_t
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_kill_line(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_kill_line(EditLine *el, Int c __attribute__((__unused__)))
 {
 	Char *kp, *cp;
 
@@ -211,7 +205,7 @@ ed_kill_line(EditLine *el, wint_t c __at
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_move_to_end(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_move_to_end(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	el->el_line.cursor = el->el_line.lastchar;
@@ -234,7 +228,7 @@ ed_move_to_end(EditLine *el, wint_t c __
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_move_to_beg(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_move_to_beg(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	el->el_line.cursor = el->el_line.buffer;
@@ -257,7 +251,7 @@ ed_move_to_beg(EditLine *el, wint_t c __
  *	[^T] [^T]
  */
 protected el_action_t
-ed_transpose_chars(EditLine *el, wint_t c)
+ed_transpose_chars(EditLine *el, Int c)
 {
 
 	if (el->el_line.cursor < el->el_line.lastchar) {
@@ -270,7 +264,7 @@ ed_transpose_chars(EditLine *el, wint_t 
 		/* must have at least two chars entered */
 		c = el->el_line.cursor[-2];
 		el->el_line.cursor[-2] = el->el_line.cursor[-1];
-		el->el_line.cursor[-1] = (Char)c;
+		el->el_line.cursor[-1] = c;
 		return CC_REFRESH;
 	} else
 		return CC_ERROR;
@@ -283,7 +277,7 @@ ed_transpose_chars(EditLine *el, wint_t 
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_next_char(EditLine *el, Int c __attribute__((__unused__)))
 {
 	Char *lim = el->el_line.lastchar;
 
@@ -312,7 +306,7 @@ ed_next_char(EditLine *el, wint_t c __at
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_word(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	if (el->el_line.cursor == el->el_line.buffer)
@@ -338,7 +332,7 @@ ed_prev_word(EditLine *el, wint_t c __at
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_char(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	if (el->el_line.cursor > el->el_line.buffer) {
@@ -362,12 +356,14 @@ ed_prev_char(EditLine *el, wint_t c __at
  *	[^V] [^V]
  */
 protected el_action_t
-ed_quoted_insert(EditLine *el, wint_t c)
+ed_quoted_insert(EditLine *el, Int c)
 {
 	int num;
+	Char tc;
 
 	tty_quotemode(el);
-	num = el_wgetc(el, &c);
+	num = FUN(el,getc)(el, &tc);
+	c = tc;
 	tty_noquotemode(el);
 	if (num == 1)
 		return ed_insert(el, c);
@@ -380,7 +376,7 @@ ed_quoted_insert(EditLine *el, wint_t c)
  *	Adds to argument or enters a digit
  */
 protected el_action_t
-ed_digit(EditLine *el, wint_t c)
+ed_digit(EditLine *el, Int c)
 {
 
 	if (!Isdigit(c))
@@ -408,7 +404,7 @@ ed_digit(EditLine *el, wint_t c)
  *	For ESC-n
  */
 protected el_action_t
-ed_argument_digit(EditLine *el, wint_t c)
+ed_argument_digit(EditLine *el, Int c)
 {
 
 	if (!Isdigit(c))
@@ -434,7 +430,7 @@ ed_argument_digit(EditLine *el, wint_t c
 protected el_action_t
 /*ARGSUSED*/
 ed_unassigned(EditLine *el __attribute__((__unused__)),
-    wint_t c __attribute__((__unused__)))
+    Int c __attribute__((__unused__)))
 {
 
 	return CC_ERROR;
@@ -451,8 +447,8 @@ ed_unassigned(EditLine *el __attribute__
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_tty_sigint(EditLine *el __attribute__((__unused__)),
-	      wint_t c __attribute__((__unused__)))
+ed_tty_sigint(EditLine *el __attribute__((__unused__)), 
+	      Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -465,8 +461,8 @@ ed_tty_sigint(EditLine *el __attribute__
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
-	     wint_t c __attribute__((__unused__)))
+ed_tty_dsusp(EditLine *el __attribute__((__unused__)), 
+	     Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -479,8 +475,8 @@ ed_tty_dsusp(EditLine *el __attribute__(
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
-		    wint_t c __attribute__((__unused__)))
+ed_tty_flush_output(EditLine *el __attribute__((__unused__)), 
+		    Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -493,8 +489,8 @@ ed_tty_flush_output(EditLine *el __attri
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
-	       wint_t c __attribute__((__unused__)))
+ed_tty_sigquit(EditLine *el __attribute__((__unused__)), 
+	       Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -507,8 +503,8 @@ ed_tty_sigquit(EditLine *el __attribute_
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
-	       wint_t c __attribute__((__unused__)))
+ed_tty_sigtstp(EditLine *el __attribute__((__unused__)), 
+	       Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -521,8 +517,8 @@ ed_tty_sigtstp(EditLine *el __attribute_
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
-		   wint_t c __attribute__((__unused__)))
+ed_tty_stop_output(EditLine *el __attribute__((__unused__)), 
+		   Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -535,8 +531,8 @@ ed_tty_stop_output(EditLine *el __attrib
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_tty_start_output(EditLine *el __attribute__((__unused__)),
-		    wint_t c __attribute__((__unused__)))
+ed_tty_start_output(EditLine *el __attribute__((__unused__)), 
+		    Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -549,7 +545,7 @@ ed_tty_start_output(EditLine *el __attri
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_newline(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_newline(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	re_goto_bottom(el);
@@ -565,7 +561,7 @@ ed_newline(EditLine *el, wint_t c __attr
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	if (el->el_line.cursor <= el->el_line.buffer)
@@ -585,7 +581,7 @@ ed_delete_prev_char(EditLine *el, wint_t
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_clear_screen(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_clear_screen(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	terminal_clear_screen(el);	/* clear the whole real screen */
@@ -600,8 +596,8 @@ ed_clear_screen(EditLine *el, wint_t c _
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_redisplay(EditLine *el __attribute__((__unused__)),
-	     wint_t c __attribute__((__unused__)))
+ed_redisplay(EditLine *el __attribute__((__unused__)), 
+	     Int c __attribute__((__unused__)))
 {
 
 	return CC_REDISPLAY;
@@ -614,7 +610,7 @@ ed_redisplay(EditLine *el __attribute__(
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_start_over(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_start_over(EditLine *el, Int c __attribute__((__unused__)))
 {
 
 	ch_reset(el, 0);
@@ -628,8 +624,8 @@ ed_start_over(EditLine *el, wint_t c __a
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
-		    wint_t c __attribute__((__unused__)))
+ed_sequence_lead_in(EditLine *el __attribute__((__unused__)), 
+		    Int c __attribute__((__unused__)))
 {
 
 	return CC_NORM;
@@ -642,7 +638,7 @@ ed_sequence_lead_in(EditLine *el __attri
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
 {
 	char beep = 0;
 	int sv_event = el->el_history.eventno;
@@ -662,6 +658,7 @@ ed_prev_history(EditLine *el, wint_t c _
 	if (hist_get(el) == CC_ERROR) {
 		if (el->el_map.type == MAP_VI) {
 			el->el_history.eventno = sv_event;
+			
 		}
 		beep = 1;
 		/* el->el_history.eventno was fixed by first call */
@@ -679,7 +676,7 @@ ed_prev_history(EditLine *el, wint_t c _
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_next_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_next_history(EditLine *el, Int c __attribute__((__unused__)))
 {
 	el_action_t beep = CC_REFRESH, rval;
 
@@ -706,11 +703,11 @@ ed_next_history(EditLine *el, wint_t c _
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_search_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
 {
 	const Char *hp;
 	int h;
-	int found = 0;
+	bool_t found = 0;
 
 	el->el_chared.c_vcmd.action = NOP;
 	el->el_chared.c_undo.len = -1;
@@ -749,7 +746,7 @@ ed_search_prev_history(EditLine *el, win
 			    (el->el_line.lastchar - el->el_line.buffer)) ||
 			hp[el->el_line.lastchar - el->el_line.buffer]) &&
 		    c_hmatch(el, hp)) {
-			found = 1;
+			found++;
 			break;
 		}
 		h++;
@@ -774,11 +771,11 @@ ed_search_prev_history(EditLine *el, win
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_search_next_history(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
 {
 	const Char *hp;
 	int h;
-	int found = 0;
+	bool_t found = 0;
 
 	el->el_chared.c_vcmd.action = NOP;
 	el->el_chared.c_undo.len = -1;
@@ -828,7 +825,7 @@ ed_search_next_history(EditLine *el, win
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_prev_line(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_prev_line(EditLine *el, Int c __attribute__((__unused__)))
 {
 	Char *ptr;
 	int nchars = c_hpos(el);
@@ -871,7 +868,7 @@ ed_prev_line(EditLine *el, wint_t c __at
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_next_line(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_next_line(EditLine *el, Int c __attribute__((__unused__)))
 {
 	Char *ptr;
 	int nchars = c_hpos(el);
@@ -905,7 +902,7 @@ ed_next_line(EditLine *el, wint_t c __at
  */
 protected el_action_t
 /*ARGSUSED*/
-ed_command(EditLine *el, wint_t c __attribute__((__unused__)))
+ed_command(EditLine *el, Int c __attribute__((__unused__)))
 {
 	Char tmpbuf[EL_BUFSIZ];
 	int tmplen;

Modified: vendor/NetBSD/libedit/dist/config.h
==============================================================================
--- vendor/NetBSD/libedit/dist/config.h	Tue Mar  8 14:39:00 2016	(r296499)
+++ vendor/NetBSD/libedit/dist/config.h	Tue Mar  8 14:55:50 2016	(r296500)
@@ -20,8 +20,8 @@
 /* Define to 1 if you have the <fcntl.h> header file. */
 #define HAVE_FCNTL_H 1
 
-/* Define to 1 if you have the `getline' function. */
-#define HAVE_GETLINE 1
+/* Define to 1 if you have the `fgetln' function. */
+#define HAVE_FGETLN 1
 
 /* Define to 1 if you have the `fork' function. */
 #define HAVE_FORK 1
@@ -187,6 +187,9 @@
 /* Define to 1 if you have the `vis' function. */
 #define HAVE_VIS 1
 
+/* Define to 1 if you have the `wcsdup' function. */
+#define HAVE_WCSDUP 1
+
 /* Define to 1 if `fork' works. */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list