* buildingcurse kompiliert wieder.

* shipcurse kompiliert wieder.
* enum-typedefs in ANSI-C sind scheisse.
* includes aufgeräumt
This commit is contained in:
Enno Rehling 2002-05-09 12:48:19 +00:00
parent 1154ff6c2d
commit 2fb5713a2d
12 changed files with 59 additions and 37 deletions

View File

@ -28,12 +28,13 @@
#include <stdlib.h> #include <stdlib.h>
static int static int
info_lmsstory(const void* vp, int i, curse * c, int i2) info_lmsstory(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unused(vp); unused(lang);
unused(i); unused(obj);
unused(typ);
unused(c); unused(c);
unused(i2); unused(self);
strcpy(buf, "Die Bauern der Region erzählen sich die Geschichte von den glorreichen Siegern des Last-Man-Standing Turniers."); strcpy(buf, "Die Bauern der Region erzählen sich die Geschichte von den glorreichen Siegern des Last-Man-Standing Turniers.");
return 1; return 1;
} }

View File

@ -215,7 +215,7 @@ typedef struct curse_type {
unsigned int mergeflags; unsigned int mergeflags;
const char *info_str; /* Wirkung des curse, wird bei einer gelungenen const char *info_str; /* Wirkung des curse, wird bei einer gelungenen
Zauberanalyse angezeigt */ Zauberanalyse angezeigt */
int (*curseinfo)(const struct locale*, const void*, int, curse*, int); int (*curseinfo)(const struct locale*, const void*, typ_t, curse*, int);
void (*change_vigour)(curse*, int); void (*change_vigour)(curse*, int);
int (*read)(FILE * F, curse * c); int (*read)(FILE * F, curse * c);
int (*write)(FILE * F, const curse * c); int (*write)(FILE * F, const curse * c);

View File

@ -40,6 +40,7 @@ typedef char direction_t;
typedef int race_t; typedef int race_t;
typedef int magic_t; typedef int magic_t;
typedef short skill_t; typedef short skill_t;
typedef short typ_t;
typedef int herb_t; typedef int herb_t;
typedef int potion_t; typedef int potion_t;
typedef int luxury_t; typedef int luxury_t;

View File

@ -23,7 +23,7 @@ typedef struct obj_ID {
int a, b; int a, b;
} obj_ID; } obj_ID;
typedef enum typ_t { enum {
TYP_UNIT, TYP_UNIT,
TYP_REGION, TYP_REGION,
TYP_BUILDING, TYP_BUILDING,
@ -32,7 +32,7 @@ typedef enum typ_t {
TYP_ACTION, TYP_ACTION,
TYP_TRIGGER, TYP_TRIGGER,
TYP_TIMEOUT TYP_TIMEOUT
} typ_t; };
extern obj_ID get_ID(void *obj, typ_t typ); extern obj_ID get_ID(void *obj, typ_t typ);
extern void write_ID(FILE *f, obj_ID id); extern void write_ID(FILE *f, obj_ID id);

View File

@ -16,14 +16,16 @@
#include "buildingcurse.h" #include "buildingcurse.h"
/* kernel includes */ /* kernel includes */
#include "message.h" #include <message.h>
#include "nrmessage.h" #include <nrmessage.h>
#include "objtypes.h" #include <objtypes.h>
#include "curse.h" #include <building.h>
#include <ship.h>
#include <curse.h>
/* util includes */ /* util includes */
#include <kernel/message.h> #include <base36.h>
#include <util/message.h> #include <functions.h>
/* libc includes */ /* libc includes */
#include <string.h> #include <string.h>
@ -31,7 +33,7 @@
#include <assert.h> #include <assert.h>
static int int
cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self) cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self)
{ {
message * msg; message * msg;
@ -77,3 +79,9 @@ cinfo_magicrunes(void * obj, typ_t typ, curse *c, int self)
return 0; return 0;
} }
void
register_buildingcurse(void)
{
register_function((pf_generic)cinfo_magicrunes, "curseinfo::magicrunes");
}

View File

@ -14,5 +14,10 @@
#ifndef _BCURSE_H #ifndef _BCURSE_H
#define _BCURSE_H #define _BCURSE_H
struct locale;
struct curse;
extern int cinfo_building(const struct locale * lang, void * obj, typ_t typ, struct curse *c, int self);
extern void register_buildingcurse(void);
#endif /* _BCURSE_H */ #endif /* _BCURSE_H */

View File

@ -32,7 +32,7 @@
#include <assert.h> #include <assert.h>
int int
cinfo_region(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
message * msg; message * msg;

View File

@ -16,7 +16,7 @@
struct curse; struct curse;
struct locale; struct locale;
extern int cinfo_region(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self); extern int cinfo_region(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);
extern void register_regioncurse(void); extern void register_regioncurse(void);

View File

@ -23,7 +23,7 @@
#include <curse.h> #include <curse.h>
/* util includes */ /* util includes */
#include <message.h> #include <functions.h>
#include <base36.h> #include <base36.h>
/* libc includes */ /* libc includes */
@ -32,8 +32,8 @@
#include <assert.h> #include <assert.h>
static int int
cinfo_ship(const locale * lang, void * obj, typ_t typ, curse *c, int self) cinfo_ship(const locale * lang, const void * obj, typ_t typ, curse *c, int self)
{ {
message * msg; message * msg;
@ -94,3 +94,9 @@ cinfo_disorientation(void * obj, typ_t typ, curse *c, int self)
return 1; return 1;
} }
void
register_shipcurse(void)
{
register_function((pf_generic)cinfo_disorientation, "curseinfo::disorientation");
register_function((pf_generic)cinfo_shipnodrift, "curseinfo::shipnodrift");
}

View File

@ -14,8 +14,9 @@
#ifndef _SCURSE_H #ifndef _SCURSE_H
#define _SCURSE_H #define _SCURSE_H
/* struct locale;
int cinfo_shipnodrift(const locale *, void *, typ_t, curse *, int); struct curse;
*/ extern int cinfo_ship(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);
extern void register_shipcurse(void);
#endif /* _SCURSE_H */ #endif /* _SCURSE_H */

View File

@ -37,7 +37,7 @@
int int
cinfo_unit(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
message * msg; message * msg;
@ -54,7 +54,7 @@ cinfo_unit(const struct locale * lang, const void * obj, enum typ_t typ, struct
} }
static int static int
cinfo_unit_onlyowner(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_unit_onlyowner(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
message * msg; message * msg;
struct unit *u; struct unit *u;
@ -78,7 +78,7 @@ cinfo_unit_onlyowner(const struct locale * lang, const void * obj, enum typ_t ty
/* C_AURA */ /* C_AURA */
/* erhöht/senkt regeneration und maxaura um effect% */ /* erhöht/senkt regeneration und maxaura um effect% */
static int static int
cinfo_auraboost(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_auraboost(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
struct unit *u; struct unit *u;
unused(typ); unused(typ);
@ -100,7 +100,7 @@ cinfo_auraboost(const struct locale * lang, const void * obj, enum typ_t typ, st
/* C_SLAVE */ /* C_SLAVE */
static int static int
cinfo_slave(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_slave(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit *u; unit *u;
unused(typ); unused(typ);
@ -118,7 +118,7 @@ cinfo_slave(const struct locale * lang, const void * obj, enum typ_t typ, struct
/* C_CALM */ /* C_CALM */
static int static int
cinfo_calm(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_calm(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit *u; unit *u;
const struct race * rc; const struct race * rc;
@ -145,7 +145,7 @@ cinfo_calm(const struct locale * lang, const void * obj, enum typ_t typ, struct
} }
/* C_SPEED */ /* C_SPEED */
static int static int
cinfo_speed(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_speed(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit *u; unit *u;
curse_unit * cu; curse_unit * cu;
@ -167,7 +167,7 @@ cinfo_speed(const struct locale * lang, const void * obj, enum typ_t typ, struct
} }
/* C_ORC */ /* C_ORC */
static int static int
cinfo_orc(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_orc(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit *u; unit *u;
message * msg; message * msg;
@ -187,7 +187,7 @@ cinfo_orc(const struct locale * lang, const void * obj, enum typ_t typ, struct c
/* C_KAELTESCHUTZ */ /* C_KAELTESCHUTZ */
static int static int
cinfo_kaelteschutz(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_kaelteschutz(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit *u; unit *u;
curse_unit * cu; curse_unit * cu;
@ -209,7 +209,7 @@ cinfo_kaelteschutz(const struct locale * lang, const void * obj, enum typ_t typ,
/* C_SPARKLE */ /* C_SPARKLE */
static int static int
cinfo_sparkle(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_sparkle(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
const char * effects[] = { const char * effects[] = {
NULL, /* end grau*/ NULL, /* end grau*/
@ -264,7 +264,7 @@ cinfo_sparkle(const struct locale * lang, const void * obj, enum typ_t typ, stru
/* C_STRENGTH */ /* C_STRENGTH */
static int static int
cinfo_strength(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_strength(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unused(c); unused(c);
unused(typ); unused(typ);
@ -281,7 +281,7 @@ cinfo_strength(const struct locale * lang, const void * obj, enum typ_t typ, str
} }
/* C_ALLSKILLS */ /* C_ALLSKILLS */
static int static int
cinfo_allskills(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_allskills(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unused(obj); unused(obj);
unused(typ); unused(typ);
@ -297,7 +297,7 @@ cinfo_allskills(const struct locale * lang, const void * obj, enum typ_t typ, st
} }
/* C_SKILL */ /* C_SKILL */
static int static int
cinfo_skill(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_skill(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit *u = (unit *)obj; unit *u = (unit *)obj;
int sk = (int)c->data; int sk = (int)c->data;
@ -313,7 +313,7 @@ cinfo_skill(const struct locale * lang, const void * obj, enum typ_t typ, struct
} }
/* C_ITEMCLOAK */ /* C_ITEMCLOAK */
static int static int
cinfo_itemcloak(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_itemcloak(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit *u; unit *u;
unused(typ); unused(typ);
@ -330,7 +330,7 @@ cinfo_itemcloak(const struct locale * lang, const void * obj, enum typ_t typ, st
} }
static int static int
cinfo_fumble(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self) cinfo_fumble(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self)
{ {
unit * u = (unit*)obj; unit * u = (unit*)obj;
unused(typ); unused(typ);

View File

@ -35,7 +35,7 @@ int cinfo_fumble(void *, enum typ_t, struct curse *, int);
*/ */
struct curse; struct curse;
struct locale; struct locale;
extern int cinfo_unit(const struct locale * lang, const void * obj, enum typ_t typ, struct curse *c, int self); extern int cinfo_unit(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self);
extern void register_unitcurse(void); extern void register_unitcurse(void);
#endif /* _UCURSE_H */ #endif /* _UCURSE_H */