From 893093f99941fd62377a2c06615d1a9e35255af9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sat, 18 Jun 2016 13:55:44 +0200 Subject: [PATCH] include: Move update stuff from prototypes.h to update.h Signed-off-by: Markus Armbruster --- include/prototypes.h | 69 ------------------------------- include/update.h | 79 ++++++++++++++++++++++++++++++++++-- src/lib/commands/newe.c | 1 + src/lib/commands/prod.c | 1 + src/lib/commands/strv.c | 1 + src/lib/commands/work.c | 1 + src/lib/subs/land.c | 1 + src/lib/subs/plane.c | 1 + src/lib/subs/sect.c | 1 + src/lib/subs/ship.c | 1 + src/lib/subs/supply.c | 1 + src/lib/update/age.c | 2 +- src/lib/update/anno.c | 1 + src/lib/update/deliver.c | 1 + src/lib/update/distribute.c | 1 + src/lib/update/finish.c | 1 + src/lib/update/human.c | 1 + src/lib/update/material.c | 2 +- src/lib/update/mobility.c | 2 +- src/lib/update/move_sat.c | 1 + src/lib/update/plague.c | 1 + src/lib/update/populace.c | 1 + src/lib/update/removewants.c | 2 +- src/lib/update/revolt.c | 1 + 24 files changed, 97 insertions(+), 77 deletions(-) diff --git a/include/prototypes.h b/include/prototypes.h index 8359a610..79b96ce6 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -642,76 +642,7 @@ extern int wu(natid, natid, char *, ...) ATTRIBUTE((format (printf, 3, 4))); /* * src/lib/update/ *.c */ -/* age.c */ -extern int age_people(int, int); -extern void age_levels(int); -/* anno.c */ -extern void delete_old_announcements(void); -/* bp.c */ /* in update.h */ -/* deliver.c */ -extern void dodeliver(struct sctstr *); -/* distribute.c */ -extern int dodistribute(struct sctstr *, int, double); -/* finish.c */ -extern void finish_sects(int); -/* human.c */ -extern void do_feed(struct sctstr *, struct natstr *, int, int); -extern int feed_people(short *, int); -extern double food_needed(short *, int); -extern int famine_victims(short *, int); -/* land.c */ -extern int prod_land(int, int, struct bp *, int); -/* main.c */ -/* in server.h */ -/* material.c */ -extern int get_materials(struct sctstr *, short[], int); -/* mobility.c */ -extern void mob_sect(void); -extern void mob_ship(void); -extern void mob_land(void); -extern void mob_plane(void); -extern void sct_do_upd_mob(struct sctstr *sp); -extern void shp_do_upd_mob(struct shpstr *sp); -extern void lnd_do_upd_mob(struct lndstr *lp); -extern void pln_do_upd_mob(struct plnstr *pp); -/* move_sat.c */ -extern void move_sat(struct plnstr *); -/* nat.c */ -extern void prod_nat(int); -/* nxtitemp.c */ -/* in nsc.h */ -/* plague.c */ -extern void do_plague(struct sctstr *, int); -extern int plague_people(struct natstr *, short *, int *, int *, int); -/* plane.c */ -extern int prod_plane(int, int, struct bp *, int); -/* populace.c */ -extern void populace(struct sctstr *, int); -extern int total_work(int, int, int, int, int, int); -/* prepare.c */ -extern void tax(struct sctstr *, int, int *, int *, int *, int *); -extern int upd_slmilcosts(natid, int); -extern void prepare_sects(int); -extern int bank_income(struct sctstr *, int); -/* produce.c */ -extern int produce(struct natstr *, struct sctstr *, int *); -extern int prod_materials_cost(struct pchrstr *, short[], int *); -extern int prod_resource_limit(struct pchrstr *, unsigned char *); -extern double prod_eff(int, float); -/* removewants.c */ -extern int update_removewants(void); -/* revolt.c */ -extern void revolt(struct sctstr *); -extern void guerrilla(struct sctstr *); -/* sect.c */ -extern double buildeff(struct sctstr *); -extern void do_fallout(struct sctstr *, int); -extern void spread_fallout(struct sctstr *, int); -extern void decay_fallout(struct sctstr *, int); -extern void produce_sect(struct natstr *, int, struct bp *, int[][2]); -/* ship.c */ -extern int prod_ship(int, int, struct bp *, int); /* * src/server diff --git a/include/update.h b/include/update.h index 41eab377..97982430 100644 --- a/include/update.h +++ b/include/update.h @@ -40,16 +40,87 @@ #define SCT_MAINT (SCT_TYPE_MAX + 2) #define SCT_BUDG_MAX SCT_MAINT -struct bp *bp_alloc(void); -void bp_set_from_sect(struct bp *, struct sctstr *); -void bp_to_sect(struct bp *, struct sctstr *); - +/* main.c */ extern int money[MAXNOC]; extern int pops[MAXNOC]; extern int sea_money[MAXNOC]; extern int lnd_money[MAXNOC]; extern int air_money[MAXNOC]; extern int tpops[MAXNOC]; +/* nat.c */ extern float levels[MAXNOC][4]; +/* age.c */ +extern int age_people(int, int); +extern void age_levels(int); +/* anno.c */ +extern void delete_old_announcements(void); +/* bp.c */ +extern struct bp *bp_alloc(void); +extern void bp_set_from_sect(struct bp *, struct sctstr *); +extern void bp_to_sect(struct bp *, struct sctstr *); +/* deliver.c */ +extern void dodeliver(struct sctstr *); +/* distribute.c */ +extern int dodistribute(struct sctstr *, int, double); +/* finish.c */ +extern void finish_sects(int); +/* human.c */ +extern void do_feed(struct sctstr *, struct natstr *, int, int); +extern int feed_people(short *, int); +extern double food_needed(short *, int); +extern int famine_victims(short *, int); +/* land.c */ +extern int prod_land(int, int, struct bp *, int); +/* main.c */ +/* in server.h */ +/* material.c */ +extern int get_materials(struct sctstr *, short[], int); +/* mobility.c */ +extern void mob_sect(void); +extern void mob_ship(void); +extern void mob_land(void); +extern void mob_plane(void); +extern void sct_do_upd_mob(struct sctstr *sp); +extern void shp_do_upd_mob(struct shpstr *sp); +extern void lnd_do_upd_mob(struct lndstr *lp); +extern void pln_do_upd_mob(struct plnstr *pp); +/* move_sat.c */ +extern void move_sat(struct plnstr *); +/* nat.c */ +extern void prod_nat(int); +/* nxtitemp.c */ +/* in nsc.h */ +/* plague.c */ +extern void do_plague(struct sctstr *, int); +extern int plague_people(struct natstr *, short *, int *, int *, int); +/* plane.c */ +extern int prod_plane(int, int, struct bp *, int); +/* populace.c */ +extern void populace(struct sctstr *, int); +extern int total_work(int, int, int, int, int, int); +/* prepare.c */ +extern void tax(struct sctstr *, int, int *, int *, int *, int *); +extern int upd_slmilcosts(natid, int); +extern void prepare_sects(int); +extern int bank_income(struct sctstr *, int); +/* produce.c */ +extern int produce(struct natstr *, struct sctstr *, int *); +extern int prod_materials_cost(struct pchrstr *, short[], int *); +extern int prod_resource_limit(struct pchrstr *, unsigned char *); +extern double prod_eff(int, float); +/* removewants.c */ +extern int update_removewants(void); +/* revolt.c */ +extern void revolt(struct sctstr *); +extern void guerrilla(struct sctstr *); +/* sect.c */ +extern double buildeff(struct sctstr *); +extern void do_fallout(struct sctstr *, int); +extern void spread_fallout(struct sctstr *, int); +extern void decay_fallout(struct sctstr *, int); +extern void produce_sect(struct natstr *, int, struct bp *, int[][2]); +/* ship.c */ +extern int prod_ship(int, int, struct bp *, int); + #endif diff --git a/src/lib/commands/newe.c b/src/lib/commands/newe.c index 08d8b22c..af697d82 100644 --- a/src/lib/commands/newe.c +++ b/src/lib/commands/newe.c @@ -36,6 +36,7 @@ #include "commands.h" #include "item.h" #include "optlist.h" +#include "update.h" int newe(void) diff --git a/src/lib/commands/prod.c b/src/lib/commands/prod.c index 21ab4e0d..2fc5fa97 100644 --- a/src/lib/commands/prod.c +++ b/src/lib/commands/prod.c @@ -38,6 +38,7 @@ #include "item.h" #include "optlist.h" #include "product.h" +#include "update.h" static void prprod(struct sctstr *, double, double, char, double, double, double, char[], int[], int[], int); diff --git a/src/lib/commands/strv.c b/src/lib/commands/strv.c index be0388b4..b633ff49 100644 --- a/src/lib/commands/strv.c +++ b/src/lib/commands/strv.c @@ -38,6 +38,7 @@ #include "land.h" #include "optlist.h" #include "ship.h" +#include "update.h" static void starv_sects(char *range); static void starv_ships(char *range); diff --git a/src/lib/commands/work.c b/src/lib/commands/work.c index 66fd4521..77613289 100644 --- a/src/lib/commands/work.c +++ b/src/lib/commands/work.c @@ -36,6 +36,7 @@ #include "commands.h" #include "land.h" #include "optlist.h" +#include "update.h" int work(void) diff --git a/src/lib/subs/land.c b/src/lib/subs/land.c index fccf0ff1..10278627 100644 --- a/src/lib/subs/land.c +++ b/src/lib/subs/land.c @@ -41,6 +41,7 @@ #include "player.h" #include "prototypes.h" #include "unit.h" +#include "update.h" void lnd_postread(int n, void *ptr) diff --git a/src/lib/subs/plane.c b/src/lib/subs/plane.c index a90c0773..a39560a2 100644 --- a/src/lib/subs/plane.c +++ b/src/lib/subs/plane.c @@ -42,6 +42,7 @@ #include "player.h" #include "prototypes.h" #include "unit.h" +#include "update.h" void pln_postread(int n, void *ptr) diff --git a/src/lib/subs/sect.c b/src/lib/subs/sect.c index a0069733..55e6c9e3 100644 --- a/src/lib/subs/sect.c +++ b/src/lib/subs/sect.c @@ -43,6 +43,7 @@ #include "player.h" #include "prototypes.h" #include "sect.h" +#include "update.h" #include "xy.h" void diff --git a/src/lib/subs/ship.c b/src/lib/subs/ship.c index 2a4d4bcd..f3f6a04d 100644 --- a/src/lib/subs/ship.c +++ b/src/lib/subs/ship.c @@ -42,6 +42,7 @@ #include "prototypes.h" #include "ship.h" #include "unit.h" +#include "update.h" void shp_postread(int n, void *ptr) diff --git a/src/lib/subs/supply.c b/src/lib/subs/supply.c index 2e55f26c..0874fee8 100644 --- a/src/lib/subs/supply.c +++ b/src/lib/subs/supply.c @@ -43,6 +43,7 @@ #include "prototypes.h" #include "sect.h" #include "ship.h" +#include "update.h" static int s_commod(struct empobj *, short *, i_type, int, int, int); static int get_minimum(struct lndstr *, i_type); diff --git a/src/lib/update/age.c b/src/lib/update/age.c index aa7e29f2..78da8c5b 100644 --- a/src/lib/update/age.c +++ b/src/lib/update/age.c @@ -36,7 +36,7 @@ #include "file.h" #include "nat.h" #include "optlist.h" -#include "prototypes.h" +#include "update.h" int age_people(int n, int etu) diff --git a/src/lib/update/anno.c b/src/lib/update/anno.c index 6c3cfb5e..4b15e71e 100644 --- a/src/lib/update/anno.c +++ b/src/lib/update/anno.c @@ -44,6 +44,7 @@ #include "optlist.h" #include "prototypes.h" #include "tel.h" +#include "update.h" static int copy_and_expire(FILE *, FILE *, char *, time_t); static int copy_sink(char *, size_t, void *); diff --git a/src/lib/update/deliver.c b/src/lib/update/deliver.c index ecb06508..f2f8e31f 100644 --- a/src/lib/update/deliver.c +++ b/src/lib/update/deliver.c @@ -39,6 +39,7 @@ #include "plague.h" #include "sect.h" #include "prototypes.h" +#include "update.h" #define DELIVER_BONUS 4.0 diff --git a/src/lib/update/distribute.c b/src/lib/update/distribute.c index 803dcf7b..4d659a6c 100644 --- a/src/lib/update/distribute.c +++ b/src/lib/update/distribute.c @@ -42,6 +42,7 @@ #include "plague.h" #include "prototypes.h" #include "sect.h" +#include "update.h" #ifdef DISTRIBUTE_DEBUG #define DPRINTF(fmt, ...) ((void)printf(fmt , ## __VA_ARGS__)) diff --git a/src/lib/update/finish.c b/src/lib/update/finish.c index a0bc18aa..668a261e 100644 --- a/src/lib/update/finish.c +++ b/src/lib/update/finish.c @@ -44,6 +44,7 @@ #include "path.h" #include "sect.h" #include "prototypes.h" +#include "update.h" static void assemble_dist_paths(double *); diff --git a/src/lib/update/human.c b/src/lib/update/human.c index 07b30a79..f5469e01 100644 --- a/src/lib/update/human.c +++ b/src/lib/update/human.c @@ -43,6 +43,7 @@ #include "player.h" #include "prototypes.h" #include "sect.h" +#include "update.h" #include "xy.h" static int new_work(struct sctstr *, int); diff --git a/src/lib/update/material.c b/src/lib/update/material.c index 5860a7e0..e6f6c555 100644 --- a/src/lib/update/material.c +++ b/src/lib/update/material.c @@ -35,7 +35,7 @@ #include "chance.h" #include "sect.h" -#include "prototypes.h" +#include "update.h" /* * Get build materials from sector @sp. diff --git a/src/lib/update/mobility.c b/src/lib/update/mobility.c index 5b764187..3d7829b0 100644 --- a/src/lib/update/mobility.c +++ b/src/lib/update/mobility.c @@ -39,10 +39,10 @@ #include "land.h" #include "optlist.h" #include "plane.h" -#include "prototypes.h" #include "sect.h" #include "server.h" #include "ship.h" +#include "update.h" static int do_upd_checking; diff --git a/src/lib/update/move_sat.c b/src/lib/update/move_sat.c index 95690a06..10878e21 100644 --- a/src/lib/update/move_sat.c +++ b/src/lib/update/move_sat.c @@ -40,6 +40,7 @@ #include "plane.h" #include "prototypes.h" #include "sect.h" +#include "update.h" #ifndef PI #define PI 3.14159265358979323846 diff --git a/src/lib/update/plague.c b/src/lib/update/plague.c index fcb79a44..306ee6a3 100644 --- a/src/lib/update/plague.c +++ b/src/lib/update/plague.c @@ -43,6 +43,7 @@ #include "plague.h" #include "prototypes.h" #include "sect.h" +#include "update.h" static int infect_people(struct natstr *, struct sctstr *); diff --git a/src/lib/update/populace.c b/src/lib/update/populace.c index 89f95046..a593151d 100644 --- a/src/lib/update/populace.c +++ b/src/lib/update/populace.c @@ -40,6 +40,7 @@ #include "prototypes.h" #include "nat.h" #include "sect.h" +#include "update.h" void populace(struct sctstr *sp, int etu) diff --git a/src/lib/update/removewants.c b/src/lib/update/removewants.c index eb04bf47..fd557cc6 100644 --- a/src/lib/update/removewants.c +++ b/src/lib/update/removewants.c @@ -34,7 +34,7 @@ #include "file.h" #include "nat.h" -#include "prototypes.h" +#include "update.h" int update_removewants(void) diff --git a/src/lib/update/revolt.c b/src/lib/update/revolt.c index bedfc96e..94b2dfcd 100644 --- a/src/lib/update/revolt.c +++ b/src/lib/update/revolt.c @@ -46,6 +46,7 @@ #include "plane.h" #include "prototypes.h" #include "sect.h" +#include "update.h" static void take_casualties(struct sctstr *, int); static void lnd_dies_fighting_che(struct lndstr *);