Let's turn 'em on. Not much supports them but we might as well have them.
ok? Index: Makefile =================================================================== RCS file: /cvs/src/lib/libedit/Makefile,v retrieving revision 1.10 diff -u -p -r1.10 Makefile --- Makefile 30 Jun 2010 00:05:35 -0000 1.10 +++ Makefile 7 Jul 2011 08:49:16 -0000 @@ -6,6 +6,8 @@ LIB= edit WANTLINT= USE_SHLIBDIR= yes +WIDECHAR= yes + OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ hist.c key.c map.c chartype.c \ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c Index: chartype.h =================================================================== RCS file: /cvs/src/lib/libedit/chartype.h,v retrieving revision 1.3 diff -u -p -r1.3 chartype.h --- chartype.h 7 Jul 2011 05:40:42 -0000 1.3 +++ chartype.h 7 Jul 2011 08:49:16 -0000 @@ -45,7 +45,7 @@ * 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... */ -#ifndef __NetBSD__ +#if !defined(__NetBSD__) && !defined(__OpenBSD__) #ifndef __STDC_ISO_10646__ /* In many places it is assumed that the first 127 code points are ASCII * compatible, so ensure wchar_t indeed does ISO 10646 and not some other Index: editline.3 =================================================================== RCS file: /cvs/src/lib/libedit/editline.3,v retrieving revision 1.31 diff -u -p -r1.31 editline.3 --- editline.3 2 Mar 2011 07:46:15 -0000 1.31 +++ editline.3 7 Jul 2011 08:49:17 -0000 @@ -36,24 +36,41 @@ .Nm el_end , .Nm el_reset , .Nm el_gets , +.Nm el_wgets , .Nm el_getc , +.Nm el_wgetc , .Nm el_push , +.Nm el_wpush , .Nm el_parse , +.Nm el_wparse , .Nm el_set , +.Nm el_wset , .Nm el_get , +.Nm el_wget , .Nm el_source , .Nm el_resize , .Nm el_line , +.Nm el_wline , .Nm el_insertstr , +.Nm el_winsertstr , .Nm el_deletestr , +.Nm el_wdeletestr , .Nm history_init , +.Nm history_winit , .Nm history_end , +.Nm history_wend , .Nm history , +.Nm history_w , .Nm tok_init , +.Nm tok_winit , .Nm tok_end , +.Nm tok_wend , .Nm tok_reset , +.Nm tok_wreset , .Nm tok_line , +.Nm tok_wline , .Nm tok_str +.Nm tok_wstr .Nd line editor, history and tokenization functions .Sh SYNOPSIS .Fd #include <histedit.h> @@ -65,17 +82,29 @@ .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 int .Fn el_getc "EditLine *e" "char *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 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_set "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_source "EditLine *e" "const char *file" .Ft void .Fn el_resize "EditLine *e" @@ -83,24 +112,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 void .Fn el_deletestr "EditLine *e" "int count" +.Ft void +.Fn el_wdeletestr "EditLine *e" "int count" .Ft History * .Fn history_init +.Ft HistoryW * +.Fn history_winit .Ft void .Fn history_end "History *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 Tokenizer * .Fn tok_init "const char *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_reset "Tokenizer *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_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[]" .Sh DESCRIPTION The .Nm @@ -122,6 +171,9 @@ which is created by .Fn el_init and freed by .Fn el_end . +.Pp +The wide-character functions behave the same way as their narrow +counterparts. .Pp The following functions are available: .Bl -tag -width 4n