more NOCWD_ASSUMPTIONS

The NOCWD_ASSUMPTIONS conditional code allows readonly
parts of NetHack to be separated from areas that require write-access.
This allows the recent panic log needed a prefix.
This commit is contained in:
nethack.allison
2002-06-29 12:44:54 +00:00
parent c0f63425df
commit 6b47ae351d
11 changed files with 75 additions and 38 deletions

View File

@@ -9,6 +9,8 @@
#include <string.h>
#endif
#define DATAPREFIX 4
#ifdef DLB
/*
* Data librarian. Present a STDIO-like interface to NetHack while
@@ -29,7 +31,7 @@ typedef struct dlb_procs {
} dlb_procs_t;
/* without extern.h via hack.h, these haven't been declared for us */
extern FILE *FDECL(fopen_datafile, (const char *,const char *,BOOLEAN_P));
extern FILE *FDECL(fopen_datafile, (const char *,const char *,int));
#ifdef DLBLIB
/*
@@ -199,7 +201,7 @@ open_library(lib_name, lp)
{
boolean status = FALSE;
lp->fdata = fopen_datafile(lib_name, RDBMODE, FALSE);
lp->fdata = fopen_datafile(lib_name, RDBMODE, DATAPREFIX);
if (lp->fdata) {
if (readlibdir(lp)) {
status = TRUE;
@@ -460,7 +462,7 @@ dlb_fopen(name, mode)
dp = (dlb *) alloc(sizeof(dlb));
if (do_dlb_fopen(dp, name, mode))
dp->fp = (FILE *) 0;
else if ((fp = fopen_datafile(name, mode, FALSE)) != 0)
else if ((fp = fopen_datafile(name, mode, DATAPREFIX)) != 0)
dp->fp = fp;
else {
/* can't find anything */