(at_minimum, blocksig, emp_bitinit, filelogerror, iceil, ifloor,

mapdsq, mask, signame, strscan, sys_siglist, typed_wire, unblocksig):
Unused, remove.

(add_airport, add_to_fired_queue, air_damage, anti_torp, best_path,
bitinit2, blankrow, bmnxtsct, bp_init, build_mission_list,
build_mission_list_type, buildeff, candchrg, canshoot, cantorp,
cede_sect, cede_ship, checksect, client_cmd, coun_cmd,
deity_build_land, divide, do_conv, do_defdam, do_demo, do_desi,
do_mob_land, do_mob_plane, do_mob_sect, do_mob_ship, do_prod,
docountry, doland, doplane, doship, dosupport, dotsprintf, dounit,
empth_start, enlist, errcheck, filereport, find_airport, find_escorts,
findcondition, fire_dchrg, fire_torp, fltp_to_list, get_minimum,
getin, goodsect, grab_sect, grab_ship, grow_people, growfood, in_addr,
infect_people, init_mchr, init_pchr, init_plchr, is_engineer,
itemname, kill_cmd, landrepair, limit_level, list_cmd, lupgr,
materials_charge, materials_cost, meltitems, mission_pln_arm,
mission_pln_sel, move_map, nat_cap, num_units, outid, pass_cmd,
perform_mission, pinflak_planedamage, play_cmd, pln_equip, prexpense,
print_res, prplanes, prunits, pupgr, quiet_bigdef, quit_cmd, radmap2,
retreat_land1, retreat_ship1, s_commod, sanc_cmd, sarg_getrange,
scuttle_it, scuttle_land, set_target, share_incr, shiprepair,
shp_check_mines, shp_check_nav, shp_check_one_mines, shp_hit_mine,
shp_interdict, shp_mess, sort_lookup_list, starvation, supgr, swap,
take_casualties, trunc_people, upd_buildeff, upd_land, upd_ship,
use_ammo, user_cmd): Change linkage to static.
This commit is contained in:
Markus Armbruster 2003-12-17 23:13:50 +00:00
parent f883ed1620
commit 2fe312adac
58 changed files with 273 additions and 693 deletions

View file

@ -78,7 +78,6 @@ extern emp_sig_t empth_alarm(int sig);
/* src/lib/empthread/pthread.c */ /* src/lib/empthread/pthread.c */
#ifdef _EMPTH_POSIX #ifdef _EMPTH_POSIX
extern void *empth_start(void *ctx);
extern int empth_init(char **ctx_ptr, int flags); extern int empth_init(char **ctx_ptr, int flags);
extern empth_t *empth_create(int prio, void (*entry) (), extern empth_t *empth_create(int prio, void (*entry) (),
int size, int flags, int size, int flags,
@ -109,13 +108,8 @@ extern int atta(void);
extern int bdes(void); extern int bdes(void);
extern int best(void); extern int best(void);
extern int boar(void); extern int boar(void);
extern int pinflak_planedamage(struct plnstr *, struct plchrstr *, natid,
int);
extern int bomb(void); extern int bomb(void);
extern int brea(void); extern int brea(void);
extern s_char *dotsprintf(s_char *, s_char *, int);
extern int goodsect(char);
extern void prexpense(long, int *, s_char, int);
extern int budg(void); extern int budg(void);
extern int buil(void); extern int buil(void);
extern int buy(void); extern int buy(void);
@ -123,10 +117,6 @@ extern int check_market(void);
extern int capi(void); extern int capi(void);
extern int carg(void); extern int carg(void);
extern int lcarg(void); extern int lcarg(void);
extern int cede_sect(struct nstr_sect *, natid);
extern void grab_sect(register struct sctstr *, natid);
extern int cede_ship(struct nstr_item *, natid);
extern void grab_ship(register struct shpstr *, natid);
extern int cede(void); extern int cede(void);
extern int cens(void); extern int cens(void);
extern void set_coastal(struct sctstr *); extern void set_coastal(struct sctstr *);
@ -135,15 +125,12 @@ extern int coas(void);
extern int coll(void); extern int coll(void);
extern int comm(void); extern int comm(void);
extern int cons(void); extern int cons(void);
extern long do_conv(struct nstr_sect, int, int);
extern int conv(void); extern int conv(void);
extern int coun(void); extern int coun(void);
extern int cuto(void); extern int cuto(void);
extern int decl(void); extern int decl(void);
extern int deli(void); extern int deli(void);
extern long do_demo(struct natstr *, struct nstr_sect, int, s_char *, int);
extern int demo(void); extern int demo(void);
extern long do_desi(struct natstr *, s_char *, s_char *, long, int);
extern int desi(void); extern int desi(void);
extern int disa(void); extern int disa(void);
extern int diss(void); extern int diss(void);
@ -151,14 +138,7 @@ extern int dist(void);
extern int drop(void); extern int drop(void);
extern int dump(void); extern int dump(void);
extern int echo(void); extern int echo(void);
extern int doland(s_char, int, s_char *, struct sctstr *);
extern int docountry(s_char, int, s_char *, float, natid, struct natstr *);
extern int doship(s_char, int, s_char *, struct shpstr *);
extern int dounit(s_char, int, s_char *, struct lndstr *);
extern int doplane(s_char, int, s_char *, struct plnstr *);
extern int edit(void); extern int edit(void);
extern int getin(s_char **, s_char **, int *, s_char *);
extern int errcheck(int, int, int);
extern int enab(void); extern int enab(void);
extern int enli(void); extern int enli(void);
extern int explore(void); extern int explore(void);
@ -171,7 +151,6 @@ extern int fly(void);
extern int foll(void); extern int foll(void);
extern int force(void); extern int force(void);
extern int fort(void); extern int fort(void);
extern int is_engineer(int, int);
extern int fuel(void); extern int fuel(void);
extern int give(void); extern int give(void);
extern int grin(void); extern int grin(void);
@ -198,12 +177,7 @@ extern int map(void);
extern int march(void); extern int march(void);
extern int mark(void); extern int mark(void);
extern int display_mark(s_char *); extern int display_mark(s_char *);
extern int quiet_bigdef(int, struct emp_qelem *, natid, natid, coord,
coord, int *);
extern int multifire(void); extern int multifire(void);
extern void use_ammo(struct emp_qelem *);
extern void do_defdam(struct emp_qelem *, double);
extern void add_to_fired_queue(struct emp_qelem *, struct emp_qelem *);
extern int mine(void); extern int mine(void);
extern int landmine(void); extern int landmine(void);
extern int mission(void); extern int mission(void);
@ -220,7 +194,6 @@ extern int navi(void);
extern int nav_map(int, int, int); extern int nav_map(int, int, int);
extern int ndump(void); extern int ndump(void);
extern int new(void); extern int new(void);
extern int deity_build_land(int, coord, coord, natid, int);
extern int newe(void); extern int newe(void);
extern int news(void); extern int news(void);
extern int nuke(void); extern int nuke(void);
@ -236,7 +209,6 @@ extern int pdump(void);
extern int plan(void); extern int plan(void);
extern int play(void); extern int play(void);
extern int powe(void); extern int powe(void);
extern int set_target(s_char *, int *);
extern int count_pop(register int); extern int count_pop(register int);
extern int prod(void); extern int prod(void);
extern int pstat(void); extern int pstat(void);
@ -261,7 +233,6 @@ extern int scra(void);
extern int scuttle_tradeship(struct shpstr *, int); extern int scuttle_tradeship(struct shpstr *, int);
extern int scut(void); extern int scut(void);
extern void scuttle_ship(struct shpstr *); extern void scuttle_ship(struct shpstr *);
extern void scuttle_land(struct lndstr *);
extern int sdump(void); extern int sdump(void);
extern int sct(void); extern int sct(void);
extern int sell(void); extern int sell(void);
@ -280,12 +251,8 @@ extern int sinfra(void);
extern int skyw(void); extern int skyw(void);
extern int line_of_sight(s_char **rad, int ax, int ay, int bx, int by); extern int line_of_sight(s_char **rad, int ax, int ay, int bx, int by);
extern int sona(void); extern int sona(void);
extern int blankrow(s_char *);
extern void plane_sona(struct emp_qelem *, int, int, struct shiplook *); extern void plane_sona(struct emp_qelem *, int, int, struct shiplook *);
extern int spy(void); extern int spy(void);
extern int num_units(int, int);
extern void prunits(int, int);
extern void prplanes(int, int);
extern int sstat(void); extern int sstat(void);
extern int start(void); extern int start(void);
extern int stop(void); extern int stop(void);
@ -294,21 +261,14 @@ extern int starve(void);
extern int supp(void); extern int supp(void);
extern int surv(void); extern int surv(void);
extern int swaps(void); extern int swaps(void);
extern void print_res(struct sctstr *);
extern int tele(void); extern int tele(void);
extern int tend(void); extern int tend(void);
extern int tend_nxtitem(struct nstr_item *, caddr_t); extern int tend_nxtitem(struct nstr_item *, caddr_t);
extern int terr(void); extern int terr(void);
extern int thre(void); extern int thre(void);
extern int togg(void); extern int togg(void);
extern void anti_torp(int, int, int);
extern void fire_dchrg(struct shpstr *, struct shpstr *, int, int);
extern s_char *prsub(struct shpstr *); extern s_char *prsub(struct shpstr *);
extern int torp(void); extern int torp(void);
extern int canshoot(struct shpstr *, struct shpstr *);
extern int cantorp(struct shpstr *, struct shpstr *);
extern int fire_torp(struct shpstr *, struct shpstr *, int, int);
extern int candchrg(struct shpstr *, struct shpstr *);
extern int trad(void); extern int trad(void);
extern int check_trade(void); extern int check_trade(void);
extern int ontradingblock(int, int *); extern int ontradingblock(int, int *);
@ -318,15 +278,11 @@ extern int trea(void);
extern int turn(void); extern int turn(void);
extern int upda(void); extern int upda(void);
extern int upgr(void); extern int upgr(void);
extern int supgr(void);
extern int pupgr(void);
extern int lupgr(void);
extern int vers(void); extern int vers(void);
extern int wai(void); extern int wai(void);
extern int wing(void); extern int wing(void);
extern int wipe(void); extern int wipe(void);
extern int work(void); extern int work(void);
extern int buildeff(struct sctstr *, int, double *);
extern int zdon(void); extern int zdon(void);
/* /*
@ -377,11 +333,8 @@ extern int adj_units(coord, coord, natid);
/* log.c */ /* log.c */
extern void loginit(void); extern void loginit(void);
extern void logerror(s_char *, ...); extern void logerror(s_char *, ...);
extern void filelogerror(s_char *, ...);
/* maps.c */ /* maps.c */
extern int draw_map(int, s_char, int, struct nstr_sect *, int); extern int draw_map(int, s_char, int, struct nstr_sect *, int);
extern int bmnxtsct(register struct nstr_sect *);
extern void bitinit2(struct nstr_sect *, u_char *, int);
extern int unit_map(int, int, struct nstr_sect *, s_char *); extern int unit_map(int, int, struct nstr_sect *, s_char *);
extern int bmaps_intersect(natid, natid); extern int bmaps_intersect(natid, natid);
extern int share_bmap(natid, natid, struct nstr_sect *, s_char, s_char *); extern int share_bmap(natid, natid, struct nstr_sect *, s_char, s_char *);
@ -392,8 +345,6 @@ extern s_char *decodep(long, void *);
extern int decode(natid, long, void *, int); extern int decode(natid, long, void *, int);
extern int nstr_exec(struct nscstr *, register int, void *, int); extern int nstr_exec(struct nscstr *, register int, void *, int);
/* path.c */ /* path.c */
extern s_char *bp_init(void);
extern int best_path(struct sctstr *, struct sctstr *, s_char *, int);
extern void bp_enable_cachepath(); extern void bp_enable_cachepath();
extern void bp_disable_cachepath(); extern void bp_disable_cachepath();
extern void bp_clear_cachepath(); extern void bp_clear_cachepath();
@ -469,8 +420,6 @@ extern int getfdtablesize(void);
extern void setfdtablesize(int, int); extern void setfdtablesize(int, int);
extern s_char *getstarg(s_char *, s_char *, s_char *); extern s_char *getstarg(s_char *, s_char *, s_char *);
extern s_char *getstring(s_char *, s_char *); extern s_char *getstring(s_char *, s_char *);
extern int ifloor(double);
extern int iceil(double);
#if !defined(_WIN32) #if !defined(_WIN32)
extern s_char *inet_ntoa(struct in_addr); extern s_char *inet_ntoa(struct in_addr);
#endif #endif
@ -481,7 +430,6 @@ extern int diffy(int, int);
extern int deltax(int, int); extern int deltax(int, int);
extern int deltay(int, int); extern int deltay(int, int);
extern int mapdist(int, int, int, int); extern int mapdist(int, int, int, int);
extern int mapdsq(int, int, int, int);
extern double dmin(double, double); extern double dmin(double, double);
#if !defined(_WIN32) #if !defined(_WIN32)
extern int max(int, int); extern int max(int, int);
@ -501,23 +449,15 @@ extern int ldround(double, int);
extern int roundintby(int, int); extern int roundintby(int, int);
extern int same(register s_char *, register s_char *); extern int same(register s_char *, register s_char *);
extern int scthash(register int, register int, int); extern int scthash(register int, register int, int);
extern void blocksig(void);
extern void unblocksig(void);
extern const s_char *signame(int);
#ifdef NOSTRDUP #ifdef NOSTRDUP
extern char *strdup(char *x); extern char *strdup(char *x);
#endif #endif
extern int strscan(s_char *target, s_char *string);
/* /*
* src/lib/global/ *.c * src/lib/global/ *.c
*/ */
extern void global_init(void); extern void global_init(void);
extern void init_pchr(void);
extern void init_mchr(void);
extern void init_plchr(void);
/* /*
@ -548,18 +488,8 @@ extern int getminleft(time_t, int *, int *);
/* empmod.c */ /* empmod.c */
/* init_nats.c */ /* init_nats.c */
extern int init_nats(void); extern int init_nats(void);
extern int nat_cap(int);
/* login.c */ /* login.c */
extern void player_login(void *); extern void player_login(void *);
extern int client_cmd(struct player *, int, char **);
extern int user_cmd(struct player *, int, char **);
extern int sanc_cmd(struct player *, int, char **);
extern int coun_cmd(struct player *, int, char **);
extern int pass_cmd(struct player *, int, char **);
extern int play_cmd(struct player *, int, char **);
extern int kill_cmd(struct player *, int, char **);
extern int list_cmd(struct player *, int, char **);
extern int quit_cmd(struct player *, int, char **);
/* nat.c */ /* nat.c */
extern int natbyname(s_char *, natid *); extern int natbyname(s_char *, natid *);
extern int natpass(int, s_char *); extern int natpass(int, s_char *);
@ -610,7 +540,6 @@ extern int shipdef(natid, natid, coord, coord);
extern int emp_getbit(int, int, u_char *); extern int emp_getbit(int, int, u_char *);
extern void emp_setbit(int, int, u_char *); extern void emp_setbit(int, int, u_char *);
extern void emp_setbitmap(int, int, u_char *, int *); extern void emp_setbitmap(int, int, u_char *, int *);
extern void emp_bitinit(struct nstr_sect *, u_char *);
/* getele.c */ /* getele.c */
extern int getele(s_char *, s_char *); extern int getele(s_char *, s_char *);
/* land.c */ /* land.c */
@ -636,35 +565,19 @@ extern int islist(s_char *);
extern s_char *mission_name(short); extern s_char *mission_name(short);
extern s_char *nameofitem(s_char *, struct genitem *, int); extern s_char *nameofitem(s_char *, struct genitem *, int);
extern int collateral_damage(coord, coord, int, struct emp_qelem *); extern int collateral_damage(coord, coord, int, struct emp_qelem *);
extern int dosupport(struct genlist *, coord, coord, natid, natid);
extern void build_mission_list(struct genlist *, coord, coord, int, natid);
extern void build_mission_list_type(struct genlist *, coord, coord, int,
int, natid);
extern int perform_mission(coord, coord, natid, struct emp_qelem *, int,
s_char *, int);
extern void mission_pln_sel(struct emp_qelem *, int, int, int);
extern int mission_pln_arm(struct emp_qelem *, coord, coord, int,
int, struct ichrstr *, int, int, int *);
extern int mission_pln_equip(struct plist *, struct ichrstr *, int, extern int mission_pln_equip(struct plist *, struct ichrstr *, int,
s_char); s_char);
extern int find_airport(struct emp_qelem *, coord, coord);
extern void add_airport(struct emp_qelem *, coord, coord);
extern void divide(struct emp_qelem *, struct emp_qelem *, coord, coord);
extern int air_damage(struct emp_qelem *, coord, coord, int, natid,
s_char *, int);
extern int ground_interdict(coord, coord, natid, s_char *); extern int ground_interdict(coord, coord, natid, s_char *);
extern int unit_interdict(coord, coord, natid, s_char *, int, int); extern int unit_interdict(coord, coord, natid, s_char *, int, int);
extern int off_support(coord, coord, natid, natid); extern int off_support(coord, coord, natid, natid);
extern int def_support(coord, coord, natid, natid); extern int def_support(coord, coord, natid, natid);
extern int oprange(struct genitem *, int, int *); extern int oprange(struct genitem *, int, int *);
extern void find_escorts(coord, coord, natid, struct emp_qelem *);
extern int cando(int, int); extern int cando(int, int);
extern s_char *mission_short_name(int); extern s_char *mission_short_name(int);
extern void show_mission(int, struct nstr_item *); extern void show_mission(int, struct nstr_item *);
extern int air_defense(coord, coord, natid, struct emp_qelem *, extern int air_defense(coord, coord, natid, struct emp_qelem *,
struct emp_qelem *); struct emp_qelem *);
/* move.c */ /* move.c */
extern int move_map(s_char *, coord, coord, s_char *);
extern int check_lmines(coord, coord, double); extern int check_lmines(coord, coord, double);
extern int move_ground(s_char *, struct sctstr *, struct sctstr *, extern int move_ground(s_char *, struct sctstr *, struct sctstr *,
double, double, s_char *, double, double, s_char *,
@ -689,7 +602,6 @@ extern int natarg(s_char *, s_char *);
extern int neigh(coord, coord, natid); extern int neigh(coord, coord, natid);
/* nreport.c */ /* nreport.c */
extern void nreport(natid, int, natid, int); extern void nreport(natid, int, natid, int);
extern void filereport(int, int, int, int);
/* nuke.c */ /* nuke.c */
extern int nuk_postread(int, s_char *); extern int nuk_postread(int, s_char *);
extern int nuk_prewrite(int, s_char *); extern int nuk_prewrite(int, s_char *);
@ -707,7 +619,6 @@ extern int pln_prewrite(int, s_char *);
extern void pln_init(int, s_char *); extern void pln_init(int, s_char *);
/* plnsub.c */ /* plnsub.c */
extern void count_planes(struct shpstr *); extern void count_planes(struct shpstr *);
extern int pln_equip(struct plist *, struct ichrstr *, int, s_char);
extern int pln_onewaymission(struct sctstr *, int *, int *); extern int pln_onewaymission(struct sctstr *, int *, int *);
extern void pln_newlanding(struct emp_qelem *, coord, coord, int); extern void pln_newlanding(struct emp_qelem *, coord, coord, int);
extern int can_be_on_ship(int, int); extern int can_be_on_ship(int, int);
@ -739,7 +650,6 @@ extern void pr_inform(struct player *, s_char *, ...);
extern void pr_wall(s_char *, ...); extern void pr_wall(s_char *, ...);
extern void pr_player(struct player *pl, int id, s_char *buf); extern void pr_player(struct player *pl, int id, s_char *buf);
extern void pr_hilite(s_char *buf); extern void pr_hilite(s_char *buf);
extern void outid(struct player *pl, int n);
extern void prredir(s_char *redir); extern void prredir(s_char *redir);
extern void prexec(s_char *file); extern void prexec(s_char *file);
extern void prprompt(int min, int btu); extern void prprompt(int min, int btu);
@ -753,7 +663,6 @@ extern void pr_beep(void);
extern void mpr(int, s_char *, ...); extern void mpr(int, s_char *, ...);
/* radmap.c */ /* radmap.c */
extern void radmap2(int, int, int, int, int, double, int);
extern int deltx(struct range *, coord); extern int deltx(struct range *, coord);
/* Prototype include a typedef name. /* Prototype include a typedef name.
It should be moved after the typedef declaration */ It should be moved after the typedef declaration */
@ -769,16 +678,12 @@ extern int setcont(natid, natid, int);
extern int setrej(natid, natid, int, int); extern int setrej(natid, natid, int, int);
/* retreat.c */ /* retreat.c */
extern void retreat_ship(struct shpstr *, s_char); extern void retreat_ship(struct shpstr *, s_char);
extern int retreat_ship1(struct shpstr *, s_char, int);
extern int findcondition(s_char);
extern void retreat_land(struct lndstr *, s_char); extern void retreat_land(struct lndstr *, s_char);
extern int retreat_land1(struct lndstr *, s_char, int);
extern int check_retreat_and_do_shipdamage(struct shpstr *, int); extern int check_retreat_and_do_shipdamage(struct shpstr *, int);
extern int check_retreat_and_do_landdamage(struct lndstr *, int); extern int check_retreat_and_do_landdamage(struct lndstr *, int);
/* sarg.c */ /* sarg.c */
extern int sarg_type(s_char *); extern int sarg_type(s_char *);
extern int sarg_xy(s_char *, coord *, coord *); extern int sarg_xy(s_char *, coord *, coord *);
extern int sarg_getrange(s_char *, register struct range *);
extern int sarg_area(s_char *, register struct range *); extern int sarg_area(s_char *, register struct range *);
extern int sarg_range(s_char *, coord *, coord *, int *); extern int sarg_range(s_char *, coord *, coord *, int *);
extern int sarg_list(s_char *, register int *, int); extern int sarg_list(s_char *, register int *, int);
@ -788,7 +693,6 @@ extern void satmap(int, int, int, int, int, int);
extern void sathead(void); extern void sathead(void);
/* sect.c */ /* sect.c */
extern int sct_postread(int, s_char *); extern int sct_postread(int, s_char *);
extern int checksect(struct sctstr *);
extern int sct_prewrite(int, s_char *); extern int sct_prewrite(int, s_char *);
extern int issector(s_char *); extern int issector(s_char *);
extern void sct_init(coord, coord, s_char *); extern void sct_init(coord, coord, s_char *);
@ -798,7 +702,6 @@ extern int shp_postread(int, s_char *);
extern int shp_prewrite(int, s_char *); extern int shp_prewrite(int, s_char *);
extern void shp_init(int, s_char *); extern void shp_init(int, s_char *);
/* show.c */ /* show.c */
extern void sort_lookup_list(void);
extern void show_bridge(int); extern void show_bridge(int);
extern void show_tower(int); extern void show_tower(int);
extern void show_item(int); extern void show_item(int);
@ -820,15 +723,9 @@ extern void show_sect_capab(int);
/* shpsub.c */ /* shpsub.c */
extern void shp_sel(struct nstr_item *, struct emp_qelem *); extern void shp_sel(struct nstr_item *, struct emp_qelem *);
extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid); extern void shp_nav(struct emp_qelem *, double *, double *, int *, natid);
extern int shp_check_one_mines(struct mlist *);
extern int shp_sweep(struct emp_qelem *, int, natid); extern int shp_sweep(struct emp_qelem *, int, natid);
extern int shp_interdict(struct emp_qelem *, coord, coord, natid);
extern void shp_mess(s_char *, struct mlist *);
extern int shp_check_mines(struct emp_qelem *);
extern int shp_check_nav(struct sctstr *);
extern s_char *shp_path(int, struct shpstr *, s_char *); extern s_char *shp_path(int, struct shpstr *, s_char *);
extern void shp_put(struct emp_qelem *, natid); extern void shp_put(struct emp_qelem *, natid);
extern int shp_hit_mine(struct shpstr *, struct mchrstr *);
extern void shp_list(struct emp_qelem *); extern void shp_list(struct emp_qelem *);
extern int shp_hardtarget(struct shpstr *); extern int shp_hardtarget(struct shpstr *);
extern void shp_view(struct emp_qelem *); extern void shp_view(struct emp_qelem *);
@ -842,12 +739,8 @@ extern int snxtsct(register struct nstr_sect *, s_char *);
/* supply.c */ /* supply.c */
extern void resupply_all(struct lndstr *); extern void resupply_all(struct lndstr *);
extern void resupply_commod(struct lndstr *, int); extern void resupply_commod(struct lndstr *, int);
extern int get_minimum(struct lndstr *, int);
extern int supply_commod(int, int, int, int, int); extern int supply_commod(int, int, int, int, int);
extern int s_commod(int, int, int, int, int, int);
extern int try_supply_commod(int, int, int, int, int); extern int try_supply_commod(int, int, int, int, int);
extern s_char *itemname(int);
extern int at_minimum(struct lndstr *, int);
extern int has_supply(struct lndstr *); extern int has_supply(struct lndstr *);
extern int use_supply(struct lndstr *); extern int use_supply(struct lndstr *);
/* takeover.c */ /* takeover.c */
@ -867,8 +760,6 @@ extern struct ichrstr *whichitem(char);
extern int trechk(register natid, register natid, int); extern int trechk(register natid, register natid, int);
/* whatitem.c */ /* whatitem.c */
extern struct ichrstr *whatitem(s_char *, s_char *); extern struct ichrstr *whatitem(s_char *, s_char *);
/* wire.c */
extern int typed_wire(natid, natid, s_char *, int);
/* wu.c */ /* wu.c */
extern void clear_telegram_is_new(natid); extern void clear_telegram_is_new(natid);
extern int typed_wu(natid, natid, s_char *, int); extern int typed_wu(natid, natid, s_char *, int);
@ -896,39 +787,21 @@ extern void finish_sects(int);
/* human.c */ /* human.c */
extern int do_feed(register struct sctstr *, register struct natstr *, extern int do_feed(register struct sctstr *, register struct natstr *,
int *, int *, int *, int); int *, int *, int *, int);
extern int growfood(struct sctstr *, register int *, int, int);
extern int feed_people(register int *, int, int *); extern int feed_people(register int *, int, int *);
extern void starvation(struct sctstr *);
extern int grow_people(struct sctstr *, register int,
register struct natstr *, int *, int,
register int *);
extern void trunc_people(struct sctstr *, register struct natstr *,
register int *);
/* land.c */ /* land.c */
extern void upd_land(register struct lndstr *, int, register int,
struct natstr *, int *, int);
extern int prod_land(int, int, int *, int); extern int prod_land(int, int, int *, int);
extern int landrepair(register struct lndstr *, int *, struct natstr *,
int *, int);
extern int feed_land(struct lndstr *, register int *, int, int *, int); extern int feed_land(struct lndstr *, register int *, int, int *, int);
extern int plague_land(struct lndstr *, struct natstr *, register int *, extern int plague_land(struct lndstr *, struct natstr *, register int *,
register int *, int); register int *, int);
/* main.c */ /* main.c */
extern void update_main(void *); extern void update_main(void *);
extern void do_prod(int, int, int, int *, long int (*)[2], int *, int *,
int *, int *, int *, int *);
/* material.c */ /* material.c */
extern void get_materials(struct sctstr *, int *, int *, int); extern void get_materials(struct sctstr *, int *, int *, int);
/* mobility.c */ /* mobility.c */
extern void mob_sect(register int); extern void mob_sect(register int);
extern void do_mob_sect(register struct sctstr *, register int);
extern void mob_ship(register int); extern void mob_ship(register int);
extern void do_mob_ship(register struct shpstr *, register int);
extern void mob_land(register int); extern void mob_land(register int);
extern void do_mob_land(register struct lndstr *, register int);
extern void mob_plane(register int); extern void mob_plane(register int);
extern void do_mob_plane(register struct plnstr *, register int);
extern void do_mob_sect(register struct sctstr *sp, register int etus);
extern void update_all_mob(void); extern void update_all_mob(void);
extern void update_timestamps(time_t offset); extern void update_timestamps(time_t offset);
extern void sct_do_upd_mob(register struct sctstr *sp); extern void sct_do_upd_mob(register struct sctstr *sp);
@ -939,12 +812,8 @@ extern void pln_do_upd_mob(register struct plnstr *pp);
extern void move_sat(register struct plnstr *); extern void move_sat(register struct plnstr *);
/* nat.c */ /* nat.c */
extern double logx(double, double); extern double logx(double, double);
extern double limit_level(double, int, int);
extern void prod_nat(int); extern void prod_nat(int);
extern void share_incr(register double *, register double *);
/* nav_ship.c */ /* nav_ship.c */
extern void scuttle_it(register struct shpstr *);
extern void swap(register struct shpstr *);
extern int nav_ship(register struct shpstr *); extern int nav_ship(register struct shpstr *);
/* nav_util.c */ /* nav_util.c */
extern int check_nav(struct sctstr *); extern int check_nav(struct sctstr *);
@ -959,8 +828,6 @@ extern s_char *nxtitemp(struct nstr_item *, int);
extern struct sctstr *nxtsctp(register struct nstr_sect *); extern struct sctstr *nxtsctp(register struct nstr_sect *);
/* plague.c */ /* plague.c */
extern void do_plague(struct sctstr *, struct natstr *, int); extern void do_plague(struct sctstr *, struct natstr *, int);
extern int infect_people(struct natstr *, register int *, u_int, int,
struct sctstr *);
extern int plague_people(struct natstr *, register int *, register int *, extern int plague_people(struct natstr *, register int *, register int *,
int); int);
/* plane.c */ /* plane.c */
@ -979,35 +846,22 @@ extern int bank_income(struct sctstr *, int);
/* produce.c */ /* produce.c */
extern int produce(struct natstr *, struct sctstr *, int *, int, int, int, extern int produce(struct natstr *, struct sctstr *, int *, int, int, int,
int, int *, int *); int, int *, int *);
extern int materials_cost(struct pchrstr *, register int *, int *);
extern void materials_charge(struct pchrstr *, register int *,
register int);
/* removewants.c */ /* removewants.c */
extern int update_removewants(void); extern int update_removewants(void);
/* revolt.c */ /* revolt.c */
extern void take_casualties(struct sctstr *, int);
extern void revolt(struct sctstr *); extern void revolt(struct sctstr *);
extern void guerrilla(struct sctstr *); extern void guerrilla(struct sctstr *);
/* sail.c */ /* sail.c */
extern void fltp_to_list(struct fltheadstr *, struct emp_qelem *);
extern void sail_ship(natid); extern void sail_ship(natid);
/* sect.c */ /* sect.c */
extern int dodeliver(struct sctstr *, int *); extern int dodeliver(struct sctstr *, int *);
extern int upd_buildeff(struct natstr *, register struct sctstr *, int *,
int *, int, int *, int, int *);
extern int enlist(register int *, int, int *);
extern void meltitems(int, int, int, int *, int, int, int, int);
extern void do_fallout(register struct sctstr *, register int); extern void do_fallout(register struct sctstr *, register int);
extern void spread_fallout(struct sctstr *, int); extern void spread_fallout(struct sctstr *, int);
extern void decay_fallout(struct sctstr *, int); extern void decay_fallout(struct sctstr *, int);
extern void produce_sect(int natnum, int etu, int *bp, extern void produce_sect(int natnum, int etu, int *bp,
long int (*p_sect)[2], int sector_type); long int (*p_sect)[2], int sector_type);
/* ship.c */ /* ship.c */
extern void upd_ship(register struct shpstr *, int, register int,
struct natstr *, int *, int);
extern int prod_ship(int, int, int *, int); extern int prod_ship(int, int, int *, int);
extern int shiprepair(register struct shpstr *, int *, struct natstr *,
int *, int);
extern int feed_ship(struct shpstr *, register int *, int, int *, int); extern int feed_ship(struct shpstr *, register int *, int, int *, int);
/* /*

View file

@ -58,12 +58,11 @@ static void pin_bomb(struct emp_qelem *list, struct sctstr *target);
static void strat_bomb(struct emp_qelem *list, struct sctstr *target); static void strat_bomb(struct emp_qelem *list, struct sctstr *target);
static void comm_bomb(struct emp_qelem *list, struct sctstr *target); static void comm_bomb(struct emp_qelem *list, struct sctstr *target);
static void eff_bomb(struct emp_qelem *list, struct sctstr *target); static void eff_bomb(struct emp_qelem *list, struct sctstr *target);
static int pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp,
natid from, int flak);
static void plane_bomb(struct emp_qelem *list, struct sctstr *target); static void plane_bomb(struct emp_qelem *list, struct sctstr *target);
static void land_bomb(struct emp_qelem *list, struct sctstr *target); static void land_bomb(struct emp_qelem *list, struct sctstr *target);
static void ship_bomb(struct emp_qelem *list, struct sctstr *target); static void ship_bomb(struct emp_qelem *list, struct sctstr *target);
int pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp,
natid from, int flak);
static int bombcomm[] = { static int bombcomm[] = {
I_CIVIL, I_CIVIL,
@ -925,7 +924,8 @@ strat_bomb(struct emp_qelem *list, struct sctstr *target)
float lflaktable[16] = { 0.20, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, float lflaktable[16] = { 0.20, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50,
0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85,
}; };
int
static int
pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp, natid from, pinflak_planedamage(struct plnstr *pp, struct plchrstr *pcp, natid from,
int flak) int flak)
{ {

View file

@ -67,14 +67,14 @@ extern double obrate, uwbrate;
extern int etu_per_update; extern int etu_per_update;
extern double money_res; extern double money_res;
s_char *dotsprintf(s_char *buf, s_char *format, int data);
int goodsect(char c);
void prexpense(long int cash, int *expensesp, s_char priority, int amount);
static void calc_all(long int (*p_sect)[2], int *taxes, int *Ncivs, static void calc_all(long int (*p_sect)[2], int *taxes, int *Ncivs,
int *Nuws, int *bars, int *Nbars, int *mil, int *Nuws, int *bars, int *Nbars, int *mil,
int *ships, int *sbuild, int *nsbuild, int *smaint, int *ships, int *sbuild, int *nsbuild, int *smaint,
int *units, int *lbuild, int *nlbuild, int *lmaint, int *units, int *lbuild, int *nlbuild, int *lmaint,
int *planes, int *pbuild, int *npbuild, int *pmaint); int *planes, int *pbuild, int *npbuild, int *pmaint);
static s_char *dotsprintf(s_char *buf, s_char *format, int data);
static int goodsect(char c);
static void prexpense(long int cash, int *expensesp, s_char priority, int amount);
int int
budg(void) budg(void)
@ -463,7 +463,7 @@ calc_all(long int (*p_sect)[2], int *taxes, int *Ncivs, int *Nuws,
free(bp); free(bp);
} }
int static int
goodsect(char c) goodsect(char c)
{ {
register int x; register int x;
@ -475,14 +475,14 @@ goodsect(char c)
return 0; return 0;
} }
s_char * static s_char *
dotsprintf(s_char *buf, s_char *format, int data) dotsprintf(s_char *buf, s_char *format, int data)
{ {
sprintf(buf, format, data); sprintf(buf, format, data);
return (s_char *)memset(buf, '.', strspn(buf, " ")); return (s_char *)memset(buf, '.', strspn(buf, " "));
} }
void static void
prexpense(long int cash, int *expensesp, s_char priority, int amount) prexpense(long int cash, int *expensesp, s_char priority, int amount)
{ {
if (cash > *expensesp) { if (cash > *expensesp) {

View file

@ -50,6 +50,10 @@
#include "commands.h" #include "commands.h"
static void cede_hdr(void); static void cede_hdr(void);
static int cede_sect(struct nstr_sect *, natid);
static int cede_ship(struct nstr_item *, natid);
static void grab_sect(register struct sctstr *, natid);
static void grab_ship(register struct shpstr *, natid);
int int
cede(void) cede(void)
@ -116,7 +120,7 @@ cede(void)
return cede_ship(&ni, to); return cede_ship(&ni, to);
} }
int static int
cede_sect(struct nstr_sect *ns, natid to) cede_sect(struct nstr_sect *ns, natid to)
{ {
struct sctstr sect, osect; struct sctstr sect, osect;
@ -191,7 +195,7 @@ cede_hdr(void)
void static void
grab_sect(register struct sctstr *sp, natid to) grab_sect(register struct sctstr *sp, natid to)
{ {
struct plnstr *pp; struct plnstr *pp;
@ -294,7 +298,7 @@ grab_sect(register struct sctstr *sp, natid to)
sp->sct_mobil = 0; sp->sct_mobil = 0;
} }
int static int
cede_ship(struct nstr_item *ni, natid to) cede_ship(struct nstr_item *ni, natid to)
{ {
struct shpstr ship; struct shpstr ship;
@ -333,7 +337,7 @@ cede_ship(struct nstr_item *ni, natid to)
return RET_OK; return RET_OK;
} }
void static void
grab_ship(register struct shpstr *sp, natid to) grab_ship(register struct shpstr *sp, natid to)
{ {
register struct plnstr *pp; register struct plnstr *pp;

View file

@ -46,7 +46,7 @@
#include "land.h" #include "land.h"
#include "commands.h" #include "commands.h"
long do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real); static long do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real);
int int
conv(void) conv(void)
@ -70,7 +70,7 @@ conv(void)
return (int)do_conv(nstr, uwtoconvert, 1); return (int)do_conv(nstr, uwtoconvert, 1);
} }
long static long
do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real) do_conv(struct nstr_sect nstr, int uwtoconvert, int for_real)
{ {
struct sctstr sect; struct sctstr sect;

View file

@ -47,8 +47,8 @@
* *
*/ */
long do_demo(struct natstr *natp, struct nstr_sect nstr, int number, static long do_demo(struct natstr *natp, struct nstr_sect nstr, int number,
s_char *p, int for_real); s_char *p, int for_real);
int int
demo(void) demo(void)
@ -82,7 +82,7 @@ demo(void)
return (int)do_demo(natp, nstr, number, p, 1); return (int)do_demo(natp, nstr, number, p, 1);
} }
long static long
do_demo(struct natstr *natp, struct nstr_sect nstr, int number, s_char *p, do_demo(struct natstr *natp, struct nstr_sect nstr, int number, s_char *p,
int for_real) int for_real)
{ {

View file

@ -45,8 +45,8 @@
#include "optlist.h" #include "optlist.h"
#include "commands.h" #include "commands.h"
long do_desi(struct natstr *natp, s_char *sects, s_char *deschar, static long do_desi(struct natstr *natp, s_char *sects, s_char *deschar,
long int cash, int for_real); long int cash, int for_real);
int int
desi(void) desi(void)
@ -67,7 +67,7 @@ desi(void)
return (int)do_desi(natp, player->argp[1], player->argp[2], cash, 1); return (int)do_desi(natp, player->argp[1], player->argp[2], cash, 1);
} }
long static long
do_desi(struct natstr *natp, s_char *sects, s_char *deschar, long int cash, do_desi(struct natstr *natp, s_char *sects, s_char *deschar, long int cash,
int for_real) int for_real)
{ {

View file

@ -56,20 +56,22 @@
#include "commands.h" #include "commands.h"
#define END -1 #define END -1
static void prnat(natid n);
static void pr_plane(struct plnstr *plane); static void benefit(natid who, int good);
static void pr_land(struct lndstr *land); static int docountry(s_char op, int arg, s_char *p, float farg, natid nat,
static void pr_ship(struct shpstr *ship); struct natstr *np);
static void prsect(struct sctstr *sect); static int doland(s_char op, int arg, s_char *p, struct sctstr *sect);
static int doplane(s_char op, int arg, s_char *p, struct plnstr *plane);
static int doship(s_char op, int arg, s_char *p, struct shpstr *ship);
static int dounit(s_char op, int arg, s_char *p, struct lndstr *land);
static int getin(s_char **, s_char **, int *, s_char *);
static void noise(struct sctstr *sptr, int public_amt, s_char *name, static void noise(struct sctstr *sptr, int public_amt, s_char *name,
int old, int new); int old, int new);
static void benefit(natid who, int good); static void pr_land(struct lndstr *land);
int doland(s_char op, int arg, s_char *p, struct sctstr *sect); static void pr_plane(struct plnstr *plane);
int docountry(s_char op, int arg, s_char *p, float farg, natid nat, static void pr_ship(struct shpstr *ship);
struct natstr *np); static void prnat(natid n);
int doship(s_char op, int arg, s_char *p, struct shpstr *ship); static void prsect(struct sctstr *sect);
int dounit(s_char op, int arg, s_char *p, struct lndstr *land);
int doplane(s_char op, int arg, s_char *p, struct plnstr *plane);
int int
@ -449,7 +451,7 @@ pr_ship(struct shpstr *ship)
pr("\n"); pr("\n");
} }
int static int
errcheck(int num, int min, int max) errcheck(int num, int min, int max)
{ {
if (num < min) if (num < min)
@ -459,7 +461,7 @@ errcheck(int num, int min, int max)
return (num); return (num);
} }
int static int
getin(s_char **what, s_char **p, int *arg, s_char *buf) getin(s_char **what, s_char **p, int *arg, s_char *buf)
{ {
if (!(*what = getstarg(*p, "%c xxxxx -- thing value : ", buf))) { if (!(*what = getstarg(*p, "%c xxxxx -- thing value : ", buf))) {
@ -482,7 +484,7 @@ getin(s_char **what, s_char **p, int *arg, s_char *buf)
} }
int static int
doland(s_char op, int arg, s_char *p, struct sctstr *sect) doland(s_char op, int arg, s_char *p, struct sctstr *sect)
{ {
natid newown, oldown; natid newown, oldown;
@ -684,8 +686,7 @@ doland(s_char op, int arg, s_char *p, struct sctstr *sect)
} }
static int
int
docountry(s_char op, int arg, s_char *p, float farg, natid nat, docountry(s_char op, int arg, s_char *p, float farg, natid nat,
struct natstr *np) struct natstr *np)
{ {
@ -785,7 +786,7 @@ docountry(s_char op, int arg, s_char *p, float farg, natid nat,
} }
int static int
doship(s_char op, int arg, s_char *p, struct shpstr *ship) doship(s_char op, int arg, s_char *p, struct shpstr *ship)
{ {
coord newx, newy; coord newx, newy;
@ -957,7 +958,7 @@ doship(s_char op, int arg, s_char *p, struct shpstr *ship)
return RET_OK; return RET_OK;
} }
int static int
dounit(s_char op, int arg, s_char *p, struct lndstr *land) dounit(s_char op, int arg, s_char *p, struct lndstr *land)
{ {
coord newx, newy; coord newx, newy;

View file

@ -44,6 +44,8 @@
#include "file.h" #include "file.h"
#include "commands.h" #include "commands.h"
static int is_engineer(int, int);
int int
fort(void) fort(void)
{ {
@ -141,7 +143,7 @@ fort(void)
return RET_OK; return RET_OK;
} }
int static int
is_engineer(int x, int y) is_engineer(int x, int y)
{ {
struct nstr_item ni; struct nstr_item ni;

View file

@ -71,6 +71,7 @@ union item_u {
struct lndstr land; struct lndstr land;
}; };
static void add_to_fired_queue(struct emp_qelem *, struct emp_qelem *);
static int defend(struct emp_qelem *al, static int defend(struct emp_qelem *al,
struct emp_qelem *dl, struct emp_qelem *dl,
enum targ_type target, enum targ_type target,
@ -79,6 +80,10 @@ static int defend(struct emp_qelem *al,
struct sctstr *fsect, struct sctstr *fsect,
struct shpstr *vship, struct shpstr *vship,
struct shpstr *fship, int fx, int fy, int *nd); struct shpstr *fship, int fx, int fy, int *nd);
static void do_defdam(struct emp_qelem *, double);
static int quiet_bigdef(int, struct emp_qelem *, natid, natid, coord,
coord, int *);
static void use_ammo(struct emp_qelem *);
int int
multifire(void) multifire(void)
@ -709,7 +714,7 @@ defend(struct emp_qelem *al, struct emp_qelem *dl, enum targ_type target,
return (dam); return (dam);
} }
void static void
do_defdam(struct emp_qelem *list, double odds) do_defdam(struct emp_qelem *list, double odds)
{ {
@ -760,7 +765,7 @@ do_defdam(struct emp_qelem *list, double odds)
} }
} }
int static int
quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown, quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
coord ax, coord ay, int *nfiring) coord ax, coord ay, int *nfiring)
{ {
@ -984,7 +989,7 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
return ((*nfiring) == 0 ? 0 : (dam / (*nfiring))); return ((*nfiring) == 0 ? 0 : (dam / (*nfiring)));
} }
void static void
use_ammo(struct emp_qelem *list) use_ammo(struct emp_qelem *list)
{ {
struct emp_qelem *qp, *next; struct emp_qelem *qp, *next;
@ -1047,7 +1052,7 @@ use_ammo(struct emp_qelem *list)
} }
void static void
add_to_fired_queue(struct emp_qelem *elem, struct emp_qelem *list) add_to_fired_queue(struct emp_qelem *elem, struct emp_qelem *list)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;

View file

@ -53,8 +53,9 @@ extern float start_education, start_happiness;
extern float start_technology, start_research; extern float start_technology, start_research;
extern int morale_base; extern int morale_base;
static void ok(s_char *map, int x, int y); static int deity_build_land(int, coord, coord, natid, int);
static int isok(int x, int y); static int isok(int x, int y);
static void ok(s_char *map, int x, int y);
static struct range defrealm = { -8, -5, 10, 5, 0, 0 }; static struct range defrealm = { -8, -5, 10, 5, 0, 0 };
@ -312,7 +313,7 @@ ok(s_char *map, int x, int y)
ok(map, diroff[dir][0] + x, diroff[dir][1] + y); ok(map, diroff[dir][0] + x, diroff[dir][1] + y);
} }
int static int
deity_build_land(int type, coord x, coord y, natid own, int tlev) deity_build_land(int type, coord x, coord y, natid own, int tlev)
{ {
extern int land_mob_max; extern int land_mob_max;

View file

@ -62,10 +62,11 @@ struct powsort {
natid cnum; natid cnum;
}; };
static int powcmp(struct powsort *p1, struct powsort *p2);
static void out5(double value, int round_val, int round_flag);
static void gen_power(void);
static void addtopow(register int *vec, register struct powstr *pow); static void addtopow(register int *vec, register struct powstr *pow);
static void gen_power(void);
static void out5(double value, int round_val, int round_flag);
static int powcmp(struct powsort *p1, struct powsort *p2);
static int set_target(s_char *, int *);
int int
powe(void) powe(void)
@ -410,7 +411,7 @@ addtopow(register int *vec, register struct powstr *pow)
pow->p_power += vec[I_HCM] / 5.0; pow->p_power += vec[I_HCM] / 5.0;
} }
int static int
set_target(s_char *p, int *targets) set_target(s_char *p, int *targets)
{ {
int target; int target;

View file

@ -47,6 +47,8 @@
#include "commands.h" #include "commands.h"
#include "optlist.h" #include "optlist.h"
static void scuttle_land(struct lndstr *);
union item_u { union item_u {
struct shpstr ship; struct shpstr ship;
struct plnstr plane; struct plnstr plane;
@ -310,7 +312,7 @@ scuttle_ship(struct shpstr *sp)
putship(sp->shp_uid, sp); putship(sp->shp_uid, sp);
} }
void static void
scuttle_land(struct lndstr *lp) scuttle_land(struct lndstr *lp)
{ {
struct nstr_item ni; struct nstr_item ni;

View file

@ -50,6 +50,8 @@
#include "commands.h" #include "commands.h"
#include "optlist.h" #include "optlist.h"
static int blankrow(s_char *);
int int
sona(void) sona(void)
{ {
@ -387,7 +389,7 @@ line_of_sight(s_char **rad, int ax, int ay, int bx, int by)
return 1; return 1;
} }
int static int
blankrow(s_char *s) blankrow(s_char *s)
{ {
while (*s) { while (*s) {

View file

@ -53,9 +53,13 @@
* format: spy <SECTS> * format: spy <SECTS>
* *
*/ */
static void spyline(struct sctstr *sp);
static void insert(coord *table, int *len, coord x, coord y);
static int check(coord *table, int *len, coord x, coord y); static int check(coord *table, int *len, coord x, coord y);
static void insert(coord *table, int *len, coord x, coord y);
static int num_units(int, int);
static void prplanes(int, int);
static void prunits(int, int);
static void spyline(struct sctstr *sp);
int int
spy(void) spy(void)
@ -256,7 +260,7 @@ check(coord *table, int *len, coord x, coord y)
return 0; return 0;
} }
int static int
num_units(int x, int y) num_units(int x, int y)
{ {
struct lndstr land; struct lndstr land;
@ -275,7 +279,7 @@ num_units(int x, int y)
return n; return n;
} }
void static void
prunits(int x, int y) prunits(int x, int y)
{ {
struct lndstr land; struct lndstr land;
@ -311,7 +315,7 @@ prunits(int x, int y)
} }
} }
void static void
prplanes(int x, int y) prplanes(int x, int y)
{ {
struct plnstr plane; struct plnstr plane;

View file

@ -45,6 +45,7 @@
#include "file.h" #include "file.h"
#include "commands.h" #include "commands.h"
static void print_res(struct sctstr *);
/* /*
* Syntax: swap <SECT> <SECT> * Syntax: swap <SECT> <SECT>
@ -89,7 +90,7 @@ swaps(void)
return RET_OK; return RET_OK;
} }
void static void
print_res(struct sctstr *sp) print_res(struct sctstr *sp)
{ {
pr("own sect eff min gold fert oil uran\n"); pr("own sect eff min gold fert oil uran\n");

View file

@ -48,9 +48,13 @@
#include "damage.h" #include "damage.h"
#include "commands.h" #include "commands.h"
void anti_torp(int f, int ntorping, int vshipown); static void anti_torp(int f, int ntorping, int vshipown);
void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, static int candchrg(struct shpstr *, struct shpstr *);
int ntargets); static int canshoot(struct shpstr *, struct shpstr *);
static int cantorp(struct shpstr *, struct shpstr *);
static void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range,
int ntargets);
static int fire_torp(struct shpstr *, struct shpstr *, int, int);
s_char *prsub(struct shpstr *sp); s_char *prsub(struct shpstr *sp);
@ -235,7 +239,7 @@ torp(void)
return RET_OK; return RET_OK;
} }
void static void
anti_torp(int f, int ntorping, int vshipown) anti_torp(int f, int ntorping, int vshipown)
{ {
int range; int range;
@ -288,7 +292,7 @@ anti_torp(int f, int ntorping, int vshipown)
} }
/* Can ship A shoot at ship B? */ /* Can ship A shoot at ship B? */
int static int
canshoot(struct shpstr *a, struct shpstr *b) canshoot(struct shpstr *a, struct shpstr *b)
{ {
/* Anyone can shoot a normal ship */ /* Anyone can shoot a normal ship */
@ -307,7 +311,7 @@ canshoot(struct shpstr *a, struct shpstr *b)
} }
/* Can ship A torp ship B? */ /* Can ship A torp ship B? */
int static int
cantorp(struct shpstr *a, struct shpstr *b) cantorp(struct shpstr *a, struct shpstr *b)
{ {
if ((mchr[(int)a->shp_type].m_flags & M_TORP) == 0) if ((mchr[(int)a->shp_type].m_flags & M_TORP) == 0)
@ -325,7 +329,7 @@ cantorp(struct shpstr *a, struct shpstr *b)
} }
/* Can ship A depth-charge (or fire guns at) ship B? */ /* Can ship A depth-charge (or fire guns at) ship B? */
int static int
candchrg(struct shpstr *a, struct shpstr *b) candchrg(struct shpstr *a, struct shpstr *b)
{ {
if ((mchr[(int)b->shp_type].m_flags & M_SUB) == 0) { if ((mchr[(int)b->shp_type].m_flags & M_SUB) == 0) {
@ -341,7 +345,7 @@ candchrg(struct shpstr *a, struct shpstr *b)
return 1; return 1;
} }
void static void
fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, int ntargets) fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
{ {
int dam; int dam;
@ -398,7 +402,7 @@ fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
} }
} }
int static int
fire_torp(struct shpstr *sp, struct shpstr *targ, int range, int ntargets) fire_torp(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
{ {
extern int torpedo_damage; extern int torpedo_damage;

View file

@ -45,6 +45,10 @@
#include "file.h" #include "file.h"
#include "commands.h" #include "commands.h"
static int lupgr(void);
static int pupgr(void);
static int supgr(void);
int int
upgr(void) upgr(void)
{ {
@ -70,7 +74,7 @@ upgr(void)
return RET_OK; return RET_OK;
} }
int static int
lupgr(void) lupgr(void)
{ {
struct sctstr sect; struct sctstr sect;
@ -178,7 +182,7 @@ lupgr(void)
return RET_OK; return RET_OK;
} }
int static int
supgr(void) supgr(void)
{ {
struct sctstr sect; struct sctstr sect;
@ -272,7 +276,7 @@ supgr(void)
return RET_OK; return RET_OK;
} }
int static int
pupgr(void) pupgr(void)
{ {
struct sctstr sect; struct sctstr sect;

View file

@ -44,6 +44,8 @@
#include "optlist.h" #include "optlist.h"
#include "commands.h" #include "commands.h"
static int buildeff(struct sctstr *, int, double *);
int int
work(void) work(void)
{ {
@ -122,7 +124,7 @@ work(void)
return RET_OK; return RET_OK;
} }
int static int
buildeff(struct sctstr *sp, int work, double *money) buildeff(struct sctstr *sp, int work, double *money)
{ {
int vec[I_MAX + 1]; int vec[I_MAX + 1];

View file

@ -120,41 +120,3 @@ logerror(s_char *format, ...)
#endif #endif
va_end(list); va_end(list);
} }
/*VARARGS*/
void
filelogerror(s_char *format, ...)
{
#if !defined(Rel4) && !defined(__linux__) && !defined(__ppc__)
extern s_char *sys_errlist[];
#endif /* Rel4 */
va_list list;
time_t now;
s_char buf[512];
s_char buf1[512];
int logf;
s_char *error;
s_char *p;
if (logfile == 0)
loginit();
va_start(list, format);
vsprintf(buf, format, list);
if ((p = index(buf, '\n')) != 0)
*p = 0;
(void)time(&now);
error = "log";
if (errno != 0)
#ifdef Rel4
error = strerror(errno);
#else
error = (s_char *)sys_errlist[errno];
#endif /* Rel4 */
(void)sprintf(buf1, "%s; (%s) %s", buf, error, ctime(&now));
if ((logf = open(logfile, O_WRONLY | O_CREAT | O_APPEND, 0666)) < 0)
return;
(void)write(logf, buf1, strlen(buf1));
(void)close(logf);
errno = 0;
va_end(list);
}

View file

@ -50,6 +50,9 @@
#include "subs.h" #include "subs.h"
#include "optlist.h" #include "optlist.h"
static void bitinit2(struct nstr_sect *, u_char *, int);
static int bmnxtsct(register struct nstr_sect *);
int int
draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp, draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
int country) int country)
@ -274,7 +277,7 @@ draw_map(int bmap, s_char origin, int map_flags, struct nstr_sect *nsp,
/* /*
* get the next sector in the range * get the next sector in the range
*/ */
int static int
bmnxtsct(register struct nstr_sect *np) bmnxtsct(register struct nstr_sect *np)
{ {
while (1) { while (1) {
@ -305,7 +308,7 @@ bmnxtsct(register struct nstr_sect *np)
/*NOTREACHED*/ /*NOTREACHED*/
} }
void static void
bitinit2(struct nstr_sect *np, u_char *bitmap, int country) bitinit2(struct nstr_sect *np, u_char *bitmap, int country)
{ {
extern int *bitmaps[]; extern int *bitmaps[];

View file

@ -107,7 +107,7 @@ struct empfile *ep;
* at reboot time (maybe) so we never need to free it */ * at reboot time (maybe) so we never need to free it */
struct sctstr **neighsects = (struct sctstr **)0; struct sctstr **neighsects = (struct sctstr **)0;
s_char * static s_char *
bp_init(void) bp_init(void)
{ {
struct bestp *bp; struct bestp *bp;
@ -135,7 +135,7 @@ bp_init(void)
* Find the best path from sector to to sector, and put the Empire movement * Find the best path from sector to to sector, and put the Empire movement
* string in path. Return 0 on success, -1 on error. * string in path. Return 0 on success, -1 on error.
*/ */
int static int
best_path(struct sctstr *from, struct sctstr *to, s_char *path, best_path(struct sctstr *from, struct sctstr *to, s_char *path,
int mob_type) int mob_type)
{ {

View file

@ -61,7 +61,7 @@ static void empth_setctx _PROTO((void *));
#endif #endif
static void empth_restorectx _PROTO(()); static void empth_restorectx _PROTO(());
void * static void *
empth_start(void *ctx) empth_start(void *ctx)
{ {
struct sigaction act; struct sigaction act;

View file

@ -36,16 +36,16 @@ LIB = $(SRCDIR)/lib/libgen.a
NTLIB = $(SRCDIR)\lib\libgen.lib NTLIB = $(SRCDIR)\lib\libgen.lib
OBJS = atoip.o atopi.o bit.o chance.o copy.o disassoc.o dtable.o \ OBJS = atoip.o atopi.o bit.o chance.o copy.o disassoc.o dtable.o \
emp_config.o getstarg.o getstring.o hpux.o iceil.o inet.o io.o \ emp_config.o getstarg.o getstring.o hpux.o inet.o io.o \
io_mask.o ioqueue.o lock.o mapdist.o minmax.o numstr.o onearg.o \ io_mask.o ioqueue.o lock.o mapdist.o minmax.o numstr.o onearg.o \
parse.o plur.o queue.o round.o same.o scthash.o signal.o \ parse.o plur.o queue.o round.o same.o scthash.o \
strdup.o strscan.o vsprintf.o strdup.o vsprintf.o
NTOBJS = atoip.obj atopi.obj bit.obj chance.obj copy.obj disassoc.obj \ NTOBJS = atoip.obj atopi.obj bit.obj chance.obj copy.obj disassoc.obj \
dtable.obj emp_config.obj getstarg.obj getstring.obj hpux.obj iceil.obj \ dtable.obj emp_config.obj getstarg.obj getstring.obj hpux.obj \
inet.obj io.obj io_mask.obj ioqueue.obj lock.obj mapdist.obj minmax.obj \ inet.obj io.obj io_mask.obj ioqueue.obj lock.obj mapdist.obj minmax.obj \
numstr.obj onearg.obj parse.obj plur.obj queue.obj round.obj same.obj \ numstr.obj onearg.obj parse.obj plur.obj queue.obj round.obj same.obj \
scthash.obj signal.obj strdup.obj strscan.obj vsprintf.obj scthash.obj strdup.obj vsprintf.obj
all: $(LIB) all: $(LIB)

View file

@ -1,52 +0,0 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
* related information and legal notices. It is expected that any future
* projects/authors will amend these files as needed.
*
* ---
*
* iceil.c: integer ceiling/floor functions
*
* Known contributors to this file:
*
*/
#include "gen.h"
int
iceil(double arg)
{
register int i;
i = arg;
return (i >= arg ? i : i + 1);
}
int
ifloor(double arg)
{
register int i;
i = arg;
return (i <= arg ? i : i - 1);
}

View file

@ -33,7 +33,6 @@
/* /*
* mapdist returns (integer) distance between two sectors. * mapdist returns (integer) distance between two sectors.
* mapdsq returns the square of the distance -- more efficient.
*/ */
#include "misc.h" #include "misc.h"
@ -107,12 +106,3 @@ mapdist(int x1, int y1, int x2, int y2)
return (dx - dy) / 2 + dy; return (dx - dy) / 2 + dy;
return dy; return dy;
} }
int
mapdsq(int x1, int y1, int x2, int y2)
{
int sq;
sq = mapdist(x1, y1, x2, y2);
return sq * sq;
}

View file

@ -1,105 +0,0 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
* related information and legal notices. It is expected that any future
* projects/authors will amend these files as needed.
*
* ---
*
* sig.c: block and unblock signals for critical sections
*
* Known contributors to this file:
* Doug Hay, 1998
* Steve McClure, 1998
*/
#include "misc.h"
#include "gen.h"
#include <signal.h>
u_int mask;
void
blocksig(void)
{
#if !defined(_WIN32)
mask = sigsetmask(0xffffffff);
#endif
}
void
unblocksig(void)
{
#if !defined(_WIN32)
sigsetmask(mask);
#endif
}
#ifdef sys5
const s_char *sys_siglist[] = {
"no signal",
"interrupt",
"quit",
"illegal instruction",
"trace trap",
"IOT instruction",
"system crash imminent",
"floating point exception",
"kill",
"bus error",
"segmentation violation",
"bad argument to system call",
"write on a pipe with no one to read it",
"alarm clock",
"software termination",
"user defined signal 1",
"user defined signal 2",
"death of a child",
"power-fail restart",
"asychronous i/o",
"PTY read/write",
"I/O intervention required",
"monitor mode granted",
"monitor mode retracted",
"sound ack",
"data pending",
};
#else
#if (!defined __ppc__) && (!defined linux) && (!defined FBSD) && (!defined __linux__)
/* linux and osx declare sys_siglist in signal.h */
extern s_char *sys_siglist[];
#endif /* linux */
#endif /* sys5 */
const s_char *
signame(int sig)
{
#ifdef POSIX_SIGNALS
if (sig <= 0 || sig > _sys_nsig)
return "bad signal";
return _sys_siglist[sig];
#else /* POSIX_SIGNALS */
if (sig <= 0 || sig > NSIG)
return "bad signal";
return sys_siglist[sig];
#endif /* POSIX_SIGNALS */
}

View file

@ -1,57 +0,0 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
* related information and legal notices. It is expected that any future
* projects/authors will amend these files as needed.
*
* ---
*
* strscan.c: scan a string for any occurence of another string
*
* Known contributors to this file:
* Steve McClure, 2000
*/
#ifdef Rel4
#include <string.h>
#endif /* Rel4 */
#include <stdio.h>
#include "misc.h"
int
strscan(s_char *target, s_char *string)
{
int i, n, delta;
if ((string == NULL) || (target == NULL))
return (1);
n = strlen(target);
delta = strlen(string);
if (delta < n)
return (1);
delta -= n;
for (i = 0; i <= delta; i++) {
if (!strncmp(target, &(string[i]), n))
return (0);
}
return (1);
}

View file

@ -41,6 +41,10 @@
#include "optlist.h" #include "optlist.h"
#include "global.h" #include "global.h"
static void init_mchr(void);
static void init_pchr(void);
static void init_plchr(void);
void void
global_init(void) global_init(void)
{ {
@ -50,7 +54,7 @@ global_init(void)
/* the same thing should be done for units... */ /* the same thing should be done for units... */
} }
void static void
init_mchr(void) init_mchr(void)
{ {
register struct mchrstr *mp; register struct mchrstr *mp;
@ -68,7 +72,7 @@ init_mchr(void)
} }
} }
void static void
init_plchr(void) init_plchr(void)
{ {
register struct plchrstr *pp; register struct plchrstr *pp;
@ -80,7 +84,7 @@ init_plchr(void)
} }
} }
void static void
init_pchr(void) init_pchr(void)
{ {
register struct pchrstr *p; register struct pchrstr *p;

View file

@ -44,6 +44,8 @@
#include "common.h" #include "common.h"
#include "gen.h" #include "gen.h"
static int nat_cap(int);
int int
init_nats(void) init_nats(void)
{ {
@ -69,7 +71,7 @@ init_nats(void)
return 0; return 0;
} }
int static int
nat_cap(int btu) nat_cap(int btu)
{ {
extern int s_p_etu; extern int s_p_etu;

View file

@ -112,7 +112,7 @@ player_login(void *ud)
/*NOTREACHED*/ /*NOTREACHED*/
} }
int static int
client_cmd(struct player *player, int ac, char **av) client_cmd(struct player *player, int ac, char **av)
{ {
int i; int i;
@ -130,7 +130,7 @@ client_cmd(struct player *player, int ac, char **av)
return RET_OK; return RET_OK;
} }
int static int
user_cmd(struct player *player, int ac, char **av) user_cmd(struct player *player, int ac, char **av)
{ {
if (ac < 1 || av[1] == '\0') if (ac < 1 || av[1] == '\0')
@ -141,7 +141,7 @@ user_cmd(struct player *player, int ac, char **av)
return RET_OK; return RET_OK;
} }
int static int
sanc_cmd(struct player *player, int ac, char **av) sanc_cmd(struct player *player, int ac, char **av)
{ {
struct nstr_item ni; struct nstr_item ni;
@ -171,7 +171,7 @@ sanc_cmd(struct player *player, int ac, char **av)
return RET_OK; return RET_OK;
} }
int static int
coun_cmd(struct player *player, int ac, char **av) coun_cmd(struct player *player, int ac, char **av)
{ {
natid cnum; natid cnum;
@ -188,7 +188,7 @@ coun_cmd(struct player *player, int ac, char **av)
return 0; return 0;
} }
int static int
pass_cmd(struct player *player, int ac, char **av) pass_cmd(struct player *player, int ac, char **av)
{ {
if (ac < 1 || av[1] == '\0') if (ac < 1 || av[1] == '\0')
@ -210,7 +210,7 @@ pass_cmd(struct player *player, int ac, char **av)
} }
/*ARGSUSED*/ /*ARGSUSED*/
int static int
play_cmd(struct player *player, int ac, char **av) play_cmd(struct player *player, int ac, char **av)
{ {
extern char *banfil; extern char *banfil;
@ -260,7 +260,7 @@ play_cmd(struct player *player, int ac, char **av)
} }
/*ARGSUSED*/ /*ARGSUSED*/
int static int
kill_cmd(struct player *player, int ac, char **av) kill_cmd(struct player *player, int ac, char **av)
{ {
struct player *other; struct player *other;
@ -280,7 +280,7 @@ kill_cmd(struct player *player, int ac, char **av)
} }
/*ARGSUSED*/ /*ARGSUSED*/
int static int
list_cmd(struct player *player, int ac, char **av) list_cmd(struct player *player, int ac, char **av)
{ {
struct player *lp; struct player *lp;
@ -303,7 +303,7 @@ list_cmd(struct player *player, int ac, char **av)
} }
/*ARGSUSED*/ /*ARGSUSED*/
int static int
quit_cmd(struct player *player, int ac, char **av) quit_cmd(struct player *player, int ac, char **av)
{ {
pr_id(player, C_EXIT, "so long\n"); pr_id(player, C_EXIT, "so long\n");

View file

@ -42,7 +42,7 @@ OBJS = aircombat.o askyn.o aswplnsubs.o attsub.o bigmap.o border.o bsanct.o \
neigh.o nreport.o nstr.o nuke.o nxtitem.o nxtsct.o paths.o plane.o \ neigh.o nreport.o nstr.o nuke.o nxtitem.o nxtsct.o paths.o plane.o \
plnsub.o pr.o radmap.o rej.o retreat.o sarg.o satmap.o \ plnsub.o pr.o radmap.o rej.o retreat.o sarg.o satmap.o \
sect.o ship.o show.o shpsub.o snxtitem.o snxtsct.o supply.o \ sect.o ship.o show.o shpsub.o snxtitem.o snxtsct.o supply.o \
takeover.o trdsub.o trechk.o whatitem.o wire.o wu.o takeover.o trdsub.o trechk.o whatitem.o wu.o
NTOBJS = aircombat.obj askyn.obj aswplnsubs.obj attsub.obj bigmap.obj \ NTOBJS = aircombat.obj askyn.obj aswplnsubs.obj attsub.obj bigmap.obj \
border.obj bsanct.obj caploss.obj chkmoney.obj cnumb.obj comsub.obj \ border.obj bsanct.obj caploss.obj chkmoney.obj cnumb.obj comsub.obj \
@ -53,7 +53,7 @@ NTOBJS = aircombat.obj askyn.obj aswplnsubs.obj attsub.obj bigmap.obj \
plnsub.obj pr.obj radmap.obj rej.obj retreat.obj sarg.obj satmap.obj \ plnsub.obj pr.obj radmap.obj rej.obj retreat.obj sarg.obj satmap.obj \
sect.obj ship.obj show.obj shpsub.obj snxtitem.obj \ sect.obj ship.obj show.obj shpsub.obj snxtitem.obj \
snxtsct.obj supply.obj takeover.obj trdsub.obj trechk.obj whatitem.obj \ snxtsct.obj supply.obj takeover.obj trdsub.obj trechk.obj whatitem.obj \
wire.obj wu.obj wu.obj
all: $(LIB) all: $(LIB)

View file

@ -78,29 +78,6 @@ emp_setbitmap(register int x, register int y, register u_char *bitmap,
} }
/*
* if we're not player->god, we have to set up the bitmaps
* correctly for the owned sectors. If we are player->god,
* forego all this (expensive) nonsense!
*/
void
emp_bitinit(struct nstr_sect *np, u_char *bitmap)
{
extern int *bitmaps[];
struct sctstr sect;
int eff;
while (nxtsct(np, &sect)) {
if (!player->owner)
continue;
eff = sect.sct_effic / 20;
if (eff > 4)
eff = 4;
emp_setbitmap(np->x, np->y, bitmap, bitmaps[eff]);
}
snxtsct_rewind(np);
}
/* /*
* *
* the bit offsets for each bit pattern based on the efficiency of * the bit offsets for each bit pattern based on the efficiency of

View file

@ -63,8 +63,20 @@ struct airport {
natid own; natid own;
}; };
s_char *mission_name(short int mission); static void add_airport(struct emp_qelem *, coord, coord);
s_char *nameofitem(s_char *buf, struct genitem *gp, int type); static int air_damage(struct emp_qelem *, coord, coord, int, natid,
s_char *, int);
static void build_mission_list(struct genlist *, coord, coord, int, natid);
static void build_mission_list_type(struct genlist *, coord, coord, int,
int, natid);
static void divide(struct emp_qelem *, struct emp_qelem *, coord, coord);
static int dosupport(struct genlist *, coord, coord, natid, natid);
static int find_airport(struct emp_qelem *, coord, coord);
static int mission_pln_arm(struct emp_qelem *, coord, coord, int,
int, struct ichrstr *, int, int, int *);
static void mission_pln_sel(struct emp_qelem *, int, int, int);
static int perform_mission(coord, coord, natid, struct emp_qelem *, int,
s_char *, int);
/* /*
* Interdict commodities & transported planes * Interdict commodities & transported planes
@ -250,7 +262,7 @@ def_support(coord x, coord y, natid victim, natid actee)
return dam; return dam;
} }
int static int
dosupport(struct genlist *mi, coord x, coord y, natid victim, natid actee) dosupport(struct genlist *mi, coord x, coord y, natid victim, natid actee)
{ {
register int cn; register int cn;
@ -274,7 +286,7 @@ dosupport(struct genlist *mi, coord x, coord y, natid victim, natid actee)
return dam; return dam;
} }
void static void
build_mission_list(struct genlist *mi, coord x, coord y, int mission, build_mission_list(struct genlist *mi, coord x, coord y, int mission,
natid victim) natid victim)
{ {
@ -283,7 +295,7 @@ build_mission_list(struct genlist *mi, coord x, coord y, int mission,
build_mission_list_type(mi, x, y, mission, EF_PLANE, victim); build_mission_list_type(mi, x, y, mission, EF_PLANE, victim);
} }
void static void
build_mission_list_type(struct genlist *mi, coord x, coord y, int mission, build_mission_list_type(struct genlist *mi, coord x, coord y, int mission,
int type, natid victim) int type, natid victim)
{ {
@ -394,7 +406,7 @@ build_mission_list_type(struct genlist *mi, coord x, coord y, int mission,
} }
} }
void static void
find_escorts(coord x, coord y, natid cn, struct emp_qelem *escorts) find_escorts(coord x, coord y, natid cn, struct emp_qelem *escorts)
{ {
struct nstr_item ni; struct nstr_item ni;
@ -424,7 +436,7 @@ find_escorts(coord x, coord y, natid cn, struct emp_qelem *escorts)
} }
} }
int static int
perform_mission(coord x, coord y, natid victim, struct emp_qelem *list, perform_mission(coord x, coord y, natid victim, struct emp_qelem *list,
int mission, s_char *s, int hardtarget) int mission, s_char *s, int hardtarget)
{ {
@ -1004,7 +1016,7 @@ oprange(struct genitem *gp, int type, int *radius)
* Remove all planes who cannot go on * Remove all planes who cannot go on
* the mission from the plane list. * the mission from the plane list.
*/ */
void static void
mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags, mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
int hardtarget) int hardtarget)
{ {
@ -1196,7 +1208,7 @@ mission_pln_sel(struct emp_qelem *list, int wantflags, int nowantflags,
* Arm only the planes at x,y * Arm only the planes at x,y
* *
*/ */
int static int
mission_pln_arm(struct emp_qelem *list, coord x, coord y, int dist, mission_pln_arm(struct emp_qelem *list, coord x, coord y, int dist,
int mission, struct ichrstr *ip, int flags, int mission, struct ichrstr *ip, int flags,
int mission_flags, int *tech) int mission_flags, int *tech)
@ -1364,7 +1376,7 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, int flags,
/* /*
* Return 1 if this x,y pair is in the list * Return 1 if this x,y pair is in the list
*/ */
int static int
find_airport(struct emp_qelem *airp, coord x, coord y) find_airport(struct emp_qelem *airp, coord x, coord y)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;
@ -1380,7 +1392,7 @@ find_airport(struct emp_qelem *airp, coord x, coord y)
} }
/* #*# This needs to be changed to include acc's -KHS */ /* #*# This needs to be changed to include acc's -KHS */
void static void
add_airport(struct emp_qelem *airp, coord x, coord y) add_airport(struct emp_qelem *airp, coord x, coord y)
{ {
struct airport *a; struct airport *a;
@ -1400,7 +1412,7 @@ add_airport(struct emp_qelem *airp, coord x, coord y)
* Take all the planes in list 1 that * Take all the planes in list 1 that
* are at x,y, and put them into list 2. * are at x,y, and put them into list 2.
*/ */
void static void
divide(struct emp_qelem *l1, struct emp_qelem *l2, coord x, coord y) divide(struct emp_qelem *l1, struct emp_qelem *l2, coord x, coord y)
{ {
struct emp_qelem *qp, *next; struct emp_qelem *qp, *next;
@ -1420,7 +1432,7 @@ divide(struct emp_qelem *l1, struct emp_qelem *l2, coord x, coord y)
} }
} }
int static int
air_damage(struct emp_qelem *bombers, coord x, coord y, int mission, air_damage(struct emp_qelem *bombers, coord x, coord y, int mission,
natid victim, s_char *s, int hardtarget) natid victim, s_char *s, int hardtarget)
{ {

View file

@ -46,7 +46,7 @@
#include "damage.h" #include "damage.h"
#include "prototypes.h" #include "prototypes.h"
extern int move_map(s_char *what, coord curx, coord cury, s_char *arg); static int move_map(s_char *what, coord curx, coord cury, s_char *arg);
int int
move_ground(s_char *what, struct sctstr *start, struct sctstr *end, move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
@ -260,7 +260,7 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
/*ARGSUSED*/ /*ARGSUSED*/
int static int
move_map(s_char *what, coord curx, coord cury, s_char *arg) move_map(s_char *what, coord curx, coord cury, s_char *arg)
{ {
struct nstr_sect ns; struct nstr_sect ns;

View file

@ -41,6 +41,8 @@
#include <fcntl.h> #include <fcntl.h>
#include "prototypes.h" #include "prototypes.h"
static void filereport(int, int, int, int);
void void
nreport(natid actor, int event, natid victim, int times) nreport(natid actor, int event, natid victim, int times)
{ {
@ -188,7 +190,7 @@ ncache(time_t now, int actor, int event, int victim, int times)
return np; return np;
} }
void static void
filereport(int actor, int event, int victim, int times) filereport(int actor, int event, int victim, int times)
{ {
struct newscache *np; struct newscache *np;

View file

@ -51,6 +51,8 @@
#include "prototypes.h" #include "prototypes.h"
#include "optlist.h" #include "optlist.h"
static int pln_equip(struct plist *, struct ichrstr *, int, s_char);
int int
pln_onewaymission(struct sctstr *target, int *shipno, int *flagp) pln_onewaymission(struct sctstr *target, int *shipno, int *flagp)
{ {
@ -510,7 +512,7 @@ pln_arm(struct emp_qelem *list, int dist, int mission, struct ichrstr *ip,
return mission_flags; return mission_flags;
} }
int static int
pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission) pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission)
{ {
register struct plchrstr *pcp; register struct plchrstr *pcp;

View file

@ -58,7 +58,7 @@
extern int update_pending; extern int update_pending;
#include "prototypes.h" #include "prototypes.h"
void outid(struct player *pl, int n); static void outid(struct player *pl, int n);
/*VARARGS*/ /*VARARGS*/
void void
@ -199,7 +199,7 @@ pr_hilite(s_char *buf)
/* /*
* output hex code + space * output hex code + space
*/ */
void static void
outid(struct player *pl, int n) outid(struct player *pl, int n)
{ {
s_char c; s_char c;

View file

@ -44,6 +44,8 @@
#include "prototypes.h" #include "prototypes.h"
#include "optlist.h" #include "optlist.h"
static void radmap2(int, int, int, int, int, double, int);
void void
radmap(int cx, int cy, int eff, int range, double seesub) radmap(int cx, int cy, int eff, int range, double seesub)
{ {
@ -70,7 +72,7 @@ static s_char *radbuf;
static s_char **vis; static s_char **vis;
static s_char *visbuf; static s_char *visbuf;
void static void
radmap2(int owner, radmap2(int owner,
int cx, int cy, int eff, int range, double seesub, int pr_flag) int cx, int cy, int eff, int range, double seesub, int pr_flag)
{ {

View file

@ -51,6 +51,10 @@
#include "prototypes.h" #include "prototypes.h"
#include "optlist.h" #include "optlist.h"
static int findcondition(s_char);
static int retreat_land1(struct lndstr *, s_char, int);
static int retreat_ship1(struct shpstr *, s_char, int);
struct ccode { struct ccode {
s_char code; s_char code;
s_char *desc[2]; s_char *desc[2];
@ -122,7 +126,7 @@ retreat_ship(struct shpstr *sp, s_char code)
} }
} }
int static int
retreat_ship1(struct shpstr *sp, s_char code, int orig) retreat_ship1(struct shpstr *sp, s_char code, int orig)
@ -356,7 +360,8 @@ struct sctstr *sect;
return CN_NAVIGABLE; return CN_NAVIGABLE;
} }
#endif #endif
int
static int
findcondition(s_char code) findcondition(s_char code)
{ {
int x; int x;
@ -417,7 +422,7 @@ retreat_land(struct lndstr *lp, s_char code)
} }
} }
int static int
retreat_land1(struct lndstr *lp, s_char code, int orig) retreat_land1(struct lndstr *lp, s_char code, int orig)

View file

@ -90,7 +90,7 @@ sarg_xy(s_char *ptr, coord *xp, coord *yp)
} }
/* returns absolute coords */ /* returns absolute coords */
int static int
sarg_getrange(s_char *buf, register struct range *rp) sarg_getrange(s_char *buf, register struct range *rp)
{ {
register int rlm; register int rlm;

View file

@ -46,6 +46,7 @@
#include "prototypes.h" #include "prototypes.h"
#include "optlist.h" #include "optlist.h"
static int checksect(struct sctstr *);
static void give_back_cap(struct sctstr *sp); static void give_back_cap(struct sctstr *sp);
/*ARGSUSED*/ /*ARGSUSED*/
@ -75,7 +76,7 @@ sct_prewrite(int id, s_char *ptr)
return 1; return 1;
} }
int static int
checksect(struct sctstr *sp) checksect(struct sctstr *sp)
{ {
int mil, civs, loyalcivs; int mil, civs, loyalcivs;

View file

@ -150,7 +150,7 @@ struct look_list {
or land units. */ or land units. */
static int lookup_list_cnt = 0; static int lookup_list_cnt = 0;
void static void
sort_lookup_list(void) sort_lookup_list(void)
{ {
struct natstr *np = getnatp(player->cnum); struct natstr *np = getnatp(player->cnum);

View file

@ -56,6 +56,11 @@ extern double tfactfire(natid, double);
extern int etu_per_update; extern int etu_per_update;
static int shp_check_nav(struct sctstr *);
static int shp_check_one_mines(struct mlist *);
static int shp_hit_mine(struct shpstr *, struct mchrstr *);
static void shp_mess(s_char *, struct mlist *);
void void
shp_sel(struct nstr_item *ni, struct emp_qelem *list) shp_sel(struct nstr_item *ni, struct emp_qelem *list)
@ -278,7 +283,7 @@ shp_sweep(struct emp_qelem *ship_list, int verbose, natid actor)
return stopping; return stopping;
} }
int static int
shp_check_one_mines(struct mlist *mlp) shp_check_one_mines(struct mlist *mlp)
{ {
struct sctstr sect; struct sctstr sect;
@ -307,7 +312,7 @@ shp_check_one_mines(struct mlist *mlp)
return 0; return 0;
} }
int static int
shp_check_mines(struct emp_qelem *ship_list) shp_check_mines(struct emp_qelem *ship_list)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;
@ -362,7 +367,7 @@ shp_list(struct emp_qelem *ship_list)
} }
} }
void static void
shp_mess(s_char *str, struct mlist *mlp) shp_mess(s_char *str, struct mlist *mlp)
{ {
mpr(mlp->ship.shp_own, "%s %s & stays in %s\n", mpr(mlp->ship.shp_own, "%s %s & stays in %s\n",
@ -374,7 +379,7 @@ shp_mess(s_char *str, struct mlist *mlp)
free((s_char *)mlp); free((s_char *)mlp);
} }
int static int
shp_check_nav(struct sctstr *sect) shp_check_nav(struct sctstr *sect)
{ {
extern struct dchrstr dchr[]; extern struct dchrstr dchr[];
@ -717,7 +722,7 @@ shp_fort_interdiction(struct emp_qelem *list, coord newx, coord newy,
return 0; return 0;
} }
int static int
shp_interdict(struct emp_qelem *list, coord newx, coord newy, natid victim) shp_interdict(struct emp_qelem *list, coord newx, coord newy, natid victim)
{ {
int stopping = 0; int stopping = 0;
@ -767,7 +772,7 @@ shp_hardtarget(struct shpstr *sp)
(20 + (double)sp->shp_speed * onsea / 2.0 - vis)); (20 + (double)sp->shp_speed * onsea / 2.0 - vis));
} }
int static int
shp_hit_mine(struct shpstr *sp, struct mchrstr *mcp) shp_hit_mine(struct shpstr *sp, struct mchrstr *mcp)
{ {
double m; double m;

View file

@ -50,6 +50,10 @@
#include "player.h" #include "player.h"
#include "prototypes.h" #include "prototypes.h"
static int get_minimum(struct lndstr *, int);
static s_char *itemname(int);
static int s_commod(int, int, int, int, int, int);
/* /*
* We want to get enough guns to be maxed out, enough shells to * We want to get enough guns to be maxed out, enough shells to
* fire once, one update's worth of food, enough fuel for * fire once, one update's worth of food, enough fuel for
@ -158,7 +162,7 @@ try_supply_commod(int own, int x, int y, int type, int total_wanted)
} }
/* Get supplies of a certain type */ /* Get supplies of a certain type */
int static int
s_commod(int own, int x, int y, int type, int total_wanted, s_commod(int own, int x, int y, int type, int total_wanted,
int actually_doit) int actually_doit)
{ {
@ -455,7 +459,7 @@ s_commod(int own, int x, int y, int type, int total_wanted,
} }
s_char * static s_char *
itemname(int type) itemname(int type)
{ {
register int t; register int t;
@ -469,25 +473,13 @@ itemname(int type)
return 0; return 0;
} }
int
at_minimum(struct lndstr *lp, int type)
{
int vec[I_MAX + 1];
getvec(VT_ITEM, vec, (s_char *)lp, EF_LAND);
if (vec[type] <= get_minimum(lp, type))
return 1;
return 0;
}
/* /*
* We want to get enough shells to fire once, * We want to get enough shells to fire once,
* one update's worth of food, enough fuel for * one update's worth of food, enough fuel for
* one update. * one update.
*/ */
int static int
get_minimum(struct lndstr *lp, int type) get_minimum(struct lndstr *lp, int type)
{ {
struct lchrstr *lcp; struct lchrstr *lcp;

View file

@ -1,88 +0,0 @@
/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* ---
*
* See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
* related information and legal notices. It is expected that any future
* projects/authors will amend these files as needed.
*
* ---
*
* wire.c: Write an announcement to the world
*
* Known contributors to this file:
*
*/
#include "misc.h"
#include <fcntl.h>
#if !defined(_WIN32)
#include <sys/uio.h>
#endif
#include "nat.h"
#include "tel.h"
#include "file.h"
#include "prototypes.h"
#if 0
int
typed_wire(natid from, natid to, s_char *message, int type)
{
register s_char *bp;
int len;
struct telstr tel;
struct natstr *np;
struct iovec iov[2];
int fd;
s_char buf[1024];
if ((np = getnatp(to)) == 0 ||
((np->nat_stat & STAT_NORM) == 0 &&
(np->nat_stat & STAT_SANCT) == 0))
return 0;
if ((fd = open(wirebox(buf, to), O_WRONLY | O_APPEND, 0)) < 0) {
logerror("telegram 'open' of %s (#%d) failed",
wirebox(buf, to), to);
return 0;
}
tel.tel_from = from;
(void)time(&tel.tel_date);
bp = message;
while (*bp++) ;
len = bp - message;
if (len >= MAXTELSIZE)
len = MAXTELSIZE;
message[len] = 0;
tel.tel_length = len;
tel.tel_type = type;
iov[0].iov_base = (caddr_t)&tel;
iov[0].iov_len = sizeof(tel);
iov[1].iov_base = message;
iov[1].iov_len = len;
if (writev(fd, iov, 2) < iov[0].iov_len + iov[1].iov_len) {
logerror("telegram 'write' to #%d failed", to);
} else {
np->nat_ann++;
/* don't do putnat because of expense */
}
(void)close(fd);
return 0;
}
#endif

View file

@ -49,6 +49,14 @@
#include "gen.h" #include "gen.h"
#include "subs.h" #include "subs.h"
static int grow_people(struct sctstr *, register int,
register struct natstr *, int *, int,
register int *);
static int growfood(struct sctstr *, register int *, int, int);
static void starvation(struct sctstr *);
static void trunc_people(struct sctstr *, register struct natstr *,
register int *);
/* /*
* feed the individual sector * feed the individual sector
* *
@ -136,7 +144,7 @@ do_feed(register struct sctstr *sp, register struct natstr *np, int *vec,
return sctwork; return sctwork;
} }
int static int
growfood(struct sctstr *sp, register int *vec, int work, int etu) growfood(struct sctstr *sp, register int *vec, int work, int etu)
{ {
extern double fgrate; extern double fgrate;
@ -244,7 +252,7 @@ feed_people(register int *vec, int etu, int *needed)
/* /*
* Truncate any extra people that may be around * Truncate any extra people that may be around
*/ */
void static void
trunc_people(struct sctstr *sp, register struct natstr *np, trunc_people(struct sctstr *sp, register struct natstr *np,
register int *vec) register int *vec)
{ {
@ -262,7 +270,7 @@ trunc_people(struct sctstr *sp, register struct natstr *np,
* rate limitation on countries with high tech * rate limitation on countries with high tech
* production? Maybe with just high education? * production? Maybe with just high education?
*/ */
int static int
grow_people(struct sctstr *sp, register int etu, grow_people(struct sctstr *sp, register int etu,
register struct natstr *np, int *workp, int sctwork, register struct natstr *np, int *workp, int sctwork,
register int *vec) register int *vec)
@ -324,7 +332,7 @@ grow_people(struct sctstr *sp, register int etu,
/* /*
* percentage of people who starved * percentage of people who starved
*/ */
void static void
starvation(struct sctstr *sp) starvation(struct sctstr *sp)
{ {
sp->sct_work = 0; sp->sct_work = 0;

View file

@ -59,8 +59,10 @@ int mil_dbl_pay;
#define MIN(x,y) ((x) > (y) ? (y) : (x)) #define MIN(x,y) ((x) > (y) ? (y) : (x))
#endif #endif
void upd_land(register struct lndstr *lp, int landno, register int etus, static int landrepair(register struct lndstr *, int *, struct natstr *,
struct natstr *np, int *bp, int build); int *, int);
static void upd_land(register struct lndstr *lp, int landno, register int etus,
struct natstr *np, int *bp, int build);
int int
prod_land(int etus, int natnum, int *bp, int build) prod_land(int etus, int natnum, int *bp, int build)
@ -109,7 +111,7 @@ prod_land(int etus, int natnum, int *bp, int build)
return k; return k;
} }
void static void
upd_land(register struct lndstr *lp, int landno, register int etus, upd_land(register struct lndstr *lp, int landno, register int etus,
struct natstr *np, int *bp, int build) struct natstr *np, int *bp, int build)
/* build = 1, maintain = 0 */ /* build = 1, maintain = 0 */
@ -239,7 +241,7 @@ upd_land(register struct lndstr *lp, int landno, register int etus,
} }
/*ARGSUSED*/ /*ARGSUSED*/
int static int
landrepair(register struct lndstr *land, int *vec, struct natstr *np, landrepair(register struct lndstr *land, int *vec, struct natstr *np,
int *bp, int etus) int *bp, int etus)
{ {

View file

@ -61,6 +61,9 @@ long tpops[MAXNOC];
extern int mil_dbl_pay; extern int mil_dbl_pay;
int update_pending = 0; int update_pending = 0;
static void do_prod(int, int, int, int *, long int (*)[2], int *, int *,
int *, int *, int *, int *);
/*ARGSUSED*/ /*ARGSUSED*/
void void
update_main(void *argv) update_main(void *argv)
@ -212,7 +215,7 @@ update_main(void *argv)
/*NOTREACHED*/ /*NOTREACHED*/
} }
void static void
do_prod(int sector_type, int etu, int n, int *bp, long int (*p_sect)[2], do_prod(int sector_type, int etu, int n, int *bp, long int (*p_sect)[2],
int *ship_build, int *ship_maint, int *plane_build, int *ship_build, int *ship_maint, int *plane_build,
int *plane_maint, int *land_build, int *land_maint) int *plane_maint, int *land_build, int *land_maint)

View file

@ -51,6 +51,10 @@ extern int timestamp_fixing;
extern int update_pending; extern int update_pending;
int do_upd_checking = 0; int do_upd_checking = 0;
static void do_mob_land(register struct lndstr *, register int);
static void do_mob_plane(register struct plnstr *, register int);
static void do_mob_sect(register struct sctstr *sp, register int etus);
static void do_mob_ship(register struct shpstr *, register int);
int int
increase_mob(time_t * counter, float mult) increase_mob(time_t * counter, float mult)
@ -239,7 +243,7 @@ mob_sect(register int etus)
} }
} }
void static void
do_mob_sect(register struct sctstr *sp, register int etus) do_mob_sect(register struct sctstr *sp, register int etus)
{ {
extern float sect_mob_scale; extern float sect_mob_scale;
@ -279,7 +283,7 @@ mob_ship(register int etus)
} }
} }
void static void
do_mob_ship(register struct shpstr *sp, register int etus) do_mob_ship(register struct shpstr *sp, register int etus)
{ {
extern int ship_mob_max; extern int ship_mob_max;
@ -392,7 +396,7 @@ mob_land(register int etus)
} }
} }
void static void
do_mob_land(register struct lndstr *lp, register int etus) do_mob_land(register struct lndstr *lp, register int etus)
{ {
extern int land_mob_max; extern int land_mob_max;
@ -539,7 +543,7 @@ mob_plane(register int etus)
} }
} }
void static void
do_mob_plane(register struct plnstr *pp, register int etus) do_mob_plane(register struct plnstr *pp, register int etus)
{ {
extern int plane_mob_max; extern int plane_mob_max;

View file

@ -45,8 +45,6 @@
#include "update.h" #include "update.h"
#include "subs.h" #include "subs.h"
float levels[MAXNOC][4];
/* /*
* hap and edu avg mean that the weight on current happiness is * hap and edu avg mean that the weight on current happiness is
* (cur_hap * hap_avg + hap_prod * etu) / (hap_avg + etu); * (cur_hap * hap_avg + hap_prod * etu) / (hap_avg + etu);
@ -62,6 +60,8 @@ extern float hap_avg;
extern float edu_avg; extern float edu_avg;
extern float ally_factor; extern float ally_factor;
static void share_incr(register double *, register double *);
/* /*
* for values below the "easy level" values, production is * for values below the "easy level" values, production is
* as normal. For values above "easy", production gets harder * as normal. For values above "easy", production gets harder
@ -78,6 +78,8 @@ extern float ally_factor;
float level_easy[4] = { 0.75, 0.75, 5.00, 5.00 }; float level_easy[4] = { 0.75, 0.75, 5.00, 5.00 };
float level_log[4] = { 1.75, 2.00, 4.00, 6.00 }; float level_log[4] = { 1.75, 2.00, 4.00, 6.00 };
float levels[MAXNOC][4];
/* /*
* technique to limit the sharpers who turn entire countries * technique to limit the sharpers who turn entire countries
* into tech plants overnight... * into tech plants overnight...
@ -91,7 +93,7 @@ logx(double d, double base)
return log10(d) / log10(base); return log10(d) / log10(base);
} }
double static double
limit_level(double level, int type, int flag) limit_level(double level, int type, int flag)
{ {
double above_easy; double above_easy;
@ -241,7 +243,7 @@ prod_nat(int etu)
/* /*
* find out everyones increment * find out everyones increment
*/ */
void static void
share_incr(register double *res, register double *tech) share_incr(register double *res, register double *tech)
{ {
register struct natstr *np; register struct natstr *np;

View file

@ -54,8 +54,9 @@
#include <stdlib.h> #include <stdlib.h>
extern int check_nav(struct sctstr *sect); extern int check_nav(struct sctstr *sect);
static void swap(register struct shpstr *);
void static void
scuttle_it(register struct shpstr *sp) scuttle_it(register struct shpstr *sp)
{ {
struct sctstr *sectp; struct sctstr *sectp;
@ -116,7 +117,7 @@ nav_check_atdest(register struct shpstr *sp, struct mchrstr *mcp)
/* flip the 2 fields that deal with autonav movement. */ /* flip the 2 fields that deal with autonav movement. */
/* CZ 6/1/94 */ /* CZ 6/1/94 */
void static void
swap(register struct shpstr *sp) swap(register struct shpstr *sp)
{ {
coord tcord; coord tcord;

View file

@ -47,6 +47,9 @@
#include "lost.h" #include "lost.h"
#include "gen.h" #include "gen.h"
static int infect_people(struct natstr *, register int *, u_int, int,
struct sctstr *);
void void
do_plague(struct sctstr *sp, struct natstr *np, int etu) do_plague(struct sctstr *sp, struct natstr *np, int etu)
{ {
@ -119,7 +122,7 @@ do_plague(struct sctstr *sp, struct natstr *np, int etu)
} }
/*ARGSUSED*/ /*ARGSUSED*/
int static int
infect_people(struct natstr *np, register int *vec, u_int eff, int mobil, infect_people(struct natstr *np, register int *vec, u_int eff, int mobil,
struct sctstr *sp) struct sctstr *sp)
{ {

View file

@ -45,6 +45,10 @@
#include "common.h" #include "common.h"
#include "optlist.h" #include "optlist.h"
static void materials_charge(struct pchrstr *, register int *,
register int);
static int materials_cost(struct pchrstr *, register int *, int *);
s_char *levelnames[] = s_char *levelnames[] =
{ "Technology", "Research", "Education", "Happiness" }; { "Technology", "Research", "Education", "Happiness" };
@ -186,7 +190,7 @@ produce(struct natstr *np, struct sctstr *sp, int *vec, int work,
return 0; return 0;
} }
int static int
materials_cost(struct pchrstr *product, register int *vec, int *costp) materials_cost(struct pchrstr *product, register int *vec, int *costp)
{ {
register u_char *vp; register u_char *vp;
@ -212,7 +216,7 @@ materials_cost(struct pchrstr *product, register int *vec, int *costp)
return count; return count;
} }
void static void
materials_charge(struct pchrstr *product, register int *vec, materials_charge(struct pchrstr *product, register int *vec,
register int count) register int count)
{ {

View file

@ -50,6 +50,8 @@
#include "lost.h" #include "lost.h"
#include "subs.h" #include "subs.h"
static void take_casualties(struct sctstr *, int);
#define get_che_cnum(x) ((x) >> 8) #define get_che_cnum(x) ((x) >> 8)
#define set_che_cnum(x, cn) ((x) = ((x) & 0xff) | ((cn) << 8)) #define set_che_cnum(x, cn) ((x) = ((x) & 0xff) | ((cn) << 8))
#define get_che_value(x) ((x) & 0xff) #define get_che_value(x) ((x) & 0xff)
@ -452,7 +454,7 @@ guerrilla(struct sctstr *sp)
} }
} }
void static void
take_casualties(struct sctstr *sp, int mc) take_casualties(struct sctstr *sp, int mc)
{ {
int orig_mil; int orig_mil;

View file

@ -50,6 +50,8 @@
#include "common.h" #include "common.h"
#include <stdlib.h> #include <stdlib.h>
static void fltp_to_list(struct fltheadstr *, struct emp_qelem *);
static void static void
cost_ship(struct shpstr *sp, struct fltelemstr *ep, struct fltheadstr *fp) cost_ship(struct shpstr *sp, struct fltelemstr *ep, struct fltheadstr *fp)
{ {
@ -331,7 +333,7 @@ sail_ship(natid cn)
/* The following is a total hack by Ken Stevens to cut down dramatically on repeated code 1995 */ /* The following is a total hack by Ken Stevens to cut down dramatically on repeated code 1995 */
void static void
fltp_to_list(struct fltheadstr *fltp, struct emp_qelem *list) fltp_to_list(struct fltheadstr *fltp, struct emp_qelem *list)
{ {
struct fltelemstr *fe; struct fltelemstr *fe;

View file

@ -95,7 +95,7 @@ dodeliver(struct sctstr *sp, int *vec)
* decrease sector efficiency if old type != new type. * decrease sector efficiency if old type != new type.
* Return amount of work used. * Return amount of work used.
*/ */
int static int
upd_buildeff(struct natstr *np, register struct sctstr *sp, int *workp, upd_buildeff(struct natstr *np, register struct sctstr *sp, int *workp,
int *vec, int etu, int *desig, int sctwork, int *cost) int *vec, int etu, int *desig, int sctwork, int *cost)
{ {
@ -179,7 +179,7 @@ upd_buildeff(struct natstr *np, register struct sctstr *sp, int *workp,
* Conversion will happen much more slowly without * Conversion will happen much more slowly without
* some mil initially. * some mil initially.
*/ */
int static int
enlist(register int *vec, int etu, int *cost) enlist(register int *vec, int etu, int *cost)
{ {
int maxmil; int maxmil;
@ -203,7 +203,7 @@ enlist(register int *vec, int etu, int *cost)
extern int melt_item_denom[]; extern int melt_item_denom[];
void static void
meltitems(int etus, int fallout, int own, int *vec, int type, int x, int y, meltitems(int etus, int fallout, int own, int *vec, int type, int x, int y,
int uid) int uid)
{ {

View file

@ -56,6 +56,11 @@
#define MIN(x,y) ((x) > (y) ? (y) : (x)) #define MIN(x,y) ((x) > (y) ? (y) : (x))
#endif #endif
static int shiprepair(register struct shpstr *, int *, struct natstr *,
int *, int);
static void upd_ship(register struct shpstr *, int, register int,
struct natstr *, int *, int);
int int
prod_ship(int etus, int natnum, int *bp, int build) prod_ship(int etus, int natnum, int *bp, int build)
/* build = 1, maintain = 0 */ /* build = 1, maintain = 0 */
@ -104,7 +109,7 @@ prod_ship(int etus, int natnum, int *bp, int build)
return k; return k;
} }
void static void
upd_ship(register struct shpstr *sp, int shipno, register int etus, upd_ship(register struct shpstr *sp, int shipno, register int etus,
struct natstr *np, int *bp, int build) struct natstr *np, int *bp, int build)
/* build = 1, maintain = 0 */ /* build = 1, maintain = 0 */
@ -258,7 +263,7 @@ upd_ship(register struct shpstr *sp, int shipno, register int etus,
* battleships +8 % eff each etu. This will cost around * battleships +8 % eff each etu. This will cost around
* 8 * 8 * $40 = $2560! * 8 * 8 * $40 = $2560!
*/ */
int static int
shiprepair(register struct shpstr *ship, int *vec, struct natstr *np, shiprepair(register struct shpstr *ship, int *vec, struct natstr *np,
int *bp, int etus) int *bp, int etus)
{ {