-s:: Suppress Emacs-like line editing and command history.
+-r:: Restore game from specified file
+
-o:: Old-style. Restores original interface, no prompt or line editing.
== BUGS ==
editline = prompt = false;
break;
case 'r':
- rfp = fopen(optarg, "r");
- if (rfp == NULL)
- fprintf(stderr,
- "advent: can't open save file %s for read\n",
- optarg);
- signal(SIGINT, sig_handler);
- break;
+ rfp = fopen(optarg, "r");
+ if (rfp == NULL)
+ fprintf(stderr,
+ "advent: can't open save file %s for read\n",
+ optarg);
+ signal(SIGINT, sig_handler);
+ break;
case 's':
editline = false;
break;
checksumming have been discarded - it's pointless to try
tamper-proofing saves when everyone has the source code.
-A -r command-line option has been added. It is functionally equivalent
-to RESTORE command, but faster.
+A -r command-line been added. When it is given (with a file
+path argument) it is functionally equivalent to RESTORE command.
== Translation ==
IGNORE(fread(&save, sizeof(struct save_t), 1, fp));
fclose(fp);
if (save.version != VRSION) {
- SETPRM(1,save.version/10,MOD(save.version,10));
- SETPRM(3,VRSION/10,MOD(VRSION,10));
- RSPEAK(VERSION_SKEW);
+ SETPRM(1,save.version/10,MOD(save.version,10));
+ SETPRM(3,VRSION/10,MOD(VRSION,10));
+ RSPEAK(VERSION_SKEW);
} else {
- memcpy(&game, &save.game, sizeof(struct game_t));
- OBJSND[BIRD] = save.bird;
- OBJTXT[OYSTER] = save.bivalve;
- game.zzword=RNDVOC(3,game.zzword);
+ memcpy(&game, &save.game, sizeof(struct game_t));
+ OBJSND[BIRD] = save.bird;
+ OBJTXT[OYSTER] = save.bivalve;
+ game.zzword=RNDVOC(3,game.zzword);
}
return GO_TOP;
}