summaryrefslogtreecommitdiff
path: root/lib/libedit/map.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2016-04-11 00:50:13 +0000
committerchristos <christos@NetBSD.org>2016-04-11 00:50:13 +0000
commit074960bb097ee8f2b57d7f3e9588ddd18a031c05 (patch)
tree3229482b7e2624f94116037ef25056c7a1e4eb36 /lib/libedit/map.c
parent914fbc62fa09a6335ae580c073d3cd6ca42f2209 (diff)
Char -> wchar_t from Ingo Schwarze.
Diffstat (limited to 'lib/libedit/map.c')
-rw-r--r--lib/libedit/map.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/lib/libedit/map.c b/lib/libedit/map.c
index d8d0e9faa39..123212f0dec 100644
--- a/lib/libedit/map.c
+++ b/lib/libedit/map.c
@@ -1,4 +1,4 @@
-/* $NetBSD: map.c,v 1.45 2016/04/11 00:22:48 christos Exp $ */
+/* $NetBSD: map.c,v 1.46 2016/04/11 00:50:13 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: map.c,v 1.45 2016/04/11 00:22:48 christos Exp $");
+__RCSID("$NetBSD: map.c,v 1.46 2016/04/11 00:50:13 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: map.c,v 1.45 2016/04/11 00:22:48 christos Exp $");
#include "help.h"
#include "parse.h"
-private void map_print_key(EditLine *, el_action_t *, const Char *);
+private void map_print_key(EditLine *, el_action_t *, const wchar_t *);
private void map_print_some_keys(EditLine *, el_action_t *, wint_t, wint_t);
private void map_print_all_keys(EditLine *);
private void map_init_nls(EditLine *);
@@ -981,7 +981,7 @@ map_init_nls(EditLine *el)
private void
map_init_meta(EditLine *el)
{
- Char buf[3];
+ wchar_t buf[3];
int i;
el_action_t *map = el->el_map.key;
el_action_t *alt = el->el_map.alt;
@@ -999,7 +999,7 @@ map_init_meta(EditLine *el)
} else
map = alt;
}
- buf[0] = (Char) i;
+ buf[0] = (wchar_t)i;
buf[2] = 0;
for (i = 0200; i <= 0377; i++)
switch (map[i]) {
@@ -1053,7 +1053,7 @@ protected void
map_init_emacs(EditLine *el)
{
int i;
- Char buf[3];
+ wchar_t buf[3];
el_action_t *key = el->el_map.key;
el_action_t *alt = el->el_map.alt;
const el_action_t *emacs = el->el_map.emacs;
@@ -1084,7 +1084,7 @@ map_init_emacs(EditLine *el)
* Set the editor
*/
protected int
-map_set_editor(EditLine *el, Char *editor)
+map_set_editor(EditLine *el, wchar_t *editor)
{
if (wcscmp(editor, L"emacs") == 0) {
@@ -1103,7 +1103,7 @@ map_set_editor(EditLine *el, Char *editor)
* Retrieve the editor
*/
protected int
-map_get_editor(EditLine *el, const Char **editor)
+map_get_editor(EditLine *el, const wchar_t **editor)
{
if (editor == NULL)
@@ -1124,7 +1124,7 @@ map_get_editor(EditLine *el, const Char **editor)
* Print the function description for 1 key
*/
private void
-map_print_key(EditLine *el, el_action_t *map, const Char *in)
+map_print_key(EditLine *el, el_action_t *map, const wchar_t *in)
{
char outbuf[EL_BUFSIZ];
el_bindings_t *bp, *ep;
@@ -1150,12 +1150,12 @@ private void
map_print_some_keys(EditLine *el, el_action_t *map, wint_t first, wint_t last)
{
el_bindings_t *bp, *ep;
- Char firstbuf[2], lastbuf[2];
+ wchar_t firstbuf[2], lastbuf[2];
char unparsbuf[EL_BUFSIZ], extrabuf[EL_BUFSIZ];
- firstbuf[0] = (Char)first;
+ firstbuf[0] = first;
firstbuf[1] = 0;
- lastbuf[0] = (Char)last;
+ lastbuf[0] = last;
lastbuf[1] = 0;
if (map[first] == ED_UNASSIGNED) {
if (first == last) {
@@ -1246,15 +1246,15 @@ map_print_all_keys(EditLine *el)
* Add/remove/change bindings
*/
protected int
-map_bind(EditLine *el, int argc, const Char **argv)
+map_bind(EditLine *el, int argc, const wchar_t **argv)
{
el_action_t *map;
int ntype, rem;
- const Char *p;
- Char inbuf[EL_BUFSIZ];
- Char outbuf[EL_BUFSIZ];
- const Char *in = NULL;
- Char *out;
+ const wchar_t *p;
+ wchar_t inbuf[EL_BUFSIZ];
+ wchar_t outbuf[EL_BUFSIZ];
+ const wchar_t *in = NULL;
+ wchar_t *out;
el_bindings_t *bp, *ep;
int cmd;
int key;
@@ -1398,7 +1398,8 @@ map_bind(EditLine *el, int argc, const Char **argv)
* add a user defined function
*/
protected int
-map_addfunc(EditLine *el, const Char *name, const Char *help, el_func_t func)
+map_addfunc(EditLine *el, const wchar_t *name, const wchar_t *help,
+ el_func_t func)
{
void *p;
size_t nf = el->el_map.nfunc + 1;