2001-01-25 10:37:55 +01:00
|
|
|
|
/* vi: set ts=2:
|
|
|
|
|
*
|
2001-04-14 13:39:14 +02:00
|
|
|
|
*
|
2003-07-29 11:48:03 +02:00
|
|
|
|
* Eressea PB(E)M host Copyright (C) 1998-2003
|
2001-01-25 10:37:55 +01:00
|
|
|
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
|
|
|
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
|
|
|
|
* Henning Peters (faroul@beyond.kn-bremen.de)
|
|
|
|
|
* Enno Rehling (enno@eressea-pbem.de)
|
|
|
|
|
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
|
|
|
|
*
|
|
|
|
|
* based on:
|
|
|
|
|
*
|
|
|
|
|
* Atlantis v1.0 13 September 1993 Copyright 1993 by Russell Wallace
|
|
|
|
|
* Atlantis v1.7 Copyright 1996 by Alex Schr<EFBFBD>der
|
|
|
|
|
*
|
|
|
|
|
* This program may not be used, modified or distributed without
|
|
|
|
|
* prior permission by the authors of Eressea.
|
|
|
|
|
* This program may not be sold or used commercially without prior written
|
|
|
|
|
* permission from the authors.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* reading and writing the data files, reading the orders */
|
|
|
|
|
|
2003-07-29 11:48:03 +02:00
|
|
|
|
#ifndef H_KRNL_SAVE
|
|
|
|
|
#define H_KRNL_SAVE
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
double version(void);
|
|
|
|
|
|
|
|
|
|
#define MAX_INPUT_SIZE DISPLAYSIZE*2
|
|
|
|
|
/* Nach MAX_INPUT_SIZE brechen wir das Einlesen der Zeile ab und nehmen an,
|
|
|
|
|
* dass hier ein Fehler (fehlende ") vorliegt */
|
|
|
|
|
|
|
|
|
|
FILE * cfopen(const char *filename, const char *mode);
|
|
|
|
|
int readorders(const char *);
|
|
|
|
|
int creategame(void);
|
2003-12-17 11:28:23 +01:00
|
|
|
|
extern int readgame(const char * filename, int backup);
|
2003-12-14 20:17:59 +01:00
|
|
|
|
void writegame(const char *filename, char quiet);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
extern void rsf(FILE * F, char *s, size_t len);
|
|
|
|
|
|
2001-04-16 16:34:19 +02:00
|
|
|
|
extern boolean is_persistent(const char *s, const struct locale * lang);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* Versions<6E>nderungen: */
|
|
|
|
|
#define HEX_VERSION 81
|
|
|
|
|
extern int data_version;
|
|
|
|
|
extern int minfaction;
|
|
|
|
|
extern int maxregions;
|
|
|
|
|
extern int firstx, firsty;
|
|
|
|
|
extern int quiet;
|
|
|
|
|
|
|
|
|
|
extern void init_locales(void);
|
2001-12-10 01:13:39 +01:00
|
|
|
|
extern int init_data(const char * xmlfile);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern int lastturn(void);
|
|
|
|
|
|
|
|
|
|
extern void read_items(FILE *f, struct item **it);
|
|
|
|
|
extern void write_items(FILE *f, struct item *it);
|
|
|
|
|
extern void a_read(FILE * f, struct attrib ** attribs);
|
|
|
|
|
extern void a_write(FILE * f, const struct attrib * attribs);
|
|
|
|
|
|
|
|
|
|
extern void write_faction_reference(const struct faction * f, FILE * F);
|
|
|
|
|
extern int read_faction_reference(struct faction ** f, FILE * F);
|
|
|
|
|
|
|
|
|
|
extern const char * datapath(void);
|
|
|
|
|
|
2001-12-15 13:26:04 +01:00
|
|
|
|
#if RESOURCE_CONVERSION
|
2001-12-10 01:13:39 +01:00
|
|
|
|
extern struct attrib_type at_resources;
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-03-03 16:16:28 +01:00
|
|
|
|
extern void writeunit(FILE * stream, const struct unit * u);
|
|
|
|
|
extern struct unit * readunit(FILE * stream);
|
|
|
|
|
|
|
|
|
|
extern void writeregion(FILE * stream, const struct region * r);
|
|
|
|
|
extern struct region * readregion(FILE * stream, int x, int y);
|
|
|
|
|
|
|
|
|
|
extern void writefaction(FILE * stream, const struct faction * f);
|
|
|
|
|
extern struct faction * readfaction(FILE * stream);
|
2002-03-10 13:04:12 +01:00
|
|
|
|
extern char * getbuf(FILE * F);
|
2002-03-03 16:16:28 +01:00
|
|
|
|
|
2003-07-29 11:48:03 +02:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#endif
|