From: John Marino Date: Sat, 11 May 2013 18:52:10 +0000 (+0200) Subject: libedit: Update to version 2012-12-13 X-Git-Tag: v3.7.0~1121 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/6a1ee0e3f7bb75e2a03e2ab6b28735321a2d6b10 libedit: Update to version 2012-12-13 There have been three releases since libedit was imported as a vendor branch, but the changelog is simply "sync with NetBSD" for each one. The main item of interest is that widechar support has been added for real this time. Previously all the man pages were in place but the library didn't actually have the support. A minor item of note is that NetBSD finally implemented the rl_completion_word_break_hook which reduces the number of files with local modifications. --- diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index 85dbf4ac8e..4b51edd31d 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -1910,40 +1910,6 @@ TO_REMOVE+=/usr/bin/doscmd TO_REMOVE+=/usr/libdata/doscmd TO_REMOVE+=/usr/share/man/cat1/doscmd.1.gz TO_REMOVE+=/usr/share/man/man1/doscmd.1.gz -TO_REMOVE+=/usr/share/man/cat3/el_wdeletestr.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wdeletestr.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_wget.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wget.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_wgetc.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wgetc.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_wgets.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wgets.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_winsertstr.3.gz -TO_REMOVE+=/usr/share/man/man3/el_winsertstr.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_wline.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wline.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_wparse.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wparse.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_wpush.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wpush.3.gz -TO_REMOVE+=/usr/share/man/cat3/el_wset.3.gz -TO_REMOVE+=/usr/share/man/man3/el_wset.3.gz -TO_REMOVE+=/usr/share/man/cat3/history_w.3.gz -TO_REMOVE+=/usr/share/man/man3/history_w.3.gz -TO_REMOVE+=/usr/share/man/cat3/history_wend.3.gz -TO_REMOVE+=/usr/share/man/man3/history_wend.3.gz -TO_REMOVE+=/usr/share/man/cat3/history_winit.3.gz -TO_REMOVE+=/usr/share/man/man3/history_winit.3.gz -TO_REMOVE+=/usr/share/man/cat3/tok_wend.3.gz -TO_REMOVE+=/usr/share/man/man3/tok_wend.3.gz -TO_REMOVE+=/usr/share/man/cat3/tok_winit.3.gz -TO_REMOVE+=/usr/share/man/man3/tok_winit.3.gz -TO_REMOVE+=/usr/share/man/cat3/tok_wline.3.gz -TO_REMOVE+=/usr/share/man/man3/tok_wline.3.gz -TO_REMOVE+=/usr/share/man/cat3/tok_wreset.3.gz -TO_REMOVE+=/usr/share/man/man3/tok_wreset.3.gz -TO_REMOVE+=/usr/share/man/cat3/tok_wstr.3.gz -TO_REMOVE+=/usr/share/man/man3/tok_wstr.3.gz TO_REMOVE+=/usr/share/man/cat3/puffs_fuse_unlink.3.gz TO_REMOVE+=/usr/share/man/man3/puffs_fuse_unlink.3.gz TO_REMOVE+=/usr/include/netgraph7/ng_tty.h diff --git a/contrib/libedit/README.DRAGONFLY b/contrib/libedit/README.DRAGONFLY index 69244564fd..38e9b054cc 100644 --- a/contrib/libedit/README.DRAGONFLY +++ b/contrib/libedit/README.DRAGONFLY @@ -1,22 +1,19 @@ -LIBEDIT 2012-03-11 -================== +LIBEDIT +======= Original source can be downloaded from: http://www.thrysoee.dk/editline -file = libedit-20120311-3.0.tar.gz -date = 11 March 2012 -size = 469830 -sha1 = 2a4be10c33af5e3b09c1d3c8829b02fe5b41796b +file = libedit-20121213-3.0.tar.gz +date = 13 December 2012 +size = 473665 +sha1 = 2f20bc835c1282b6815c4c8e2f852d6fe4318f7a A list of files and directories removed is in README.DELETED Local modifications applied to following files: - src/editline/readline.h + src/chartype.h src/el.c src/filecomplete.c - src/makelist - src/readline.c src/sys.h src/vi.c - diff --git a/contrib/libedit/src/chartype.h b/contrib/libedit/src/chartype.h index 12fa9ac1f7..f8c68ee1ba 100644 --- a/contrib/libedit/src/chartype.h +++ b/contrib/libedit/src/chartype.h @@ -44,6 +44,8 @@ * supports non-BMP code points without requiring UTF-16, but nothing * seems to actually advertise this properly, despite Unicode 3.1 having * been around since 2001... */ + +#if 0 /* DragonFly wchar supports ISO 10646 */ #if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) #ifndef __STDC_ISO_10646__ /* In many places it is assumed that the first 127 code points are ASCII @@ -52,6 +54,7 @@ #error wchar_t must store ISO 10646 characters #endif #endif +#endif /* Oh for a with char32_t and __STDC_UTF_32__ in it... * ref: ISO/IEC DTR 19769 diff --git a/lib/libedit/libedit/Makefile b/lib/libedit/libedit/Makefile index 74567f8efe..39773aba4a 100644 --- a/lib/libedit/libedit/Makefile +++ b/lib/libedit/libedit/Makefile @@ -40,10 +40,11 @@ SRCS+= chared.c \ tokenizer.c \ history.c \ filecomplete.c \ - readline.c + readline.c \ + eln.c SRCS+= common.h emacs.h fcns.h help.h vi.h -SRCS+= fcns.c help.c +SRCS+= fcns.c help.c tokenizern.c historyn.c MAN= editline.3 editrc.5 @@ -70,6 +71,24 @@ MLINKS= editline.3 el_init.3 \ editline.3 tok_line.3 \ editline.3 tok_str.3 +MLINKS+= editline.3 el_wgets.3 \ + editline.3 el_wgetc.3 \ + editline.3 el_wpush.3 \ + editline.3 el_wparse.3 \ + editline.3 el_wset.3 \ + editline.3 el_wget.3 \ + editline.3 el_wline.3 \ + editline.3 el_winsertstr.3 \ + editline.3 el_wdeletestr.3 \ + editline.3 history_winit.3 \ + editline.3 history_wend.3 \ + editline.3 history_w.3 \ + editline.3 tok_winit.3 \ + editline.3 tok_wend.3 \ + editline.3 tok_wreset.3 \ + editline.3 tok_wline.3 \ + editline.3 tok_wstr.3 + CLEANFILES+= common.h emacs.h fcns.c fcns.h help.c help.h vi.h editline.c AHDR= vi.h emacs.h common.h ASRC= ${SRCDIR}/vi.c ${SRCDIR}/emacs.c ${SRCDIR}/common.c @@ -95,4 +114,10 @@ fcns.c: ${AHDR} help.c: ${ASRC} AWK=awk sh ${SRCDIR}/makelist -bc ${ASRC} > ${.TARGET} +tokenizern.c: tokenizer.c + AWK=awk sh ${SRCDIR}/makelist -n ${.ALLSRC} > ${.TARGET} + +historyn.c: history.c + AWK=awk sh ${SRCDIR}/makelist -n ${.ALLSRC} > ${.TARGET} + .include diff --git a/lib/libedit/libedit/config.h b/lib/libedit/libedit/config.h index 75caf591f1..de132e2daf 100644 --- a/lib/libedit/libedit/config.h +++ b/lib/libedit/libedit/config.h @@ -65,7 +65,7 @@ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_MALLOC_H 1 +/* #undef HAVE_MALLOC_H */ /* Define to 1 if you have the `memchr' function. */ #define HAVE_MEMCHR 1 @@ -208,7 +208,7 @@ #define LT_OBJDIR ".libs/" /* Name of package */ -#define PACKAGE "libedit-20120311" +#define PACKAGE "libedit-20121213" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" @@ -220,7 +220,7 @@ #define PACKAGE_STRING "libedit 3.0" /* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libedit-20120311" +#define PACKAGE_TARNAME "libedit-20121213" /* Define to the home page for this package. */ #define PACKAGE_URL "" @@ -260,7 +260,7 @@ #define VERSION "3.0" /* Define to 1 if you want wide-character code */ -/* #undef WIDECHAR */ +#define WIDECHAR 1 /* Define to 1 if on MINIX. */ /* #undef _MINIX */ diff --git a/lib/libedit/libedit/editline.3 b/lib/libedit/libedit/editline.3 index 008c991e12..e869161d7f 100644 --- a/lib/libedit/libedit/editline.3 +++ b/lib/libedit/libedit/editline.3 @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.75 2011/02/27 01:51:37 christos Exp $ +.\" $NetBSD: editline.3,v 1.77 2012/09/11 20:29:58 christos Exp $ .\" .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -26,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 26, 2011 +.Dd September 11, 2012 .Dt EDITLINE 3 .Os .Sh NAME @@ -35,41 +35,41 @@ .Nm el_end , .Nm el_reset , .Nm el_gets , -.\".Nm el_wgets , +.Nm el_wgets , .Nm el_getc , -.\".Nm el_wgetc , +.Nm el_wgetc , .Nm el_push , -.\".Nm el_wpush , +.Nm el_wpush , .Nm el_parse , -.\".Nm el_wparse , +.Nm el_wparse , .Nm el_set , -.\".Nm el_wset , +.Nm el_wset , .Nm el_get , -.\".Nm el_wget , +.Nm el_wget , .Nm el_source , .Nm el_resize , .Nm el_line , -.\".Nm el_wline , +.Nm el_wline , .Nm el_insertstr , -.\".Nm el_winsertstr , +.Nm el_winsertstr , .Nm el_deletestr , -.\".Nm el_wdeletestr , +.Nm el_wdeletestr , .Nm history_init , -.\".Nm history_winit , +.Nm history_winit , .Nm history_end , -.\".Nm history_wend , +.Nm history_wend , .Nm history , -.\".Nm history_w , +.Nm history_w , .Nm tok_init , -.\".Nm tok_winit , +.Nm tok_winit , .Nm tok_end , -.\".Nm tok_wend , +.Nm tok_wend , .Nm tok_reset , -.\".Nm tok_wreset , +.Nm tok_wreset , .Nm tok_line , -.\".Nm tok_wline , +.Nm tok_wline , .Nm tok_str -.\".Nm tok_wstr +.Nm tok_wstr .Nd line editor, history and tokenization functions .Sh LIBRARY .Lb libedit @@ -83,28 +83,28 @@ .Fn el_reset "EditLine *e" .Ft const char * .Fn el_gets "EditLine *e" "int *count" -.\".Ft const wchar_t * -.\".Fn el_wgets "EditLine *e" "int *count" +.Ft const wchar_t * +.Fn el_wgets "EditLine *e" "int *count" .Ft int .Fn el_getc "EditLine *e" "char *ch" -.\".Ft int -.\".Fn el_wgetc "EditLine *e" "wchar_t *ch" +.Ft int +.Fn el_wgetc "EditLine *e" "wchar_t *ch" .Ft void .Fn el_push "EditLine *e" "const char *str" -.\".Ft void -.\".Fn el_wpush "EditLine *e" "const wchar_t *str" +.Ft void +.Fn el_wpush "EditLine *e" "const wchar_t *str" .Ft int .Fn el_parse "EditLine *e" "int argc" "const char *argv[]" -.\".Ft int -.\".Fn el_wparse "EditLine *e" "int argc" "const wchar_t *argv[]" +.Ft int +.Fn el_wparse "EditLine *e" "int argc" "const wchar_t *argv[]" .Ft int .Fn el_set "EditLine *e" "int op" "..." -.\".Ft int -.\".Fn el_wset "EditLine *e" "int op" "..." +.Ft int +.Fn el_wset "EditLine *e" "int op" "..." .Ft int .Fn el_get "EditLine *e" "int op" "..." -.\".Ft int -.\".Fn el_wget "EditLine *e" "int op" "..." +.Ft int +.Fn el_wget "EditLine *e" "int op" "..." .Ft int .Fn el_source "EditLine *e" "const char *file" .Ft void @@ -113,44 +113,44 @@ .Fn el_line "EditLine *e" .Ft int .Fn el_insertstr "EditLine *e" "const char *str" -.\".Ft int -.\".Fn el_winsertstr "EditLine *e" "const wchar_t *str" +.Ft int +.Fn el_winsertstr "EditLine *e" "const wchar_t *str" .Ft void .Fn el_deletestr "EditLine *e" "int count" -.\".Ft void -.\".Fn el_wdeletestr "EditLine *e" "int count" +.Ft void +.Fn el_wdeletestr "EditLine *e" "int count" .Ft History * .Fn history_init -.\".Ft HistoryW * -.\".Fn history_winit +.Ft HistoryW * +.Fn history_winit .Ft void .Fn history_end "History *h" -.\".Ft void -.\".Fn history_wend "HistoryW *h" +.Ft void +.Fn history_wend "HistoryW *h" .Ft int .Fn history "History *h" "HistEvent *ev" "int op" "..." -.\".Ft int -.\".Fn history_w "HistoryW *h" "HistEventW *ev" "int op" "..." +.Ft int +.Fn history_w "HistoryW *h" "HistEventW *ev" "int op" "..." .Ft Tokenizer * .Fn tok_init "const char *IFS" -.\".Ft TokenizerW * -.\".Fn tok_winit "const wchar_t *IFS" +.Ft TokenizerW * +.Fn tok_winit "const wchar_t *IFS" .Ft void .Fn tok_end "Tokenizer *t" -.\".Ft void -.\".Fn tok_wend "TokenizerW *t" +.Ft void +.Fn tok_wend "TokenizerW *t" .Ft void .Fn tok_reset "Tokenizer *t" -.\".Ft void -.\".Fn tok_wreset "TokenizerW *t" +.Ft void +.Fn tok_wreset "TokenizerW *t" .Ft int .Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]" "int *cursorc" "int *cursoro" -.\".Ft int -.\".Fn tok_wline "TokenizerW *t" "const LineInfoW *li" "int *argc" "const wchar_t **argv[]" "int *cursorc" "int *cursoro" +.Ft int +.Fn tok_wline "TokenizerW *t" "const LineInfoW *li" "int *argc" "const wchar_t **argv[]" "int *cursorc" "int *cursoro" .Ft int .Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]" -.\".Ft int -.\".Fn tok_wstr "TokenizerW *t" "const wchar_t *str" "int *argc" "const wchar_t **argv[]" +.Ft int +.Fn tok_wstr "TokenizerW *t" "const wchar_t *str" "int *argc" "const wchar_t **argv[]" .Sh DESCRIPTION The .Nm @@ -173,9 +173,9 @@ which is created by and freed by .Fn el_end . .Pp -.\"The wide-character functions behave the same way as their narrow -.\"counterparts. -.\".Pp +The wide-character functions behave the same way as their narrow +counterparts. +.Pp The following functions are available: .Bl -tag -width 4n .It Fn el_init @@ -221,7 +221,10 @@ and must be copied if the data is to be retained. Read a character from the tty. .Fa ch is modified to contain the character read. -Returns the number of characters read if successful, \-1 otherwise. +Returns the number of characters read if successful, \-1 otherwise, +in which case +.Dv errno +can be inspected for the cause. .It Fn el_push Pushes .Fa str @@ -432,6 +435,14 @@ check this (using .Fn el_get ) to determine if editing should be enabled or not. +.It Dv EL_UNBUFFERED , Fa "int flag" +If +.Fa flag +is zero, +unbuffered mode is disabled (the default). +In unbuffered mode, +.Fn el_gets +will return immediately after processing a single character. .It Dv EL_GETCFN , Fa "int (*f)(EditLine *, char *c)" Define the character reading function as .Fa f , @@ -534,10 +545,7 @@ previously registered with the corresponding .Fn el_set call. .It Dv EL_UNBUFFERED , Fa "int" -Sets or clears unbuffered mode. -In this mode, -.Fn el_gets -will return immediately after processing a single character. +Return non-zero if unbuffered mode is enabled. .It Dv EL_PREP_TERM , Fa "int" Sets or clears terminal editing mode. .It Dv EL_GETFP , Fa "int fd", Fa "FILE **fp" @@ -861,7 +869,7 @@ Luke Mewburn wrote this manual and implemented and .Dv EL_RPROMPT . Jaromir Dolecek implemented the readline emulation. -.\"Johny Mattsson implemented wide-character support. +Johny Mattsson implemented wide-character support. .Sh BUGS At this time, it is the responsibility of the caller to check the result of the diff --git a/lib/libedit/libedit/editrc.5 b/lib/libedit/libedit/editrc.5 index 28256b5ae4..0c01605b08 100644 --- a/lib/libedit/libedit/editrc.5 +++ b/lib/libedit/libedit/editrc.5 @@ -1,4 +1,4 @@ -.\" $NetBSD: editrc.5,v 1.25 2011/04/25 22:47:27 wiz Exp $ +.\" $NetBSD: editrc.5,v 1.26 2012/06/02 14:19:20 njoly Exp $ .\" .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -88,7 +88,7 @@ shell. The following builtin commands are available: .Bl -tag -width 4n .It Ic bind Oo Fl a Oc Oo Fl e Oc Oo Fl k Oc Oo Fl l Oc Oo Fl r Oc \ -Oo Fl s Oc Oo Fl v Oc Oo Ar key Op Ar command Oc +Oo Fl s Oc Oo Fl v Oc Oo Ar key Oo Ar command Oc Oc Without options, list all bound keys, and the editor command to which each is bound. If