Add some missing declarations to headers. Remove some redundant
declarations elsewhere. Change linkage of some functions to static.
This commit is contained in:
parent
e7811102a3
commit
4a3f0b8146
43 changed files with 72 additions and 169 deletions
|
@ -153,6 +153,7 @@ extern struct castr loan_ca[];
|
||||||
extern struct castr genitem_ca[];
|
extern struct castr genitem_ca[];
|
||||||
extern struct castr map_ca[];
|
extern struct castr map_ca[];
|
||||||
extern struct castr bmp_ca[];
|
extern struct castr bmp_ca[];
|
||||||
|
extern struct castr lost_ca[];
|
||||||
extern struct castr commodity_ca[];
|
extern struct castr commodity_ca[];
|
||||||
|
|
||||||
/* src/lib/subs/nstr.c */
|
/* src/lib/subs/nstr.c */
|
||||||
|
|
|
@ -205,6 +205,10 @@ extern long last_demand_update;
|
||||||
|
|
||||||
/* Game parameters that cannot be set in econfig (yet) */
|
/* Game parameters that cannot be set in econfig (yet) */
|
||||||
extern int melt_item_denom[];
|
extern int melt_item_denom[];
|
||||||
|
extern float start_education;
|
||||||
|
extern float start_happiness;
|
||||||
|
extern float start_technology;
|
||||||
|
extern float start_research;
|
||||||
#ifdef START_UNITS
|
#ifdef START_UNITS
|
||||||
int start_unit_type[];
|
int start_unit_type[];
|
||||||
#endif
|
#endif
|
||||||
|
@ -219,6 +223,7 @@ extern s_char *commfil;
|
||||||
extern s_char *banfil;
|
extern s_char *banfil;
|
||||||
extern s_char *authfil;
|
extern s_char *authfil;
|
||||||
extern s_char *timestampfil;
|
extern s_char *timestampfil;
|
||||||
|
/* teldir, telfil, annfil are in tel.h */
|
||||||
|
|
||||||
struct keymatch {
|
struct keymatch {
|
||||||
s_char *km_key; /* the key */
|
s_char *km_key; /* the key */
|
||||||
|
|
|
@ -44,10 +44,10 @@
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void wrmakesrc(char *pathname);
|
static void wrmakesrc(char *pathname);
|
||||||
void wripglob(char *filename);
|
static void wripglob(char *filename);
|
||||||
void wrauth(char *filename);
|
static void wrauth(char *filename);
|
||||||
void wrgamesdef(char *filename);
|
static void wrgamesdef(char *filename);
|
||||||
|
|
||||||
char *_c_copyright_header =
|
char *_c_copyright_header =
|
||||||
"/*\n * Empire - A multi-player, client/server Internet based war game.\n * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,\n * Ken Stevens, Steve McClure\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n *\n * ---\n *\n * See the \"LEGAL\", \"LICENSE\", \"CREDITS\" and \"README\" files for all the\n * related information and legal notices. It is expected that any future\n * projects/authors will amend these files as needed.\n *\n * ---\n *\n * gamesdef.h: This is an auto-generated file.\n * \n * Known contributors to this file:\n * Automatically generated by doconfig.c\n */\n\n";
|
"/*\n * Empire - A multi-player, client/server Internet based war game.\n * Copyright (C) 1986-2000, Dave Pare, Jeff Bailey, Thomas Ruschak,\n * Ken Stevens, Steve McClure\n *\n * This program is free software; you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation; either version 2 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n *\n * ---\n *\n * See the \"LEGAL\", \"LICENSE\", \"CREDITS\" and \"README\" files for all the\n * related information and legal notices. It is expected that any future\n * projects/authors will amend these files as needed.\n *\n * ---\n *\n * gamesdef.h: This is an auto-generated file.\n * \n * Known contributors to this file:\n * Automatically generated by doconfig.c\n */\n\n";
|
||||||
|
@ -105,7 +105,7 @@ main(void)
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
wrmakesrc(char *pathname)
|
wrmakesrc(char *pathname)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -123,7 +123,7 @@ wrmakesrc(char *pathname)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
wripglob(char *filename)
|
wripglob(char *filename)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -140,7 +140,7 @@ wripglob(char *filename)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
wrauth(char *filename)
|
wrauth(char *filename)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -166,7 +166,7 @@ wrauth(char *filename)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
wrgamesdef(char *filename)
|
wrgamesdef(char *filename)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
|
@ -44,9 +44,7 @@
|
||||||
#include "tel.h"
|
#include "tel.h"
|
||||||
#include "land.h"
|
#include "land.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
#include "optlist.h"
|
||||||
extern float start_education, start_happiness;
|
|
||||||
extern float start_technology, start_research;
|
|
||||||
|
|
||||||
int
|
int
|
||||||
add(void)
|
add(void)
|
||||||
|
|
|
@ -48,8 +48,6 @@
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
extern int etu_per_update;
|
|
||||||
extern int sect_mob_neg_factor;
|
|
||||||
/*
|
/*
|
||||||
* format: anti <SECT>
|
* format: anti <SECT>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -56,15 +56,6 @@
|
||||||
#define MIN(x,y) ((x) > (y) ? (y) : (x))
|
#define MIN(x,y) ((x) > (y) ? (y) : (x))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int etu_per_update;
|
|
||||||
extern double bankint;
|
|
||||||
extern double money_civ;
|
|
||||||
extern double money_uw;
|
|
||||||
extern double money_mil;
|
|
||||||
extern double obrate, uwbrate;
|
|
||||||
extern int etu_per_update;
|
|
||||||
extern double money_res;
|
|
||||||
|
|
||||||
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,
|
||||||
|
|
|
@ -68,10 +68,6 @@ static int build_plane(register struct sctstr *sp,
|
||||||
|
|
||||||
static int cash; /* static ok */
|
static int cash; /* static ok */
|
||||||
|
|
||||||
extern int morale_base;
|
|
||||||
extern int sect_mob_neg_factor;
|
|
||||||
extern int etu_per_update;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* build <WHAT> <SECTS> <TYPE|DIR|MEG> [NUMBER]
|
* build <WHAT> <SECTS> <TYPE|DIR|MEG> [NUMBER]
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -54,8 +54,6 @@
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
extern int MARK_DELAY;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* format: buy <COMMODITY>
|
* format: buy <COMMODITY>
|
||||||
*
|
*
|
||||||
|
|
|
@ -46,9 +46,6 @@
|
||||||
|
|
||||||
static int explore_map(s_char *what, coord curx, coord cury, s_char *arg);
|
static int explore_map(s_char *what, coord curx, coord cury, s_char *arg);
|
||||||
|
|
||||||
extern int etu_per_update;
|
|
||||||
extern int sect_mob_neg_factor;
|
|
||||||
|
|
||||||
int
|
int
|
||||||
explore(void)
|
explore(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -235,7 +235,6 @@ printdir(void)
|
||||||
extern int alphasort(const struct dirent *const *,
|
extern int alphasort(const struct dirent *const *,
|
||||||
const struct dirent *const *);
|
const struct dirent *const *);
|
||||||
#endif
|
#endif
|
||||||
extern s_char *infodir;
|
|
||||||
static time_t lastmodtime;
|
static time_t lastmodtime;
|
||||||
static int number;
|
static int number;
|
||||||
static struct dirent **dp;
|
static struct dirent **dp;
|
||||||
|
@ -369,7 +368,6 @@ apro(void)
|
||||||
int
|
int
|
||||||
info(void)
|
info(void)
|
||||||
{
|
{
|
||||||
extern s_char *infodir;
|
|
||||||
s_char buf[255];
|
s_char buf[255];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
s_char *bp;
|
s_char *bp;
|
||||||
|
@ -441,7 +439,6 @@ info(void)
|
||||||
static int
|
static int
|
||||||
printdir(void)
|
printdir(void)
|
||||||
{
|
{
|
||||||
extern s_char *infodir;
|
|
||||||
HANDLE hDir;
|
HANDLE hDir;
|
||||||
WIN32_FIND_DATA fData;
|
WIN32_FIND_DATA fData;
|
||||||
int count;
|
int count;
|
||||||
|
@ -473,7 +470,6 @@ printdir(void)
|
||||||
int
|
int
|
||||||
apro(void)
|
apro(void)
|
||||||
{
|
{
|
||||||
extern s_char *infodir;
|
|
||||||
HANDLE hDir;
|
HANDLE hDir;
|
||||||
WIN32_FIND_DATA fData;
|
WIN32_FIND_DATA fData;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
#define LOAD 1
|
#define LOAD 1
|
||||||
#define UNLOAD -1
|
#define UNLOAD -1
|
||||||
|
|
||||||
void gift(int givee, int giver, s_char *ptr, int type, s_char *mesg);
|
|
||||||
static int load_plane_ship(struct sctstr *sectp, struct shpstr *sp,
|
static int load_plane_ship(struct sctstr *sectp, struct shpstr *sp,
|
||||||
int noisy, int load_unload, int *nshipsp);
|
int noisy, int load_unload, int *nshipsp);
|
||||||
static int load_land_ship(struct sctstr *sectp, struct shpstr *sp,
|
static int load_land_ship(struct sctstr *sectp, struct shpstr *sp,
|
||||||
|
|
|
@ -41,8 +41,7 @@
|
||||||
#include "nat.h"
|
#include "nat.h"
|
||||||
#include "deity.h"
|
#include "deity.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
#include "optlist.h"
|
||||||
extern int morale_base;
|
|
||||||
|
|
||||||
int
|
int
|
||||||
morale(void)
|
morale(void)
|
||||||
|
|
|
@ -49,10 +49,6 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
extern float start_education, start_happiness;
|
|
||||||
extern float start_technology, start_research;
|
|
||||||
extern int morale_base;
|
|
||||||
|
|
||||||
static int deity_build_land(int, coord, coord, natid, int);
|
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 void ok(s_char *map, int x, int y);
|
||||||
|
@ -64,9 +60,6 @@ static struct range defrealm = { -8, -5, 10, 5, 0, 0 };
|
||||||
int
|
int
|
||||||
new(void)
|
new(void)
|
||||||
{
|
{
|
||||||
#ifdef START_UNITS
|
|
||||||
extern int start_unit_type[START_UNITS];
|
|
||||||
#endif /* START_UNITS */
|
|
||||||
struct sctstr sect;
|
struct sctstr sect;
|
||||||
struct natstr *natp;
|
struct natstr *natp;
|
||||||
struct boundstr newrealms;
|
struct boundstr newrealms;
|
||||||
|
|
|
@ -48,7 +48,6 @@
|
||||||
#include "land.h"
|
#include "land.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
extern int etu_per_update;
|
|
||||||
static void starv_sects(s_char *range);
|
static void starv_sects(s_char *range);
|
||||||
static void starv_ships(s_char *range);
|
static void starv_ships(s_char *range);
|
||||||
static void starv_units(s_char *range);
|
static void starv_units(s_char *range);
|
||||||
|
|
|
@ -57,8 +57,6 @@ static void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range,
|
||||||
int ntargets);
|
int ntargets);
|
||||||
static int fire_torp(struct shpstr *, struct shpstr *, int, int);
|
static int fire_torp(struct shpstr *, struct shpstr *, int, int);
|
||||||
|
|
||||||
s_char *prsub(struct shpstr *sp);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
torp(void)
|
torp(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,10 +55,6 @@
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
extern int sect_mob_neg_factor;
|
|
||||||
extern int etu_per_update;
|
|
||||||
extern int TRADE_DELAY;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* format: trade
|
* format: trade
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -47,8 +47,6 @@
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
|
||||||
extern float drnuke_const;
|
|
||||||
|
|
||||||
int
|
int
|
||||||
vers(void)
|
vers(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,8 +34,7 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "nat.h"
|
#include "nat.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
#include "optlist.h"
|
||||||
extern float fire_range_factor;
|
|
||||||
|
|
||||||
double
|
double
|
||||||
tfact(natid cn, double mult)
|
tfact(natid cn, double mult)
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include "match.h"
|
#include "match.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
#include "tel.h"
|
||||||
#include "gen.h" /* parse */
|
#include "gen.h" /* parse */
|
||||||
|
|
||||||
/* for systems without strdup */
|
/* for systems without strdup */
|
||||||
|
@ -380,9 +381,6 @@ struct otherfiles {
|
||||||
char *name;
|
char *name;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern s_char *upfil, *downfil, *disablefil, *banfil, *authfil;
|
|
||||||
extern s_char *commfil, *annfil, *telfil, *teldir, *timestampfil;
|
|
||||||
|
|
||||||
/* list of other well known files... -maybe tailor these oneday
|
/* list of other well known files... -maybe tailor these oneday
|
||||||
* anyway - meantime they are all relative to datadir */
|
* anyway - meantime they are all relative to datadir */
|
||||||
static struct otherfiles ofiles[] = {
|
static struct otherfiles ofiles[] = {
|
||||||
|
|
|
@ -63,8 +63,6 @@
|
||||||
|
|
||||||
#include "empthread.h"
|
#include "empthread.h"
|
||||||
|
|
||||||
extern struct player *player; /* XXX */
|
|
||||||
|
|
||||||
struct iop {
|
struct iop {
|
||||||
int fd;
|
int fd;
|
||||||
struct ioqueue *input;
|
struct ioqueue *input;
|
||||||
|
|
|
@ -98,7 +98,6 @@ void
|
||||||
lwpInitContext(volatile struct lwpProc *volatile newp, void *sp)
|
lwpInitContext(volatile struct lwpProc *volatile newp, void *sp)
|
||||||
{
|
{
|
||||||
static jmp_buf *cpp;
|
static jmp_buf *cpp;
|
||||||
extern struct lwpProc *LwpCurrent;
|
|
||||||
|
|
||||||
if (!lwpSave(LwpCurrent->context)) {
|
if (!lwpSave(LwpCurrent->context)) {
|
||||||
cpp = (jmp_buf *) & newp->context;
|
cpp = (jmp_buf *) & newp->context;
|
||||||
|
@ -305,7 +304,6 @@ void
|
||||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||||
{
|
{
|
||||||
static jmp_buf *cpp;
|
static jmp_buf *cpp;
|
||||||
extern struct lwpProc *LwpCurrent;
|
|
||||||
|
|
||||||
memset(newp->context, 0, sizeof(newp->context));
|
memset(newp->context, 0, sizeof(newp->context));
|
||||||
newp->context[0] = (int)sp;
|
newp->context[0] = (int)sp;
|
||||||
|
|
|
@ -36,11 +36,6 @@
|
||||||
#include <bounds/unchecked.h>
|
#include <bounds/unchecked.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef hpc
|
|
||||||
extern struct lwpProc *initcontext;
|
|
||||||
extern int startpoint;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct lwpQueue LwpSchedQ[LWP_MAX_PRIO], LwpDeadQ;
|
struct lwpQueue LwpSchedQ[LWP_MAX_PRIO], LwpDeadQ;
|
||||||
|
|
||||||
struct lwpProc *LwpCurrent = NULL;
|
struct lwpProc *LwpCurrent = NULL;
|
||||||
|
|
|
@ -29,6 +29,11 @@
|
||||||
/* more inefficient the context switch time */
|
/* more inefficient the context switch time */
|
||||||
#define LCOUNT -1
|
#define LCOUNT -1
|
||||||
|
|
||||||
|
#ifdef hpc
|
||||||
|
extern struct lwpProc *initcontext;
|
||||||
|
extern int startpoint;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef hpux
|
#ifdef hpux
|
||||||
int lwpSave(jmp_buf);
|
int lwpSave(jmp_buf);
|
||||||
void lwpRestore(jmp_buf);
|
void lwpRestore(jmp_buf);
|
||||||
|
|
|
@ -61,7 +61,6 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
struct player *player;
|
struct player *player;
|
||||||
extern int m_m_p_d;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
player_main(struct player *p)
|
player_main(struct player *p)
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
void kaboom(int x, int y, int rad, natid cn);
|
static void kaboom(int x, int y, int rad, natid cn);
|
||||||
|
|
||||||
int
|
int
|
||||||
detonate(struct plnstr *pp, int x, int y)
|
detonate(struct plnstr *pp, int x, int y)
|
||||||
|
@ -317,7 +317,7 @@ detonate(struct plnstr *pp, int x, int y)
|
||||||
/*
|
/*
|
||||||
* silly to be sure.
|
* silly to be sure.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
kaboom(int x, int y, int rad, natid cn)
|
kaboom(int x, int y, int rad, natid cn)
|
||||||
{
|
{
|
||||||
mpr(cn, "\n\nK A B ");
|
mpr(cn, "\n\nK A B ");
|
||||||
|
|
|
@ -43,17 +43,6 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
extern struct castr sect_ca[];
|
|
||||||
extern struct castr news_ca[];
|
|
||||||
extern struct castr loan_ca[];
|
|
||||||
extern struct castr ship_ca[];
|
|
||||||
extern struct castr plane_ca[];
|
|
||||||
extern struct castr treaty_ca[];
|
|
||||||
extern struct castr nuke_ca[];
|
|
||||||
extern struct castr trade_ca[];
|
|
||||||
extern struct castr commodity_ca[];
|
|
||||||
extern struct castr lost_ca[];
|
|
||||||
|
|
||||||
struct fileinit fileinit[EF_MAX] = {
|
struct fileinit fileinit[EF_MAX] = {
|
||||||
{(ef_fileinit)sct_init, sct_postread, sct_prewrite, sect_ca},
|
{(ef_fileinit)sct_init, sct_postread, sct_prewrite, sect_ca},
|
||||||
{shp_init, shp_postread, shp_prewrite, ship_ca},
|
{shp_init, shp_postread, shp_prewrite, ship_ca},
|
||||||
|
|
|
@ -53,8 +53,6 @@
|
||||||
#define QUIET 0
|
#define QUIET 0
|
||||||
#define NOISY 1
|
#define NOISY 1
|
||||||
|
|
||||||
extern double tfactfire(natid, double);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See if any nearby ships will open up on the attacker
|
* See if any nearby ships will open up on the attacker
|
||||||
* Return damage done to attacker, if any.
|
* Return damage done to attacker, if any.
|
||||||
|
|
|
@ -47,8 +47,6 @@
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
extern s_char *effadv(int);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
shipsatxy(coord x, coord y, int wantflags, int nowantflags)
|
shipsatxy(coord x, coord y, int wantflags, int nowantflags)
|
||||||
{
|
{
|
||||||
|
|
|
@ -53,8 +53,6 @@
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
extern int etu_per_update;
|
|
||||||
|
|
||||||
int
|
int
|
||||||
attack_val(int combat_mode, struct lndstr *lp)
|
attack_val(int combat_mode, struct lndstr *lp)
|
||||||
{
|
{
|
||||||
|
@ -934,7 +932,6 @@ static int
|
||||||
lnd_fort_interdiction(struct emp_qelem *list,
|
lnd_fort_interdiction(struct emp_qelem *list,
|
||||||
coord newx, coord newy, natid victim)
|
coord newx, coord newy, natid victim)
|
||||||
{
|
{
|
||||||
extern int fort_max_interdiction_range;
|
|
||||||
struct nstr_sect ns;
|
struct nstr_sect ns;
|
||||||
struct sctstr fsect;
|
struct sctstr fsect;
|
||||||
int trange;
|
int trange;
|
||||||
|
|
|
@ -40,8 +40,6 @@
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
|
|
||||||
extern s_char *relates[];
|
|
||||||
|
|
||||||
int
|
int
|
||||||
setrel(natid us, natid them, int rel)
|
setrel(natid us, natid them, int rel)
|
||||||
{
|
{
|
||||||
|
|
|
@ -336,8 +336,6 @@ static int
|
||||||
check_nav(sect)
|
check_nav(sect)
|
||||||
struct sctstr *sect;
|
struct sctstr *sect;
|
||||||
{
|
{
|
||||||
extern struct dchrstr dchr[];
|
|
||||||
|
|
||||||
switch (dchr[sect->sct_type].d_flg & 03) {
|
switch (dchr[sect->sct_type].d_flg & 03) {
|
||||||
case NAVOK:
|
case NAVOK:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -46,8 +46,6 @@
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
void satdisp(struct sctstr *sp, int acc, int showstuff);
|
|
||||||
|
|
||||||
static s_char **rad;
|
static s_char **rad;
|
||||||
static s_char *radbuf;
|
static s_char *radbuf;
|
||||||
|
|
||||||
|
|
|
@ -53,10 +53,6 @@
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
extern double tfactfire(natid, double);
|
|
||||||
|
|
||||||
extern int etu_per_update;
|
|
||||||
|
|
||||||
static int shp_check_nav(struct sctstr *);
|
static int shp_check_nav(struct sctstr *);
|
||||||
static int shp_check_one_mines(struct mlist *);
|
static int shp_check_one_mines(struct mlist *);
|
||||||
static int shp_hit_mine(struct shpstr *, struct mchrstr *);
|
static int shp_hit_mine(struct shpstr *, struct mchrstr *);
|
||||||
|
|
|
@ -47,10 +47,6 @@
|
||||||
|
|
||||||
#define CHE_MAX 255
|
#define CHE_MAX 255
|
||||||
|
|
||||||
void takeover_land(register struct lndstr *landp, natid newown,
|
|
||||||
int hostile);
|
|
||||||
void takeover_plane(register struct plnstr *pp, natid newown);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
takeover(register struct sctstr *sp, natid newown)
|
takeover(register struct sctstr *sp, natid newown)
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,9 +72,7 @@ static s_char *finish_path = "h"; /* Placeholder indicating path exists */
|
||||||
#endif /* SAVE_FINISH_PATHS */
|
#endif /* SAVE_FINISH_PATHS */
|
||||||
|
|
||||||
static void assemble_dist_paths(struct distinfo *distptrs);
|
static void assemble_dist_paths(struct distinfo *distptrs);
|
||||||
s_char *BestDistPath(s_char *, struct sctstr *, struct sctstr *, double *, int);
|
static s_char *ReversePath(s_char *path);
|
||||||
s_char *ReversePath(s_char *path);
|
|
||||||
double pathcost(struct sctstr *, s_char *, int);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
finish_sects(int etu)
|
finish_sects(int etu)
|
||||||
|
@ -240,7 +238,7 @@ assemble_dist_paths(struct distinfo *distptrs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s_char *
|
static s_char *
|
||||||
ReversePath(s_char *path)
|
ReversePath(s_char *path)
|
||||||
{
|
{
|
||||||
s_char *patharray = "aucdefjhigklmyopqrstbvwxnz";
|
s_char *patharray = "aucdefjhigklmyopqrstbvwxnz";
|
||||||
|
|
|
@ -58,7 +58,6 @@ long lnd_money[MAXNOC];
|
||||||
long air_money[MAXNOC];
|
long air_money[MAXNOC];
|
||||||
long tpops[MAXNOC];
|
long tpops[MAXNOC];
|
||||||
|
|
||||||
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 *,
|
static void do_prod(int, int, int, int *, long int (*)[2], int *, int *,
|
||||||
|
|
|
@ -57,10 +57,6 @@
|
||||||
* level of 0 yields (1) 0.4, (6) 2.2, (12) 3.9, (18) 5.2.
|
* level of 0 yields (1) 0.4, (6) 2.2, (12) 3.9, (18) 5.2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern float hap_avg;
|
|
||||||
extern float edu_avg;
|
|
||||||
extern float ally_factor;
|
|
||||||
|
|
||||||
static void share_incr(register double *, register double *);
|
static void share_incr(register double *, register double *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -53,7 +53,6 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
extern int check_nav(struct sctstr *sect);
|
|
||||||
static void swap(register struct shpstr *);
|
static void swap(register struct shpstr *);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -52,8 +52,6 @@
|
||||||
#include "gen.h"
|
#include "gen.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
extern float levels[MAXNOC][4];
|
|
||||||
|
|
||||||
void
|
void
|
||||||
prepare_sects(int etu, int *bp)
|
prepare_sects(int etu, int *bp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,8 +55,6 @@
|
||||||
#include "lost.h"
|
#include "lost.h"
|
||||||
#include "gen.h"
|
#include "gen.h"
|
||||||
|
|
||||||
extern float levels[MAXNOC][4];
|
|
||||||
|
|
||||||
int
|
int
|
||||||
dodeliver(struct sctstr *sp, int *vec)
|
dodeliver(struct sctstr *sp, int *vec)
|
||||||
{
|
{
|
||||||
|
@ -201,8 +199,6 @@ enlist(register int *vec, int etu, int *cost)
|
||||||
|
|
||||||
/* Fallout is calculated here. */
|
/* Fallout is calculated here. */
|
||||||
|
|
||||||
extern int melt_item_denom[];
|
|
||||||
|
|
||||||
static 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)
|
||||||
|
|
|
@ -67,19 +67,15 @@
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
|
||||||
void nullify_objects(void);
|
static void nullify_objects(void);
|
||||||
void init_files(void);
|
static void init_files(void);
|
||||||
void close_files(void);
|
static void close_files(void);
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
static void loc_NTInit(void);
|
static void loc_NTInit(void);
|
||||||
static void loc_NTTerm(void);
|
static void loc_NTTerm(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void mobility_init(void);
|
|
||||||
extern void mobility_check(void *);
|
|
||||||
extern void market_update(void *);
|
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
static int mainpid = 0;
|
static int mainpid = 0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -250,7 +246,7 @@ main(int argc, char **argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
init_files(void)
|
init_files(void)
|
||||||
{
|
{
|
||||||
ef_open(EF_NATION, O_RDWR, EFF_MEM);
|
ef_open(EF_NATION, O_RDWR, EFF_MEM);
|
||||||
|
@ -270,7 +266,7 @@ init_files(void)
|
||||||
ef_open(EF_LOST, O_RDWR, 0);
|
ef_open(EF_LOST, O_RDWR, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
close_files(void)
|
close_files(void)
|
||||||
{
|
{
|
||||||
ef_close(EF_NATION);
|
ef_close(EF_NATION);
|
||||||
|
@ -385,7 +381,7 @@ shutdwn(int sig)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
static void
|
||||||
nullify_objects(void)
|
nullify_objects(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
|
|
||||||
empth_sem_t *update_sem;
|
empth_sem_t *update_sem;
|
||||||
|
|
||||||
extern void update_main(void *);
|
|
||||||
static void update_wait(void *argv);
|
static void update_wait(void *argv);
|
||||||
time_t update_time;
|
time_t update_time;
|
||||||
|
|
||||||
|
|
|
@ -153,27 +153,27 @@ int fl_status; /* is anything wrong? */
|
||||||
const char *numletter =
|
const char *numletter =
|
||||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||||
|
|
||||||
void parse_args(int argc, char *argv[]);
|
static void parse_args(int argc, char *argv[]);
|
||||||
int allocate_memory(void);
|
static int allocate_memory(void);
|
||||||
void init(void);
|
static void init(void);
|
||||||
int drift(void);
|
static int drift(void);
|
||||||
void grow_continents(void);
|
static void grow_continents(void);
|
||||||
void create_elevations(void);
|
static void create_elevations(void);
|
||||||
void write_sects(void);
|
static void write_sects(void);
|
||||||
int write_file(void);
|
static int write_file(void);
|
||||||
void output(void);
|
static void output(void);
|
||||||
int write_newcap_script(void);
|
static int write_newcap_script(void);
|
||||||
int stable(void);
|
static int stable(void);
|
||||||
void elevate_land(void);
|
static void elevate_land(void);
|
||||||
void elevate_sea(void);
|
static void elevate_sea(void);
|
||||||
void translate_continents(void);
|
static void translate_continents(void);
|
||||||
int map_symbol(int x, int y);
|
static int map_symbol(int x, int y);
|
||||||
static void fl_sct_init(coord x, coord y, s_char *ptr);
|
static void fl_sct_init(coord x, coord y, s_char *ptr);
|
||||||
|
|
||||||
void print_vars(void);
|
static void print_vars(void);
|
||||||
void fl_move(int);
|
static void fl_move(int);
|
||||||
void next_coast(int c, int x, int y, int *xp, int *yp);
|
static void next_coast(int c, int x, int y, int *xp, int *yp);
|
||||||
void grow_islands(void);
|
static void grow_islands(void);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
MAIN
|
MAIN
|
||||||
|
@ -260,7 +260,7 @@ main(int argc, char *argv[])
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
print_vars(void)
|
print_vars(void)
|
||||||
{
|
{
|
||||||
if (quiet)
|
if (quiet)
|
||||||
|
@ -291,7 +291,7 @@ my_sqrt(int n)
|
||||||
PARSE COMMAND LINE ARGUMENTS
|
PARSE COMMAND LINE ARGUMENTS
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void
|
static void
|
||||||
parse_args(int argc, char *argv[])
|
parse_args(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if (argc < 2 || argc > 8) {
|
if (argc < 2 || argc > 8) {
|
||||||
|
@ -393,7 +393,7 @@ parse_args(int argc, char *argv[])
|
||||||
VARIABLE INITIALIZATION
|
VARIABLE INITIALIZATION
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int
|
static int
|
||||||
allocate_memory(void)
|
allocate_memory(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -453,7 +453,7 @@ allocate_memory(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
init(void)
|
init(void)
|
||||||
{
|
{
|
||||||
int i, j, xx = 0, yy = 0;
|
int i, j, xx = 0, yy = 0;
|
||||||
|
@ -508,7 +508,7 @@ iso(int j, int newx, int newy)
|
||||||
|
|
||||||
/* Drift all the capitals
|
/* Drift all the capitals
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
drift(void)
|
drift(void)
|
||||||
{
|
{
|
||||||
int i, turns;
|
int i, turns;
|
||||||
|
@ -525,7 +525,7 @@ drift(void)
|
||||||
/* Check to see if we have stabilized--can we stop drifting the capitals?
|
/* Check to see if we have stabilized--can we stop drifting the capitals?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
static int
|
||||||
stable(void)
|
stable(void)
|
||||||
{
|
{
|
||||||
int i, isod, d = 0, stab = 1;
|
int i, isod, d = 0, stab = 1;
|
||||||
|
@ -546,7 +546,7 @@ stable(void)
|
||||||
/* This routine does the actual drifting
|
/* This routine does the actual drifting
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
static void
|
||||||
fl_move(int j)
|
fl_move(int j)
|
||||||
{
|
{
|
||||||
int i, n, newx, newy;
|
int i, n, newx, newy;
|
||||||
|
@ -632,7 +632,7 @@ try_to_grow(int c, int newx, int newy, int d)
|
||||||
/* Move along the coast in a clockwise direction.
|
/* Move along the coast in a clockwise direction.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
static void
|
||||||
next_coast(int c, int x, int y, int *xp, int *yp)
|
next_coast(int c, int x, int y, int *xp, int *yp)
|
||||||
{
|
{
|
||||||
int i, nx, ny, wat = 0;
|
int i, nx, ny, wat = 0;
|
||||||
|
@ -734,7 +734,7 @@ grow_one_sector(int c)
|
||||||
|
|
||||||
/* Grow all the continents
|
/* Grow all the continents
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
grow_continents(void)
|
grow_continents(void)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
@ -795,7 +795,7 @@ place_island(int c, int *xp, int *yp)
|
||||||
/* Grow all the islands
|
/* Grow all the islands
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
static void
|
||||||
grow_islands(void)
|
grow_islands(void)
|
||||||
{
|
{
|
||||||
int c, x, y, isiz;
|
int c, x, y, isiz;
|
||||||
|
@ -819,7 +819,7 @@ grow_islands(void)
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
CREATE ELEVATIONS
|
CREATE ELEVATIONS
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
void
|
static void
|
||||||
create_elevations(void)
|
create_elevations(void)
|
||||||
{
|
{
|
||||||
elevate_land();
|
elevate_land();
|
||||||
|
@ -869,7 +869,7 @@ distance_to_what(int x, int y, int flag)
|
||||||
|
|
||||||
/* Decide where the mountains go
|
/* Decide where the mountains go
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
elevate_land(void)
|
elevate_land(void)
|
||||||
{
|
{
|
||||||
int i, mountain_search, k, c, total, ns, nm, highest, where, h, newk,
|
int i, mountain_search, k, c, total, ns, nm, highest, where, h, newk,
|
||||||
|
@ -959,7 +959,7 @@ elevate_land(void)
|
||||||
|
|
||||||
#define distance_to_land() distance_to_what(x, y, 1)
|
#define distance_to_land() distance_to_what(x, y, 1)
|
||||||
|
|
||||||
void
|
static void
|
||||||
elevate_sea(void)
|
elevate_sea(void)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
|
@ -1053,7 +1053,7 @@ add_resources(struct sctstr *sct)
|
||||||
DESIGNATE THE SECTORS
|
DESIGNATE THE SECTORS
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void
|
static void
|
||||||
write_sects(void)
|
write_sects(void)
|
||||||
{
|
{
|
||||||
register struct sctstr *sct;
|
register struct sctstr *sct;
|
||||||
|
@ -1091,7 +1091,7 @@ write_sects(void)
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
WRITE ALL THIS STUFF TO THE FILE
|
WRITE ALL THIS STUFF TO THE FILE
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
int
|
static int
|
||||||
write_file(void)
|
write_file(void)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
@ -1112,7 +1112,7 @@ write_file(void)
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
PRINT A PICTURE OF THE MAP TO YOUR SCREEN
|
PRINT A PICTURE OF THE MAP TO YOUR SCREEN
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
void
|
static void
|
||||||
output(void)
|
output(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -1137,7 +1137,7 @@ output(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reorder the continents from top left to bottom right */
|
/* Reorder the continents from top left to bottom right */
|
||||||
void
|
static void
|
||||||
translate_continents(void)
|
translate_continents(void)
|
||||||
{
|
{
|
||||||
int i, j, n = 0, k, gotit, c;
|
int i, j, n = 0, k, gotit, c;
|
||||||
|
@ -1185,7 +1185,7 @@ translate_continents(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
map_symbol(int x, int y)
|
map_symbol(int x, int y)
|
||||||
{
|
{
|
||||||
int c, iscap = 0;
|
int c, iscap = 0;
|
||||||
|
@ -1203,7 +1203,7 @@ map_symbol(int x, int y)
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
WRITE A SCRIPT FOR PLACING CAPITALS
|
WRITE A SCRIPT FOR PLACING CAPITALS
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
int
|
static int
|
||||||
write_newcap_script(void)
|
write_newcap_script(void)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
@ -1238,7 +1238,7 @@ qprint(const char *str)
|
||||||
fputs(str, stdout);
|
fputs(str, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
fl_sct_init(coord x, coord y, s_char *ptr)
|
fl_sct_init(coord x, coord y, s_char *ptr)
|
||||||
{
|
{
|
||||||
struct sctstr *sp = (struct sctstr *)ptr;
|
struct sctstr *sp = (struct sctstr *)ptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue