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.");
}
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;
+#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <termios.h>
#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 */
short curwnd;
#endif /* SERGEEV */
+#ifndef SERGEEV
static void outro(int sig) {
/* wrap up, either normally or due to signal */
if (curses) {
putchar('\n');
exit(0);
}
+#endif /* SERGEEV */
void iostart(int usecurses) {
#ifdef SERGEEV
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);
srscan(2);
setwnd(LRSCAN_WINDOW);
clrscr();
- strcpy(line,"l");
+ enqueue("l");
lrscan();
_setcursortype(_NORMALCURSOR);
}
#define SSTDOC "sst.doc"
#endif
-static char line[128], *linep = line;
-
/*
Here are Tom Almy's changes:
*/
+/* the input queue */
+static char line[128], *linep = line;
+
static struct
{
char *name;
fclose(fp);
}
+void enqueue(char *s) {
+ strcpy(line, s);
+}
+
static void makemoves(void) {
int i, hitme;
clrscr();
commandhook(commands[i].name, TRUE);
switch (i) { /* command switch */
case SRSCAN: // srscan
- srscan(1);
+ srscan(SRSCAN);
break;
case LRSCAN: // lrscan
lrscan();
void commandhook(char *, int);
void c_printf (char *format, ... );
void makechart(void);
+void enqueue(char *s);
typedef struct {
int wndleft,wndtop,wndright,wndbottom;