From 088fff53b0c6141a1db9cf12f63d0c584893bd0e Mon Sep 17 00:00:00 2001 From: schwarze Date: Mon, 15 Dec 2014 22:35:41 +0000 Subject: [PATCH] merge improvements from NetBSD; ok jmc@ nicm@ --- lib/libedit/editline.3 | 30 ++++++++++++++++++++---------- lib/libedit/editrc.5 | 8 ++++---- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/lib/libedit/editline.3 b/lib/libedit/editline.3 index 58a0a6af31e..c7a2e739859 100644 --- a/lib/libedit/editline.3 +++ b/lib/libedit/editline.3 @@ -1,5 +1,5 @@ -.\" $OpenBSD: editline.3,v 1.35 2014/12/12 17:04:22 schwarze Exp $ -.\" $NetBSD: editline.3,v 1.73 2010/01/03 19:05:26 wiz Exp $ +.\" $OpenBSD: editline.3,v 1.36 2014/12/15 22:35:41 schwarze Exp $ +.\" $NetBSD: editline.3,v 1.82 2014/05/11 09:01:42 wiz Exp $ .\" .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 12 2014 $ +.Dd $Mdocdate: December 15 2014 $ .Dt EDITLINE 3 .Os .Sh NAME @@ -110,6 +110,8 @@ .Fn el_resize "EditLine *e" .Ft const LineInfo * .Fn el_line "EditLine *e" +.Ft const LineInfoW * +.Fn el_wline "EditLine *e" .Ft int .Fn el_insertstr "EditLine *e" "const char *str" .Ft int @@ -222,7 +224,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 @@ -434,6 +439,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 , @@ -536,10 +549,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" @@ -737,9 +747,9 @@ Save the history list to .Fa file . .It Dv H_SAVE_FP , Fa "FILE *fp" Save the history list to the opened -.Fa fp .Ft FILE -pointer . +pointer +.Fa fp . .It Dv H_SETUNIQUE , Fa "int unique" Set flag that adjacent identical event strings should not be entered into the history. diff --git a/lib/libedit/editrc.5 b/lib/libedit/editrc.5 index 7a7d6134104..27802b23855 100644 --- a/lib/libedit/editrc.5 +++ b/lib/libedit/editrc.5 @@ -1,5 +1,5 @@ -.\" $OpenBSD: editrc.5,v 1.27 2014/12/12 17:04:22 schwarze Exp $ -.\" $NetBSD: editrc.5,v 1.24 2009/04/11 22:17:52 wiz Exp $ +.\" $OpenBSD: editrc.5,v 1.28 2014/12/15 22:35:41 schwarze Exp $ +.\" $NetBSD: editrc.5,v 1.27 2013/01/10 16:03:42 wiz Exp $ .\" .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: December 12 2014 $ +.Dd $Mdocdate: December 15 2014 $ .Dt EDITRC 5 .Os .Sh NAME @@ -195,7 +195,7 @@ is .Sq cols , .Sq lines , .Sq rows , -.Sq meta +.Sq meta , or .Sq tabs , the value of that capability is printed, with -- 2.20.1