mirror of
https://github.com/ksherlock/marlene.git
synced 2025-01-15 03:33:05 +00:00
minor tweaks
This commit is contained in:
parent
77be11f696
commit
517dfd3ad6
17
darlene.c
17
darlene.c
@ -90,7 +90,7 @@ forkpty2(int *amaster, char *name, struct sgttyb *sg, struct winsize *winp) {
|
|||||||
|
|
||||||
#pragma databank 1
|
#pragma databank 1
|
||||||
static void sigchild(int sig, int x) {
|
static void sigchild(int sig, int x) {
|
||||||
PostEvent(0x8000,0);
|
PostEvent(app4Mask,0);
|
||||||
}
|
}
|
||||||
#pragma databank 0
|
#pragma databank 0
|
||||||
|
|
||||||
@ -108,20 +108,27 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(;;) {
|
for(;;) {
|
||||||
|
static char buffer[1024];
|
||||||
int fio = 0;
|
int fio = 0;
|
||||||
ioctl(fd, FIONREAD, &fio);
|
ioctl(fd, FIONREAD, &fio);
|
||||||
if (fio > 256) fio = 256;
|
if (fio > sizeof(buffer)) fio = sizeof(buffer);
|
||||||
if (fio > 0) {
|
if (fio > 0) {
|
||||||
fio = read(fd, buffer, fio);
|
fio = read(fd, buffer, fio);
|
||||||
if (fio > 0) vt100_process(buffer, fio);
|
if (fio > 0) vt100_process(buffer, fio);
|
||||||
}
|
}
|
||||||
GetNextEvent(...);
|
|
||||||
|
|
||||||
|
GetNextEvent(everyEvent, &event);
|
||||||
|
if (event.what == keyDownEvt) {
|
||||||
|
|
||||||
if (fio <= 0) {
|
}
|
||||||
|
|
||||||
|
if (event.what == app4Mask) {
|
||||||
|
/* child signal received! */
|
||||||
union wait wt;
|
union wait wt;
|
||||||
ok = waitpid(pid, &wt, WNOHANG);
|
ok = waitpid(pid, &wt, WNOHANG);
|
||||||
if (ok <= 0)
|
if (ok <= 0) continue;
|
||||||
|
display_str("\r\nChild exited.\r\n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
asm { cop 0x7f }
|
asm { cop 0x7f }
|
||||||
}
|
}
|
||||||
|
@ -183,6 +183,7 @@ int main(int argc, char **argv) {
|
|||||||
Handle shdHandle = NULL;
|
Handle shdHandle = NULL;
|
||||||
Word err;
|
Word err;
|
||||||
int ok;
|
int ok;
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
|
||||||
iLoaded = iStarted = iConnected = false;
|
iLoaded = iStarted = iConnected = false;
|
||||||
@ -196,7 +197,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
|
|
||||||
// todo:keypad flag of some sort?
|
// todo:keypad flag of some sort?
|
||||||
for (i = 1; i < argv; ++i) {
|
for (i = 1; i < argc; ++i) {
|
||||||
char *cp = argv[i];
|
char *cp = argv[i];
|
||||||
if (cp[0] != '-') break;
|
if (cp[0] != '-') break;
|
||||||
if (strcmp(cp, "--vt52") == 0) {
|
if (strcmp(cp, "--vt52") == 0) {
|
||||||
@ -330,7 +331,7 @@ int main(int argc, char **argv) {
|
|||||||
vt100_process(buffer, buffer_size);
|
vt100_process(buffer, buffer_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetNextEvent(keyDownMask | autoKeyMask, &event);
|
GetNextEvent(everyEvent, &event);
|
||||||
if (event.what == keyDownEvt) {
|
if (event.what == keyDownEvt) {
|
||||||
|
|
||||||
unsigned char key = event.message;
|
unsigned char key = event.message;
|
||||||
@ -394,7 +395,7 @@ _exit:
|
|||||||
|
|
||||||
|
|
||||||
// flush q
|
// flush q
|
||||||
while (GetNextEvent(keyDownMask | autoKeyMask, &event)) ;
|
FlushEvents(everyEvent, 0);
|
||||||
display_cstr("\n\rPress any key to exit.\n\r");
|
display_cstr("\n\rPress any key to exit.\n\r");
|
||||||
while (!GetNextEvent(keyDownMask | autoKeyMask, &event)) ;
|
while (!GetNextEvent(keyDownMask | autoKeyMask, &event)) ;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user