#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
+#include <getopt.h>
#include "main.h"
#include "misc.h"
TRVSIZ = 885, TTEXT[6], TURNS, URN, V1, V2, VASE, VEND, VERB,
VOLCAN, VRBSIZ = 35, VRSION = 25, WATER, WD1, WD1X, WD2, WD2X,
WZDARK = false, ZZWORD;
+FILE *logfp;
extern void initialise();
extern void score(long);
*/
int main(int argc, char *argv[]) {
+ int ch;
/* Adventure (rev 2: 20 treasures) */
* Errata fixed: 78/12/25 */
+/* Options. */
+
+ while ((ch = getopt(argc, argv, "l:")) != EOF) {
+ switch (ch) {
+ case 'l':
+ logfp = fopen(optarg, "w+");
+ if (logfp == NULL)
+ fprintf(stderr,
+ "advent: can't open logfile %s for write\n",
+ optarg);
+ break;
+ }
+ }
+
/* Logical variables:
*
* CLOSED says whether we're all the way closed
RSPEAK(201);
exit(0);
-
-
/* Start-up, dwarf stuff */
L1: SETUP= -1;