Remove experimental Unicode support.

This reverts commit 7f0f43e6f9 and some related
subsequent commits.

This compiles, but I have not done extensive testing.

Conflicts:
	include/config.h
	include/decl.h
	include/extern.h
	include/global.h
	include/tradstdc.h
	include/wintty.h
	src/drawing.c
	src/files.c
	src/hacklib.c
	src/mapglyph.c
	src/options.c
	sys/winnt/nttty.c
	win/tty/getline.c
	win/tty/topl.c
	win/tty/wintty.c
This commit is contained in:
Sean Hunt
2015-02-14 15:02:50 -05:00
committed by Pasi Kallinen
parent fb46fed99d
commit 5fb3fea9c6
22 changed files with 189 additions and 1060 deletions

View File

@@ -24,25 +24,6 @@ extern int NDECL(extcmd_via_menu); /* cmd.c */
extern char erase_char, kill_char; /* from appropriate tty.c file */
/* cloned from topl.c, but not identical
*/
#ifdef UNICODE_WIDEWINPORT
/* nhwchar is wchar; data from core needs narrow-to-wide conversion;
data going back to core needs wide-to-narrow conversion; data
used within tty routines typically needs wide-to-wide awareness */
STATIC_VAR nhwchar getl_wbuf[BUFSZ];
STATIC_VAR char getl_nbuf[BUFSZ];
#define T(x) L##x
#define Waddtopl(str) addtopl(nhwstrcpy(getl_wbuf,str))
#define Wputsyms(str) putsyms(nhwstrcpy(getl_wbuf,str))
#define NWstrcpy(wdst,src) nhwstrcpy(wdst,src) /* narrow-to-wide */
#else /*!UNICODE_WIDEWINPORT*/
/* nhwchar is char; no conversions needed */
#define T(x) x
#define Waddtopl(str) addtopl(str)
#define Wputsyms(str) putsyms(str)
#endif /*?UNICODE_WIDEWINPORT*/
/*
* Read a line closed with '\n' into the array char bufp[BUFSZ].
* (The '\n' is not stored. The string is closed with a '\0'.)
@@ -76,12 +57,7 @@ getlin_hook_proc hook;
*obufp = 0;
for(;;) {
(void) fflush(stdout);
#ifdef UNICODE_WIDEWINPORT
Strcat(strcat(strcpy(getl_nbuf, query), " "), obufp);
(void)NWstrcpy(toplines, getl_nbuf);
#else
Strcat(strcat(strcpy(toplines, query), " "), obufp);
#endif
c = pgetchar();
if (c == '\033' || c == EOF) {
obufp[0] = '\033';
@@ -100,10 +76,10 @@ getlin_hook_proc hook;
ttyDisplay->inread = sav;
tty_clear_nhwindow(WIN_MESSAGE);
cw->maxcol = cw->maxrow;
Waddtopl(query);
Waddtopl(T(" "));
addtopl(query);
addtopl(" ");
*bufp = 0;
Waddtopl(obufp);
addtopl(obufp);
} else {
if (!doprev)
(void) tty_doprev_message();/* need two initially */
@@ -115,10 +91,10 @@ getlin_hook_proc hook;
tty_clear_nhwindow(WIN_MESSAGE);
cw->maxcol = cw->maxrow;
doprev = 0;
Waddtopl(query);
Waddtopl(T(" "));
addtopl(query);
addtopl(" ");
*bufp = 0;
Waddtopl(obufp);
addtopl(obufp);
}
if(c == erase_char || c == '\b') {
if(bufp != obufp) {
@@ -128,11 +104,11 @@ getlin_hook_proc hook;
#endif /* NEWAUTOCOMP */
bufp--;
#ifndef NEWAUTOCOMP
putsyms(T("\b \b"));/* putsym converts \b */
putsyms("\b \b");/* putsym converts \b */
#else /* NEWAUTOCOMP */
putsyms(T("\b"));
for (i = bufp; *i; ++i) putsyms(T(" "));
for (; i > bufp; --i) putsyms(T("\b"));
putsyms("\b");
for (i = bufp; *i; ++i) putsyms(" ");
for (; i > bufp; --i) putsyms("\b");
*bufp = 0;
#endif /* NEWAUTOCOMP */
} else tty_nhbell();
@@ -155,21 +131,21 @@ getlin_hook_proc hook;
#endif /* NEWAUTOCOMP */
*bufp = c;
bufp[1] = 0;
Wputsyms(bufp);
putsyms(bufp);
bufp++;
if (hook && (*hook)(obufp)) {
Wputsyms(bufp);
putsyms(bufp);
#ifndef NEWAUTOCOMP
bufp = eos(bufp);
#else /* NEWAUTOCOMP */
/* pointer and cursor left where they were */
for (i = bufp; *i; ++i) putsyms(T("\b"));
for (i = bufp; *i; ++i) putsyms("\b");
} else if (i > bufp) {
char *s = i;
/* erase rest of prior guess */
for (; i > bufp; --i) putsyms(T(" "));
for (; s > bufp; --s) putsyms(T("\b"));
for (; i > bufp; --i) putsyms(" ");
for (; s > bufp; --s) putsyms("\b");
#endif /* NEWAUTOCOMP */
}
} else if(c == kill_char || c == '\177') { /* Robert Viduya */
@@ -177,11 +153,11 @@ getlin_hook_proc hook;
#ifndef NEWAUTOCOMP
while(bufp != obufp) {
bufp--;
putsyms(T("\b \b"));
putsyms("\b \b");
}
#else /* NEWAUTOCOMP */
for (; *bufp; ++bufp) putsyms(T(" "));
for (; bufp != obufp; --bufp) putsyms(T("\b \b"));
for (; *bufp; ++bufp) putsyms(" ");
for (; bufp != obufp; --bufp) putsyms("\b \b");
*bufp = 0;
#endif /* NEWAUTOCOMP */
} else
@@ -192,8 +168,6 @@ getlin_hook_proc hook;
clear_nhwindow(WIN_MESSAGE); /* clean up after ourselves */
}
#undef T
void
xwaitforspace(s)
register const char *s; /* chars allowed besides return */