Hi Here are the bits for wide character support in libcurses, libform, libpanel, libmenu.
Apply the diff below and extract this tarball in src/lib (note this is on a slow connection so please don't bother unless you are going to test): http://nicm.ath.cx/~nicholas/ncursesw.tar.gz It is a major bump for all four libs. The files are also on cvs in ~nicm/ncursesw/. This builds all the libraries with the widechar code and also links them to "w" versions (libncursesw, libformw, etc). Some OSs only put the widechar stuff into libncursesw and not libncurses - I don't much like knobs in the form of library names but if opinion is that we should go that way then I can change it. I've been running with this for a while on amd64 without seeing any problems, and UTF-8 seems fine in mutt - the port picks it up fine, then you just need to set LANG. It also seems fine on sparc64. Any ports person like to volunteer to help test this/take care of breakage? :-) Tests, comments, oks? Index: libform/Makefile =================================================================== RCS file: /cvs/src/lib/libform/Makefile,v retrieving revision 1.9 diff -u -p -r1.9 Makefile --- libform/Makefile 12 Jan 2010 23:22:07 -0000 1.9 +++ libform/Makefile 19 Aug 2010 20:16:29 -0000 @@ -57,4 +57,16 @@ includes: ${INSTALL} ${INSTALL_COPY} -m 444 -o $(BINOWN) -g $(BINGRP) $$i \ ${DESTDIR}/usr/include; done +.include <bsd.own.mk> + +afterinstall: + -cd ${DESTDIR}${LIBDIR}; \ + for i in ${_LIBS}; do \ + ln -f $$i `echo $$i | sed 's/form/formw/'`; \ + done +.if (${DEBUGLIBS:L} == "yes") + -cd ${DESTDIR}${LIBDIR}/debug; \ + ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/form/formw/'`.a +.endif + .include <bsd.lib.mk> Index: libform/shlib_version =================================================================== RCS file: /cvs/src/lib/libform/shlib_version,v retrieving revision 1.6 diff -u -p -r1.6 shlib_version @@ -1,2 +1,2 @@ -major=4 +major=5 minor=0 Index: libpanel/Makefile =================================================================== RCS file: /cvs/src/lib/libpanel/Makefile,v retrieving revision 1.8 diff -u -p -r1.8 Makefile --- libpanel/Makefile 12 Jan 2010 23:22:08 -0000 1.8 +++ libpanel/Makefile 19 Aug 2010 20:16:34 -0000 @@ -20,4 +20,16 @@ includes: ${INSTALL} ${INSTALL_COPY} -m 444 -o $(BINOWN) -g $(BINGRP) $$i \ ${DESTDIR}/usr/include; done +.include <bsd.own.mk> + +afterinstall: + -cd ${DESTDIR}${LIBDIR}; \ + for i in ${_LIBS}; do \ + ln -f $$i `echo $$i | sed 's/panel/panelw/'`; \ + done +.if (${DEBUGLIBS:L} == "yes") + -cd ${DESTDIR}${LIBDIR}/debug; \ + ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/panel/panelw/'`.a +.endif + .include <bsd.lib.mk> Index: libpanel/shlib_version =================================================================== RCS file: /cvs/src/lib/libpanel/shlib_version,v retrieving revision 1.7 diff -u -p -r1.7 shlib_version @@ -1,2 +1,2 @@ -major=4 +major=5 minor=0 Index: libmenu/Makefile =================================================================== RCS file: /cvs/src/lib/libmenu/Makefile,v retrieving revision 1.12 diff -u -p -r1.12 Makefile --- libmenu/Makefile 12 Jan 2010 23:22:07 -0000 1.12 +++ libmenu/Makefile 19 Aug 2010 20:16:41 -0000 @@ -1,3 +1,5 @@ +# $OpenBSD$ + LIB= menu WANTLINT= SRCS= m_attribs.c m_cursor.c m_driver.c m_format.c \ @@ -45,5 +47,17 @@ includes: cmp -s $$i ${DESTDIR}/usr/include/$$i || \ ${INSTALL} ${INSTALL_COPY} -m 444 -o $(BINOWN) -g $(BINGRP) $$i \ ${DESTDIR}/usr/include; done + +.include <bsd.own.mk> + +afterinstall: + -cd ${DESTDIR}${LIBDIR}; \ + for i in ${_LIBS}; do \ + ln -f $$i `echo $$i | sed 's/menu/menuw/'`; \ + done +.if (${DEBUGLIBS:L} == "yes") + -cd ${DESTDIR}${LIBDIR}/debug; \ + ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/menu/menuw/'`.a +.endif .include <bsd.lib.mk> Index: libmenu/shlib_version =================================================================== RCS file: /cvs/src/lib/libmenu/shlib_version,v retrieving revision 1.6 diff -u -p -r1.6 shlib_version @@ -1,2 +1,2 @@ -major=4 +major=5 minor=0 Index: libcurses/Makefile =================================================================== RCS file: /cvs/src/lib/libcurses/Makefile,v retrieving revision 1.59 diff -u -p -r1.59 Makefile --- libcurses/Makefile 12 Jan 2010 23:21:58 -0000 1.59 +++ libcurses/Makefile 19 Aug 2010 20:11:07 -0000 @@ -10,7 +10,8 @@ FALLBACK_LIST= AWK?= /usr/bin/awk # Search in subdirs -.PATH: ${.CURDIR}/base ${.CURDIR}/tinfo ${.CURDIR}/trace ${.CURDIR}/tty +.PATH: ${.CURDIR}/base ${.CURDIR}/tinfo ${.CURDIR}/trace ${.CURDIR}/tty \ + ${.CURDIR}/widechar LIB= curses WANTLINT= @@ -53,6 +54,12 @@ SRCS+= lib_trace.c lib_traceatr.c lib_tr # tty SRCS+= hardscroll.c hashmap.c lib_mvcur.c lib_tstp.c lib_twait.c \ lib_vidattr.c tty_update.c +# widechar +SRCS+= charable.c lib_add_wch.c lib_box_set.c lib_cchar.c lib_erasewchar.c \ + lib_get_wch.c lib_get_wstr.c lib_hline_set.c lib_in_wch.c \ + lib_in_wchnstr.c lib_ins_wch.c lib_inwstr.c lib_key_name.c \ + lib_pecho_wchar.c lib_slk_wset.c lib_unget_wch.c lib_vid_attr.c \ + lib_vline_set.c lib_wacs.c lib_wunctrl.c HOSTCFLAGS?= ${CFLAGS} HOSTLDFLAGS?= ${LDFLAGS} @@ -298,12 +305,14 @@ afterinstall: ln -f $$i `echo $$i | sed 's/curses/termlib/'`; \ ln -f $$i `echo $$i | sed 's/curses/termcap/'`; \ ln -f $$i `echo $$i | sed 's/curses/ncurses/'`; \ + ln -f $$i `echo $$i | sed 's/curses/ncursesw/'`; \ done .if (${DEBUGLIBS:L} == "yes") -cd ${DESTDIR}${LIBDIR}/debug; \ ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/curses/termlib/'`.a; \ ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/curses/termcap/'`.a; \ - ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/curses/ncurses/'`.a + ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/curses/ncurses/'`.a; \ + ln -f lib${LIB}.a lib`echo ${LIB} | sed 's/curses/ncursesw/'`.a .endif .include <bsd.lib.mk> Index: libcurses/curses.3tbl =================================================================== RCS file: /cvs/src/lib/libcurses/curses.3tbl,v retrieving revision 1.20 diff -u -p -r1.20 curses.3tbl --- libcurses/curses.3tbl 12 Jan 2010 23:21:59 -0000 1.20 +++ libcurses/curses.3tbl 26 Jul 2010 19:58:34 -0000 @@ -272,8 +272,6 @@ functions in the "normal" library. There is a naming convention which relates many of the normal/wide variants: a "_w" is inserted into the name. For example, \fBwaddch\fP becomes \fBwadd_wch\fP. -.IP -ncursesw is not currently supported on OpenBSD. .RE .PP .\" Index: libcurses/curses.h =================================================================== RCS file: /cvs/src/lib/libcurses/curses.h,v retrieving revision 1.60 diff -u -p -r1.60 curses.h --- libcurses/curses.h 12 Jan 2010 23:21:59 -0000 1.60 +++ libcurses/curses.h 26 Jul 2010 19:47:59 -0000 @@ -137,7 +137,7 @@ * of the header incompatible. */ #undef NCURSES_CH_T -#define NCURSES_CH_T chtype +#define NCURSES_CH_T cchar_t #if 0 && defined(_LP64) typedef unsigned chtype; @@ -342,7 +342,7 @@ typedef chtype attr_t; /* ...must be at #include <libutf8.h> #endif -#if 0 +#if 1 #include <wchar.h> /* ...to get mbstate_t, etc. */ #endif @@ -1334,6 +1334,258 @@ extern NCURSES_EXPORT_VAR(int) TABSIZE; #define KEY_EVENT 0633 /* We were interrupted by an event */ #define KEY_MAX 0777 /* Maximum key value is 0633 */ +/* $Id: curses.wide,v 1.34 2007/03/10 17:52:23 tom Exp $ */ +/* + * vile:cmode: + * This file is part of ncurses, designed to be appended after curses.h.in + * (see that file for the relevant copyright). + */ +#ifdef _XOPEN_SOURCE_EXTENDED + +extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs; + +#define NCURSES_WACS(c) (&_nc_wacs[(unsigned char)c]) + +#define WACS_BSSB NCURSES_WACS('l') +#define WACS_SSBB NCURSES_WACS('m') +#define WACS_BBSS NCURSES_WACS('k') +#define WACS_SBBS NCURSES_WACS('j') +#define WACS_SBSS NCURSES_WACS('u') +#define WACS_SSSB NCURSES_WACS('t') +#define WACS_SSBS NCURSES_WACS('v') +#define WACS_BSSS NCURSES_WACS('w') +#define WACS_BSBS NCURSES_WACS('q') +#define WACS_SBSB NCURSES_WACS('x') +#define WACS_SSSS NCURSES_WACS('n') + +#define WACS_ULCORNER WACS_BSSB +#define WACS_LLCORNER WACS_SSBB +#define WACS_URCORNER WACS_BBSS +#define WACS_LRCORNER WACS_SBBS +#define WACS_RTEE WACS_SBSS +#define WACS_LTEE WACS_SSSB +#define WACS_BTEE WACS_SSBS +#define WACS_TTEE WACS_BSSS +#define WACS_HLINE WACS_BSBS +#define WACS_VLINE WACS_SBSB +#define WACS_PLUS WACS_SSSS + +#define WACS_S1 NCURSES_WACS('o') /* scan line 1 */ +#define WACS_S9 NCURSES_WACS('s') /* scan line 9 */ +#define WACS_DIAMOND NCURSES_WACS('`') /* diamond */ +#define WACS_CKBOARD NCURSES_WACS('a') /* checker board */ +#define WACS_DEGREE NCURSES_WACS('f') /* degree symbol */ +#define WACS_PLMINUS NCURSES_WACS('g') /* plus/minus */ +#define WACS_BULLET NCURSES_WACS('~') /* bullet */ + + /* Teletype 5410v1 symbols */ +#define WACS_LARROW NCURSES_WACS(',') /* arrow left */ +#define WACS_RARROW NCURSES_WACS('+') /* arrow right */ +#define WACS_DARROW NCURSES_WACS('.') /* arrow down */ +#define WACS_UARROW NCURSES_WACS('-') /* arrow up */ +#define WACS_BOARD NCURSES_WACS('h') /* board of squares */ +#define WACS_LANTERN NCURSES_WACS('i') /* lantern symbol */ +#define WACS_BLOCK NCURSES_WACS('0') /* solid square block */ + + /* ncurses extensions */ +#define WACS_S3 NCURSES_WACS('p') /* scan line 3 */ +#define WACS_S7 NCURSES_WACS('r') /* scan line 7 */ +#define WACS_LEQUAL NCURSES_WACS('y') /* less/equal */ +#define WACS_GEQUAL NCURSES_WACS('z') /* greater/equal */ +#define WACS_PI NCURSES_WACS('{') /* Pi */ +#define WACS_NEQUAL NCURSES_WACS('|') /* not equal */ +#define WACS_STERLING NCURSES_WACS('}') /* UK pound sign */ + +/* + * Function prototypes for wide-character operations. + * + * "generated" comments should include ":WIDEC" to make the corresponding + * functions ifdef'd in lib_gen.c + * + * "implemented" comments do not need this marker. + */ + +extern NCURSES_EXPORT(int) add_wch (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) add_wchnstr (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) add_wchstr (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) addnwstr (const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) addwstr (const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) bkgrnd (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(void) bkgrndset (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) border_set (const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) box_set (WINDOW *, const cchar_t *, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) echo_wchar (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) erasewchar (wchar_t*); /* implemented */ +extern NCURSES_EXPORT(int) get_wch (wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) get_wstr (wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*); /* implemented */ +extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wch (cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wchnstr (cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) in_wchstr (cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) innwstr (wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_nwstr (const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_wch (const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) ins_wstr (const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) inwstr (wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(NCURSES_CONST char*) key_name (wchar_t); /* implemented */ +extern NCURSES_EXPORT(int) killwchar (wchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) mvadd_wch (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvadd_wchnstr (int, int, const cchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvadd_wchstr (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvaddnwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvaddwstr (int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvget_wch (int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvget_wstr (int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvgetn_wstr (int, int, wint_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvhline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wch (int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wchnstr (int, int, cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvin_wchstr (int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvinnwstr (int, int, wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_nwstr (int, int, const wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_wch (int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvins_wstr (int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvinwstr (int, int, wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvvline_set (int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wchnstr (WINDOW *, int, int, const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwadd_wchstr (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwaddnwstr (WINDOW *, int, int, const wchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwaddwstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwget_wch (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwget_wstr (WINDOW *, int, int, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwgetn_wstr (WINDOW *, int, int, wint_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwhline_set (WINDOW *, int, int, const cchar_t *, int);/* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wch (WINDOW *, int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wchnstr (WINDOW *, int,int, cchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwin_wchstr (WINDOW *, int, int, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwinnwstr (WINDOW *, int, int, wchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_nwstr (WINDOW *, int,int, const wchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_wch (WINDOW *, int, int, const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *); /* implemented */ +extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(attr_t) term_attrs (void); /* implemented */ +extern NCURSES_EXPORT(int) unget_wch (const wchar_t); /* implemented */ +extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *); /* implemented */ +extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, int (*)(int)); /* implemented */ +extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int); /* implemented */ +extern NCURSES_EXPORT(int) wadd_wchstr (WINDOW *,const cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) waddnwstr (WINDOW *,const wchar_t *,int); /* implemented */ +extern NCURSES_EXPORT(int) waddwstr (WINDOW *,const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wbkgrnd (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(void) wbkgrndset (WINDOW *,const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wborder_set (WINDOW *,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*,const cchar_t*); /* implemented */ +extern NCURSES_EXPORT(int) wecho_wchar (WINDOW *, const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wget_wch (WINDOW *, wint_t *); /* implemented */ +extern NCURSES_EXPORT(int) wget_wstr (WINDOW *, wint_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wgetbkgrnd (WINDOW *, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) wgetn_wstr (WINDOW *,wint_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) whline_set (WINDOW *, const cchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) win_wch (WINDOW *, cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) win_wchnstr (WINDOW *, cchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) win_wchstr (WINDOW *, cchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) winnwstr (WINDOW *, wchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) wins_nwstr (WINDOW *, const wchar_t *, int); /* implemented */ +extern NCURSES_EXPORT(int) wins_wch (WINDOW *, const cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wins_wstr (WINDOW *, const wchar_t *); /* generated:WIDEC */ +extern NCURSES_EXPORT(int) winwstr (WINDOW *, wchar_t *); /* implemented */ +extern NCURSES_EXPORT(wchar_t*) wunctrl (cchar_t *); /* implemented */ +extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int); /* implemented */ + +#ifndef NCURSES_NOMACROS + +/* + * XSI curses macros for XPG4 conformance. + */ +#define add_wch(c) wadd_wch(stdscr,c) +#define add_wchnstr(str,n) wadd_wchnstr(stdscr,str,n) +#define add_wchstr(str) wadd_wchstr(stdscr,str) +#define addnwstr(wstr,n) waddnwstr(stdscr,wstr,n) +#define addwstr(wstr) waddwstr(stdscr,wstr) +#define bkgrnd(c) wbkgrnd(stdscr,c) +#define bkgrndset(c) wbkgrndset(stdscr,c) +#define border_set(l,r,t,b,tl,tr,bl,br) wborder_set(stdscr,l,r,t,b,tl,tr,bl,br) +#define box_set(w,v,h) wborder_set(w,v,v,h,h,0,0,0,0) +#define echo_wchar(c) wecho_wchar(stdscr,c) +#define get_wch(c) wget_wch(stdscr,c) +#define get_wstr(t) wget_wstr(stdscr,t) +#define getbkgrnd(wch) wgetbkgrnd(stdscr,wch) +#define getn_wstr(t,n) wgetn_wstr(stdscr,t,n) +#define hline_set(c,n) whline_set(stdscr,c,n) +#define in_wch(c) win_wch(stdscr,c) +#define in_wchnstr(c,n) win_wchnstr(stdscr,c,n) +#define in_wchstr(c) win_wchstr(stdscr,c) +#define innwstr(c,n) winnwstr(stdscr,c,n) +#define ins_nwstr(t,n) wins_nwstr(stdscr,t,n) +#define ins_wch(c) wins_wch(stdscr,c) +#define ins_wstr(t) wins_wstr(stdscr,t) +#define inwstr(c) winwstr(stdscr,c) +#define vline_set(c,n) wvline_set(stdscr,c,n) +#define wadd_wchstr(win,str) wadd_wchnstr(win,str,-1) +#define waddwstr(win,wstr) waddnwstr(win,wstr,-1) +#define wget_wstr(w,t) wgetn_wstr(w,t,-1) +#define win_wchstr(w,c) win_wchnstr(w,c,-1) +#define wins_wstr(w,t) wins_nwstr(w,t,-1) + +#if !NCURSES_OPAQUE +#define wgetbkgrnd(win,wch) (*wch = win->_bkgrnd, OK) +#endif + +#define mvadd_wch(y,x,c) mvwadd_wch(stdscr,y,x,c) +#define mvadd_wchnstr(y,x,s,n) mvwadd_wchnstr(stdscr,y,x,s,n) +#define mvadd_wchstr(y,x,s) mvwadd_wchstr(stdscr,y,x,s) +#define mvaddnwstr(y,x,wstr,n) mvwaddnwstr(stdscr,y,x,wstr,n) +#define mvaddwstr(y,x,wstr) mvwaddwstr(stdscr,y,x,wstr) +#define mvget_wch(y,x,c) mvwget_wch(stdscr,y,x,c) +#define mvget_wstr(y,x,t) mvwget_wstr(stdscr,y,x,t) +#define mvgetn_wstr(y,x,t,n) mvwgetn_wstr(stdscr,y,x,t,n) +#define mvhline_set(y,x,c,n) mvwhline_set(stdscr,y,x,c,n) +#define mvin_wch(y,x,c) mvwin_wch(stdscr,y,x,c) +#define mvin_wchnstr(y,x,c,n) mvwin_wchnstr(stdscr,y,x,c,n) +#define mvin_wchstr(y,x,c) mvwin_wchstr(stdscr,y,x,c) +#define mvinnwstr(y,x,c,n) mvwinnwstr(stdscr,y,x,c,n) +#define mvins_nwstr(y,x,t,n) mvwins_nwstr(stdscr,y,x,t,n) +#define mvins_wch(y,x,c) mvwins_wch(stdscr,y,x,c) +#define mvins_wstr(y,x,t) mvwins_wstr(stdscr,y,x,t) +#define mvinwstr(y,x,c) mvwinwstr(stdscr,y,x,c) +#define mvvline_set(y,x,c,n) mvwvline_set(stdscr,y,x,c,n) + +#define mvwadd_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wadd_wch(win,c)) +#define mvwadd_wchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : wadd_wchnstr(win,s,n)) +#define mvwadd_wchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : wadd_wchstr(win,s)) +#define mvwaddnwstr(win,y,x,wstr,n) (wmove(win,y,x) == ERR ? ERR : waddnwstr(win,wstr,n)) +#define mvwaddwstr(win,y,x,wstr) (wmove(win,y,x) == ERR ? ERR : waddwstr(win,wstr)) +#define mvwget_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wget_wch(win,c)) +#define mvwget_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wget_wstr(win,t)) +#define mvwgetn_wstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wgetn_wstr(win,t,n)) +#define mvwhline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline_set(win,c,n)) +#define mvwin_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wch(win,c)) +#define mvwin_wchnstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : win_wchnstr(win,c,n)) +#define mvwin_wchstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : win_wchstr(win,c)) +#define mvwinnwstr(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : winnwstr(win,c,n)) +#define mvwins_nwstr(win,y,x,t,n) (wmove(win,y,x) == ERR ? ERR : wins_nwstr(win,t,n)) +#define mvwins_wch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : wins_wch(win,c)) +#define mvwins_wstr(win,y,x,t) (wmove(win,y,x) == ERR ? ERR : wins_wstr(win,t)) +#define mvwinwstr(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winwstr(win,c)) +#define mvwvline_set(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline_set(win,c,n)) + +#endif /* NCURSES_NOMACROS */ + +#if defined(TRACE) || defined(NCURSES_TEST) +extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *); +extern NCURSES_EXPORT(const char *) _nc_viswibuf(const wint_t *); +#endif + +#endif /* _XOPEN_SOURCE_EXTENDED */ /* $Id: curses.h,v 1.60 2010/01/12 23:21:59 nicm Exp $ */ /* * vile:cmode: Index: libcurses/curses.priv.h =================================================================== RCS file: /cvs/src/lib/libcurses/curses.priv.h,v retrieving revision 1.33 diff -u -p -r1.33 curses.priv.h --- libcurses/curses.priv.h 12 Jan 2010 23:21:59 -0000 1.33 +++ libcurses/curses.priv.h 26 Jul 2010 19:42:28 -0000 @@ -262,6 +262,7 @@ color_t; #if USE_WIDEC_SUPPORT #define _nc_bkgd _bkgrnd +#define _XOPEN_SOURCE_EXTENDED 1 #else #undef _XOPEN_SOURCE_EXTENDED #define _nc_bkgd _bkgd Index: libcurses/ncurses_cfg.h =================================================================== RCS file: /cvs/src/lib/libcurses/ncurses_cfg.h,v retrieving revision 1.24 diff -u -p -r1.24 ncurses_cfg.h --- libcurses/ncurses_cfg.h 12 Jan 2010 23:21:59 -0000 1.24 +++ libcurses/ncurses_cfg.h 26 Jul 2010 19:45:14 -0000 @@ -58,6 +58,7 @@ #define GCC_UNUSED __attribute__((__unused__)) #define HAVE_BIG_CORE 1 #define HAVE_BSD_CGETENT 1 +#define HAVE_BTOWC 1 #define HAVE_CURSES_VERSION 1 #define HAVE_DIRENT_H 1 #define HAVE_ERRNO 1 @@ -80,6 +81,12 @@ #define HAVE_LINK 1 #define HAVE_LOCALE_H 1 #define HAVE_LONG_FILE_NAMES 1 +#define HAVE_MBLEN 1 +#define HAVE_MBRLEN 1 +#define HAVE_MBRTOWC 1 +#define HAVE_MBSRTOWCS 1 +#define HAVE_MBSTOWCS 1 +#define HAVE_MBTOWC 1 #define HAVE_MEMORY_H 1 #define HAVE_MENU_H 1 #define HAVE_MKSTEMP 1 @@ -88,6 +95,7 @@ #define HAVE_PANEL_H 1 #define HAVE_POLL 1 #define HAVE_POLL_H 1 +#define HAVE_PUTWC 1 #define HAVE_REGEX_H_FUNCS 1 #define HAVE_REMOVE 1 #define HAVE_REMOVE 1 @@ -130,6 +138,10 @@ #define HAVE_USE_DEFAULT_COLORS 1 #define HAVE_VSNPRINTF 1 #define HAVE_VSSCANF 1 +#define HAVE_WCSRTOMBS 1 +#define HAVE_WCSTOMBS 1 +#define HAVE_WCTOB 1 +#define HAVE_WCTOMB 1 #define HAVE_WCTYPE_H 1 #define HAVE_WORKING_POLL 1 #define HAVE_WRESIZE 1 @@ -140,6 +152,7 @@ #define NCURSES_PATHSEP ':' #define NCURSES_VERSION_STRING "5.7.20081102" #define NDEBUG 1 +#define NEED_WCHAR_H 1 #define PURE_TERMINFO 0 #define RETSIGTYPE void #define SIG_ATOMIC_T volatile sig_atomic_t @@ -152,12 +165,13 @@ #define TYPEOF_CHTYPE long #define USE_ASSUMED_COLOR 1 #define USE_DATABASE 1 -#define USE_GETCAP 1 +#define USE_GETCAP 1 #define USE_HASHMAP 1 #define USE_HOME_TERMINFO 1 #define USE_LINKS 1 #define USE_OPENPTY_HEADER <util.h> #define USE_ROOT_ENVIRON 1 +#define USE_WIDEC_SUPPORT 1 #define USE_XTERM_PTY 1 /* #define HAVE_LIBFORM 1 */ /* #define HAVE_LIBMENU 1 */ Index: libcurses/shlib_version =================================================================== RCS file: /cvs/src/lib/libcurses/shlib_version,v retrieving revision 1.17 diff -u -p -r1.17 shlib_version @@ -1,2 +1,2 @@ -major=11 +major=12 minor=0