Declare all configuration parameters in optlist.h. Remove some
redundant declarations elsewhere.
This commit is contained in:
parent
6b67276f4f
commit
966eb40899
13 changed files with 65 additions and 58 deletions
|
@ -42,57 +42,58 @@ struct option_list {
|
|||
|
||||
extern struct option_list Options[];
|
||||
|
||||
extern int opt_NO_FORT_FIRE;
|
||||
extern int opt_TREATIES;
|
||||
/* Options, can be switched in econfig */
|
||||
extern int opt_ALL_BLEED;
|
||||
extern int opt_BIG_CITY;
|
||||
extern int opt_BLITZ;
|
||||
extern int opt_BRIDGETOWERS;
|
||||
extern int opt_DEFENSE_INFRA;
|
||||
extern int opt_DEMANDUPDATE;
|
||||
extern int opt_DRNUKE;
|
||||
extern int opt_EASY_BRIDGES;
|
||||
extern int opt_FALLOUT;
|
||||
extern int opt_FUEL;
|
||||
extern int opt_GODNEWS;
|
||||
extern int opt_GO_RENEW;
|
||||
extern int opt_DEFENSE_INFRA;
|
||||
extern int opt_SHIP_DECAY;
|
||||
extern int opt_MOB_ACCESS;
|
||||
extern int opt_MARKET;
|
||||
extern int opt_LOANS;
|
||||
extern int opt_LANDSPIES;
|
||||
extern int opt_PLANENAMES;
|
||||
extern int opt_NO_LCMS;
|
||||
extern int opt_NO_HCMS;
|
||||
extern int opt_NO_OIL;
|
||||
extern int opt_NOFOOD;
|
||||
extern int opt_SNEAK_ATTACK;
|
||||
extern int opt_BLITZ;
|
||||
extern int opt_GRAB_THINGS;
|
||||
extern int opt_HIDDEN;
|
||||
extern int opt_INTERDICT_ATT;
|
||||
extern int opt_LANDSPIES;
|
||||
extern int opt_LOANS;
|
||||
extern int opt_LOSE_CONTACT;
|
||||
extern int opt_NONUKES;
|
||||
extern int opt_FUEL;
|
||||
extern int opt_TRADESHIPS;
|
||||
extern int opt_MARKET;
|
||||
extern int opt_MOB_ACCESS;
|
||||
extern int opt_NEUTRON;
|
||||
extern int opt_NEWPOWER;
|
||||
extern int opt_NOMOBCOST;
|
||||
extern int opt_SUPER_BARS;
|
||||
extern int opt_EASY_BRIDGES;
|
||||
extern int opt_ALL_BLEED;
|
||||
extern int opt_DRNUKE;
|
||||
extern int opt_SLOW_WAR;
|
||||
extern int opt_NO_PLAGUE;
|
||||
extern int opt_NEW_STARVE;
|
||||
extern int opt_NEW_WORK;
|
||||
extern int opt_RES_POP;
|
||||
extern int opt_GRAB_THINGS;
|
||||
extern int opt_SHOWPLANE;
|
||||
extern int opt_NOFOOD;
|
||||
extern int opt_NOMOBCOST;
|
||||
extern int opt_NONUKES;
|
||||
extern int opt_NO_FORT_FIRE;
|
||||
extern int opt_NO_HCMS;
|
||||
extern int opt_NO_LCMS;
|
||||
extern int opt_NO_OIL;
|
||||
extern int opt_NO_PLAGUE;
|
||||
extern int opt_NUKEFAILDETONATE;
|
||||
extern int opt_ORBIT;
|
||||
extern int opt_PINPOINTMISSILE;
|
||||
extern int opt_FALLOUT;
|
||||
extern int opt_SAIL;
|
||||
extern int opt_NUKEFAILDETONATE;
|
||||
extern int opt_MISSINGMISSILES;
|
||||
extern int opt_SHIPNAMES; /* not used currently */
|
||||
extern int opt_NEUTRON;
|
||||
extern int opt_UPDATESCHED;
|
||||
extern int opt_DEMANDUPDATE;
|
||||
extern int opt_BIG_CITY;
|
||||
extern int opt_INTERDICT_ATT;
|
||||
extern int opt_TECH_POP;
|
||||
extern int opt_PLANENAMES;
|
||||
extern int opt_RES_POP;
|
||||
extern int opt_ROLLOVER_AVAIL;
|
||||
extern int opt_SAIL;
|
||||
extern int opt_SHIPNAMES;
|
||||
extern int opt_SHIP_DECAY;
|
||||
extern int opt_SHOWPLANE;
|
||||
extern int opt_SLOW_WAR;
|
||||
extern int opt_SNEAK_ATTACK;
|
||||
extern int opt_SUPER_BARS;
|
||||
extern int opt_TECH_POP;
|
||||
extern int opt_TRADESHIPS;
|
||||
extern int opt_TREATIES;
|
||||
extern int opt_UPDATESCHED;
|
||||
|
||||
/* Game parameters, can be set in econfig */
|
||||
extern s_char *datadir;
|
||||
extern s_char *infodir;
|
||||
extern s_char *loginport;
|
||||
|
@ -202,6 +203,23 @@ extern int fuel_mult;
|
|||
extern int lost_items_timeout;
|
||||
extern long last_demand_update;
|
||||
|
||||
/* Game parameters that cannot be set in econfig (yet) */
|
||||
extern int melt_item_denom[];
|
||||
#ifdef START_UNITS
|
||||
int start_unit_type[];
|
||||
#endif
|
||||
|
||||
/* Variables that get values derived from econfig */
|
||||
extern s_char *upfil;
|
||||
extern s_char *downfil;
|
||||
extern s_char *disablefil;
|
||||
extern s_char *telfil;
|
||||
extern s_char *annfil;
|
||||
extern s_char *commfil;
|
||||
extern s_char *banfil;
|
||||
extern s_char *authfil;
|
||||
extern s_char *timestampfil;
|
||||
|
||||
struct keymatch {
|
||||
s_char *km_key; /* the key */
|
||||
void (*km_func)(struct keymatch * kp, s_char **av);
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
#include <fcntl.h>
|
||||
#include "misc.h"
|
||||
#include "commands.h"
|
||||
#include "optlist.h"
|
||||
|
||||
int
|
||||
disa(void)
|
||||
{
|
||||
extern s_char *disablefil;
|
||||
int fd;
|
||||
|
||||
if ((fd = open(disablefil, O_RDWR | O_CREAT | O_TRUNC, 0660)) < 0)
|
||||
|
|
|
@ -35,12 +35,11 @@
|
|||
#include <fcntl.h>
|
||||
#include "misc.h"
|
||||
#include "commands.h"
|
||||
#include "optlist.h"
|
||||
|
||||
int
|
||||
enab(void)
|
||||
{
|
||||
extern s_char *disablefil;
|
||||
|
||||
(void)unlink(disablefil);
|
||||
pr("Updates are enabled\n");
|
||||
return RET_OK;
|
||||
|
|
|
@ -55,7 +55,6 @@ mobupdate(void)
|
|||
extern int updating_mob;
|
||||
struct mob_acc_globals timestamps;
|
||||
long now;
|
||||
extern s_char *timestampfil;
|
||||
|
||||
if (!opt_MOB_ACCESS) {
|
||||
pr("Command invalid - MOB_ACCESS is not enabled.\n");
|
||||
|
|
|
@ -35,14 +35,13 @@
|
|||
#include "player.h"
|
||||
#include "tel.h"
|
||||
#include "commands.h"
|
||||
#include "optlist.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
int
|
||||
turn(void)
|
||||
{
|
||||
extern s_char *upfil;
|
||||
extern s_char *downfil;
|
||||
int fd;
|
||||
struct telstr tgm;
|
||||
register s_char *p;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include "player.h"
|
||||
#include "commands.h"
|
||||
#include "optlist.h"
|
||||
|
||||
#include "keyword.h"
|
||||
#include "wantupd.h"
|
||||
|
||||
|
@ -51,7 +50,6 @@ upda(void)
|
|||
FILE *fp;
|
||||
struct mob_acc_globals timestamps;
|
||||
extern int updating_mob;
|
||||
extern s_char *timestampfil;
|
||||
|
||||
if (opt_MOB_ACCESS) {
|
||||
#if !defined(_WIN32)
|
||||
|
|
|
@ -374,7 +374,6 @@ next_update_check_time(time_t * now, time_t * tim, time_t * delta)
|
|||
int
|
||||
updates_disabled(void)
|
||||
{
|
||||
extern s_char *disablefil;
|
||||
int fd;
|
||||
|
||||
if ((fd = open(disablefil, O_RDONLY, 0)) < 0)
|
||||
|
|
|
@ -286,9 +286,9 @@ int opt_NUKEFAILDETONATE = 0;
|
|||
#endif
|
||||
|
||||
#ifdef SHIPNAMES
|
||||
int opt_SHIPNAMES = 1; /* not used currently */
|
||||
int opt_SHIPNAMES = 1;
|
||||
#else
|
||||
int opt_SHIPNAMES = 0; /* not used currently */
|
||||
int opt_SHIPNAMES = 0;
|
||||
#endif
|
||||
|
||||
#ifdef NEUTRON
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "empio.h"
|
||||
#include "subs.h"
|
||||
#include "common.h"
|
||||
#include "optlist.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
@ -154,7 +155,6 @@ explain(void)
|
|||
int
|
||||
gamedown(void)
|
||||
{
|
||||
extern s_char *downfil;
|
||||
int downf;
|
||||
struct telstr tgm;
|
||||
s_char buf[1024];
|
||||
|
|
|
@ -209,7 +209,6 @@ pass_cmd(void)
|
|||
static int
|
||||
play_cmd(void)
|
||||
{
|
||||
extern char *banfil;
|
||||
struct player *other;
|
||||
natid cnum;
|
||||
struct natstr *natp;
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include "gen.h"
|
||||
#include "subs.h"
|
||||
#include "common.h"
|
||||
#include "optlist.h"
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#include <unistd.h>
|
||||
|
@ -65,7 +66,6 @@ extern int m_m_p_d;
|
|||
void
|
||||
player_main(struct player *p)
|
||||
{
|
||||
extern s_char *authfil;
|
||||
struct natstr *natp;
|
||||
int hour[2];
|
||||
int secs;
|
||||
|
@ -347,7 +347,6 @@ execute(void)
|
|||
int
|
||||
show_motd(void)
|
||||
{
|
||||
extern s_char *upfil;
|
||||
int upf;
|
||||
struct telstr tgm;
|
||||
s_char buf[MAXTELSIZE];
|
||||
|
|
|
@ -39,12 +39,12 @@
|
|||
#include "empthread.h"
|
||||
#include <stdio.h>
|
||||
#include "prototypes.h"
|
||||
#include "optlist.h"
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
mobility_check(void *argv)
|
||||
{
|
||||
extern s_char *timestampfil;
|
||||
extern int updating_mob;
|
||||
struct mob_acc_globals timestamps;
|
||||
time_t now;
|
||||
|
@ -93,7 +93,6 @@ mobility_check(void *argv)
|
|||
void
|
||||
mobility_init(void)
|
||||
{
|
||||
extern s_char *timestampfil;
|
||||
extern int updating_mob;
|
||||
struct mob_acc_globals timestamps;
|
||||
time_t now;
|
||||
|
|
|
@ -71,8 +71,6 @@ static void file_sct_init(coord x, coord y, s_char *ptr);
|
|||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
extern s_char *timestampfil;
|
||||
extern s_char *commfil;
|
||||
s_char buf[255];
|
||||
s_char tbuf[512];
|
||||
s_char *filename;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue