Break inclusion cycle: prototypes.h and commands.h included each

other.  Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special).  New header types.h to
help avoid inclusion cycles.  Sort include directives.  Remove some
superflous includes.
This commit is contained in:
Markus Armbruster 2006-07-10 06:37:23 +00:00
parent 16a0869bb0
commit e42053d928
373 changed files with 1193 additions and 2516 deletions

View file

@ -33,12 +33,7 @@
#include <config.h>
#include "misc.h"
#include "nat.h"
#include "file.h"
#include "update.h"
#include "gen.h"
#include "optlist.h"
void
age_levels(int etu)

View file

@ -36,17 +36,10 @@
#include <config.h>
#include "misc.h"
#include "tel.h"
#include <fcntl.h>
#include <stdio.h>
#include <time.h>
#if !defined(_WIN32)
#include <unistd.h>
#endif
#include "tel.h"
#include "update.h"
#include "optlist.h"
#include "common.h"
static int copy_and_expire(FILE *annfp, FILE *tmpfp,
char *tmp_filename, time_t expiry_time);

View file

@ -33,13 +33,8 @@
#include <config.h>
#include "misc.h"
#include "nat.h"
#include "sect.h"
#include "budg.h"
#include "update.h"
#include "common.h"
#include "optlist.h"
static int bud_key[I_MAX + 2] =
{ 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 7 };

View file

@ -33,16 +33,10 @@
#include <config.h>
#include "misc.h"
#include "plague.h"
#include "sect.h"
#include "item.h"
#include "path.h"
#include "file.h"
#include "xy.h"
#include "plague.h"
#include "update.h"
#include "subs.h"
#include "common.h"
#define DELIVER_BONUS 4.0

View file

@ -34,20 +34,12 @@
#include <config.h>
#include <stdlib.h>
#include "misc.h"
#include "plague.h"
#include "nat.h"
#include "sect.h"
#include "item.h"
#include "xy.h"
#include "path.h"
#include "file.h"
#include "distribute.h"
#include "update.h"
#include "subs.h"
#include "common.h"
#include "item.h"
#include "path.h"
#include "plague.h"
#include "prototypes.h"
#include "update.h"
#define EXPORT_BONUS 10.0
#define IMPORT_BONUS 10.0

View file

@ -35,16 +35,10 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "nat.h"
#include "file.h"
#include "xy.h"
#include "path.h"
#include "distribute.h"
#include "path.h"
#include "update.h"
#include "common.h"
#include "optlist.h"
#include <stdlib.h>
/* Used for building up distribution info */
struct distinfo {

View file

@ -35,20 +35,13 @@
#include <config.h>
#include <math.h>
#include "misc.h"
#include "sect.h"
#include "nat.h"
#include "budg.h"
#include "item.h"
#include "news.h"
#include "xy.h"
#include "optlist.h"
#include "budg.h"
#include "player.h"
#include "update.h"
#include "common.h"
#include "gen.h"
#include "subs.h"
#include "xy.h"
#include <math.h>
static int growfood(struct sctstr *, short *, int, int);
static int starve_some(short *, i_type, int);

View file

@ -36,24 +36,15 @@
#include <config.h>
#include <math.h>
#include "misc.h"
#include "plague.h"
#include "sect.h"
#include "nat.h"
#include "land.h"
#include "ship.h"
#include "news.h"
#include "file.h"
#include "optlist.h"
#include "budg.h"
#include "player.h"
#include "update.h"
#include "land.h"
#include "lost.h"
#include "common.h"
#include "subs.h"
#include "common.h"
#include "gen.h"
#include "news.h"
#include "plague.h"
#include "player.h"
#include "ship.h"
#include "update.h"
#include <math.h>
static void landrepair(struct lndstr *, struct natstr *, int *, int);
static void upd_land(struct lndstr *, int, struct natstr *, int *, int);

View file

@ -35,23 +35,12 @@
#include <config.h>
#include "misc.h"
#include "nat.h"
#include "file.h"
#include "sect.h"
#include "player.h"
#include "empthread.h"
#include "budg.h"
#include "player.h"
#include "update.h"
#include "common.h"
#include "optlist.h"
#include "empthread.h"
#include "journal.h"
#include "player.h"
#include "server.h"
#include <stdlib.h>
#if !defined(_WIN32)
#include <sys/time.h>
#endif
#include "update.h"
long money[MAXNOC];
long pops[MAXNOC];

View file

@ -33,13 +33,9 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "budg.h"
#include "player.h"
#include "update.h"
#include "common.h"
#include "subs.h"
void
get_materials(struct sctstr *sp, int *bp, int *mvec, int check)

View file

@ -34,19 +34,11 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "ship.h"
#include "land.h"
#include "plane.h"
#include "nat.h"
#include "file.h"
#include "optlist.h"
#include "update.h"
#include "gen.h"
#include "subs.h"
#include "optlist.h"
#include "server.h"
#include "ship.h"
#include "update.h"
int updating_mob = 1;

View file

@ -34,17 +34,10 @@
#include <config.h>
#include <math.h>
#include "misc.h"
#include "plane.h"
#include "sect.h"
#include "xy.h"
#include "nsc.h"
#include "nat.h"
#include "path.h"
#include "file.h"
#include "plane.h"
#include "update.h"
#include "subs.h"
#include "optlist.h"
#ifndef PI
#define PI 3.14159265358979323846

View file

@ -35,16 +35,9 @@
#include <config.h>
#include <math.h>
#include "misc.h"
#include "sect.h"
#include "nat.h"
#include "item.h"
#include "file.h"
#include "xy.h"
#include "optlist.h"
#include "update.h"
#include "subs.h"
#include "budg.h"
#include "item.h"
#include "update.h"
/*
* hap and edu avg mean that the weight on current happiness is

View file

@ -34,23 +34,13 @@
#include <config.h>
#include "misc.h"
#include <ctype.h>
#include "ship.h"
#include "sect.h"
#include "xy.h"
#include "nsc.h"
#include "nat.h"
#include "path.h"
#include "file.h"
#include "item.h"
#include "optlist.h"
#include "player.h"
#include "nsc.h"
#include "path.h"
#include "ship.h"
#include "update.h"
#include "subs.h"
#include "common.h"
#include <stdlib.h>
static void swap(struct shpstr *);

View file

@ -33,26 +33,15 @@
#include <config.h>
#include "misc.h"
#include <ctype.h>
#include "plague.h"
#include "ship.h"
#include "plane.h"
#include "land.h"
#include "sect.h"
#include "xy.h"
#include "nsc.h"
#include "nat.h"
#include "path.h"
#include "file.h"
#include "item.h"
#include "optlist.h"
#include "player.h"
#include "land.h"
#include "nsc.h"
#include "path.h"
#include "plague.h"
#include "plane.h"
#include "ship.h"
#include "update.h"
#include "subs.h"
#include "common.h"
#include "gen.h"
/* load a specific ship given its
* location and what field to modify.

View file

@ -33,16 +33,11 @@
#include <config.h>
#include "misc.h"
#include "xy.h"
#include "ship.h"
#include "empobj.h"
#include "land.h"
#include "nsc.h"
#include "file.h"
#include "player.h"
#include "ship.h"
#include "update.h"
#include "gen.h"
#include "common.h"
void *
nxtitemp(struct nstr_item *np)

View file

@ -33,20 +33,11 @@
#include <config.h>
#include "misc.h"
#include "plague.h"
#include "sect.h"
#include "nat.h"
#include "item.h"
#include "news.h"
#include "file.h"
#include "xy.h"
#include "optlist.h"
#include "update.h"
#include "common.h"
#include "subs.h"
#include "lost.h"
#include "gen.h"
#include "news.h"
#include "plague.h"
#include "update.h"
static int infect_people(struct natstr *, struct sctstr *);

View file

@ -35,20 +35,12 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "plane.h"
#include "ship.h"
#include "nat.h"
#include "file.h"
#include "optlist.h"
#include "budg.h"
#include "player.h"
#include "update.h"
#include "lost.h"
#include "subs.h"
#include "common.h"
#include "gen.h"
#include "plane.h"
#include "player.h"
#include "ship.h"
#include "update.h"
static void planerepair(struct plnstr *, struct natstr *, int *, int);
static void upd_plane(struct plnstr *, int, struct natstr *, int *, int);

View file

@ -33,18 +33,10 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "nat.h"
#include "file.h"
#include "path.h"
#include "xy.h"
#include "land.h"
#include "update.h"
#include "subs.h"
#include "gen.h"
#include "common.h"
#include "lost.h"
#include "path.h"
#include "update.h"
void
populace(struct natstr *np, struct sctstr *sp, int etu)

View file

@ -35,21 +35,13 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "nat.h"
#include "item.h"
#include "file.h"
#include "xy.h"
#include "path.h"
#include "optlist.h"
#include "budg.h"
#include "item.h"
#include "land.h"
#include "path.h"
#include "player.h"
#include "ship.h"
#include "land.h"
#include "update.h"
#include "gen.h"
#include "common.h"
void
prepare_sects(int etu, int *bp)

View file

@ -33,18 +33,10 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "product.h"
#include "nat.h"
#include "xy.h"
#include "player.h"
#include "update.h"
#include "gen.h"
#include "subs.h"
#include "common.h"
#include "optlist.h"
#include "budg.h"
#include "player.h"
#include "product.h"
#include "update.h"
static void materials_charge(struct pchrstr *, short *, int);
static int materials_cost(struct pchrstr *, short *, int *);

View file

@ -33,9 +33,6 @@
#include <config.h>
#include "misc.h"
#include "nat.h"
#include "file.h"
#include "update.h"
int

View file

@ -34,21 +34,13 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "nat.h"
#include "news.h"
#include "file.h"
#include "path.h"
#include "xy.h"
#include "land.h"
#include "lost.h"
#include "news.h"
#include "nsc.h"
#include "path.h"
#include "plane.h"
#include "update.h"
#include "common.h"
#include "gen.h"
#include "lost.h"
#include "subs.h"
static void take_casualties(struct sctstr *, int);

View file

@ -36,19 +36,11 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include <math.h>
#include "nsc.h"
#include "path.h"
#include "ship.h"
#include "file.h"
#include "nat.h"
#include "xy.h"
#include "nsc.h"
#include "update.h"
#include "subs.h"
#include "common.h"
#include <math.h>
#include <stdlib.h>
static void fltp_to_list(struct fltheadstr *, struct emp_qelem *);

View file

@ -34,24 +34,15 @@
#include <config.h>
#include "misc.h"
#include "sect.h"
#include "nat.h"
#include "item.h"
#include "file.h"
#include "xy.h"
#include "path.h"
#include "product.h"
#include "optlist.h"
#include "budg.h"
#include "player.h"
#include "item.h"
#include "land.h"
#include "lost.h"
#include "path.h"
#include "player.h"
#include "product.h"
#include "ship.h"
#include "update.h"
#include "subs.h"
#include "common.h"
#include "lost.h"
#include "gen.h"
/*
* Increase sector efficiency if old type == new type.

View file

@ -37,25 +37,15 @@
#include <config.h>
#include <math.h>
#include "misc.h"
#include "plague.h"
#include "sect.h"
#include "nat.h"
#include "ship.h"
#include "news.h"
#include "file.h"
#include "product.h"
#include "land.h"
#include "xy.h"
#include "nsc.h"
#include "optlist.h"
#include "player.h"
#include "update.h"
#include "common.h"
#include "subs.h"
#include "gen.h"
#include "lost.h"
#include "budg.h"
#include "land.h"
#include "lost.h"
#include "news.h"
#include "plague.h"
#include "player.h"
#include "product.h"
#include "ship.h"
#include "update.h"
static void shiprepair(struct shpstr *, struct natstr *, int *, int);
static void upd_ship(struct shpstr *, int, struct natstr *, int *, int);