Module Name:    src
Committed By:   christos
Date:           Mon May 11 18:33:30 UTC 2009

Modified Files:
        src/lib/libedit: editline.3 el.c histedit.h

Log Message:
restore binary compatibility by providing new prompt functions that take
an extra literal character.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/libedit/editline.3
cvs rdiff -u -r1.51 -r1.52 src/lib/libedit/el.c
cvs rdiff -u -r1.39 -r1.40 src/lib/libedit/histedit.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/editline.3
diff -u src/lib/libedit/editline.3:1.67 src/lib/libedit/editline.3:1.68
--- src/lib/libedit/editline.3:1.67	Sat Apr 11 16:48:26 2009
+++ src/lib/libedit/editline.3	Mon May 11 14:33:30 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: editline.3,v 1.67 2009/04/11 20:48:26 joerg Exp $
+.\"	$NetBSD: editline.3,v 1.68 2009/05/11 18:33:30 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 March 31, 2009
+.Dd May 11, 2009
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -218,11 +218,14 @@
 .Fa op
 are supported, along with the required argument list:
 .Bl -tag -width 4n
-.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)" , Fa "char c"
+.It Dv EL_PROMPT , Fa "char *(*f)(EditLine *)"
 Define prompt printing function as
 .Fa f ,
 which is to return a string that contains the prompt.
-The
+.It Dv EL_PROMPT_ESC , Fa "char *(*f)(EditLine *)" , Fa "char c"
+Same as
+.Dv EL_PROMPT,
+but the
 .Fa c
 argument indicates the start/stop literal prompt character.
 .Pp
@@ -241,6 +244,8 @@
 Define right side prompt printing function as
 .Fa f ,
 which is to return a string that contains the prompt.
+.It Dv EL_RPROMPT_ESC , Fa "char *(*f)(EditLine *)" , Fa "char c"
+Define the right prompt printing function but with a literal escape character.
 .It Dv EL_TERMINAL , Fa "const char *type"
 Define terminal type of the tty to be
 .Fa type ,

Index: src/lib/libedit/el.c
diff -u src/lib/libedit/el.c:1.51 src/lib/libedit/el.c:1.52
--- src/lib/libedit/el.c:1.51	Tue Mar 31 13:38:27 2009
+++ src/lib/libedit/el.c	Mon May 11 14:33:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: el.c,v 1.51 2009/03/31 17:38:27 christos Exp $	*/
+/*	$NetBSD: el.c,v 1.52 2009/05/11 18:33:30 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c	8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.51 2009/03/31 17:38:27 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.52 2009/05/11 18:33:30 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -157,6 +157,14 @@
 	case EL_PROMPT:
 	case EL_RPROMPT: {
 		el_pfunc_t p = va_arg(ap, el_pfunc_t);
+
+		rv = prompt_set(el, p, 0, op);
+		break;
+	}
+
+	case EL_PROMPT_ESC:
+	case EL_RPROMPT_ESC: {
+		el_pfunc_t p = va_arg(ap, el_pfunc_t);
 		char c = va_arg(ap, int);
 
 		rv = prompt_set(el, p, c, op);

Index: src/lib/libedit/histedit.h
diff -u src/lib/libedit/histedit.h:1.39 src/lib/libedit/histedit.h:1.40
--- src/lib/libedit/histedit.h:1.39	Tue Mar 31 13:38:27 2009
+++ src/lib/libedit/histedit.h	Mon May 11 14:33:30 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: histedit.h,v 1.39 2009/03/31 17:38:27 christos Exp $	*/
+/*	$NetBSD: histedit.h,v 1.40 2009/05/11 18:33:30 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -115,7 +115,7 @@
 /*
  * el_set/el_get parameters
  */
-#define	EL_PROMPT	0	/* , el_pfunc_t, char);		*/
+#define	EL_PROMPT	0	/* , el_pfunc_t);		*/
 #define	EL_TERMINAL	1	/* , const char *);		*/
 #define	EL_EDITOR	2	/* , const char *);		*/
 #define	EL_SIGNAL	3	/* , int);			*/
@@ -128,15 +128,17 @@
 				/* , el_func_t);		*/
 #define	EL_HIST		10	/* , hist_fun_t, const char *);	*/
 #define	EL_EDITMODE	11	/* , int);			*/
-#define	EL_RPROMPT	12	/* , el_pfunc_t, char);		*/
+#define	EL_RPROMPT	12	/* , el_pfunc_t);		*/
 #define	EL_GETCFN	13	/* , el_rfunc_t);		*/
 #define	EL_CLIENTDATA	14	/* , void *);			*/
 #define	EL_UNBUFFERED	15	/* , int);			*/
-#define	EL_PREP_TERM    16      /* , int);                      */
+#define	EL_PREP_TERM	16	/* , int);			*/
 #define	EL_GETTC	17	/* , const char *, ..., NULL);	*/
 #define	EL_GETFP	18	/* , int, FILE **);		*/
 #define	EL_SETFP	19	/* , int, FILE *);		*/
-#define EL_REFRESH	20	/* , void);			*/
+#define	EL_REFRESH	20	/* , void);			*/
+#define	EL_PROMPT_ESC	21	/* , el_pfunc_t, char);		*/
+#define	EL_RPROMPT_ESC	22	/* , el_pfunc_t, char);		*/
 
 #define	EL_BUILTIN_GETCFN	(NULL)
 

Reply via email to