version 1.61 | | version 1.62 |
---|
| | |
| | |
/* | | /* |
* static char *rcs_treasure_c = | | * static char *rcs_treasure_c = |
* "$Id: treasure.c,v 1.61 2005/11/16 08:16:00 mwedel Exp $"; | | * "$Id: treasure.c,v 1.62 2005/12/05 23:34:03 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* Allocate and return the pointer to an empty treasurelist structure. | | * Allocate and return the pointer to an empty treasurelist structure. |
*/ | | */ |
| | |
static treasurelist *get_empty_treasurelist() { | | static treasurelist *get_empty_treasurelist(void) { |
treasurelist *tl = (treasurelist *) malloc(sizeof(treasurelist)); | | treasurelist *tl = (treasurelist *) malloc(sizeof(treasurelist)); |
if(tl==NULL) | | if(tl==NULL) |
fatal(OUT_OF_MEMORY); | | fatal(OUT_OF_MEMORY); |
| | |
* Allocate and return the pointer to an empty treasure structure. | | * Allocate and return the pointer to an empty treasure structure. |
*/ | | */ |
| | |
static treasure *get_empty_treasure() { | | static treasure *get_empty_treasure(void) { |
treasure *t = (treasure *) calloc(1,sizeof(treasure)); | | treasure *t = (treasure *) calloc(1,sizeof(treasure)); |
if(t==NULL) | | if(t==NULL) |
fatal(OUT_OF_MEMORY); | | fatal(OUT_OF_MEMORY); |
| | |
* Each treasure is parsed with the help of load_treasure(). | | * Each treasure is parsed with the help of load_treasure(). |
*/ | | */ |
| | |
void load_treasures() { | | void load_treasures(void) { |
FILE *fp; | | FILE *fp; |
char filename[MAX_BUF], buf[MAX_BUF], name[MAX_BUF]; | | char filename[MAX_BUF], buf[MAX_BUF], name[MAX_BUF]; |
treasurelist *previous=NULL; | | treasurelist *previous=NULL; |
| | |
* Allocate and return the pointer to an empty artifactlist structure. | | * Allocate and return the pointer to an empty artifactlist structure. |
*/ | | */ |
| | |
static artifactlist *get_empty_artifactlist() { | | static artifactlist *get_empty_artifactlist(void) { |
artifactlist *tl = (artifactlist *) malloc(sizeof(artifactlist)); | | artifactlist *tl = (artifactlist *) malloc(sizeof(artifactlist)); |
if(tl==NULL) | | if(tl==NULL) |
fatal(OUT_OF_MEMORY); | | fatal(OUT_OF_MEMORY); |
| | |
* Allocate and return the pointer to an empty artifact structure. | | * Allocate and return the pointer to an empty artifact structure. |
*/ | | */ |
| | |
static artifact *get_empty_artifact() { | | static artifact *get_empty_artifact(void) { |
artifact *t = (artifact *) malloc(sizeof(artifact)); | | artifact *t = (artifact *) malloc(sizeof(artifact)); |
if(t==NULL) | | if(t==NULL) |
fatal(OUT_OF_MEMORY); | | fatal(OUT_OF_MEMORY); |
| | |
* For debugging purposes. Dumps all tables. | | * For debugging purposes. Dumps all tables. |
*/ | | */ |
| | |
void dump_artifacts() { | | void dump_artifacts(void) { |
artifactlist *al; | | artifactlist *al; |
artifact *art; | | artifact *art; |
linked_char *next; | | linked_char *next; |
| | |
* Builds up the lists of artifacts from the file in the libdir. | | * Builds up the lists of artifacts from the file in the libdir. |
*/ | | */ |
| | |
void init_artifacts() { | | void init_artifacts(void) { |
static int has_been_inited=0; | | static int has_been_inited=0; |
FILE *fp; | | FILE *fp; |
char filename[MAX_BUF], buf[HUGE_BUF], *cp, *next; | | char filename[MAX_BUF], buf[HUGE_BUF], *cp, *next; |
| | |
} | | } |
} | | } |
| | |
void free_all_treasures() { | | void free_all_treasures(void) { |
treasurelist *tl, *next; | | treasurelist *tl, *next; |
| | |
| | |