Updated libedit to NetBSD upstream
Note: This unconditionally assumes wchar_t support. May need revision if some platforms prove problematic.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: prompt.c,v 1.18 2009/12/31 15:58:26 christos Exp $ */
|
||||
/* $NetBSD: prompt.c,v 1.26 2016/05/09 21:46:56 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
@@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: prompt.c,v 1.18 2009/12/31 15:58:26 christos Exp $");
|
||||
__RCSID("$NetBSD: prompt.c,v 1.26 2016/05/09 21:46:56 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint && not SCCSID */
|
||||
|
||||
@@ -47,43 +47,43 @@ __RCSID("$NetBSD: prompt.c,v 1.18 2009/12/31 15:58:26 christos Exp $");
|
||||
#include <stdio.h>
|
||||
#include "el.h"
|
||||
|
||||
private Char *prompt_default(EditLine *);
|
||||
private Char *prompt_default_r(EditLine *);
|
||||
static wchar_t *prompt_default(EditLine *);
|
||||
static wchar_t *prompt_default_r(EditLine *);
|
||||
|
||||
/* prompt_default():
|
||||
* Just a default prompt, in case the user did not provide one
|
||||
*/
|
||||
private Char *
|
||||
static wchar_t *
|
||||
/*ARGSUSED*/
|
||||
prompt_default(EditLine *el __attribute__((__unused__)))
|
||||
{
|
||||
static Char a[3] = {'?', ' ', '\0'};
|
||||
static wchar_t a[3] = L"? ";
|
||||
|
||||
return (a);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
/* prompt_default_r():
|
||||
* Just a default rprompt, in case the user did not provide one
|
||||
*/
|
||||
private Char *
|
||||
static wchar_t *
|
||||
/*ARGSUSED*/
|
||||
prompt_default_r(EditLine *el __attribute__((__unused__)))
|
||||
{
|
||||
static Char a[1] = {'\0'};
|
||||
static wchar_t a[1] = L"";
|
||||
|
||||
return (a);
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
/* prompt_print():
|
||||
* Print the prompt and update the prompt position.
|
||||
*/
|
||||
protected void
|
||||
libedit_private void
|
||||
prompt_print(EditLine *el, int op)
|
||||
{
|
||||
el_prompt_t *elp;
|
||||
Char *p;
|
||||
wchar_t *p;
|
||||
int ignore = 0;
|
||||
|
||||
if (op == EL_PROMPT)
|
||||
@@ -103,7 +103,7 @@ prompt_print(EditLine *el, int op)
|
||||
continue;
|
||||
}
|
||||
if (ignore)
|
||||
term__putc(el, *p);
|
||||
terminal__putc(el, *p);
|
||||
else
|
||||
re_putc(el, *p, 1);
|
||||
}
|
||||
@@ -116,7 +116,7 @@ prompt_print(EditLine *el, int op)
|
||||
/* prompt_init():
|
||||
* Initialize the prompt stuff
|
||||
*/
|
||||
protected int
|
||||
libedit_private int
|
||||
prompt_init(EditLine *el)
|
||||
{
|
||||
|
||||
@@ -135,7 +135,7 @@ prompt_init(EditLine *el)
|
||||
/* prompt_end():
|
||||
* Clean up the prompt stuff
|
||||
*/
|
||||
protected void
|
||||
libedit_private void
|
||||
/*ARGSUSED*/
|
||||
prompt_end(EditLine *el __attribute__((__unused__)))
|
||||
{
|
||||
@@ -145,8 +145,8 @@ prompt_end(EditLine *el __attribute__((__unused__)))
|
||||
/* prompt_set():
|
||||
* Install a prompt printing function
|
||||
*/
|
||||
protected int
|
||||
prompt_set(EditLine *el, el_pfunc_t prf, Char c, int op, int wide)
|
||||
libedit_private int
|
||||
prompt_set(EditLine *el, el_pfunc_t prf, wchar_t c, int op, int wide)
|
||||
{
|
||||
el_prompt_t *p;
|
||||
|
||||
@@ -177,8 +177,8 @@ prompt_set(EditLine *el, el_pfunc_t prf, Char c, int op, int wide)
|
||||
/* prompt_get():
|
||||
* Retrieve the prompt printing function
|
||||
*/
|
||||
protected int
|
||||
prompt_get(EditLine *el, el_pfunc_t *prf, Char *c, int op)
|
||||
libedit_private int
|
||||
prompt_get(EditLine *el, el_pfunc_t *prf, wchar_t *c, int op)
|
||||
{
|
||||
el_prompt_t *p;
|
||||
|
||||
|
Reference in New Issue
Block a user