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 struct option_list Options[];
|
||||||
|
|
||||||
extern int opt_NO_FORT_FIRE;
|
/* Options, can be switched in econfig */
|
||||||
extern int opt_TREATIES;
|
extern int opt_ALL_BLEED;
|
||||||
|
extern int opt_BIG_CITY;
|
||||||
|
extern int opt_BLITZ;
|
||||||
extern int opt_BRIDGETOWERS;
|
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_GODNEWS;
|
||||||
extern int opt_GO_RENEW;
|
extern int opt_GO_RENEW;
|
||||||
extern int opt_DEFENSE_INFRA;
|
extern int opt_GRAB_THINGS;
|
||||||
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_HIDDEN;
|
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_LOSE_CONTACT;
|
||||||
extern int opt_NONUKES;
|
extern int opt_MARKET;
|
||||||
extern int opt_FUEL;
|
extern int opt_MOB_ACCESS;
|
||||||
extern int opt_TRADESHIPS;
|
extern int opt_NEUTRON;
|
||||||
extern int opt_NEWPOWER;
|
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_STARVE;
|
||||||
extern int opt_NEW_WORK;
|
extern int opt_NEW_WORK;
|
||||||
extern int opt_RES_POP;
|
extern int opt_NOFOOD;
|
||||||
extern int opt_GRAB_THINGS;
|
extern int opt_NOMOBCOST;
|
||||||
extern int opt_SHOWPLANE;
|
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_ORBIT;
|
||||||
extern int opt_PINPOINTMISSILE;
|
extern int opt_PINPOINTMISSILE;
|
||||||
extern int opt_FALLOUT;
|
extern int opt_PLANENAMES;
|
||||||
extern int opt_SAIL;
|
extern int opt_RES_POP;
|
||||||
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_ROLLOVER_AVAIL;
|
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 *datadir;
|
||||||
extern s_char *infodir;
|
extern s_char *infodir;
|
||||||
extern s_char *loginport;
|
extern s_char *loginport;
|
||||||
|
@ -202,6 +203,23 @@ extern int fuel_mult;
|
||||||
extern int lost_items_timeout;
|
extern int lost_items_timeout;
|
||||||
extern long last_demand_update;
|
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 {
|
struct keymatch {
|
||||||
s_char *km_key; /* the key */
|
s_char *km_key; /* the key */
|
||||||
void (*km_func)(struct keymatch * kp, s_char **av);
|
void (*km_func)(struct keymatch * kp, s_char **av);
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
#include "optlist.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
disa(void)
|
disa(void)
|
||||||
{
|
{
|
||||||
extern s_char *disablefil;
|
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if ((fd = open(disablefil, O_RDWR | O_CREAT | O_TRUNC, 0660)) < 0)
|
if ((fd = open(disablefil, O_RDWR | O_CREAT | O_TRUNC, 0660)) < 0)
|
||||||
|
|
|
@ -35,12 +35,11 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
#include "optlist.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
enab(void)
|
enab(void)
|
||||||
{
|
{
|
||||||
extern s_char *disablefil;
|
|
||||||
|
|
||||||
(void)unlink(disablefil);
|
(void)unlink(disablefil);
|
||||||
pr("Updates are enabled\n");
|
pr("Updates are enabled\n");
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
|
|
@ -55,7 +55,6 @@ mobupdate(void)
|
||||||
extern int updating_mob;
|
extern int updating_mob;
|
||||||
struct mob_acc_globals timestamps;
|
struct mob_acc_globals timestamps;
|
||||||
long now;
|
long now;
|
||||||
extern s_char *timestampfil;
|
|
||||||
|
|
||||||
if (!opt_MOB_ACCESS) {
|
if (!opt_MOB_ACCESS) {
|
||||||
pr("Command invalid - MOB_ACCESS is not enabled.\n");
|
pr("Command invalid - MOB_ACCESS is not enabled.\n");
|
||||||
|
|
|
@ -35,14 +35,13 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "tel.h"
|
#include "tel.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
|
#include "optlist.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
turn(void)
|
turn(void)
|
||||||
{
|
{
|
||||||
extern s_char *upfil;
|
|
||||||
extern s_char *downfil;
|
|
||||||
int fd;
|
int fd;
|
||||||
struct telstr tgm;
|
struct telstr tgm;
|
||||||
register s_char *p;
|
register s_char *p;
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
#include "optlist.h"
|
#include "optlist.h"
|
||||||
|
|
||||||
#include "keyword.h"
|
#include "keyword.h"
|
||||||
#include "wantupd.h"
|
#include "wantupd.h"
|
||||||
|
|
||||||
|
@ -51,7 +50,6 @@ upda(void)
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
struct mob_acc_globals timestamps;
|
struct mob_acc_globals timestamps;
|
||||||
extern int updating_mob;
|
extern int updating_mob;
|
||||||
extern s_char *timestampfil;
|
|
||||||
|
|
||||||
if (opt_MOB_ACCESS) {
|
if (opt_MOB_ACCESS) {
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
|
|
|
@ -374,7 +374,6 @@ next_update_check_time(time_t * now, time_t * tim, time_t * delta)
|
||||||
int
|
int
|
||||||
updates_disabled(void)
|
updates_disabled(void)
|
||||||
{
|
{
|
||||||
extern s_char *disablefil;
|
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if ((fd = open(disablefil, O_RDONLY, 0)) < 0)
|
if ((fd = open(disablefil, O_RDONLY, 0)) < 0)
|
||||||
|
|
|
@ -286,9 +286,9 @@ int opt_NUKEFAILDETONATE = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SHIPNAMES
|
#ifdef SHIPNAMES
|
||||||
int opt_SHIPNAMES = 1; /* not used currently */
|
int opt_SHIPNAMES = 1;
|
||||||
#else
|
#else
|
||||||
int opt_SHIPNAMES = 0; /* not used currently */
|
int opt_SHIPNAMES = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NEUTRON
|
#ifdef NEUTRON
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "empio.h"
|
#include "empio.h"
|
||||||
#include "subs.h"
|
#include "subs.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "optlist.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
@ -154,7 +155,6 @@ explain(void)
|
||||||
int
|
int
|
||||||
gamedown(void)
|
gamedown(void)
|
||||||
{
|
{
|
||||||
extern s_char *downfil;
|
|
||||||
int downf;
|
int downf;
|
||||||
struct telstr tgm;
|
struct telstr tgm;
|
||||||
s_char buf[1024];
|
s_char buf[1024];
|
||||||
|
|
|
@ -209,7 +209,6 @@ pass_cmd(void)
|
||||||
static int
|
static int
|
||||||
play_cmd(void)
|
play_cmd(void)
|
||||||
{
|
{
|
||||||
extern char *banfil;
|
|
||||||
struct player *other;
|
struct player *other;
|
||||||
natid cnum;
|
natid cnum;
|
||||||
struct natstr *natp;
|
struct natstr *natp;
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include "gen.h"
|
#include "gen.h"
|
||||||
#include "subs.h"
|
#include "subs.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "optlist.h"
|
||||||
|
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -65,7 +66,6 @@ extern int m_m_p_d;
|
||||||
void
|
void
|
||||||
player_main(struct player *p)
|
player_main(struct player *p)
|
||||||
{
|
{
|
||||||
extern s_char *authfil;
|
|
||||||
struct natstr *natp;
|
struct natstr *natp;
|
||||||
int hour[2];
|
int hour[2];
|
||||||
int secs;
|
int secs;
|
||||||
|
@ -347,7 +347,6 @@ execute(void)
|
||||||
int
|
int
|
||||||
show_motd(void)
|
show_motd(void)
|
||||||
{
|
{
|
||||||
extern s_char *upfil;
|
|
||||||
int upf;
|
int upf;
|
||||||
struct telstr tgm;
|
struct telstr tgm;
|
||||||
s_char buf[MAXTELSIZE];
|
s_char buf[MAXTELSIZE];
|
||||||
|
|
|
@ -39,12 +39,12 @@
|
||||||
#include "empthread.h"
|
#include "empthread.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
|
#include "optlist.h"
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
void
|
void
|
||||||
mobility_check(void *argv)
|
mobility_check(void *argv)
|
||||||
{
|
{
|
||||||
extern s_char *timestampfil;
|
|
||||||
extern int updating_mob;
|
extern int updating_mob;
|
||||||
struct mob_acc_globals timestamps;
|
struct mob_acc_globals timestamps;
|
||||||
time_t now;
|
time_t now;
|
||||||
|
@ -93,7 +93,6 @@ mobility_check(void *argv)
|
||||||
void
|
void
|
||||||
mobility_init(void)
|
mobility_init(void)
|
||||||
{
|
{
|
||||||
extern s_char *timestampfil;
|
|
||||||
extern int updating_mob;
|
extern int updating_mob;
|
||||||
struct mob_acc_globals timestamps;
|
struct mob_acc_globals timestamps;
|
||||||
time_t now;
|
time_t now;
|
||||||
|
|
|
@ -71,8 +71,6 @@ static void file_sct_init(coord x, coord y, s_char *ptr);
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
extern s_char *timestampfil;
|
|
||||||
extern s_char *commfil;
|
|
||||||
s_char buf[255];
|
s_char buf[255];
|
||||||
s_char tbuf[512];
|
s_char tbuf[512];
|
||||||
s_char *filename;
|
s_char *filename;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue