NOSTATICFN for src/*
This commit is contained in:
362
src/files.c
362
src/files.c
@@ -120,119 +120,119 @@ extern char *translate_path_variables(const char *, char *);
|
||||
extern char *sounddir; /* defined in sounds.c */
|
||||
#endif
|
||||
|
||||
static NHFILE *new_nhfile(void);
|
||||
static void free_nhfile(NHFILE *);
|
||||
staticfn NHFILE *new_nhfile(void);
|
||||
staticfn void free_nhfile(NHFILE *);
|
||||
#ifdef SELECTSAVED
|
||||
static int QSORTCALLBACK strcmp_wrap(const void *, const void *);
|
||||
staticfn int QSORTCALLBACK strcmp_wrap(const void *, const void *);
|
||||
#endif
|
||||
static char *set_bonesfile_name(char *, d_level *);
|
||||
static char *set_bonestemp_name(void);
|
||||
staticfn char *set_bonesfile_name(char *, d_level *);
|
||||
staticfn char *set_bonestemp_name(void);
|
||||
#ifdef COMPRESS
|
||||
static void redirect(const char *, const char *, FILE *, boolean);
|
||||
staticfn void redirect(const char *, const char *, FILE *, boolean);
|
||||
#endif
|
||||
#if defined(COMPRESS) || defined(ZLIB_COMP)
|
||||
static void docompress_file(const char *, boolean);
|
||||
staticfn void docompress_file(const char *, boolean);
|
||||
#endif
|
||||
#if defined(ZLIB_COMP)
|
||||
static boolean make_compressed_name(const char *, char *);
|
||||
staticfn boolean make_compressed_name(const char *, char *);
|
||||
#endif
|
||||
#ifndef USE_FCNTL
|
||||
static char *make_lockname(const char *, char *);
|
||||
staticfn char *make_lockname(const char *, char *);
|
||||
#endif
|
||||
static void set_configfile_name(const char *);
|
||||
static FILE *fopen_config_file(const char *, int);
|
||||
static int get_uchars(char *, uchar *, boolean, int, const char *);
|
||||
staticfn void set_configfile_name(const char *);
|
||||
staticfn FILE *fopen_config_file(const char *, int);
|
||||
staticfn int get_uchars(char *, uchar *, boolean, int, const char *);
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
static void adjust_prefix(char *, int);
|
||||
staticfn void adjust_prefix(char *, int);
|
||||
#endif
|
||||
static char *choose_random_part(char *, char);
|
||||
static boolean config_error_nextline(const char *);
|
||||
static void free_config_sections(void);
|
||||
static char *is_config_section(char *);
|
||||
static boolean handle_config_section(char *);
|
||||
staticfn char *choose_random_part(char *, char);
|
||||
staticfn boolean config_error_nextline(const char *);
|
||||
staticfn void free_config_sections(void);
|
||||
staticfn char *is_config_section(char *);
|
||||
staticfn boolean handle_config_section(char *);
|
||||
boolean parse_config_line(char *);
|
||||
static char *find_optparam(const char *);
|
||||
static boolean cnf_line_OPTIONS(char *);
|
||||
static boolean cnf_line_AUTOPICKUP_EXCEPTION(char *);
|
||||
static boolean cnf_line_BINDINGS(char *);
|
||||
static boolean cnf_line_AUTOCOMPLETE(char *);
|
||||
static boolean cnf_line_MSGTYPE(char *);
|
||||
static boolean cnf_line_HACKDIR(char *);
|
||||
static boolean cnf_line_LEVELDIR(char *);
|
||||
static boolean cnf_line_SAVEDIR(char *);
|
||||
static boolean cnf_line_BONESDIR(char *);
|
||||
static boolean cnf_line_DATADIR(char *);
|
||||
static boolean cnf_line_SCOREDIR(char *);
|
||||
static boolean cnf_line_LOCKDIR(char *);
|
||||
static boolean cnf_line_CONFIGDIR(char *);
|
||||
static boolean cnf_line_TROUBLEDIR(char *);
|
||||
static boolean cnf_line_NAME(char *);
|
||||
static boolean cnf_line_ROLE(char *);
|
||||
static boolean cnf_line_dogname(char *);
|
||||
static boolean cnf_line_catname(char *);
|
||||
static boolean cnf_line_WIZARDS(char *);
|
||||
static boolean cnf_line_SHELLERS(char *);
|
||||
static boolean cnf_line_EXPLORERS(char *);
|
||||
static boolean cnf_line_DEBUGFILES(char *);
|
||||
static boolean cnf_line_DUMPLOGFILE(char *);
|
||||
static boolean cnf_line_GENERICUSERS(char *);
|
||||
static boolean cnf_line_BONES_POOLS(char *);
|
||||
static boolean cnf_line_SUPPORT(char *);
|
||||
static boolean cnf_line_RECOVER(char *);
|
||||
static boolean cnf_line_CHECK_SAVE_UID(char *);
|
||||
static boolean cnf_line_CHECK_PLNAME(char *);
|
||||
static boolean cnf_line_SEDUCE(char *);
|
||||
static boolean cnf_line_HIDEUSAGE(char *);
|
||||
static boolean cnf_line_MAXPLAYERS(char *);
|
||||
static boolean cnf_line_PERSMAX(char *);
|
||||
static boolean cnf_line_PERS_IS_UID(char *);
|
||||
static boolean cnf_line_ENTRYMAX(char *);
|
||||
static boolean cnf_line_POINTSMIN(char *);
|
||||
static boolean cnf_line_MAX_STATUENAME_RANK(char *);
|
||||
static boolean cnf_line_LIVELOG(char *);
|
||||
static boolean cnf_line_PANICTRACE_LIBC(char *);
|
||||
static boolean cnf_line_PANICTRACE_GDB(char *);
|
||||
static boolean cnf_line_GDBPATH(char *);
|
||||
static boolean cnf_line_GREPPATH(char *);
|
||||
static boolean cnf_line_CRASHREPORTURL(char *);
|
||||
static boolean cnf_line_SAVEFORMAT(char *);
|
||||
static boolean cnf_line_BONESFORMAT(char *);
|
||||
static boolean cnf_line_ACCESSIBILITY(char *);
|
||||
static boolean cnf_line_PORTABLE_DEVICE_PATHS(char *);
|
||||
static boolean cnf_line_BOULDER(char *);
|
||||
static boolean cnf_line_MENUCOLOR(char *);
|
||||
static boolean cnf_line_HILITE_STATUS(char *);
|
||||
static boolean cnf_line_WARNINGS(char *);
|
||||
static boolean cnf_line_ROGUESYMBOLS(char *);
|
||||
static boolean cnf_line_SYMBOLS(char *);
|
||||
static boolean cnf_line_WIZKIT(char *);
|
||||
staticfn char *find_optparam(const char *);
|
||||
staticfn boolean cnf_line_OPTIONS(char *);
|
||||
staticfn boolean cnf_line_AUTOPICKUP_EXCEPTION(char *);
|
||||
staticfn boolean cnf_line_BINDINGS(char *);
|
||||
staticfn boolean cnf_line_AUTOCOMPLETE(char *);
|
||||
staticfn boolean cnf_line_MSGTYPE(char *);
|
||||
staticfn boolean cnf_line_HACKDIR(char *);
|
||||
staticfn boolean cnf_line_LEVELDIR(char *);
|
||||
staticfn boolean cnf_line_SAVEDIR(char *);
|
||||
staticfn boolean cnf_line_BONESDIR(char *);
|
||||
staticfn boolean cnf_line_DATADIR(char *);
|
||||
staticfn boolean cnf_line_SCOREDIR(char *);
|
||||
staticfn boolean cnf_line_LOCKDIR(char *);
|
||||
staticfn boolean cnf_line_CONFIGDIR(char *);
|
||||
staticfn boolean cnf_line_TROUBLEDIR(char *);
|
||||
staticfn boolean cnf_line_NAME(char *);
|
||||
staticfn boolean cnf_line_ROLE(char *);
|
||||
staticfn boolean cnf_line_dogname(char *);
|
||||
staticfn boolean cnf_line_catname(char *);
|
||||
staticfn boolean cnf_line_WIZARDS(char *);
|
||||
staticfn boolean cnf_line_SHELLERS(char *);
|
||||
staticfn boolean cnf_line_EXPLORERS(char *);
|
||||
staticfn boolean cnf_line_DEBUGFILES(char *);
|
||||
staticfn boolean cnf_line_DUMPLOGFILE(char *);
|
||||
staticfn boolean cnf_line_GENERICUSERS(char *);
|
||||
staticfn boolean cnf_line_BONES_POOLS(char *);
|
||||
staticfn boolean cnf_line_SUPPORT(char *);
|
||||
staticfn boolean cnf_line_RECOVER(char *);
|
||||
staticfn boolean cnf_line_CHECK_SAVE_UID(char *);
|
||||
staticfn boolean cnf_line_CHECK_PLNAME(char *);
|
||||
staticfn boolean cnf_line_SEDUCE(char *);
|
||||
staticfn boolean cnf_line_HIDEUSAGE(char *);
|
||||
staticfn boolean cnf_line_MAXPLAYERS(char *);
|
||||
staticfn boolean cnf_line_PERSMAX(char *);
|
||||
staticfn boolean cnf_line_PERS_IS_UID(char *);
|
||||
staticfn boolean cnf_line_ENTRYMAX(char *);
|
||||
staticfn boolean cnf_line_POINTSMIN(char *);
|
||||
staticfn boolean cnf_line_MAX_STATUENAME_RANK(char *);
|
||||
staticfn boolean cnf_line_LIVELOG(char *);
|
||||
staticfn boolean cnf_line_PANICTRACE_LIBC(char *);
|
||||
staticfn boolean cnf_line_PANICTRACE_GDB(char *);
|
||||
staticfn boolean cnf_line_GDBPATH(char *);
|
||||
staticfn boolean cnf_line_GREPPATH(char *);
|
||||
staticfn boolean cnf_line_CRASHREPORTURL(char *);
|
||||
staticfn boolean cnf_line_SAVEFORMAT(char *);
|
||||
staticfn boolean cnf_line_BONESFORMAT(char *);
|
||||
staticfn boolean cnf_line_ACCESSIBILITY(char *);
|
||||
staticfn boolean cnf_line_PORTABLE_DEVICE_PATHS(char *);
|
||||
staticfn boolean cnf_line_BOULDER(char *);
|
||||
staticfn boolean cnf_line_MENUCOLOR(char *);
|
||||
staticfn boolean cnf_line_HILITE_STATUS(char *);
|
||||
staticfn boolean cnf_line_WARNINGS(char *);
|
||||
staticfn boolean cnf_line_ROGUESYMBOLS(char *);
|
||||
staticfn boolean cnf_line_SYMBOLS(char *);
|
||||
staticfn boolean cnf_line_WIZKIT(char *);
|
||||
#ifdef USER_SOUNDS
|
||||
static boolean cnf_line_SOUNDDIR(char *);
|
||||
static boolean cnf_line_SOUND(char *);
|
||||
staticfn boolean cnf_line_SOUNDDIR(char *);
|
||||
staticfn boolean cnf_line_SOUND(char *);
|
||||
#endif
|
||||
static boolean cnf_line_QT_TILEWIDTH(char *);
|
||||
static boolean cnf_line_QT_TILEHEIGHT(char *);
|
||||
static boolean cnf_line_QT_FONTSIZE(char *);
|
||||
static boolean cnf_line_QT_COMPACT(char *);
|
||||
staticfn boolean cnf_line_QT_TILEWIDTH(char *);
|
||||
staticfn boolean cnf_line_QT_TILEHEIGHT(char *);
|
||||
staticfn boolean cnf_line_QT_FONTSIZE(char *);
|
||||
staticfn boolean cnf_line_QT_COMPACT(char *);
|
||||
struct _cnf_parser_state; /* defined below (far below...) */
|
||||
static void cnf_parser_init(struct _cnf_parser_state *parser);
|
||||
static void cnf_parser_done(struct _cnf_parser_state *parser);
|
||||
static void parse_conf_buf(struct _cnf_parser_state *parser,
|
||||
staticfn void cnf_parser_init(struct _cnf_parser_state *parser);
|
||||
staticfn void cnf_parser_done(struct _cnf_parser_state *parser);
|
||||
staticfn void parse_conf_buf(struct _cnf_parser_state *parser,
|
||||
boolean (*proc)(char *arg));
|
||||
/* next one is in extern.h; why here too? */
|
||||
boolean parse_conf_str(const char *str, boolean (*proc)(char *arg));
|
||||
static boolean parse_conf_file(FILE *fp, boolean (*proc)(char *arg));
|
||||
static void parseformat(int *, char *);
|
||||
static FILE *fopen_wizkit_file(void);
|
||||
static void wizkit_addinv(struct obj *);
|
||||
staticfn boolean parse_conf_file(FILE *fp, boolean (*proc)(char *arg));
|
||||
staticfn void parseformat(int *, char *);
|
||||
staticfn FILE *fopen_wizkit_file(void);
|
||||
staticfn void wizkit_addinv(struct obj *);
|
||||
boolean proc_wizkit_line(char *buf);
|
||||
void read_wizkit(void); /* in extern.h; why here too? */
|
||||
static FILE *fopen_sym_file(void);
|
||||
staticfn FILE *fopen_sym_file(void);
|
||||
|
||||
#ifdef SELF_RECOVER
|
||||
static boolean copy_bytes(int, int);
|
||||
staticfn boolean copy_bytes(int, int);
|
||||
#endif
|
||||
static NHFILE *viable_nhfile(NHFILE *);
|
||||
staticfn NHFILE *viable_nhfile(NHFILE *);
|
||||
|
||||
/* return a file's name without its path and optionally trailing 'type' */
|
||||
const char *
|
||||
@@ -512,7 +512,7 @@ zero_nhfile(NHFILE *nhfp)
|
||||
nhfp->fnidx = 0;
|
||||
}
|
||||
|
||||
static NHFILE *
|
||||
staticfn NHFILE *
|
||||
new_nhfile(void)
|
||||
{
|
||||
NHFILE *nhfp = (NHFILE *) alloc(sizeof(NHFILE));
|
||||
@@ -521,7 +521,7 @@ new_nhfile(void)
|
||||
return nhfp;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
free_nhfile(NHFILE *nhfp)
|
||||
{
|
||||
if (nhfp) {
|
||||
@@ -551,8 +551,7 @@ rewind_nhfile(NHFILE *nhfp)
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
NHFILE *
|
||||
staticfn NHFILE *
|
||||
viable_nhfile(NHFILE *nhfp)
|
||||
{
|
||||
/* perform some sanity checks before returning
|
||||
@@ -718,7 +717,7 @@ clearlocks(void)
|
||||
|
||||
#if defined(SELECTSAVED)
|
||||
/* qsort comparison routine */
|
||||
static int QSORTCALLBACK
|
||||
staticfn int QSORTCALLBACK
|
||||
strcmp_wrap(const void *p, const void *q)
|
||||
{
|
||||
#if defined(UNIX) && defined(QT_GRAPHICS)
|
||||
@@ -750,7 +749,7 @@ nhclose(int fd)
|
||||
/* set up "file" to be file name for retrieving bones, and return a
|
||||
* bonesid to be read/written in the bones file.
|
||||
*/
|
||||
static char *
|
||||
staticfn char *
|
||||
set_bonesfile_name(char *file, d_level *lev)
|
||||
{
|
||||
s_level *sptr;
|
||||
@@ -799,7 +798,7 @@ set_bonesfile_name(char *file, d_level *lev)
|
||||
* (we are not reading or writing level files while writing bones files, so
|
||||
* the same array may be used instead of copying.)
|
||||
*/
|
||||
static char *
|
||||
staticfn char *
|
||||
set_bonestemp_name(void)
|
||||
{
|
||||
char *tf;
|
||||
@@ -1426,7 +1425,7 @@ free_saved_games(char **saved)
|
||||
|
||||
#ifdef COMPRESS /* external compression */
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
redirect(
|
||||
const char *filename,
|
||||
const char *mode,
|
||||
@@ -1454,7 +1453,7 @@ redirect(
|
||||
*
|
||||
* cf. child() in unixunix.c.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
docompress_file(const char *filename, boolean uncomp)
|
||||
{
|
||||
char *cfn = 0;
|
||||
@@ -1659,7 +1658,7 @@ nh_uncompress(const char *filename UNUSED_if_not_COMPRESS)
|
||||
}
|
||||
|
||||
#ifdef ZLIB_COMP /* RLC 09 Mar 1999: Support internal ZLIB */
|
||||
static boolean
|
||||
staticfn boolean
|
||||
make_compressed_name(const char *filename, char *cfn)
|
||||
{
|
||||
#ifndef SHORT_FILENAMES
|
||||
@@ -1690,7 +1689,7 @@ make_compressed_name(const char *filename, char *cfn)
|
||||
#endif /* SHORT_FILENAMES */
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
docompress_file(const char *filename, boolean uncomp)
|
||||
{
|
||||
gzFile compressedfile;
|
||||
@@ -1843,7 +1842,7 @@ struct flock sflock; /* for unlocking, same as above */
|
||||
|
||||
|
||||
#ifndef USE_FCNTL
|
||||
static char *
|
||||
staticfn char *
|
||||
make_lockname(const char *filename UNUSED_conditional, char *lockname)
|
||||
{
|
||||
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(WIN32) \
|
||||
@@ -2158,14 +2157,14 @@ do_write_config_file(void)
|
||||
|
||||
/* remember the name of the file we're accessing;
|
||||
if may be used in option reject messages */
|
||||
static void
|
||||
staticfn void
|
||||
set_configfile_name(const char *fname)
|
||||
{
|
||||
(void) strncpy(configfile, fname, sizeof configfile - 1);
|
||||
configfile[sizeof configfile - 1] = '\0';
|
||||
}
|
||||
|
||||
static FILE *
|
||||
staticfn FILE *
|
||||
fopen_config_file(const char *filename, int src)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -2306,7 +2305,7 @@ fopen_config_file(const char *filename, int src)
|
||||
* NOTE: zeros are inserted unless modlist is TRUE, in which case the list
|
||||
* location is unchanged. Callers must handle zeros if modlist is FALSE.
|
||||
*/
|
||||
static int
|
||||
staticfn int
|
||||
get_uchars(char *bufp, /* current pointer */
|
||||
uchar *list, /* return list */
|
||||
boolean modlist, /* TRUE: list is being modified in place */
|
||||
@@ -2366,7 +2365,7 @@ get_uchars(char *bufp, /* current pointer */
|
||||
}
|
||||
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
static void
|
||||
staticfn void
|
||||
adjust_prefix(char *bufp, int prefixid)
|
||||
{
|
||||
char *ptr;
|
||||
@@ -2389,7 +2388,7 @@ adjust_prefix(char *bufp, int prefixid)
|
||||
#endif
|
||||
|
||||
/* Choose at random one of the sep separated parts from str. Mangles str. */
|
||||
static char *
|
||||
staticfn char *
|
||||
choose_random_part(char *str, char sep)
|
||||
{
|
||||
int nsep = 1;
|
||||
@@ -2427,7 +2426,7 @@ choose_random_part(char *str, char sep)
|
||||
return (char *) 0;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
free_config_sections(void)
|
||||
{
|
||||
if (gc.config_section_chosen) {
|
||||
@@ -2443,7 +2442,7 @@ free_config_sections(void)
|
||||
/* check for " [ anything-except-bracket-or-empty ] # arbitrary-comment"
|
||||
with spaces optional; returns pointer to "anything-except..." (with
|
||||
trailing " ] #..." stripped) if ok, otherwise Null */
|
||||
static char *
|
||||
staticfn char *
|
||||
is_config_section(
|
||||
char *str) /* trailing spaces are stripped, ']' too iff result is good */
|
||||
{
|
||||
@@ -2472,7 +2471,7 @@ is_config_section(
|
||||
return trimspaces(a);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
handle_config_section(char *buf)
|
||||
{
|
||||
char *sect = is_config_section(buf);
|
||||
@@ -2507,7 +2506,7 @@ handle_config_section(char *buf)
|
||||
#define match_varname(INP, NAM, LEN) match_optname(INP, NAM, LEN, TRUE)
|
||||
|
||||
/* find the '=' or ':' */
|
||||
static char *
|
||||
staticfn char *
|
||||
find_optparam(const char *buf)
|
||||
{
|
||||
char *bufp, *altp;
|
||||
@@ -2520,7 +2519,7 @@ find_optparam(const char *buf)
|
||||
return bufp;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_OPTIONS(char *origbuf)
|
||||
{
|
||||
char *bufp = find_optparam(origbuf);
|
||||
@@ -2529,33 +2528,33 @@ cnf_line_OPTIONS(char *origbuf)
|
||||
return parseoptions(bufp, TRUE, TRUE);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_AUTOPICKUP_EXCEPTION(char *bufp)
|
||||
{
|
||||
add_autopickup_exception(bufp);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BINDINGS(char *bufp)
|
||||
{
|
||||
return parsebindings(bufp);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_AUTOCOMPLETE(char *bufp)
|
||||
{
|
||||
parseautocomplete(bufp, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MSGTYPE(char *bufp)
|
||||
{
|
||||
return msgtype_parse_add(bufp);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_HACKDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2570,7 +2569,7 @@ cnf_line_HACKDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_LEVELDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2590,7 +2589,7 @@ cnf_line_LEVELDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SAVEDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2612,7 +2611,7 @@ cnf_line_SAVEDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BONESDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2623,7 +2622,7 @@ cnf_line_BONESDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_DATADIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2634,7 +2633,7 @@ cnf_line_DATADIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SCOREDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2645,7 +2644,7 @@ cnf_line_SCOREDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_LOCKDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2656,7 +2655,7 @@ cnf_line_LOCKDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CONFIGDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2667,7 +2666,7 @@ cnf_line_CONFIGDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_TROUBLEDIR(char *bufp)
|
||||
{
|
||||
#ifdef NOCWD_ASSUMPTIONS
|
||||
@@ -2678,14 +2677,14 @@ cnf_line_TROUBLEDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_NAME(char *bufp)
|
||||
{
|
||||
(void) strncpy(gp.plname, bufp, PL_NSIZ - 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ROLE(char *bufp)
|
||||
{
|
||||
int len;
|
||||
@@ -2695,21 +2694,21 @@ cnf_line_ROLE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_dogname(char *bufp)
|
||||
{
|
||||
(void) strncpy(gd.dogname, bufp, PL_PSIZ - 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_catname(char *bufp)
|
||||
{
|
||||
(void) strncpy(gc.catname, bufp, PL_PSIZ - 1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_WIZARDS(char *bufp)
|
||||
{
|
||||
if (sysopt.wizards)
|
||||
@@ -2726,7 +2725,7 @@ cnf_line_WIZARDS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SHELLERS(char *bufp)
|
||||
{
|
||||
if (sysopt.shellers)
|
||||
@@ -2735,7 +2734,7 @@ cnf_line_SHELLERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_EXPLORERS(char *bufp)
|
||||
{
|
||||
if (sysopt.explorers)
|
||||
@@ -2744,7 +2743,7 @@ cnf_line_EXPLORERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_DEBUGFILES(char *bufp)
|
||||
{
|
||||
/* if showdebug() has already been called (perhaps we've added
|
||||
@@ -2758,7 +2757,7 @@ cnf_line_DEBUGFILES(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_DUMPLOGFILE(char *bufp)
|
||||
{
|
||||
#ifdef DUMPLOG
|
||||
@@ -2771,7 +2770,7 @@ cnf_line_DUMPLOGFILE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_GENERICUSERS(char *bufp)
|
||||
{
|
||||
if (sysopt.genericusers)
|
||||
@@ -2780,7 +2779,7 @@ cnf_line_GENERICUSERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BONES_POOLS(char *bufp)
|
||||
{
|
||||
/* max value of 10 guarantees (N % bones.pools) will be one digit
|
||||
@@ -2794,7 +2793,7 @@ cnf_line_BONES_POOLS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SUPPORT(char *bufp)
|
||||
{
|
||||
if (sysopt.support)
|
||||
@@ -2803,7 +2802,7 @@ cnf_line_SUPPORT(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_RECOVER(char *bufp)
|
||||
{
|
||||
if (sysopt.recover)
|
||||
@@ -2812,7 +2811,7 @@ cnf_line_RECOVER(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CHECK_SAVE_UID(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2821,7 +2820,7 @@ cnf_line_CHECK_SAVE_UID(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CHECK_PLNAME(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2830,7 +2829,7 @@ cnf_line_CHECK_PLNAME(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SEDUCE(char *bufp)
|
||||
{
|
||||
int n = !!atoi(bufp); /* XXX this could be tighter */
|
||||
@@ -2852,7 +2851,7 @@ cnf_line_SEDUCE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_HIDEUSAGE(char *bufp)
|
||||
{
|
||||
int n = !!atoi(bufp);
|
||||
@@ -2861,7 +2860,7 @@ cnf_line_HIDEUSAGE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MAXPLAYERS(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2875,7 +2874,7 @@ cnf_line_MAXPLAYERS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PERSMAX(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2888,7 +2887,7 @@ cnf_line_PERSMAX(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PERS_IS_UID(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2901,7 +2900,7 @@ cnf_line_PERS_IS_UID(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ENTRYMAX(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2914,7 +2913,7 @@ cnf_line_ENTRYMAX(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_POINTSMIN(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2927,7 +2926,7 @@ cnf_line_POINTSMIN(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MAX_STATUENAME_RANK(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2941,7 +2940,7 @@ cnf_line_MAX_STATUENAME_RANK(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_LIVELOG(char *bufp)
|
||||
{
|
||||
/* using 0 for base accepts "dddd" as decimal provided that first 'd'
|
||||
@@ -2958,7 +2957,7 @@ cnf_line_LIVELOG(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PANICTRACE_LIBC(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2973,7 +2972,7 @@ cnf_line_PANICTRACE_LIBC(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PANICTRACE_GDB(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -2988,7 +2987,7 @@ cnf_line_PANICTRACE_GDB(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_GDBPATH(char *bufp)
|
||||
{
|
||||
#if defined(PANICTRACE) && !defined(VMS)
|
||||
@@ -3003,7 +3002,7 @@ cnf_line_GDBPATH(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_GREPPATH(char *bufp)
|
||||
{
|
||||
#if defined(PANICTRACE) && !defined(VMS)
|
||||
@@ -3018,7 +3017,7 @@ cnf_line_GREPPATH(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_CRASHREPORTURL(char *bufp)
|
||||
{
|
||||
if (sysopt.crashreporturl)
|
||||
@@ -3027,21 +3026,21 @@ cnf_line_CRASHREPORTURL(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SAVEFORMAT(char *bufp)
|
||||
{
|
||||
parseformat(sysopt.saveformat, bufp);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BONESFORMAT(char *bufp)
|
||||
{
|
||||
parseformat(sysopt.bonesformat, bufp);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ACCESSIBILITY(char *bufp)
|
||||
{
|
||||
int n = atoi(bufp);
|
||||
@@ -3054,7 +3053,7 @@ cnf_line_ACCESSIBILITY(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_PORTABLE_DEVICE_PATHS(char *bufp)
|
||||
{
|
||||
#ifdef WIN32
|
||||
@@ -3073,7 +3072,7 @@ cnf_line_PORTABLE_DEVICE_PATHS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_BOULDER(char *bufp)
|
||||
{
|
||||
(void) get_uchars(bufp, &go.ov_primary_syms[SYM_BOULDER + SYM_OFF_X],
|
||||
@@ -3081,13 +3080,13 @@ cnf_line_BOULDER(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_MENUCOLOR(char *bufp)
|
||||
{
|
||||
return add_menu_coloring(bufp);
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_HILITE_STATUS(char *bufp)
|
||||
{
|
||||
#ifdef STATUS_HILITES
|
||||
@@ -3098,7 +3097,7 @@ cnf_line_HILITE_STATUS(char *bufp)
|
||||
#endif
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_WARNINGS(char *bufp)
|
||||
{
|
||||
uchar translate[MAXPCHARS];
|
||||
@@ -3108,7 +3107,7 @@ cnf_line_WARNINGS(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_ROGUESYMBOLS(char *bufp)
|
||||
{
|
||||
if (parsesymbols(bufp, ROGUESET)) {
|
||||
@@ -3119,7 +3118,7 @@ cnf_line_ROGUESYMBOLS(char *bufp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SYMBOLS(char *bufp)
|
||||
{
|
||||
if (parsesymbols(bufp, PRIMARYSET)) {
|
||||
@@ -3130,7 +3129,7 @@ cnf_line_SYMBOLS(char *bufp)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_WIZKIT(char *bufp)
|
||||
{
|
||||
(void) strncpy(gw.wizkit, bufp, WIZKIT_MAX - 1);
|
||||
@@ -3138,7 +3137,7 @@ cnf_line_WIZKIT(char *bufp)
|
||||
}
|
||||
|
||||
#ifdef USER_SOUNDS
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SOUNDDIR(char *bufp)
|
||||
{
|
||||
if (sounddir)
|
||||
@@ -3147,7 +3146,7 @@ cnf_line_SOUNDDIR(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_SOUND(char *bufp)
|
||||
{
|
||||
add_sound_mapping(bufp);
|
||||
@@ -3155,7 +3154,7 @@ cnf_line_SOUND(char *bufp)
|
||||
}
|
||||
#endif /*USER_SOUNDS*/
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_TILEWIDTH(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3169,7 +3168,7 @@ cnf_line_QT_TILEWIDTH(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_TILEHEIGHT(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3183,7 +3182,7 @@ cnf_line_QT_TILEHEIGHT(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_FONTSIZE(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3197,7 +3196,7 @@ cnf_line_QT_FONTSIZE(char *bufp)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
cnf_line_QT_COMPACT(char *bufp)
|
||||
{
|
||||
#ifdef QT_GRAPHICS
|
||||
@@ -3400,7 +3399,7 @@ config_error_init(boolean from_file, const char *sourcename, boolean secure)
|
||||
gp.program_state.config_error_ready = TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
staticfn boolean
|
||||
config_error_nextline(const char *line)
|
||||
{
|
||||
struct _config_error_frame *ced = config_error_data;
|
||||
@@ -3564,7 +3563,7 @@ struct _cnf_parser_state {
|
||||
};
|
||||
|
||||
/* Initialize config parser data */
|
||||
static void
|
||||
staticfn void
|
||||
cnf_parser_init(struct _cnf_parser_state *parser)
|
||||
{
|
||||
parser->rv = TRUE; /* assume successful parse */
|
||||
@@ -3579,7 +3578,7 @@ cnf_parser_init(struct _cnf_parser_state *parser)
|
||||
}
|
||||
|
||||
/* caller has finished with 'parser' (except for 'rv' so leave that intact) */
|
||||
static void
|
||||
staticfn void
|
||||
cnf_parser_done(struct _cnf_parser_state *parser)
|
||||
{
|
||||
parser->ep = 0; /* points into parser->inbuf, so becoming stale */
|
||||
@@ -3595,7 +3594,7 @@ cnf_parser_done(struct _cnf_parser_state *parser)
|
||||
*
|
||||
* Continued lines are merged together with one space in between.
|
||||
*/
|
||||
static void
|
||||
staticfn void
|
||||
parse_conf_buf(struct _cnf_parser_state *p, boolean (*proc)(char *arg))
|
||||
{
|
||||
p->cont = FALSE;
|
||||
@@ -3745,7 +3744,7 @@ parse_conf_str(const char *str, boolean (*proc)(char *arg))
|
||||
*
|
||||
* Read from file fp, calling parse_conf_buf for each line.
|
||||
*/
|
||||
static boolean
|
||||
staticfn boolean
|
||||
parse_conf_file(FILE *fp, boolean (*proc)(char *arg))
|
||||
{
|
||||
struct _cnf_parser_state parser;
|
||||
@@ -3764,7 +3763,7 @@ parse_conf_file(FILE *fp, boolean (*proc)(char *arg))
|
||||
return parser.rv;
|
||||
}
|
||||
|
||||
static void
|
||||
staticfn void
|
||||
parseformat(int *arr, char *str)
|
||||
{
|
||||
const char *legal[] = { "historical", "lendian", "ascii" };
|
||||
@@ -3801,7 +3800,7 @@ parseformat(int *arr, char *str)
|
||||
|
||||
/* ---------- BEGIN WIZKIT FILE HANDLING ----------- */
|
||||
|
||||
static FILE *
|
||||
staticfn FILE *
|
||||
fopen_wizkit_file(void)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -3873,7 +3872,7 @@ fopen_wizkit_file(void)
|
||||
}
|
||||
|
||||
/* add to hero's inventory if there's room, otherwise put item on floor */
|
||||
static void
|
||||
staticfn void
|
||||
wizkit_addinv(struct obj *obj)
|
||||
{
|
||||
if (!obj || obj == &hands_obj)
|
||||
@@ -3945,8 +3944,7 @@ read_wizkit(void)
|
||||
extern const char *const known_handling[]; /* symbols.c */
|
||||
extern const char *const known_restrictions[]; /* symbols.c */
|
||||
|
||||
static
|
||||
FILE *
|
||||
staticfn FILE *
|
||||
fopen_sym_file(void)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -4749,11 +4747,11 @@ reveal_paths(void)
|
||||
|
||||
#define MAXPASSAGES SIZE(gc.context.novel.pasg) /* 20 */
|
||||
|
||||
static int choose_passage(int, unsigned);
|
||||
staticfn int choose_passage(int, unsigned);
|
||||
|
||||
/* choose a random passage that hasn't been chosen yet; once all have
|
||||
been chosen, reset the tracking to make all passages available again */
|
||||
static int
|
||||
staticfn int
|
||||
choose_passage(int passagecnt, /* total of available passages */
|
||||
unsigned oid) /* book.o_id, used to determine whether
|
||||
re-reading same book */
|
||||
|
||||
Reference in New Issue
Block a user