#include <stdio.h>
#include <unistd.h>
-#include <curses.h>
-#include <signal.h>
-#include <ctype.h>
-#include <stdarg.h>
+#include "config.h"
#include "sst.h"
#include "sstlinux.h"
(void)endwin();
putchar('\n');
}
+ if (logfp)
+ fclose(logfp);
}
void iostart(void)
{
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+ gettext("");
+
+ if (atexit(outro)){
+ fprintf(stderr,"Unable to register outro(), exiting...\n");
+ exit(1);
+ }
if (!(game.options & OPTION_CURSES)) {
rows = atoi(getenv("LINES"));
} else {
- if (atexit(outro)){
- fprintf(stderr,"Unable to register outro(), exiting...\n");
- exit(1);
- }
(void)initscr();
#ifdef KEY_MIN
keypad(stdscr, TRUE);
strcat(line, "\n");
wrefresh(curwnd);
} else {
- fgets(line, max, stdin);
+ if (replayfp && !feof(replayfp))
+ fgets(line, max, replayfp);
+ else
+ fgets(line, max, stdin);
}
+ if (logfp)
+ fputs(line, logfp);
line[strlen(line)-1] = '\0';
}
}
}
-void commandhook(char *cmd, int before) {
+void commandhook(char *cmd, bool before) {
}
/*
void setpassword(void)
{
if (!(game.options & OPTION_CURSES)) {
- while (TRUE) {
+ for (;;) {
scan();
strcpy(game.passwd, citem);
chew();