mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 07:16:23 -05:00
Compare commits
2 Commits
e6921a8ed1
...
38aa6b97c8
Author | SHA1 | Date | |
---|---|---|---|
38aa6b97c8 | |||
679d8d098b |
@ -7,7 +7,7 @@
|
|||||||
# if __NetBSD__
|
# if __NetBSD__
|
||||||
# define BSD 1
|
# define BSD 1
|
||||||
# define POSIX 1
|
# define POSIX 1
|
||||||
# elsif __linux__
|
# elif __linux__
|
||||||
# define USG 1
|
# define USG 1
|
||||||
# define SVR4 1 /* locks */
|
# define SVR4 1 /* locks */
|
||||||
# define POSIX 1
|
# define POSIX 1
|
||||||
|
@ -207,7 +207,7 @@ static void vtputc( unicode_t c) {
|
|||||||
c &= 0xFF ;
|
c &= 0xFF ;
|
||||||
|
|
||||||
if( c == '\t') {
|
if( c == '\t') {
|
||||||
sane_vtputc( viewtab ? 0x226B : ' ') ; /* 0x226B: '≫' */
|
sane_vtputc( viewtab ? 0xBB : ' ') ; /* 0xBB: '»' */
|
||||||
while( ((vtcol + taboff) % tabwidth) != 0)
|
while( ((vtcol + taboff) % tabwidth) != 0)
|
||||||
sane_vtputc( ' ') ;
|
sane_vtputc( ' ') ;
|
||||||
} else if( c < 0x20 || c == 0x7F) {
|
} else if( c < 0x20 || c == 0x7F) {
|
||||||
|
46
posix.c
46
posix.c
@ -149,27 +149,28 @@ void ttflush(void)
|
|||||||
exit(15);
|
exit(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Read a character from the terminal, performing no editing and doing no echo
|
|
||||||
* at all.
|
|
||||||
* Very simple on CPM, because the system can do exactly what you want.
|
|
||||||
*/
|
|
||||||
int ttgetc(void)
|
|
||||||
{
|
|
||||||
static char buffer[32];
|
|
||||||
static int pending;
|
|
||||||
unicode_t c;
|
|
||||||
int count, bytes = 1, expected;
|
|
||||||
|
|
||||||
count = pending;
|
/* Read a character from the terminal, performing no editing and doing no
|
||||||
if (!count) {
|
echo at all.
|
||||||
count = read(0, buffer, sizeof(buffer));
|
*/
|
||||||
if (count <= 0)
|
int ttgetc( void) {
|
||||||
return 0;
|
static char buffer[ 32] ;
|
||||||
pending = count;
|
static int pending ;
|
||||||
|
unicode_t c ;
|
||||||
|
|
||||||
|
int count = pending ;
|
||||||
|
if( !count) {
|
||||||
|
count = read( 0, buffer, sizeof( buffer)) ;
|
||||||
|
if( count <= 0)
|
||||||
|
return 0 ;
|
||||||
|
|
||||||
|
pending = count ;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = (unsigned char) buffer[0];
|
int bytes = 1 ;
|
||||||
|
c = (unsigned char) buffer[ 0] ;
|
||||||
|
#if 0 // temporary fix for wsl
|
||||||
|
|
||||||
if (c >= 32 && c < 128)
|
if (c >= 32 && c < 128)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
@ -186,7 +187,7 @@ int ttgetc(void)
|
|||||||
* delay for some *very* unusual utf8 character
|
* delay for some *very* unusual utf8 character
|
||||||
* input.
|
* input.
|
||||||
*/
|
*/
|
||||||
expected = 2;
|
int expected = 2;
|
||||||
if ((c & 0xe0) == 0xe0)
|
if ((c & 0xe0) == 0xe0)
|
||||||
expected = 6;
|
expected = 6;
|
||||||
|
|
||||||
@ -220,9 +221,10 @@ int ttgetc(void)
|
|||||||
bytes = utf8_to_unicode(buffer, 0, pending, &c);
|
bytes = utf8_to_unicode(buffer, 0, pending, &c);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
pending -= bytes;
|
#endif
|
||||||
memmove(buffer, buffer+bytes, pending);
|
pending -= bytes ;
|
||||||
return c;
|
memmove( buffer, buffer + bytes, pending) ;
|
||||||
|
return c ;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* typahead: Check to see if any characters are already in the
|
/* typahead: Check to see if any characters are already in the
|
||||||
|
Loading…
Reference in New Issue
Block a user