From 458c7ff54123a67012af3d60d1c83e7a43b8eb74 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 4 Feb 2005 14:52:23 +0000 Subject: [PATCH] Make sure this builds with -DSERGEEV. --- finish.c | 4 ++-- io.c | 9 ++++++--- sst.c | 11 ++++++++--- sst.h | 1 + 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/finish.c b/finish.c index 7ae6c87..e3ace26 100644 --- a/finish.c +++ b/finish.c @@ -393,7 +393,7 @@ void plaque(void) { while (fp == NULL) { proutn("File or device name for your plaque: "); - getline(winner, sizeof(winner)); + cgetline(winner, sizeof(winner)); fp = fopen(winner, "w"); if (fp==NULL) { prout("Invalid name."); @@ -401,7 +401,7 @@ void plaque(void) { } proutn("Enter name to go on plaque (up to 30 characters): "); - getline(winner, sizeof(winner)); + cgetline(winner, sizeof(winner)); /* The 38 below must be 64 for 132-column paper */ nskip = 38 - strlen(winner)/2; diff --git a/io.c b/io.c index 93ea842..07bc150 100644 --- a/io.c +++ b/io.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include #include @@ -13,8 +14,8 @@ #ifndef SERGEEV static int linecount; /* for paging */ -#endif /* SERGEEV */ static int screenheight = 24, screenwidth = 80; +#endif /* SERGEEV */ #ifndef SERGEEV static int curses = FALSE; #else /* SERGEEV */ @@ -32,6 +33,7 @@ wnd wnds[6]={{1,1,80,25}, /* FULLSCREEN_WINDOW */ short curwnd; #endif /* SERGEEV */ +#ifndef SERGEEV static void outro(int sig) { /* wrap up, either normally or due to signal */ if (curses) { @@ -48,6 +50,7 @@ static void fastexit(int sig) { putchar('\n'); exit(0); } +#endif /* SERGEEV */ void iostart(int usecurses) { #ifdef SERGEEV @@ -346,7 +349,7 @@ void drawmaps(short l) { if (l==1) sensor(); if (l!=2) setwnd(LEFTUPPER_WINDOW); gotoxy(1,1); - strcpy(line,"s"); + enqueue("s"); srscan(1); if (l!=2){ setwnd(SRSCAN_WINDOW); @@ -354,7 +357,7 @@ void drawmaps(short l) { srscan(2); setwnd(LRSCAN_WINDOW); clrscr(); - strcpy(line,"l"); + enqueue("l"); lrscan(); _setcursortype(_NORMALCURSOR); } diff --git a/sst.c b/sst.c index 07b7da5..0f8aed6 100644 --- a/sst.c +++ b/sst.c @@ -10,8 +10,6 @@ #define SSTDOC "sst.doc" #endif -static char line[128], *linep = line; - /* Here are Tom Almy's changes: @@ -94,6 +92,9 @@ Eric Raymond's changes: */ +/* the input queue */ +static char line[128], *linep = line; + static struct { char *name; @@ -261,6 +262,10 @@ static void helpme(void) { fclose(fp); } +void enqueue(char *s) { + strcpy(line, s); +} + static void makemoves(void) { int i, hitme; clrscr(); @@ -302,7 +307,7 @@ static void makemoves(void) { commandhook(commands[i].name, TRUE); switch (i) { /* command switch */ case SRSCAN: // srscan - srscan(1); + srscan(SRSCAN); break; case LRSCAN: // lrscan lrscan(); diff --git a/sst.h b/sst.h index aef476b..7e0734b 100644 --- a/sst.h +++ b/sst.h @@ -445,6 +445,7 @@ void setpassword(void); void commandhook(char *, int); void c_printf (char *format, ... ); void makechart(void); +void enqueue(char *s); typedef struct { int wndleft,wndtop,wndright,wndbottom; -- 2.31.1