version 1.69 | | version 1.70 |
---|
| | |
/* | | /* |
* static char *rcsid_init_c = | | * static char *rcsid_init_c = |
* "$Id: init.c,v 1.69 2005/10/28 19:08:53 akirschbaum Exp $"; | | * "$Id: init.c,v 1.70 2005/12/05 23:34:04 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
weathermap_t **weathermap; | | weathermap_t **weathermap; |
| | |
void set_logfile(char *val) { settings.logfilename=val; } | | void set_logfile(char *val) { settings.logfilename=val; } |
void call_version() { version(NULL); exit(0); } | | void call_version(void) { version(NULL); exit(0); } |
void showscores() { display_high_score(NULL,9999,NULL); exit(0); } | | void showscores(void) { display_high_score(NULL,9999,NULL); exit(0); } |
void set_debug() { settings.debug=llevDebug; } | | void set_debug(void) { settings.debug=llevDebug; } |
void unset_debug() { settings.debug=llevInfo; } | | void unset_debug(void) { settings.debug=llevInfo; } |
void set_mondebug() { settings.debug=llevMonster; } | | void set_mondebug(void) { settings.debug=llevMonster; } |
void set_dumpmon1() {settings.dumpvalues=1; } | | void set_dumpmon1(void) {settings.dumpvalues=1; } |
void set_dumpmon2() {settings.dumpvalues=2; } | | void set_dumpmon2(void) {settings.dumpvalues=2; } |
void set_dumpmon3() {settings.dumpvalues=3; } | | void set_dumpmon3(void) {settings.dumpvalues=3; } |
void set_dumpmon4() {settings.dumpvalues=4; } | | void set_dumpmon4(void) {settings.dumpvalues=4; } |
void set_dumpmon5() {settings.dumpvalues=5; } | | void set_dumpmon5(void) {settings.dumpvalues=5; } |
void set_dumpmon6() {settings.dumpvalues=6; } | | void set_dumpmon6(void) {settings.dumpvalues=6; } |
void set_dumpmon7() {settings.dumpvalues=7; } | | void set_dumpmon7(void) {settings.dumpvalues=7; } |
void set_dumpmon8() {settings.dumpvalues=8; } | | void set_dumpmon8(void) {settings.dumpvalues=8; } |
void set_dumpmon9() {settings.dumpvalues=9; } | | void set_dumpmon9(void) {settings.dumpvalues=9; } |
void set_dumpmont(char *name) {settings.dumpvalues=10; settings.dumparg=name; } | | void set_dumpmont(char *name) {settings.dumpvalues=10; settings.dumparg=name; } |
void set_daemon() {settings.daemonmode=1; } | | void set_daemon(void) {settings.daemonmode=1; } |
void set_datadir(char *path) { settings.datadir=path; } | | void set_datadir(char *path) { settings.datadir=path; } |
void set_confdir(char *path) { settings.confdir=path; } | | void set_confdir(char *path) { settings.confdir=path; } |
void set_localdir(char *path) { settings.localdir=path; } | | void set_localdir(char *path) { settings.localdir=path; } |
| | |
| | |
materialtype_t *materialt; | | materialtype_t *materialt; |
| | |
static materialtype_t *get_empty_mat() { | | static materialtype_t *get_empty_mat(void) { |
materialtype_t *mt; | | materialtype_t *mt; |
int i; | | int i; |
| | |
| | |
return mt; | | return mt; |
} | | } |
| | |
static void load_materials() | | static void load_materials(void) |
{ | | { |
char buf[MAX_BUF], filename[MAX_BUF], *cp, *next; | | char buf[MAX_BUF], filename[MAX_BUF], *cp, *next; |
FILE *fp; | | FILE *fp; |
| | |
* be here or in the common directory - but since only the server needs this | | * be here or in the common directory - but since only the server needs this |
* information, having it here probably makes more sense. | | * information, having it here probably makes more sense. |
*/ | | */ |
static void load_settings() | | static void load_settings(void) |
{ | | { |
char buf[MAX_BUF],*cp; | | char buf[MAX_BUF],*cp; |
int has_val,comp; | | int has_val,comp; |
| | |
init_done=1; | | init_done=1; |
} | | } |
| | |
void usage() { | | void usage(void) { |
(void) fprintf(logfile, | | (void) fprintf(logfile, |
"Usage: crossfire [-h] [-<flags>]...\n"); | | "Usage: crossfire [-h] [-<flags>]...\n"); |
} | | } |
| | |
void help() { | | void help(void) { |
/* The information in usage is redundant with what is given below, so why call it? */ | | /* The information in usage is redundant with what is given below, so why call it? */ |
/* usage();*/ | | /* usage();*/ |
printf("Flags:\n"); | | printf("Flags:\n"); |
| | |
exit(0); | | exit(0); |
} | | } |
| | |
void init_beforeplay() { | | void init_beforeplay(void) { |
init_archetypes(); /* If not called before, reads all archetypes from file */ | | init_archetypes(); /* If not called before, reads all archetypes from file */ |
init_artifacts(); /* If not called before, reads all artifacts from file */ | | init_artifacts(); /* If not called before, reads all artifacts from file */ |
init_spells(); /* If not called before, links archtypes used by spells */ | | init_spells(); /* If not called before, links archtypes used by spells */ |
| | |
} | | } |
} | | } |
| | |
void init_startup() { | | void init_startup(void) { |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
FILE *fp; | | FILE *fp; |
int comp; | | int comp; |
| | |
* at compile time. | | * at compile time. |
*/ | | */ |
| | |
void compile_info() { | | void compile_info(void) { |
int i=0; | | int i=0; |
printf("Non-standard include files:\n"); | | printf("Non-standard include files:\n"); |
#if !defined (__STRICT_ANSI__) || defined (__sun__) | | #if !defined (__STRICT_ANSI__) || defined (__sun__) |
| | |
exit(0); | | exit(0); |
} | | } |
| | |
void init_signals() { | | void init_signals(void) { |
#ifndef WIN32 /* init_signals() remove signals */ | | #ifndef WIN32 /* init_signals() remove signals */ |
signal(SIGHUP,rec_sighup); | | signal(SIGHUP,rec_sighup); |
signal(SIGINT,rec_sigint); | | signal(SIGINT,rec_sigint); |
| | |
* putting together lists of creatures, etc that belong to gods. | | * putting together lists of creatures, etc that belong to gods. |
*/ | | */ |
| | |
void init_races () { | | void init_races (void) { |
FILE *file; | | FILE *file; |
char race[MAX_BUF], fname[MAX_BUF], buf[MAX_BUF], *cp, variable[MAX_BUF]; | | char race[MAX_BUF], fname[MAX_BUF], buf[MAX_BUF], *cp, variable[MAX_BUF]; |
archetype *mon=NULL; | | archetype *mon=NULL; |
| | |
LOG(llevDebug,"done.\n"); | | LOG(llevDebug,"done.\n"); |
} | | } |
| | |
void dump_races() | | void dump_races(void) |
{ | | { |
racelink *list; | | racelink *list; |
objectlink *tmp; | | objectlink *tmp; |