Supply prototypes where possible. This uncovered type errors with
thread entrypoints: (lwpSelect, shutdown_sequence): Parameters didn't match thread entry point prototype. (lwpEntryPoint): Arguments didn't match thread entry point prototype. Change linkage of functions without prototype declaration to static where possible. Remove some superflous declarations, replace others by suitable includes.
This commit is contained in:
parent
7dbb87b0e0
commit
237baffca9
108 changed files with 505 additions and 877 deletions
|
@ -31,10 +31,10 @@
|
|||
* Ville Virrankoski, 1995
|
||||
*/
|
||||
|
||||
void fill_update_array();
|
||||
int *get_wp();
|
||||
int gt_bg_nmbr();
|
||||
void pt_bg_nmbr();
|
||||
void get_materials();
|
||||
void fill_update_array(int *bp, struct sctstr *sp);
|
||||
int *get_wp(int *bp, struct sctstr *sp, int cm);
|
||||
int gt_bg_nmbr(int *bp, struct sctstr *sp, int comm);
|
||||
void pt_bg_nmbr(int *bp, struct sctstr *sp, int comm, int amount);
|
||||
void get_materials(struct sctstr *sp, int *bp, int *mvec, int check);
|
||||
|
||||
extern int mil_dbl_pay;
|
||||
|
|
|
@ -97,9 +97,6 @@ extern int att_fight(int, struct combat *, struct emp_qelem *, double,
|
|||
extern int att_free_lists(struct emp_qelem *, struct emp_qelem *);
|
||||
|
||||
|
||||
extern double att_asupport();
|
||||
extern double att_dsupport();
|
||||
extern double att_mine_dsupport();
|
||||
extern double combat_mob;
|
||||
extern s_char *att_mode[];
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
#ifndef _EMTHREAD_H_
|
||||
#define _EMTHREAD_H_
|
||||
|
||||
#include "prototype.h"
|
||||
#include "misc.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
@ -66,14 +65,13 @@ typedef struct lwpSem empth_sem_t;
|
|||
#define EMPTH_PRINT 0x1
|
||||
#define EMPTH_STACKCHECK 0x2
|
||||
|
||||
typedef void (*vf_ptr) ();
|
||||
#define EMPTH_KILLED 1
|
||||
typedef struct empth_ctx_t {
|
||||
char *name; /* thread name */
|
||||
char *desc; /* description */
|
||||
void *ud; /* user data */
|
||||
int state; /* my state */
|
||||
vf_ptr ep; /* entry point */
|
||||
void (*ep)(void *); /* entry point */
|
||||
pthread_t id; /* thread id */
|
||||
} empth_t;
|
||||
|
||||
|
@ -110,20 +108,19 @@ typedef void empth_sem_t;
|
|||
|
||||
#endif
|
||||
|
||||
int empth_init _PROTO((char **ctx, int flags));
|
||||
empth_t *empth_create _PROTO((int, void (*)(), int,
|
||||
int, char *, char *, void *));
|
||||
empth_t *empth_self();
|
||||
void empth_exit _PROTO((void));
|
||||
void empth_yield _PROTO((void));
|
||||
void empth_terminate _PROTO((empth_t *));
|
||||
void empth_select _PROTO((int fd, int flags));
|
||||
void empth_wakeup _PROTO((empth_t *));
|
||||
void empth_sleep _PROTO((long until));
|
||||
empth_sem_t *empth_sem_create _PROTO((char *name, int count));
|
||||
void empth_sem_signal _PROTO((empth_sem_t *));
|
||||
void empth_sem_wait _PROTO((empth_sem_t *));
|
||||
void empth_alarm _PROTO((int));
|
||||
int empth_init(char **ctx, int flags);
|
||||
empth_t *empth_create(int, void (*)(void *), int, int, char *, char *, void *);
|
||||
empth_t *empth_self(void);
|
||||
void empth_exit(void);
|
||||
void empth_yield(void);
|
||||
void empth_terminate(empth_t *);
|
||||
void empth_select(int fd, int flags);
|
||||
void empth_wakeup(empth_t *);
|
||||
void empth_sleep(long until);
|
||||
empth_sem_t *empth_sem_create(char *name, int count);
|
||||
void empth_sem_signal(empth_sem_t *);
|
||||
void empth_sem_wait(empth_sem_t *);
|
||||
void empth_alarm(int);
|
||||
|
||||
|
||||
#include "prototypes.h" /* must come at end, after defines and typedefs */
|
||||
|
|
|
@ -109,7 +109,7 @@ extern int ef_vars(int, register s_char *, u_char **,
|
|||
u_char **, u_short **);
|
||||
extern int ef_byname(s_char *);
|
||||
|
||||
extern int ef_nbread();
|
||||
extern int ef_nbread(int type, int id, caddr_t ptr);
|
||||
extern struct empfile empfile[];
|
||||
|
||||
#endif /* _FILE_H_ */
|
||||
|
|
|
@ -53,7 +53,7 @@ extern int maxitem;
|
|||
|
||||
/* procedures using/returning this struct */
|
||||
|
||||
extern struct ichrstr *whatitem();
|
||||
extern struct ichrstr *whatitem(s_char *ptr, s_char *prompt);
|
||||
|
||||
extern int itm_maxno;
|
||||
|
||||
|
|
|
@ -228,10 +228,7 @@ extern int lnd_support(natid, natid, coord, coord);
|
|||
extern int lnd_can_attack(struct lndstr *);
|
||||
extern int lnd_fortify (struct lndstr *lp, int hard_amt);
|
||||
|
||||
void landdamage();
|
||||
void lnd_nav();
|
||||
int lnd_check_nav();
|
||||
double sqrt();
|
||||
s_char *prland();
|
||||
void landdamage(struct lndstr *lp, int dam);
|
||||
s_char *prland(struct lndstr *lp);
|
||||
|
||||
#endif /* _LAND_H_ */
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
*/
|
||||
#ifndef _LWP_H_
|
||||
#define _LWP_H_
|
||||
#include "prototype.h"
|
||||
#ifdef UCONTEXT
|
||||
#include <ucontext.h>
|
||||
#else /* UCONTEXT */
|
||||
|
@ -42,7 +41,7 @@ struct lwpProc {
|
|||
#endif /* UCONTEXT */
|
||||
void *sbtm; /* bottom of stack attached to it */
|
||||
int size; /* size of stack */
|
||||
void (*entry) (); /* entry point */
|
||||
void (*entry)(void *); /* entry point */
|
||||
int dead; /* whether the process can be rescheduled */
|
||||
int pri; /* which scheduling queue we're on */
|
||||
long runtime; /* time at which process is restarted */
|
||||
|
@ -76,27 +75,27 @@ struct lwpSem {
|
|||
|
||||
#define LWP_MAX_PRIO 8
|
||||
|
||||
struct lwpProc *lwpInitSystem _PROTO((int prio, char **ctxp, int flags));
|
||||
struct lwpProc *lwpCreate _PROTO((int prio, void (*)(), int size,
|
||||
int flags, char *name, char *desc,
|
||||
int argc, char **argv, void *ud));
|
||||
void lwpExit _PROTO((void));
|
||||
void lwpTerminate _PROTO((struct lwpProc * p));
|
||||
void lwpYield _PROTO((void));
|
||||
void lwpSleepFd _PROTO((int fd, int flags));
|
||||
void lwpSleepUntil _PROTO((long until));
|
||||
void lwpWakeupFd _PROTO((struct lwpProc * p));
|
||||
void *lwpGetUD _PROTO((struct lwpProc * p));
|
||||
void lwpSetUD _PROTO((struct lwpProc * p, char *ud));
|
||||
void lwpSetDesc _PROTO((struct lwpProc * p, char *name, char *desc));
|
||||
int lwpSetPriority _PROTO((int prio));
|
||||
void lwpReschedule _PROTO((void));
|
||||
struct lwpProc *lwpInitSystem(int prio, char **ctxp, int flags);
|
||||
struct lwpProc *lwpCreate(int prio, void (*)(void *), int size,
|
||||
int flags, char *name, char *desc,
|
||||
int argc, char **argv, void *ud);
|
||||
void lwpExit(void);
|
||||
void lwpTerminate(struct lwpProc * p);
|
||||
void lwpYield(void);
|
||||
void lwpSleepFd(int fd, int flags);
|
||||
void lwpSleepUntil(long until);
|
||||
void lwpWakeupFd(struct lwpProc * p);
|
||||
void *lwpGetUD(struct lwpProc * p);
|
||||
void lwpSetUD(struct lwpProc * p, char *ud);
|
||||
void lwpSetDesc(struct lwpProc * p, char *name, char *desc);
|
||||
int lwpSetPriority(int prio);
|
||||
void lwpReschedule(void);
|
||||
|
||||
struct lwpSem *lwpCreateSem _PROTO((char *name, int count));
|
||||
void lwpSignal _PROTO((struct lwpSem *));
|
||||
void lwpWait _PROTO((struct lwpSem *));
|
||||
void lwpSelect _PROTO((int argc, char **argv));
|
||||
void lwpStatus _PROTO((struct lwpProc * proc, char *format, ...));
|
||||
struct lwpSem *lwpCreateSem(char *name, int count);
|
||||
void lwpSignal(struct lwpSem *);
|
||||
void lwpWait(struct lwpSem *);
|
||||
void lwpSelect(void *);
|
||||
void lwpStatus(struct lwpProc * proc, char *format, ...);
|
||||
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
|
|
@ -57,7 +57,6 @@ typedef unsigned int u_int;
|
|||
/*#define _POSIX_ */
|
||||
#endif
|
||||
|
||||
#include "prototype.h"
|
||||
#include "options.h"
|
||||
|
||||
/* This is the structure we use to keep track of the global mobility
|
||||
|
@ -115,7 +114,6 @@ typedef short coord; /* also change NSC_COORD in nsc.h */
|
|||
#define hours(x) (60*60*(x))
|
||||
#define days(x) (60*60*24*(x))
|
||||
|
||||
typedef void (*voidfunc) ();
|
||||
typedef int (*qsort_func_t) (const void *, const void *);
|
||||
|
||||
/* return codes from command routines */
|
||||
|
@ -124,70 +122,18 @@ typedef int (*qsort_func_t) (const void *, const void *);
|
|||
#define RET_SYN 2 /* syntax error in command */
|
||||
#define RET_SYS 3 /* system error (missing file, etc) */
|
||||
|
||||
#define MAX_DISTPATH_LEN 10 /* Has to go somewhere */
|
||||
double dmax(double n1, double n2);
|
||||
double dmin(double n1, double n2);
|
||||
|
||||
/*
|
||||
* references to library functions which aren't related to any
|
||||
* particular object, and are of general interest
|
||||
*/
|
||||
#if !defined(ALPHA) && !defined(__osf__) && !defined(__linux__) && !defined(_WIN32)
|
||||
extern long random();
|
||||
#endif
|
||||
|
||||
double dmax _PROTO((double n1, double n2));
|
||||
double dmin _PROTO((double n1, double n2));
|
||||
|
||||
extern s_char *numstr _PROTO((s_char buf[], int n));
|
||||
extern s_char *esplur _PROTO((int n));
|
||||
extern s_char *splur _PROTO((int n));
|
||||
extern s_char *iesplur _PROTO((int n));
|
||||
extern s_char *plur _PROTO((int n, s_char *no, s_char *yes));
|
||||
extern s_char *getstarg
|
||||
_PROTO((s_char *input, s_char *prompt, s_char buf[]));
|
||||
extern s_char *getstring _PROTO((s_char *prompt, s_char buf[]));
|
||||
extern s_char *numstr(s_char buf[], int n);
|
||||
extern s_char *esplur(int n);
|
||||
extern s_char *splur(int n);
|
||||
extern s_char *iesplur(int n);
|
||||
extern s_char *plur(int n, s_char *no, s_char *yes);
|
||||
extern s_char *getstarg(s_char *input, s_char *prompt, s_char buf[]);
|
||||
extern s_char *getstring(s_char *prompt, s_char buf[]);
|
||||
extern s_char *prbuf(s_char *format, ...);
|
||||
|
||||
/*
|
||||
* frequently used libc functions
|
||||
*/
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#if defined(linux)
|
||||
#ifndef __STDC__
|
||||
extern char *malloc();
|
||||
extern char *calloc();
|
||||
#endif
|
||||
#else
|
||||
#if !defined(ALPHA) && !defined(__osf__) && !defined(ultrix) && !defined(hpux) && !defined(FBSD)
|
||||
extern char *malloc();
|
||||
extern char *calloc();
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (!defined (aix) && !defined (sgi))
|
||||
extern char *ctime();
|
||||
extern char *strncpy();
|
||||
extern char *strcpy();
|
||||
#endif /* !aix && !sgi */
|
||||
|
||||
extern time_t time();
|
||||
#if !defined(_WIN32)
|
||||
#ifdef linux
|
||||
#ifndef atof
|
||||
extern double atof();
|
||||
#endif
|
||||
#else
|
||||
extern double atof();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#if !defined (__ppc__) && !defined (hpux) && !defined (aix) && !defined (linux) && !defined(ALPHA) && !defined(__osf__) && !defined(SUN4) && !defined (Rel4) && !(defined (ultrix) && (defined (__STDC__) || defined (__SYSTEMFIVE) || defined (__POSIX)))
|
||||
extern char *sprintf();
|
||||
#endif /* aix */
|
||||
#endif
|
||||
|
||||
#define MAXCHRNV 12
|
||||
|
||||
#include "prototypes.h" /* must come at end, after defines and typedefs */
|
||||
|
|
|
@ -191,7 +191,6 @@ extern void putrel(struct natstr *np, natid them, int relate);
|
|||
extern void putreject(struct natstr *np, natid them, int how, int what);
|
||||
extern void putcontact(struct natstr *np, natid them, int contact);
|
||||
extern void agecontact(struct natstr *np);
|
||||
extern struct fixnat *natfield();
|
||||
|
||||
#define NF_INFORM bit(0) /* Inform me of telegrams right away */
|
||||
#define NF_FLASH bit(1) /* Allow other players to flash me (sicko :) */
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#ifndef _NSC_H_
|
||||
#define _NSC_H_
|
||||
|
||||
#include "prototype.h"
|
||||
#include "xy.h"
|
||||
|
||||
#define NS_LSIZE 128
|
||||
|
@ -55,7 +54,7 @@ struct nstr_sect {
|
|||
struct range range; /* area of coverage */
|
||||
int dist; /* dist query: range */
|
||||
coord cx, cy; /* dist query: center x-y */
|
||||
int (*read) (); /* read function */
|
||||
int (*read)(int type, int id, caddr_t ptr); /* read function */
|
||||
int ncond; /* # of selection conditions */
|
||||
struct nscstr cond[NS_NCOND]; /* selection conditions */
|
||||
};
|
||||
|
@ -72,7 +71,7 @@ struct nstr_item {
|
|||
int size; /* NS_LIST: size of list */
|
||||
int index; /* NS_LIST: index */
|
||||
int list[NS_LSIZE]; /* NS_LIST: item list */
|
||||
int (*read) (); /* read function */
|
||||
int (*read)(int type, int id, caddr_t ptr); /* read function */
|
||||
int flags; /* EFF_ flags */
|
||||
int ncond; /* # of selection conditions */
|
||||
struct nscstr cond[NS_NCOND]; /* selection conditions */
|
||||
|
@ -161,6 +160,6 @@ extern s_char *nstr_comp(struct nscstr *, int *, int, s_char *);
|
|||
extern int encode(register s_char *, long *, int);
|
||||
|
||||
|
||||
extern s_char *decodep _PROTO((register long code, register void *addr));
|
||||
extern s_char *decodep(register long code, register void *addr);
|
||||
|
||||
#endif /* _NSC_H_ */
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
#ifndef _OPTLIST_H_
|
||||
#define _OPTLIST_H_
|
||||
|
||||
#include "prototype.h"
|
||||
|
||||
struct option_list {
|
||||
char *opt_key;
|
||||
int *opt_valuep;
|
||||
|
@ -44,8 +42,8 @@ struct option_list {
|
|||
|
||||
extern struct option_list Options[];
|
||||
|
||||
extern void set_option _PROTO((const char *key));
|
||||
extern void delete_option _PROTO((const char *key));
|
||||
extern void set_option(const char *key);
|
||||
extern void delete_option(const char *key);
|
||||
|
||||
extern int WORLD_X;
|
||||
extern int WORLD_Y;
|
||||
|
@ -104,7 +102,7 @@ extern int opt_ROLLOVER_AVAIL;
|
|||
struct keymatch; /* forward decl */
|
||||
|
||||
/* function prototype for variable setting routines */
|
||||
typedef void KmFunc _PROTO((struct keymatch * kp, s_char **av));
|
||||
typedef void KmFunc(struct keymatch * kp, s_char **av);
|
||||
|
||||
/* current known routines */
|
||||
#if defined(__cplusplus) || (defined(__STDC__) &&__STDC__)
|
||||
|
|
|
@ -72,10 +72,7 @@ extern int chkpath(natid, s_char *, coord, coord);
|
|||
extern void pathrange(register coord, register coord, register s_char *,
|
||||
int, struct range *);
|
||||
|
||||
extern s_char *masktopath();
|
||||
extern long pathtomask();
|
||||
|
||||
extern double sector_mcost();
|
||||
extern double sector_mcost(struct sctstr *sp, int do_bonus);
|
||||
|
||||
#define P_NONE 0 /* NO destinations allowed */
|
||||
#define P_WALKING 1 /* use BestLandPath, only owned */
|
||||
|
|
|
@ -165,14 +165,10 @@ struct shiplook {
|
|||
#define PLN_LOAD(b, t) (t ? (b * (logx((double)t, (double)50.0) < 1.0 ? 1.0 : \
|
||||
logx((double)t, (double)50.0))) : b)
|
||||
|
||||
double sqrt();
|
||||
double logx();
|
||||
|
||||
float pln_damage_sect();
|
||||
double logx(double d, double base);
|
||||
|
||||
void count_planes();
|
||||
double sqrt();
|
||||
s_char *prplane();
|
||||
s_char *prplane(struct plnstr *pp);
|
||||
|
||||
|
||||
/* src/lib/subs/aircombat.c */
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#if !defined(_WIN32)
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#include "prototype.h"
|
||||
#include "queue.h"
|
||||
#include "misc.h"
|
||||
#include "com.h"
|
||||
|
|
|
@ -1,44 +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.
|
||||
*
|
||||
* ---
|
||||
*
|
||||
* prototype.h: Various prototype stuff
|
||||
*
|
||||
* Known contributors to this file:
|
||||
*
|
||||
*/
|
||||
|
||||
/* this stuff ought to be somewhere general... */
|
||||
#ifndef _PROTOTYPE_H_
|
||||
#define _PROTOTYPE_H_
|
||||
#if defined(__cplusplus) || (defined(__STDC__) &&__STDC__) || defined(_WIN32)
|
||||
#define _PROTO(x) x
|
||||
#else
|
||||
#define _PROTO(x) ()
|
||||
#define const
|
||||
#define volatile
|
||||
#endif
|
||||
#endif /* _PROTOTYPE_H_ */
|
|
@ -58,7 +58,7 @@ extern void shutdwn(int sig);
|
|||
/* src/lib/empthread/lwp.c */
|
||||
#ifdef _EMPTH_LWP
|
||||
extern int empth_init(char **ctx, int flags);
|
||||
extern empth_t *empth_create(int prio, void (*entry) (), int size,
|
||||
extern empth_t *empth_create(int prio, void (*entry)(void *), int size,
|
||||
int flags, char *name, char *desc, void *ud);
|
||||
#if 0
|
||||
extern void empth_setctx(void *ctx);
|
||||
|
@ -79,7 +79,7 @@ extern void empth_alarm(int sig);
|
|||
/* src/lib/empthread/pthread.c */
|
||||
#ifdef _EMPTH_POSIX
|
||||
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)(void *),
|
||||
int size, int flags,
|
||||
char *name, char *desc, void *ud);
|
||||
extern empth_t *empth_self(void);
|
||||
|
@ -346,9 +346,9 @@ extern s_char *decodep(long, void *);
|
|||
extern int decode(natid, long, void *, int);
|
||||
extern int nstr_exec(struct nscstr *, register int, void *, int);
|
||||
/* path.c */
|
||||
extern void bp_enable_cachepath();
|
||||
extern void bp_disable_cachepath();
|
||||
extern void bp_clear_cachepath();
|
||||
extern void bp_enable_cachepath(void);
|
||||
extern void bp_disable_cachepath(void);
|
||||
extern void bp_clear_cachepath(void);
|
||||
extern s_char *BestDistPath(s_char *, struct sctstr *, struct sctstr *,
|
||||
double *, int);
|
||||
extern s_char *BestLandPath(s_char *, struct sctstr *, struct sctstr *,
|
||||
|
@ -856,6 +856,6 @@ extern int feed_ship(struct shpstr *, register int *, int, int *, int);
|
|||
*/
|
||||
/* shutdown.c */
|
||||
extern void shutdown_init(void);
|
||||
extern void shutdown_sequence(int argc, s_char **argv);
|
||||
extern void shutdown_sequence(void *);
|
||||
|
||||
#endif /* _PROTOTYPES_H_ */
|
||||
|
|
|
@ -168,7 +168,7 @@ struct dchrstr {
|
|||
|
||||
/* things relating to sectors */
|
||||
extern int sctoff(coord x, coord y);
|
||||
extern double landgun();
|
||||
extern double landgun(int effic, int guns);
|
||||
|
||||
extern int sct_maxno;
|
||||
extern struct dchrstr dchr[];
|
||||
|
|
|
@ -193,7 +193,7 @@ struct mchrstr {
|
|||
#define getshipp(n) \
|
||||
(struct shpstr *) ef_ptr(EF_SHIP, n)
|
||||
|
||||
extern double seagun();
|
||||
extern double seagun(int effic, int guns);
|
||||
|
||||
extern struct mchrstr mchr[];
|
||||
extern int shp_maxno;
|
||||
|
@ -216,8 +216,7 @@ struct mlist {
|
|||
#define SHP_FIR(b, t) (t ? (b * (logx((double)t, (double)60.0) < 1.0 ? 1.0 : \
|
||||
logx((double)t, (double)60.0))) : b)
|
||||
|
||||
double sqrt();
|
||||
double logx();
|
||||
double logx(double d, double base);
|
||||
|
||||
/* return codes from shp_check_nav */
|
||||
#define CN_NAVIGABLE (0)
|
||||
|
|
|
@ -43,8 +43,6 @@
|
|||
#include "land.h"
|
||||
#include "ship.h"
|
||||
|
||||
#include "prototype.h"
|
||||
|
||||
struct trdstr {
|
||||
short ef_type;
|
||||
natid trd_owner;
|
||||
|
@ -76,7 +74,7 @@ union trdgenstr {
|
|||
struct shpstr shp;
|
||||
};
|
||||
|
||||
s_char *trade_nameof _PROTO((struct trdstr * tp, union trdgenstr * tgp));
|
||||
s_char *trade_nameof(struct trdstr * tp, union trdgenstr * tgp);
|
||||
|
||||
#define gettrade(n, p) \
|
||||
ef_read(EF_TRADE, n, (caddr_t)p)
|
||||
|
|
|
@ -53,7 +53,6 @@ struct range {
|
|||
int height;
|
||||
};
|
||||
|
||||
extern s_char *xyfmt();
|
||||
extern s_char *xyas(coord x, coord y, natid country);
|
||||
extern s_char *ownxy(struct sctstr *sp);
|
||||
extern coord xrel(struct natstr *np, coord absx);
|
||||
|
|
|
@ -46,10 +46,7 @@
|
|||
#endif
|
||||
|
||||
int
|
||||
expect(s, match, buf)
|
||||
int s;
|
||||
int match;
|
||||
s_char *buf;
|
||||
expect(int s, int match, s_char *buf)
|
||||
{
|
||||
int size;
|
||||
s_char *p;
|
||||
|
@ -143,10 +140,7 @@ s_char *buf;
|
|||
}
|
||||
|
||||
void
|
||||
sendcmd(s, cmd, arg)
|
||||
int s;
|
||||
int cmd;
|
||||
s_char *arg;
|
||||
sendcmd(int s, int cmd, s_char *arg)
|
||||
{
|
||||
extern struct fn fnlist[];
|
||||
s_char buf[128];
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#define _FNLIST_H_
|
||||
|
||||
struct fn {
|
||||
int (*func) ();
|
||||
int (*func)(void);
|
||||
s_char *name;
|
||||
int value;
|
||||
};
|
||||
|
|
|
@ -37,8 +37,7 @@
|
|||
#endif
|
||||
|
||||
int
|
||||
handleintr(s)
|
||||
int s;
|
||||
handleintr(int s)
|
||||
{
|
||||
extern int interrupt;
|
||||
|
||||
|
|
|
@ -50,9 +50,7 @@
|
|||
#include "misc.h"
|
||||
|
||||
int
|
||||
hostaddr(name, addr)
|
||||
s_char *name;
|
||||
struct sockaddr_in *addr;
|
||||
hostaddr(s_char *name, struct sockaddr_in *addr)
|
||||
{
|
||||
struct hostent *hp;
|
||||
|
||||
|
@ -76,9 +74,7 @@ struct sockaddr_in *addr;
|
|||
}
|
||||
|
||||
int
|
||||
hostport(name, addr)
|
||||
s_char *name;
|
||||
struct sockaddr_in *addr;
|
||||
hostport(s_char *name, struct sockaddr_in *addr)
|
||||
{
|
||||
struct servent *sp;
|
||||
|
||||
|
@ -101,8 +97,7 @@ struct sockaddr_in *addr;
|
|||
}
|
||||
|
||||
int
|
||||
hostconnect(addr)
|
||||
struct sockaddr_in *addr;
|
||||
hostconnect(struct sockaddr_in *addr)
|
||||
{
|
||||
int s;
|
||||
|
||||
|
|
|
@ -51,20 +51,18 @@ typedef struct iovec {
|
|||
#endif
|
||||
|
||||
|
||||
static int ioqtobuf();
|
||||
static int ioqtoiov();
|
||||
static void enqueuecc();
|
||||
static int dequeuecc();
|
||||
static int ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc);
|
||||
static int ioqtoiov(register struct ioqueue *ioq, register struct iovec *iov, register int max);
|
||||
static void enqueuecc(struct ioqueue *ioq, s_char *buf, int cc);
|
||||
static int dequeuecc(register struct ioqueue *ioq, register int cc);
|
||||
|
||||
void insque();
|
||||
void remque();
|
||||
void initque();
|
||||
struct qelem *makeqt();
|
||||
void insque(struct qelem *, struct qelem *);
|
||||
void remque(struct qelem *);
|
||||
void initque(struct qelem *p);
|
||||
struct qelem *makeqt(int nelem);
|
||||
|
||||
void
|
||||
ioq_init(ioq, bsize)
|
||||
struct ioqueue *ioq;
|
||||
int bsize;
|
||||
ioq_init(struct ioqueue *ioq, int bsize)
|
||||
{
|
||||
extern s_char num_teles[];
|
||||
|
||||
|
@ -80,10 +78,7 @@ int bsize;
|
|||
* return # of iovec initialized.
|
||||
*/
|
||||
int
|
||||
ioq_peekiov(ioq, iov, max)
|
||||
struct ioqueue *ioq;
|
||||
struct iovec *iov;
|
||||
int max;
|
||||
ioq_peekiov(struct ioqueue *ioq, struct iovec *iov, int max)
|
||||
{
|
||||
if (ioq->cc <= 0)
|
||||
return 0;
|
||||
|
@ -96,18 +91,13 @@ int max;
|
|||
* number of bytes actually found.
|
||||
*/
|
||||
int
|
||||
ioq_peek(ioq, buf, cc)
|
||||
struct ioqueue *ioq;
|
||||
s_char *buf;
|
||||
int cc;
|
||||
ioq_peek(struct ioqueue *ioq, s_char *buf, int cc)
|
||||
{
|
||||
return ioqtobuf(ioq, buf, cc);
|
||||
}
|
||||
|
||||
int
|
||||
ioq_dequeue(ioq, cc)
|
||||
struct ioqueue *ioq;
|
||||
int cc;
|
||||
ioq_dequeue(struct ioqueue *ioq, int cc)
|
||||
{
|
||||
if (dequeuecc(ioq, cc) != cc)
|
||||
return 0;
|
||||
|
@ -115,10 +105,7 @@ int cc;
|
|||
}
|
||||
|
||||
int
|
||||
ioq_read(ioq, buf, cc)
|
||||
struct ioqueue *ioq;
|
||||
s_char *buf;
|
||||
int cc;
|
||||
ioq_read(struct ioqueue *ioq, s_char *buf, int cc)
|
||||
{
|
||||
int n;
|
||||
|
||||
|
@ -129,24 +116,19 @@ int cc;
|
|||
}
|
||||
|
||||
void
|
||||
ioq_write(ioq, buf, cc)
|
||||
struct ioqueue *ioq;
|
||||
s_char *buf;
|
||||
int cc;
|
||||
ioq_write(struct ioqueue *ioq, s_char *buf, int cc)
|
||||
{
|
||||
enqueuecc(ioq, buf, cc);
|
||||
}
|
||||
|
||||
int
|
||||
ioq_qsize(ioq)
|
||||
struct ioqueue *ioq;
|
||||
ioq_qsize(struct ioqueue *ioq)
|
||||
{
|
||||
return ioq->cc;
|
||||
}
|
||||
|
||||
void
|
||||
ioq_drain(ioq)
|
||||
struct ioqueue *ioq;
|
||||
ioq_drain(struct ioqueue *ioq)
|
||||
{
|
||||
struct io *io;
|
||||
struct qelem *qp;
|
||||
|
@ -161,10 +143,7 @@ struct ioqueue *ioq;
|
|||
}
|
||||
|
||||
s_char *
|
||||
ioq_gets(ioq, buf, cc)
|
||||
struct ioqueue *ioq;
|
||||
s_char *buf;
|
||||
int cc;
|
||||
ioq_gets(struct ioqueue *ioq, s_char *buf, int cc)
|
||||
{
|
||||
register s_char *p;
|
||||
register s_char *end;
|
||||
|
@ -195,10 +174,7 @@ int cc;
|
|||
* left for a higher level.
|
||||
*/
|
||||
static int
|
||||
ioqtobuf(ioq, buf, cc)
|
||||
register struct ioqueue *ioq;
|
||||
s_char *buf;
|
||||
int cc;
|
||||
ioqtobuf(register struct ioqueue *ioq, s_char *buf, int cc)
|
||||
{
|
||||
register struct io *io;
|
||||
struct qelem *qp;
|
||||
|
@ -235,10 +211,7 @@ int cc;
|
|||
* of a full ioqueue still be quick.
|
||||
*/
|
||||
static int
|
||||
ioqtoiov(ioq, iov, max)
|
||||
register struct ioqueue *ioq;
|
||||
register struct iovec *iov;
|
||||
register int max;
|
||||
ioqtoiov(register struct ioqueue *ioq, register struct iovec *iov, register int max)
|
||||
{
|
||||
register struct io *io;
|
||||
register int cc;
|
||||
|
@ -265,10 +238,7 @@ register int max;
|
|||
* append a buffer to the end of the ioq.
|
||||
*/
|
||||
static void
|
||||
enqueuecc(ioq, buf, cc)
|
||||
struct ioqueue *ioq;
|
||||
s_char *buf;
|
||||
int cc;
|
||||
enqueuecc(struct ioqueue *ioq, s_char *buf, int cc)
|
||||
{
|
||||
struct io *io;
|
||||
|
||||
|
@ -286,9 +256,7 @@ int cc;
|
|||
* which are no longer used.
|
||||
*/
|
||||
static int
|
||||
dequeuecc(ioq, cc)
|
||||
register struct ioqueue *ioq;
|
||||
register int cc;
|
||||
dequeuecc(register struct ioqueue *ioq, register int cc)
|
||||
{
|
||||
register struct io *io;
|
||||
register struct qelem *qp;
|
||||
|
|
|
@ -43,16 +43,11 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
int expect();
|
||||
void sendcmd();
|
||||
int expect(int s, int match, s_char *buf);
|
||||
void sendcmd(int s, int cmd, s_char *arg);
|
||||
|
||||
int
|
||||
login(s, uname, cname, cpass, kill_proc)
|
||||
int s;
|
||||
s_char *uname;
|
||||
s_char *cname;
|
||||
s_char *cpass;
|
||||
int kill_proc;
|
||||
login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc)
|
||||
{
|
||||
s_char tmp[128];
|
||||
s_char buf[1024];
|
||||
|
|
|
@ -72,27 +72,25 @@ HANDLE hStdIn;
|
|||
int interrupt;
|
||||
int sock;
|
||||
|
||||
void saveargv();
|
||||
void getsose();
|
||||
int hostport();
|
||||
int hostaddr();
|
||||
int hostconnect();
|
||||
int login();
|
||||
void ioq_init();
|
||||
void io_init();
|
||||
int handleintr();
|
||||
int termio();
|
||||
int serverio();
|
||||
void servercmd();
|
||||
void ioq_drain();
|
||||
void saveargv(int ac, s_char **src, s_char **dst);
|
||||
void getsose(void);
|
||||
int hostport(s_char *name, struct sockaddr_in *addr);
|
||||
int hostaddr(s_char *name, struct sockaddr_in *addr);
|
||||
int hostconnect(struct sockaddr_in *addr);
|
||||
int login(int s, s_char *uname, s_char *cname, s_char *cpass, int kill_proc);
|
||||
void ioq_init(struct ioqueue *ioq, int bsize);
|
||||
void io_init(void);
|
||||
int handleintr(int);
|
||||
int termio(int fd, int sock, FILE *auxfi);
|
||||
int serverio(int s, struct ioqueue *ioq);
|
||||
void servercmd(struct ioqueue *ioq, FILE *auxfi);
|
||||
void ioq_drain(struct ioqueue *ioq);
|
||||
|
||||
static void intr(int sig);
|
||||
|
||||
|
||||
int
|
||||
main(ac, av)
|
||||
int ac;
|
||||
s_char *av[];
|
||||
main(int ac, s_char **av)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
WSADATA WsaData;
|
||||
|
|
|
@ -39,9 +39,7 @@
|
|||
#include "queue.h"
|
||||
|
||||
void
|
||||
insque(p, q)
|
||||
struct qelem *p;
|
||||
struct qelem *q;
|
||||
insque(struct qelem *p, struct qelem *q)
|
||||
{
|
||||
p->q_forw = q->q_forw;
|
||||
p->q_back = q;
|
||||
|
@ -50,24 +48,21 @@ struct qelem *q;
|
|||
}
|
||||
|
||||
void
|
||||
remque(p)
|
||||
struct qelem *p;
|
||||
remque(struct qelem *p)
|
||||
{
|
||||
p->q_back->q_forw = p->q_forw;
|
||||
p->q_forw->q_back = p->q_back;
|
||||
}
|
||||
|
||||
void
|
||||
initque(p)
|
||||
struct qelem *p;
|
||||
initque(struct qelem *p)
|
||||
{
|
||||
p->q_forw = p;
|
||||
p->q_back = p;
|
||||
}
|
||||
|
||||
struct qelem *
|
||||
makeqt(nelem)
|
||||
int nelem;
|
||||
makeqt(int nelem)
|
||||
{
|
||||
struct qelem *table;
|
||||
struct qelem *qp;
|
||||
|
|
|
@ -36,10 +36,7 @@
|
|||
#include "misc.h"
|
||||
|
||||
void
|
||||
saveargv(ac, src, dst)
|
||||
int ac;
|
||||
s_char **src;
|
||||
s_char **dst;
|
||||
saveargv(int ac, s_char **src, s_char **dst)
|
||||
{
|
||||
register s_char *ptr;
|
||||
register int i;
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
#include <io.h>
|
||||
#endif
|
||||
|
||||
extern s_char *gettag();
|
||||
extern s_char *gettag(s_char *p);
|
||||
|
||||
s_char num_teles[64];
|
||||
static s_char the_prompt[1024];
|
||||
|
@ -59,23 +59,21 @@ FILE *redir_fp;
|
|||
FILE *pipe_fp;
|
||||
int exec_fd;
|
||||
|
||||
void prompt();
|
||||
void doredir();
|
||||
void dopipe();
|
||||
void doexecute();
|
||||
void output();
|
||||
void screen();
|
||||
int sendeof();
|
||||
int termio();
|
||||
void _noecho();
|
||||
void prompt(FILE *auxfi);
|
||||
void doredir(s_char *p);
|
||||
void dopipe(s_char *p);
|
||||
void doexecute(s_char *p, FILE *auxfi);
|
||||
void output(int code, s_char *buf, FILE *auxfi);
|
||||
void screen(register s_char *buf);
|
||||
int sendeof(int);
|
||||
int termio(int fd, int sock, FILE *auxfi);
|
||||
void _noecho(int);
|
||||
|
||||
extern s_char *SO;
|
||||
extern s_char *SE;
|
||||
|
||||
void
|
||||
servercmd(ioq, auxfi)
|
||||
struct ioqueue *ioq;
|
||||
FILE *auxfi;
|
||||
servercmd(struct ioqueue *ioq, FILE *auxfi)
|
||||
{
|
||||
s_char *ioq_gets(struct ioqueue *, s_char *, int);
|
||||
s_char buf[1024];
|
||||
|
@ -133,8 +131,7 @@ FILE *auxfi;
|
|||
}
|
||||
|
||||
void
|
||||
prompt(auxfi)
|
||||
FILE *auxfi;
|
||||
prompt(FILE *auxfi)
|
||||
{
|
||||
if (mode == C_PROMPT) {
|
||||
if (redir_fp) {
|
||||
|
@ -166,8 +163,7 @@ FILE *auxfi;
|
|||
* opens redir_fp if successful
|
||||
*/
|
||||
void
|
||||
doredir(p)
|
||||
s_char *p;
|
||||
doredir(s_char *p)
|
||||
{
|
||||
s_char *how;
|
||||
s_char *name;
|
||||
|
@ -219,8 +215,7 @@ s_char *p;
|
|||
* opens "pipe_fp" if successful
|
||||
*/
|
||||
void
|
||||
dopipe(p)
|
||||
s_char *p;
|
||||
dopipe(s_char *p)
|
||||
{
|
||||
s_char *tag;
|
||||
|
||||
|
@ -250,9 +245,7 @@ s_char *p;
|
|||
}
|
||||
|
||||
void
|
||||
doexecute(p, auxfi)
|
||||
s_char *p;
|
||||
FILE *auxfi;
|
||||
doexecute(s_char *p, FILE *auxfi)
|
||||
{
|
||||
extern int sock;
|
||||
int fd;
|
||||
|
@ -296,10 +289,7 @@ FILE *auxfi;
|
|||
}
|
||||
|
||||
void
|
||||
output(code, buf, auxfi)
|
||||
int code;
|
||||
s_char *buf;
|
||||
FILE *auxfi;
|
||||
output(int code, s_char *buf, FILE *auxfi)
|
||||
{
|
||||
switch (code) {
|
||||
case C_NOECHO:
|
||||
|
@ -357,8 +347,7 @@ FILE *auxfi;
|
|||
}
|
||||
|
||||
void
|
||||
screen(buf)
|
||||
register s_char *buf;
|
||||
screen(register s_char *buf)
|
||||
{
|
||||
register s_char *sop;
|
||||
register s_char c;
|
||||
|
|
|
@ -47,12 +47,10 @@
|
|||
#include <io.h>
|
||||
#endif
|
||||
|
||||
void ioq_write();
|
||||
void ioq_write(struct ioqueue *ioq, s_char *buf, int cc);
|
||||
|
||||
int
|
||||
serverio(s, ioq)
|
||||
int s;
|
||||
struct ioqueue *ioq;
|
||||
serverio(int s, struct ioqueue *ioq)
|
||||
{
|
||||
s_char *buf;
|
||||
int n;
|
||||
|
|
|
@ -48,7 +48,7 @@ s_char exec[8];
|
|||
static unsigned short tagnum;
|
||||
|
||||
void
|
||||
io_init()
|
||||
io_init(void)
|
||||
{
|
||||
taglist = NULL;
|
||||
buf[0] = 0;
|
||||
|
@ -57,8 +57,7 @@ io_init()
|
|||
}
|
||||
|
||||
s_char *
|
||||
gettag(p)
|
||||
s_char *p;
|
||||
gettag(s_char *p)
|
||||
{
|
||||
struct tagstruct *tag1, *tag2;
|
||||
|
||||
|
|
|
@ -60,13 +60,10 @@ extern s_char exec[];
|
|||
extern HANDLE hStdIn;
|
||||
#endif
|
||||
|
||||
int sendeof();
|
||||
int sendeof(int sock);
|
||||
|
||||
int
|
||||
termio(fd, sock, auxfi)
|
||||
int fd;
|
||||
int sock;
|
||||
FILE *auxfi;
|
||||
termio(int fd, int sock, FILE *auxfi)
|
||||
{
|
||||
s_char out[4096];
|
||||
int i, n;
|
||||
|
@ -226,8 +223,7 @@ FILE *auxfi;
|
|||
}
|
||||
|
||||
int
|
||||
sendeof(sock)
|
||||
int sock;
|
||||
sendeof(int sock)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
if (write(sock, "ctld\n", 5) < 5) {
|
||||
|
@ -245,8 +241,7 @@ int echomode = 1;
|
|||
|
||||
#if defined(hpux) || defined(aix) || defined (sgi) || defined(linux)
|
||||
void
|
||||
_noecho(fd)
|
||||
int fd;
|
||||
_noecho(int fd)
|
||||
{
|
||||
struct termio io;
|
||||
|
||||
|
@ -257,8 +252,7 @@ int fd;
|
|||
}
|
||||
|
||||
void
|
||||
_echo(fd)
|
||||
int fd;
|
||||
_echo(int fd)
|
||||
{
|
||||
struct termio io;
|
||||
|
||||
|
|
|
@ -45,11 +45,10 @@
|
|||
s_char *SO = 0;
|
||||
s_char *SE = 0;
|
||||
|
||||
int tgetent();
|
||||
int tgetent(char *, char *);
|
||||
|
||||
void
|
||||
parsedelay(r)
|
||||
s_char *r;
|
||||
parsedelay(s_char *r)
|
||||
{
|
||||
s_char *s, *t;
|
||||
|
||||
|
@ -64,10 +63,10 @@ s_char *r;
|
|||
}
|
||||
|
||||
void
|
||||
getsose()
|
||||
getsose(void)
|
||||
{
|
||||
#ifndef _WIN32
|
||||
extern s_char *tgetstr();
|
||||
extern s_char *tgetstr(char *, char **);
|
||||
s_char *cp;
|
||||
s_char *term;
|
||||
static s_char tbuf[1024];
|
||||
|
|
|
@ -54,7 +54,7 @@ char *_ipglob_copyright_header =
|
|||
|
||||
|
||||
int
|
||||
main()
|
||||
main(void)
|
||||
{
|
||||
char buf[256];
|
||||
char *cp;
|
||||
|
|
|
@ -165,9 +165,9 @@ extern struct as_path *as_find_cachepath(coord fx,
|
|||
/* Functions that are "private" to algorithm */
|
||||
|
||||
extern void as_add_cachepath(struct as_data *adp);
|
||||
extern void as_clear_cachepath();
|
||||
extern void as_enable_cachepath();
|
||||
extern void as_disable_cachepath();
|
||||
extern void as_clear_cachepath(void);
|
||||
extern void as_enable_cachepath(void);
|
||||
extern void as_disable_cachepath(void);
|
||||
|
||||
extern void as_makepath(struct as_data *adp);
|
||||
extern void as_free_path(struct as_path *pp);
|
||||
|
|
|
@ -55,13 +55,13 @@ static struct as_frompath **fromhead = (struct as_frompath **)0;
|
|||
static int as_cachepath_on = 0; /* Default to off */
|
||||
|
||||
void
|
||||
as_enable_cachepath()
|
||||
as_enable_cachepath(void)
|
||||
{
|
||||
as_cachepath_on = 1;
|
||||
}
|
||||
|
||||
void
|
||||
as_disable_cachepath()
|
||||
as_disable_cachepath(void)
|
||||
{
|
||||
as_cachepath_on = 0;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ as_add_cachepath(struct as_data *adp)
|
|||
}
|
||||
|
||||
void
|
||||
as_clear_cachepath()
|
||||
as_clear_cachepath(void)
|
||||
{
|
||||
struct as_frompath *from, *from2;
|
||||
struct as_topath *to, *to2;
|
||||
|
|
|
@ -47,7 +47,6 @@ as_search(struct as_data *adp)
|
|||
struct as_queue *qp;
|
||||
struct as_path *pp;
|
||||
#endif /* DEBUG */
|
||||
struct as_queue *as_extend(struct as_data *adp);
|
||||
|
||||
as_reset(adp);
|
||||
|
||||
|
|
|
@ -67,7 +67,6 @@ anti(void)
|
|||
double odds, damil, dache;
|
||||
int mob;
|
||||
int n_cheleft;
|
||||
extern double hap_fact();
|
||||
|
||||
if (!snxtsct(&nstr, player->argp[1]))
|
||||
return RET_SYN;
|
||||
|
|
|
@ -48,7 +48,7 @@ int
|
|||
best(void)
|
||||
{
|
||||
double cost;
|
||||
s_char *BestDistPath(), *BestLandPath(), *s;
|
||||
s_char *s;
|
||||
struct sctstr s1, s2;
|
||||
struct nstr_sect nstr, nstr2;
|
||||
s_char buf[1024];
|
||||
|
|
|
@ -214,7 +214,6 @@ bomb(void)
|
|||
static void
|
||||
pin_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||
{
|
||||
extern s_char *effadv();
|
||||
struct dchrstr *dcp;
|
||||
int nplanes;
|
||||
int nships;
|
||||
|
|
|
@ -348,7 +348,6 @@ calc_all(long int (*p_sect)[2], int *taxes, int *Ncivs, int *Nuws,
|
|||
extern long lnd_money[MAXNOC];
|
||||
extern long air_money[MAXNOC];
|
||||
extern long tpops[MAXNOC];
|
||||
extern int mil_dbl_pay;
|
||||
|
||||
lnd_money[player->cnum] = sea_money[player->cnum] = 0;
|
||||
air_money[player->cnum] = 0;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
* Steve McClure, 1998-2000
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#ifdef Rel4
|
||||
#include <string.h>
|
||||
#endif /* Rel4 */
|
||||
|
@ -69,9 +70,6 @@ static int build_plane(register struct sctstr *sp,
|
|||
|
||||
static int cash; /* static ok */
|
||||
|
||||
double sqrt(double);
|
||||
double logx();
|
||||
|
||||
extern int morale_base;
|
||||
extern int sect_mob_neg_factor;
|
||||
extern int etu_per_update;
|
||||
|
@ -494,7 +492,6 @@ build_land(register struct sctstr *sp, register struct lchrstr *lp,
|
|||
int points;
|
||||
struct natstr *natp;
|
||||
float eff = ((float)LAND_MINEFF / 100.0);
|
||||
double techfact(int, double);
|
||||
int mil, lcm, hcm, gun, shell;
|
||||
int freeland = 0;
|
||||
|
||||
|
|
|
@ -111,9 +111,7 @@ static int
|
|||
cons_choose(struct ltcomstr *ltcp)
|
||||
{
|
||||
s_char *p;
|
||||
extern int disloan();
|
||||
extern int distrea();
|
||||
int (*dis) ();
|
||||
int (*dis)();
|
||||
struct lonstr *lp;
|
||||
struct trtstr *tp;
|
||||
s_char prompt[128];
|
||||
|
|
|
@ -71,8 +71,6 @@ static long
|
|||
do_desi(struct natstr *natp, s_char *sects, s_char *deschar, long int cash,
|
||||
int for_real)
|
||||
{
|
||||
extern int opt_NO_LCMS;
|
||||
extern int opt_NO_HCMS;
|
||||
register int n;
|
||||
s_char *p;
|
||||
int breaksanct;
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
int
|
||||
diss(void)
|
||||
{
|
||||
int quit(void);
|
||||
struct sctstr sect;
|
||||
struct lndstr land;
|
||||
struct shpstr ship;
|
||||
|
|
|
@ -51,7 +51,6 @@ land(void)
|
|||
struct nstr_item ni;
|
||||
struct lndstr land;
|
||||
int vec[I_MAX + 1];
|
||||
s_char *mission_short_name();
|
||||
|
||||
if (!snxtitem(&ni, EF_LAND, player->argp[1]))
|
||||
return RET_SYN;
|
||||
|
|
|
@ -53,7 +53,7 @@ ldump(void)
|
|||
struct nstr_item ni;
|
||||
struct lndstr land;
|
||||
int vec[I_MAX + 1];
|
||||
s_char *mission_short_name();
|
||||
s_char *mission_short_name(int);
|
||||
int n, i;
|
||||
struct natstr *np;
|
||||
time_t now;
|
||||
|
|
|
@ -257,7 +257,6 @@ look_land(register struct lndstr *lookland)
|
|||
int vrange;
|
||||
int i;
|
||||
int dist;
|
||||
double techfact(int, double);
|
||||
|
||||
drange = techfact(lookland->lnd_tech, (double)lookland->lnd_spy);
|
||||
drange = (drange * ((double)lookland->lnd_effic / 100.0));
|
||||
|
|
|
@ -50,7 +50,7 @@ lsta(void)
|
|||
int nunits;
|
||||
struct nstr_item ni;
|
||||
struct lndstr land;
|
||||
s_char *mission_short_name();
|
||||
s_char *mission_short_name(int);
|
||||
|
||||
if (!snxtitem(&ni, EF_LAND, player->argp[1]))
|
||||
return RET_SYN;
|
||||
|
|
|
@ -57,7 +57,7 @@ mark(void)
|
|||
return display_mark(" ");
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
pr_mark(struct comstr *comm)
|
||||
{
|
||||
time_t now;
|
||||
|
|
|
@ -780,7 +780,6 @@ quiet_bigdef(int attacker, struct emp_qelem *list, natid own, natid aown,
|
|||
struct sctstr firing;
|
||||
struct nstr_sect ns;
|
||||
struct flist *fp;
|
||||
double techfact(int, double);
|
||||
extern int torpedo_damage;
|
||||
int gun;
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ mission(void)
|
|||
extern int land_mob_max;
|
||||
extern int plane_mob_max;
|
||||
extern double mission_mob_cost;
|
||||
s_char *nameofitem();
|
||||
s_char prompt[128];
|
||||
s_char buf[1024];
|
||||
|
||||
|
|
|
@ -53,7 +53,6 @@ morale(void)
|
|||
int i, min;
|
||||
s_char *p;
|
||||
s_char mess[128];
|
||||
double techfact(int, double);
|
||||
s_char buf[1024];
|
||||
|
||||
if (!snxtitem(&np, EF_LAND, player->argp[1]))
|
||||
|
|
|
@ -46,8 +46,8 @@
|
|||
#include "optlist.h"
|
||||
#include "commands.h"
|
||||
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
|
||||
extern float start_education, start_happiness;
|
||||
extern float start_technology, start_research;
|
||||
|
@ -321,7 +321,6 @@ deity_build_land(int type, coord x, coord y, natid own, int tlev)
|
|||
struct lchrstr *lp;
|
||||
struct nstr_item nstr;
|
||||
struct natstr *natp;
|
||||
double techfact(int, double);
|
||||
int lvec[I_MAX + 1];
|
||||
int extend = 1;
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ path(void)
|
|||
coord cx, cy;
|
||||
int i;
|
||||
int y;
|
||||
s_char *pp, *p, *BestDistPath();
|
||||
s_char *pp, *p;
|
||||
/* Note this is not re-entrant anyway, so we keep the buffers
|
||||
around */
|
||||
static s_char *mapbuf = (s_char *)0;
|
||||
|
|
|
@ -38,8 +38,7 @@
|
|||
#include "nat.h"
|
||||
#include "file.h"
|
||||
#include "commands.h"
|
||||
|
||||
extern void shutdown_sequence();
|
||||
#include "prototypes.h"
|
||||
|
||||
int
|
||||
shut(void)
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "path.h"
|
||||
#include "file.h"
|
||||
#include "commands.h"
|
||||
#include "combat.h"
|
||||
|
||||
int
|
||||
sinfra(void)
|
||||
|
@ -49,8 +50,6 @@ sinfra(void)
|
|||
struct sctstr sect;
|
||||
int nsect;
|
||||
struct nstr_sect nstr;
|
||||
double sector_mcost();
|
||||
double sector_strength(struct sctstr *);
|
||||
|
||||
if (!snxtsct(&nstr, player->argp[1]))
|
||||
return RET_SYN;
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
int
|
||||
thre(void)
|
||||
{
|
||||
extern struct ichrstr *whatitem();
|
||||
extern struct ichrstr *whatitem(s_char *, s_char *);
|
||||
struct sctstr sect;
|
||||
struct nstr_sect nstr;
|
||||
int val;
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
* Steve McClure, 1996-2000
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "misc.h"
|
||||
#include "player.h"
|
||||
#include "xy.h"
|
||||
|
|
|
@ -424,8 +424,6 @@ ef_flags(int type)
|
|||
time_t
|
||||
ef_mtime(int type)
|
||||
{
|
||||
extern time_t fdate(int fd);
|
||||
|
||||
if (empfile[type].fd <= 0)
|
||||
return 0;
|
||||
return fdate(empfile[type].fd);
|
||||
|
|
|
@ -110,8 +110,6 @@ kw_find(s_char *name)
|
|||
s_char *
|
||||
kw_parse(int type, s_char *text, int *data)
|
||||
{
|
||||
s_char *get_time(s_char *ptr, int *data);
|
||||
s_char *weekday(s_char *ptr, int *data);
|
||||
s_char *next;
|
||||
|
||||
while (isspace(*text))
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
static s_char *logfile = 0;
|
||||
|
||||
s_char *
|
||||
getlogfile()
|
||||
getlogfile(void)
|
||||
{
|
||||
return (s_char *)logfile;
|
||||
}
|
||||
|
|
|
@ -441,19 +441,19 @@ bp_coord_hash(struct as_coord c)
|
|||
}
|
||||
|
||||
void
|
||||
bp_enable_cachepath()
|
||||
bp_enable_cachepath(void)
|
||||
{
|
||||
as_enable_cachepath();
|
||||
}
|
||||
|
||||
void
|
||||
bp_disable_cachepath()
|
||||
bp_disable_cachepath(void)
|
||||
{
|
||||
as_disable_cachepath();
|
||||
}
|
||||
|
||||
void
|
||||
bp_clear_cachepath()
|
||||
bp_clear_cachepath(void)
|
||||
{
|
||||
as_clear_cachepath();
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "gen.h"
|
||||
#include "subs.h"
|
||||
#include "lost.h"
|
||||
#include "combat.h"
|
||||
|
||||
int
|
||||
sect_damage(struct sctstr *sp, int dam, struct emp_qelem *list)
|
||||
|
@ -93,7 +94,6 @@ sectdamage(struct sctstr *sp, int dam, struct emp_qelem *list)
|
|||
struct plnstr plane;
|
||||
double real_dam;
|
||||
int eff;
|
||||
double sector_strength();
|
||||
|
||||
/* Some sectors are harder/easier to kill.. */
|
||||
/* Average sector has a dstr of 1, so adjust */
|
||||
|
|
|
@ -46,8 +46,8 @@ empth_init(char **ctx, int flags)
|
|||
|
||||
|
||||
empth_t *
|
||||
empth_create(int prio, void (*entry) (), int size, int flags, char *name,
|
||||
char *desc, void *ud)
|
||||
empth_create(int prio, void (*entry)(void *), int size, int flags,
|
||||
char *name, char *desc, void *ud)
|
||||
{
|
||||
/* inherit flags */
|
||||
if (!flags)
|
||||
|
|
|
@ -390,7 +390,7 @@ empth_init(char **ctx_ptr, int flags)
|
|||
* It is also passed to the entry function...
|
||||
*/
|
||||
empth_t *
|
||||
empth_create(int prio, void (*entry) (), int size, int flags,
|
||||
empth_create(int prio, void (*entry)(void *), int size, int flags,
|
||||
char *name, char *desc, void *ud)
|
||||
{
|
||||
loc_Thread_t *pThread = NULL;
|
||||
|
|
|
@ -57,9 +57,9 @@ static pthread_mutex_t mtx_ctxsw; /* thread in critical section */
|
|||
|
||||
|
||||
#if 0
|
||||
static void empth_setctx _PROTO((void *));
|
||||
static void empth_setctx(void *);
|
||||
#endif
|
||||
static void empth_restorectx _PROTO(());
|
||||
static void empth_restorectx();
|
||||
|
||||
static void *
|
||||
empth_start(void *ctx)
|
||||
|
@ -176,7 +176,7 @@ empth_init(char **ctx_ptr, int flags)
|
|||
* More then that priority is not needed even in lwp threads.
|
||||
*/
|
||||
empth_t *
|
||||
empth_create(int prio, void (*entry) (), int size, int flags,
|
||||
empth_create(int prio, void (*entry)(void *), int size, int flags,
|
||||
char *name, char *desc, void *ud)
|
||||
{
|
||||
pthread_t t;
|
||||
|
|
|
@ -392,9 +392,8 @@ struct keymatch configkeys[] = {
|
|||
{NULL, NULL, (caddr_t)0, 0, NULL}
|
||||
};
|
||||
|
||||
static void fixup_files _PROTO((void));
|
||||
static struct keymatch *keylookup
|
||||
_PROTO((s_char *key, struct keymatch tbl[]));
|
||||
static void fixup_files(void);
|
||||
static struct keymatch *keylookup(s_char *key, struct keymatch tbl[]);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -37,8 +37,6 @@
|
|||
s_char *
|
||||
getstarg(s_char *input, s_char *prompt, s_char *buf)
|
||||
{
|
||||
extern s_char *getstring(s_char *prompt, s_char *buf);
|
||||
|
||||
*buf = '\0';
|
||||
if (input == 0 || *input == 0) {
|
||||
if (getstring(prompt, buf) == 0)
|
||||
|
|
|
@ -72,7 +72,7 @@ struct iop {
|
|||
int flags;
|
||||
s_char *assoc;
|
||||
int bufsize;
|
||||
int (*notify) ();
|
||||
int (*notify)(void);
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -81,7 +81,7 @@ io_init(void)
|
|||
}
|
||||
|
||||
struct iop *
|
||||
io_open(int fd, int flags, int bufsize, int (*notify) (void),
|
||||
io_open(int fd, int flags, int bufsize, int (*notify)(void),
|
||||
s_char *assoc)
|
||||
{
|
||||
struct iop *iop;
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
int
|
||||
onearg(s_char *arg, s_char *prompt)
|
||||
{
|
||||
extern s_char *getstring(s_char *prompt, s_char *buf);
|
||||
int n;
|
||||
s_char buf[1024];
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@ static struct lwpProc *tempcontext;
|
|||
struct lwpProc *initcontext = NULL;
|
||||
int startpoint;
|
||||
|
||||
startcontext()
|
||||
static void
|
||||
startcontext(void)
|
||||
{
|
||||
int space[10000];
|
||||
int x;
|
||||
|
@ -64,9 +65,7 @@ startcontext()
|
|||
}
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
struct lwpProc holder;
|
||||
int endpoint;
|
||||
|
@ -96,9 +95,7 @@ void *sp;
|
|||
#elif defined(hpux)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
volatile struct lwpProc *volatile newp;
|
||||
void *sp;
|
||||
lwpInitContext(volatile struct lwpProc *volatile newp, void *sp)
|
||||
{
|
||||
static jmp_buf *cpp;
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
@ -113,8 +110,7 @@ void *sp;
|
|||
}
|
||||
|
||||
int
|
||||
lwpSave(jb)
|
||||
jmp_buf jb;
|
||||
lwpSave(jmp_buf jb)
|
||||
{
|
||||
/* save stack pointer and return program counter */
|
||||
asm("stw %sp, 4(%arg0)");
|
||||
|
@ -149,8 +145,7 @@ jmp_buf jb;
|
|||
}
|
||||
|
||||
void
|
||||
lwpRestore(jb)
|
||||
jmp_buf jb;
|
||||
lwpRestore(jmp_buf jb)
|
||||
{
|
||||
/* restore stack pointer and program counter */
|
||||
asm volatile ("ldw 4(%arg0), %sp");
|
||||
|
@ -185,9 +180,7 @@ jmp_buf jb;
|
|||
|
||||
#elif defined(BSD386)
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
newp->context[2] = (int)sp;
|
||||
newp->context[0] = (int)lwpEntryPoint;
|
||||
|
@ -196,9 +189,7 @@ void *sp;
|
|||
#elif defined(FBSD)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
setjmp(newp->context);
|
||||
newp->context->_jb[2] = (int)sp;
|
||||
|
@ -209,9 +200,7 @@ void *sp;
|
|||
#elif defined(__linux__)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
|
||||
#if defined(__PPC__)
|
||||
|
@ -232,9 +221,7 @@ void *sp;
|
|||
#elif defined(SUN3)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
newp->context[2] = (int)sp;
|
||||
newp->context[3] = (int)lwpEntryPoint;
|
||||
|
@ -245,9 +232,7 @@ void *sp;
|
|||
#include <stdio.h>
|
||||
|
||||
void
|
||||
lwpInitContext(newp, stack)
|
||||
struct lwpProc *newp;
|
||||
void *stack;
|
||||
lwpInitContext(struct lwpProc *newp, void *stack)
|
||||
{
|
||||
int *sp = (int *)stack;
|
||||
int *fp = 0;
|
||||
|
@ -282,8 +267,7 @@ void *stack;
|
|||
}
|
||||
|
||||
int
|
||||
lwpSave(jb)
|
||||
jmp_buf jb;
|
||||
lwpSave(jmp_buf jb)
|
||||
{
|
||||
asm("movl 4(ap), r0"); /* r0 = &jb */
|
||||
asm("movl r6, (r0)"); /* jb[0] = r6 */
|
||||
|
@ -298,8 +282,7 @@ jmp_buf jb;
|
|||
}
|
||||
|
||||
void
|
||||
lwpRestore(jb)
|
||||
jmp_buf jb;
|
||||
lwpRestore(jmp_buf jb)
|
||||
{
|
||||
asm("movl 4(ap), r0"); /* r0 = &jb */
|
||||
asm("movl (r0), r6"); /* r6 = jb[0] */
|
||||
|
@ -319,9 +302,7 @@ jmp_buf jb;
|
|||
#elif defined(SUN4)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
static jmp_buf *cpp;
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
@ -377,9 +358,7 @@ void *sp;
|
|||
*/
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
newp->context[4] = (int)sp;
|
||||
newp->context[5] = (int)lwpEntryPoint;
|
||||
|
@ -395,9 +374,7 @@ void *sp;
|
|||
*/
|
||||
|
||||
void
|
||||
lwpInitContext(newp, spp)
|
||||
struct lwpProc *newp;
|
||||
stack_t *spp;
|
||||
lwpInitContext(struct lwpProc *newp, stack_t *spp)
|
||||
{
|
||||
getcontext(&(newp->context));
|
||||
newp->context.uc_stack.ss_sp = spp->ss_sp;
|
||||
|
@ -410,9 +387,7 @@ stack_t *spp;
|
|||
#include <c_asm.h>
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
extern long *_gp;
|
||||
|
||||
|
@ -425,15 +400,13 @@ void *sp;
|
|||
}
|
||||
|
||||
int
|
||||
lwpSave(jb)
|
||||
jmp_buf jb;
|
||||
lwpSave(jmp_buf jb)
|
||||
{
|
||||
return _setjmp(jb);
|
||||
}
|
||||
|
||||
void
|
||||
lwpRestore(jb)
|
||||
jmp_buf jb;
|
||||
lwpRestore(jmp_buf jb)
|
||||
{
|
||||
/* resume, but get the pv from the jmp_buf */
|
||||
asm("ldq %pv, 248(%a0)");
|
||||
|
|
|
@ -58,14 +58,13 @@ static int oldmask;
|
|||
extern char *strdup();
|
||||
#endif /* NOSTRDUP */
|
||||
|
||||
static void lwpStackCheckInit();
|
||||
static int lwpStackCheck();
|
||||
static void lwpStackCheckUsed();
|
||||
static void lwpStackCheckInit(struct lwpProc *newp);
|
||||
static int lwpStackCheck(struct lwpProc *newp);
|
||||
static void lwpStackCheckUsed(struct lwpProc *newp);
|
||||
|
||||
/* check stack direction */
|
||||
static int
|
||||
growsdown(x)
|
||||
void *x;
|
||||
growsdown(void *x)
|
||||
{
|
||||
int y;
|
||||
|
||||
|
@ -86,7 +85,7 @@ void *x;
|
|||
* processes here and free them.
|
||||
*/
|
||||
void
|
||||
lwpReschedule()
|
||||
lwpReschedule(void)
|
||||
{
|
||||
extern struct lwpQueue LwpSchedQ[];
|
||||
static int lcount = LCOUNT;
|
||||
|
@ -195,9 +194,8 @@ lwpReschedule()
|
|||
* lwpEntryPoint -- process entry point.
|
||||
*/
|
||||
void
|
||||
lwpEntryPoint()
|
||||
lwpEntryPoint(void)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
#ifdef POSIXSIGNALS
|
||||
sigset_t set;
|
||||
#endif /* POSIXSIGNALS */
|
||||
|
@ -215,8 +213,7 @@ lwpEntryPoint()
|
|||
*LwpContextPtr = LwpCurrent->ud;
|
||||
|
||||
lwpStatus(LwpCurrent, "starting at entry point");
|
||||
(*LwpCurrent->entry) (LwpCurrent->argc, LwpCurrent->argv,
|
||||
LwpCurrent->ud);
|
||||
(*LwpCurrent->entry)(LwpCurrent->ud);
|
||||
lwpExit();
|
||||
#ifdef BOUNDS_CHECK
|
||||
BOUNDS_CHECKING_ON;
|
||||
|
@ -229,18 +226,8 @@ lwpEntryPoint()
|
|||
* lwpCreate -- create a process.
|
||||
*/
|
||||
struct lwpProc *
|
||||
lwpCreate(priority, entry, size, flags, name, desc, argc, argv, ud)
|
||||
int priority;
|
||||
void (*entry) ();
|
||||
int size;
|
||||
int flags;
|
||||
char *name;
|
||||
char *desc;
|
||||
int argc;
|
||||
char *argv[];
|
||||
void *ud;
|
||||
lwpCreate(int priority, void (*entry)(void *), int size, int flags, char *name, char *desc, int argc, char **argv, void *ud)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
struct lwpProc *newp;
|
||||
int *s, x;
|
||||
#ifdef UCONTEXT
|
||||
|
@ -329,8 +316,7 @@ void *ud;
|
|||
}
|
||||
|
||||
void
|
||||
lwpDestroy(proc)
|
||||
struct lwpProc *proc;
|
||||
lwpDestroy(struct lwpProc *proc)
|
||||
{
|
||||
if (proc->flags & LWP_STACKCHECK) {
|
||||
lwpStackCheckUsed(proc);
|
||||
|
@ -355,12 +341,8 @@ struct lwpProc *proc;
|
|||
* lwpReady -- put process on ready queue. if null, assume current.
|
||||
*/
|
||||
void
|
||||
lwpReady(p)
|
||||
struct lwpProc *p;
|
||||
lwpReady(struct lwpProc *p)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
extern struct lwpQueue LwpSchedQ[];
|
||||
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
lwpStatus(p, "added to run queue");
|
||||
|
@ -371,8 +353,7 @@ struct lwpProc *p;
|
|||
* return user's data
|
||||
*/
|
||||
void *
|
||||
lwpGetUD(p)
|
||||
struct lwpProc *p;
|
||||
lwpGetUD(struct lwpProc *p)
|
||||
{
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
|
@ -383,9 +364,7 @@ struct lwpProc *p;
|
|||
* set user's data
|
||||
*/
|
||||
void
|
||||
lwpSetUD(p, ud)
|
||||
struct lwpProc *p;
|
||||
char *ud;
|
||||
lwpSetUD(struct lwpProc *p, char *ud)
|
||||
{
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
|
@ -396,10 +375,7 @@ char *ud;
|
|||
* set name & desc
|
||||
*/
|
||||
void
|
||||
lwpSetDesc(p, name, desc)
|
||||
struct lwpProc *p;
|
||||
char *name;
|
||||
char *desc;
|
||||
lwpSetDesc(struct lwpProc *p, char *name, char *desc)
|
||||
{
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
|
@ -413,7 +389,7 @@ char *desc;
|
|||
* lwpYield -- yield the processor to another thread.
|
||||
*/
|
||||
void
|
||||
lwpYield()
|
||||
lwpYield(void)
|
||||
{
|
||||
lwpStatus(LwpCurrent, "yielding control");
|
||||
lwpReady(LwpCurrent);
|
||||
|
@ -424,7 +400,7 @@ lwpYield()
|
|||
* cause the current process to be scheduled for deletion.
|
||||
*/
|
||||
void
|
||||
lwpExit()
|
||||
lwpExit(void)
|
||||
{
|
||||
lwpStatus(LwpCurrent, "marking self as dead");
|
||||
LwpCurrent->dead = 1;
|
||||
|
@ -436,8 +412,7 @@ lwpExit()
|
|||
* remove any lingering FD action
|
||||
*/
|
||||
void
|
||||
lwpTerminate(p)
|
||||
struct lwpProc *p;
|
||||
lwpTerminate(struct lwpProc *p)
|
||||
{
|
||||
lwpStatus(p, "terminating process");
|
||||
p->dead = 1;
|
||||
|
@ -450,8 +425,7 @@ struct lwpProc *p;
|
|||
* if the new priority is lower than the old, we reschedule.
|
||||
*/
|
||||
int
|
||||
lwpSetPriority(new)
|
||||
int new;
|
||||
lwpSetPriority(int new)
|
||||
{
|
||||
int old = LwpCurrent->pri;
|
||||
|
||||
|
@ -470,13 +444,8 @@ int new;
|
|||
* initialise the coroutine structures
|
||||
*/
|
||||
struct lwpProc *
|
||||
lwpInitSystem(pri, ctxptr, flags)
|
||||
int pri;
|
||||
char **ctxptr;
|
||||
int flags;
|
||||
lwpInitSystem(int pri, char **ctxptr, int flags)
|
||||
{
|
||||
extern struct lwpQueue LwpSchedQ[];
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
struct lwpQueue *q;
|
||||
int i, *stack;
|
||||
struct lwpProc *sel;
|
||||
|
@ -517,8 +486,7 @@ int flags;
|
|||
* used.
|
||||
*/
|
||||
static void
|
||||
lwpStackCheckInit(newp)
|
||||
struct lwpProc *newp;
|
||||
lwpStackCheckInit(struct lwpProc *newp)
|
||||
{
|
||||
register int i;
|
||||
register long *lp;
|
||||
|
@ -542,8 +510,7 @@ struct lwpProc *newp;
|
|||
* down the entire process.
|
||||
*/
|
||||
static int
|
||||
lwpStackCheck(newp)
|
||||
struct lwpProc *newp;
|
||||
lwpStackCheck(struct lwpProc *newp)
|
||||
{
|
||||
register int end, amt;
|
||||
register unsigned int i;
|
||||
|
@ -602,8 +569,7 @@ struct lwpProc *newp;
|
|||
* Figure out how much stack was used by this thread.
|
||||
*/
|
||||
static void
|
||||
lwpStackCheckUsed(newp)
|
||||
struct lwpProc *newp;
|
||||
lwpStackCheckUsed(struct lwpProc *newp)
|
||||
{
|
||||
register int i;
|
||||
register long *lp;
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
#define LCOUNT -1
|
||||
|
||||
#ifdef hpux
|
||||
int lwpSave _PROTO((jmp_buf));
|
||||
void lwpRestore _PROTO((jmp_buf));
|
||||
int lwpSave(jmp_buf);
|
||||
void lwpRestore(jmp_buf);
|
||||
#endif
|
||||
|
||||
#if defined(MIPS) || defined(AIX32) || defined(ALPHA) || defined(__vax)
|
||||
int lwpSave _PROTO((jmp_buf));
|
||||
void lwpRestore _PROTO((jmp_buf));
|
||||
int lwpSave(jmp_buf);
|
||||
void lwpRestore(jmp_buf);
|
||||
#elif defined(SUN4)
|
||||
#define lwpSave(x) _setjmp(x)
|
||||
#define lwpRestore(x) _longjmp(x, 1)
|
||||
|
@ -78,27 +78,27 @@ typedef struct {
|
|||
#endif
|
||||
|
||||
/* internal routines */
|
||||
void lwpAddTail _PROTO((struct lwpQueue *, struct lwpProc *));
|
||||
struct lwpProc *lwpGetFirst _PROTO((struct lwpQueue *));
|
||||
void lwpReschedule _PROTO((void));
|
||||
void lwpReady _PROTO((struct lwpProc *));
|
||||
void lwpOnalarm _PROTO((void));
|
||||
void lwpAddTail(struct lwpQueue *, struct lwpProc *);
|
||||
struct lwpProc *lwpGetFirst(struct lwpQueue *);
|
||||
void lwpReschedule(void);
|
||||
void lwpReady(struct lwpProc *);
|
||||
void lwpOnalarm(void);
|
||||
|
||||
#ifdef UCONTEXT
|
||||
void lwpInitContext _PROTO((struct lwpProc *, stack_t *));
|
||||
void lwpInitContext(struct lwpProc *, stack_t *);
|
||||
#else /* GETCONTEXT */
|
||||
#ifdef hpc
|
||||
void lwpInitContext _PROTO((struct lwpProc *, void *));
|
||||
void lwpInitContext(struct lwpProc *, void *);
|
||||
#else
|
||||
#ifdef hpux
|
||||
void lwpInitContext _PROTO((volatile struct lwpProc * volatile, void *));
|
||||
void lwpInitContext(volatile struct lwpProc * volatile, void *);
|
||||
#else
|
||||
void lwpInitContext _PROTO((struct lwpProc *, void *));
|
||||
void lwpInitContext(struct lwpProc *, void *);
|
||||
#endif /* hpux */
|
||||
#endif /* hpc */
|
||||
#endif /* GETCONTEXT */
|
||||
void lwpEntryPoint _PROTO((void));
|
||||
void lwpInitSelect _PROTO((struct lwpProc * self));
|
||||
void lwpDestroy _PROTO((struct lwpProc * proc));
|
||||
void lwpEntryPoint(void);
|
||||
void lwpInitSelect(struct lwpProc * self);
|
||||
void lwpDestroy(struct lwpProc * proc);
|
||||
|
||||
#endif /* _LWP_H */
|
||||
|
|
|
@ -23,14 +23,6 @@
|
|||
#ifndef _LWP_H
|
||||
#define _LWP_H
|
||||
|
||||
#ifndef _PROTO
|
||||
#ifdef __cplusplus
|
||||
#define _PROTO(x) x
|
||||
#else
|
||||
#define _PROTO(x) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <setjmp.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
@ -67,24 +59,23 @@ struct lwpSem {
|
|||
|
||||
#define LWP_MAX_PRIO 8
|
||||
|
||||
struct lwpProc *lwpInitSystem _PROTO((int));
|
||||
struct lwpProc *lwpCreate
|
||||
_PROTO((int, void (*)(), int, int, char **, void *));
|
||||
void lwpExit _PROTO((void));
|
||||
void lwpTerminate _PROTO((struct lwpProc *));
|
||||
void lwpYield _PROTO((void));
|
||||
void lwpSleepFd _PROTO((int fd, int flags));
|
||||
void lwpSleepUntil _PROTO((long until));
|
||||
void lwpWakeupFd _PROTO((struct lwpProc *));
|
||||
void *lwpGetUD _PROTO((struct lwpProc *));
|
||||
void lwpSetUD _PROTO((struct lwpProc *, char *));
|
||||
int lwpSetPriority _PROTO((int));
|
||||
void lwpReschedule _PROTO(());
|
||||
struct lwpProc *lwpInitSystem(int);
|
||||
struct lwpProc *lwpCreate(int, void (*)(void *), int, int, char **, void *);
|
||||
void lwpExit(void);
|
||||
void lwpTerminate(struct lwpProc *);
|
||||
void lwpYield(void);
|
||||
void lwpSleepFd(int fd, int flags);
|
||||
void lwpSleepUntil(long until);
|
||||
void lwpWakeupFd(struct lwpProc *);
|
||||
void *lwpGetUD(struct lwpProc *);
|
||||
void lwpSetUD(struct lwpProc *, char *);
|
||||
int lwpSetPriority(int);
|
||||
void lwpReschedule();
|
||||
|
||||
struct lwpSem *lwpCreateSem _PROTO((int));
|
||||
void lwpSignal _PROTO((struct lwpSem *));
|
||||
void lwpWait _PROTO((struct lwpSem *));
|
||||
void lwpSelect _PROTO((int argc, char **argv));
|
||||
struct lwpSem *lwpCreateSem(int);
|
||||
void lwpSignal(struct lwpSem *);
|
||||
void lwpWait(struct lwpSem *);
|
||||
void lwpSelect(int argc, char **argv);
|
||||
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
#if defined(_EMPTH_LWP)
|
||||
|
||||
struct lwpProc *
|
||||
lwpGetFirst(q)
|
||||
struct lwpQueue *q;
|
||||
lwpGetFirst(struct lwpQueue *q)
|
||||
{
|
||||
struct lwpProc *head;
|
||||
|
||||
|
@ -38,9 +37,7 @@ struct lwpQueue *q;
|
|||
}
|
||||
|
||||
void
|
||||
lwpAddTail(q, p)
|
||||
register struct lwpQueue *q;
|
||||
register struct lwpProc *p;
|
||||
lwpAddTail(register struct lwpQueue *q, register struct lwpProc *p)
|
||||
{
|
||||
if (!q->tail)
|
||||
q->head = p;
|
||||
|
|
|
@ -62,8 +62,7 @@ struct lwpSelect {
|
|||
struct lwpSelect LwpSelect;
|
||||
|
||||
void
|
||||
lwpInitSelect(proc)
|
||||
struct lwpProc *proc;
|
||||
lwpInitSelect(struct lwpProc *proc)
|
||||
{
|
||||
LwpSelect.maxfd = 0;
|
||||
LwpSelect.nfds = 0;
|
||||
|
@ -82,9 +81,7 @@ struct lwpProc *proc;
|
|||
}
|
||||
|
||||
void
|
||||
lwpSleepFd(fd, mask)
|
||||
int fd;
|
||||
int mask;
|
||||
lwpSleepFd(int fd, int mask)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
@ -116,8 +113,7 @@ int mask;
|
|||
}
|
||||
|
||||
void
|
||||
lwpWakeupFd(proc)
|
||||
struct lwpProc *proc;
|
||||
lwpWakeupFd(struct lwpProc *proc)
|
||||
{
|
||||
if (proc->fd < 0)
|
||||
return;
|
||||
|
@ -132,8 +128,7 @@ struct lwpProc *proc;
|
|||
}
|
||||
|
||||
void
|
||||
lwpSleepUntil(until)
|
||||
long until;
|
||||
lwpSleepUntil(long int until)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
@ -149,9 +144,7 @@ long until;
|
|||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
lwpSelect(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
lwpSelect(void *arg)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
struct lwpProc *us = LwpCurrent;
|
||||
|
|
|
@ -38,9 +38,7 @@ extern char *strdup();
|
|||
* create a lwpSemaphore.
|
||||
*/
|
||||
struct lwpSem *
|
||||
lwpCreateSem(name, count)
|
||||
char *name;
|
||||
int count;
|
||||
lwpCreateSem(char *name, int count)
|
||||
{
|
||||
struct lwpSem *new;
|
||||
|
||||
|
@ -57,8 +55,7 @@ int count;
|
|||
* the blocked process has a higher priority than ours'.
|
||||
*/
|
||||
void
|
||||
lwpSignal(s)
|
||||
struct lwpSem *s;
|
||||
lwpSignal(struct lwpSem *s)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
@ -78,8 +75,7 @@ struct lwpSem *s;
|
|||
* wait on a lwpSemaphore
|
||||
*/
|
||||
void
|
||||
lwpWait(s)
|
||||
struct lwpSem *s;
|
||||
lwpWait(struct lwpSem *s)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
|
|
@ -40,195 +40,195 @@
|
|||
#include "nat.h"
|
||||
#include "file.h"
|
||||
|
||||
extern int add();
|
||||
extern int anti();
|
||||
extern int assa();
|
||||
extern int atta();
|
||||
extern int boar();
|
||||
extern int bdes();
|
||||
extern int bomb();
|
||||
extern int buil();
|
||||
extern int chan();
|
||||
extern int coas();
|
||||
extern int comm();
|
||||
extern int coun();
|
||||
extern int decl();
|
||||
extern int deli();
|
||||
extern int show();
|
||||
extern int add(void);
|
||||
extern int anti(void);
|
||||
extern int assa(void);
|
||||
extern int atta(void);
|
||||
extern int boar(void);
|
||||
extern int bdes(void);
|
||||
extern int bomb(void);
|
||||
extern int buil(void);
|
||||
extern int chan(void);
|
||||
extern int coas(void);
|
||||
extern int comm(void);
|
||||
extern int coun(void);
|
||||
extern int decl(void);
|
||||
extern int deli(void);
|
||||
extern int show(void);
|
||||
extern int show_motd(void);
|
||||
extern int desi();
|
||||
extern int diss();
|
||||
extern int drop();
|
||||
extern int desi(void);
|
||||
extern int diss(void);
|
||||
extern int drop(void);
|
||||
extern int echo(void);
|
||||
extern int enli();
|
||||
extern int fire();
|
||||
extern int flee();
|
||||
extern int fly();
|
||||
extern int force();
|
||||
extern int info();
|
||||
extern int apro();
|
||||
extern int load();
|
||||
extern int look();
|
||||
extern int map();
|
||||
extern int mine();
|
||||
extern int move();
|
||||
extern int nati();
|
||||
extern int navi();
|
||||
extern int head(), news();
|
||||
extern int nuke();
|
||||
extern int offs();
|
||||
extern int para();
|
||||
extern int path();
|
||||
extern int payo();
|
||||
extern int powe();
|
||||
extern int rada();
|
||||
extern int rea();
|
||||
extern int real();
|
||||
extern int reco();
|
||||
extern int rout();
|
||||
extern int sona();
|
||||
extern int spy();
|
||||
extern int tele();
|
||||
extern int tend();
|
||||
extern int torp();
|
||||
extern int tran();
|
||||
extern int trea();
|
||||
extern int turn();
|
||||
extern int vers();
|
||||
extern int enli(void);
|
||||
extern int fire(void);
|
||||
extern int flee(void);
|
||||
extern int fly(void);
|
||||
extern int force(void);
|
||||
extern int info(void);
|
||||
extern int apro(void);
|
||||
extern int load(void);
|
||||
extern int look(void);
|
||||
extern int map(void);
|
||||
extern int mine(void);
|
||||
extern int move(void);
|
||||
extern int nati(void);
|
||||
extern int navi(void);
|
||||
extern int head(void), news(void);
|
||||
extern int nuke(void);
|
||||
extern int offs(void);
|
||||
extern int para(void);
|
||||
extern int path(void);
|
||||
extern int payo(void);
|
||||
extern int powe(void);
|
||||
extern int rada(void);
|
||||
extern int rea(void);
|
||||
extern int real(void);
|
||||
extern int reco(void);
|
||||
extern int rout(void);
|
||||
extern int sona(void);
|
||||
extern int spy(void);
|
||||
extern int tele(void);
|
||||
extern int tend(void);
|
||||
extern int torp(void);
|
||||
extern int tran(void);
|
||||
extern int trea(void);
|
||||
extern int turn(void);
|
||||
extern int vers(void);
|
||||
/*
|
||||
* new commands
|
||||
*/
|
||||
extern int repo();
|
||||
extern int laun();
|
||||
extern int new();
|
||||
extern int shoo();
|
||||
extern int thre();
|
||||
extern int dist();
|
||||
extern int sct();
|
||||
extern int plan();
|
||||
extern int arm();
|
||||
extern int hard();
|
||||
extern int upgr();
|
||||
extern int surv();
|
||||
extern int capi();
|
||||
extern int orig();
|
||||
extern int conv();
|
||||
extern int leve();
|
||||
extern int cuto();
|
||||
extern int prod();
|
||||
extern int wai();
|
||||
extern int carg();
|
||||
extern int terr();
|
||||
extern int sate();
|
||||
extern int give();
|
||||
extern int edit();
|
||||
extern int wipe();
|
||||
extern int dump();
|
||||
extern int ldump();
|
||||
extern int ndump();
|
||||
extern int pdump();
|
||||
extern int pboa();
|
||||
extern int sdump();
|
||||
extern int lost();
|
||||
extern int explore();
|
||||
extern int reso();
|
||||
extern int scra();
|
||||
extern int rela();
|
||||
extern int brea();
|
||||
extern int upda();
|
||||
extern int hidd();
|
||||
extern int orde();
|
||||
extern int qorde();
|
||||
extern int sorde();
|
||||
extern int reje();
|
||||
extern int acce();
|
||||
extern int sabo();
|
||||
extern int scut();
|
||||
extern int grin();
|
||||
extern int shar();
|
||||
extern int sail(); /* Forsman's hacks */
|
||||
extern int foll();
|
||||
extern int mobq();
|
||||
extern int name();
|
||||
extern int range();
|
||||
extern int zdon();
|
||||
extern int fuel();
|
||||
extern int multifire();
|
||||
extern int retr();
|
||||
extern int budg();
|
||||
extern int wire();
|
||||
extern int stop();
|
||||
extern int start();
|
||||
extern int repo(void);
|
||||
extern int laun(void);
|
||||
extern int new(void);
|
||||
extern int shoo(void);
|
||||
extern int thre(void);
|
||||
extern int dist(void);
|
||||
extern int sct(void);
|
||||
extern int plan(void);
|
||||
extern int arm(void);
|
||||
extern int hard(void);
|
||||
extern int upgr(void);
|
||||
extern int surv(void);
|
||||
extern int capi(void);
|
||||
extern int orig(void);
|
||||
extern int conv(void);
|
||||
extern int leve(void);
|
||||
extern int cuto(void);
|
||||
extern int prod(void);
|
||||
extern int wai(void);
|
||||
extern int carg(void);
|
||||
extern int terr(void);
|
||||
extern int sate(void);
|
||||
extern int give(void);
|
||||
extern int edit(void);
|
||||
extern int wipe(void);
|
||||
extern int dump(void);
|
||||
extern int ldump(void);
|
||||
extern int ndump(void);
|
||||
extern int pdump(void);
|
||||
extern int pboa(void);
|
||||
extern int sdump(void);
|
||||
extern int lost(void);
|
||||
extern int explore(void);
|
||||
extern int reso(void);
|
||||
extern int scra(void);
|
||||
extern int rela(void);
|
||||
extern int brea(void);
|
||||
extern int upda(void);
|
||||
extern int hidd(void);
|
||||
extern int orde(void);
|
||||
extern int qorde(void);
|
||||
extern int sorde(void);
|
||||
extern int reje(void);
|
||||
extern int acce(void);
|
||||
extern int sabo(void);
|
||||
extern int scut(void);
|
||||
extern int grin(void);
|
||||
extern int shar(void);
|
||||
extern int sail(void); /* Forsman's hacks */
|
||||
extern int foll(void);
|
||||
extern int mobq(void);
|
||||
extern int name(void);
|
||||
extern int range(void);
|
||||
extern int zdon(void);
|
||||
extern int fuel(void);
|
||||
extern int multifire(void);
|
||||
extern int retr(void);
|
||||
extern int budg(void);
|
||||
extern int wire(void);
|
||||
extern int stop(void);
|
||||
extern int start(void);
|
||||
|
||||
extern int land();
|
||||
extern int supp();
|
||||
extern int lboa();
|
||||
extern int lcarg();
|
||||
extern int lload();
|
||||
extern int army();
|
||||
extern int lrange();
|
||||
extern int morale();
|
||||
extern int lretr();
|
||||
extern int landmine();
|
||||
extern int fort();
|
||||
extern int march();
|
||||
extern int llook();
|
||||
extern int mission();
|
||||
extern int work();
|
||||
extern int ltend();
|
||||
extern int cede();
|
||||
extern int best();
|
||||
extern int newe();
|
||||
extern int starve();
|
||||
extern int land(void);
|
||||
extern int supp(void);
|
||||
extern int lboa(void);
|
||||
extern int lcarg(void);
|
||||
extern int lload(void);
|
||||
extern int army(void);
|
||||
extern int lrange(void);
|
||||
extern int morale(void);
|
||||
extern int lretr(void);
|
||||
extern int landmine(void);
|
||||
extern int fort(void);
|
||||
extern int march(void);
|
||||
extern int llook(void);
|
||||
extern int mission(void);
|
||||
extern int work(void);
|
||||
extern int ltend(void);
|
||||
extern int cede(void);
|
||||
extern int best(void);
|
||||
extern int newe(void);
|
||||
extern int starve(void);
|
||||
|
||||
extern int setres();
|
||||
extern int setsector();
|
||||
extern int setres(void);
|
||||
extern int setsector(void);
|
||||
|
||||
extern int disa();
|
||||
extern int enab();
|
||||
extern int disa(void);
|
||||
extern int enab(void);
|
||||
|
||||
/*
|
||||
* Undeclared functions
|
||||
*/
|
||||
extern int quit(void);
|
||||
extern int cens();
|
||||
extern int demo();
|
||||
extern int shi();
|
||||
extern int wing();
|
||||
extern int cens(void);
|
||||
extern int demo(void);
|
||||
extern int shi(void);
|
||||
extern int wing(void);
|
||||
extern int execute(void);
|
||||
extern int explain(void);
|
||||
extern int set();
|
||||
extern int set(void);
|
||||
extern int flash(void);
|
||||
extern int wall();
|
||||
extern int shut();
|
||||
extern int togg();
|
||||
extern int stre();
|
||||
extern int skyw();
|
||||
extern int play();
|
||||
extern int swaps();
|
||||
extern int wall(void);
|
||||
extern int shut(void);
|
||||
extern int togg(void);
|
||||
extern int stre(void);
|
||||
extern int skyw(void);
|
||||
extern int play(void);
|
||||
extern int swaps(void);
|
||||
|
||||
extern int trad();
|
||||
extern int mark();
|
||||
extern int buy();
|
||||
extern int mult();
|
||||
extern int sell();
|
||||
extern int rese();
|
||||
extern int trad(void);
|
||||
extern int mark(void);
|
||||
extern int buy(void);
|
||||
extern int mult(void);
|
||||
extern int sell(void);
|
||||
extern int rese(void);
|
||||
|
||||
extern int repa();
|
||||
extern int fina();
|
||||
extern int coll();
|
||||
extern int cons();
|
||||
extern int ledg();
|
||||
extern int shark();
|
||||
extern int offe();
|
||||
extern int repa(void);
|
||||
extern int fina(void);
|
||||
extern int coll(void);
|
||||
extern int cons(void);
|
||||
extern int ledg(void);
|
||||
extern int shark(void);
|
||||
extern int offe(void);
|
||||
|
||||
extern int mobupdate();
|
||||
extern int mobupdate(void);
|
||||
|
||||
extern int sinfra();
|
||||
extern int improve();
|
||||
extern int lsta();
|
||||
extern int pstat();
|
||||
extern int sstat();
|
||||
extern int sinfra(void);
|
||||
extern int improve(void);
|
||||
extern int lsta(void);
|
||||
extern int pstat(void);
|
||||
extern int sstat(void);
|
||||
|
||||
struct cmndstr player_coms[] = {
|
||||
/* command form cost addr permit */
|
||||
|
|
|
@ -163,7 +163,6 @@ command(void)
|
|||
{
|
||||
register unsigned int x;
|
||||
s_char *redir;
|
||||
int kill_player();
|
||||
s_char scanspace[1024];
|
||||
|
||||
if (getcommand(player->combuf) < 0)
|
||||
|
|
|
@ -148,7 +148,6 @@ int
|
|||
print_found(struct shiplook *head)
|
||||
{
|
||||
struct shiplook *s;
|
||||
extern s_char *effadv(int);
|
||||
int first;
|
||||
struct mchrstr *mp;
|
||||
struct shpstr ship;
|
||||
|
|
|
@ -157,9 +157,7 @@ prcom(int inon, struct combat *com)
|
|||
|
||||
/* Doing a sneak attack */
|
||||
static void
|
||||
do_sneak(def, success)
|
||||
struct combat *def;
|
||||
int success;
|
||||
do_sneak(struct combat *def, int success)
|
||||
{
|
||||
struct sctstr sect;
|
||||
struct natstr *natp = getnatp(player->cnum);
|
||||
|
@ -1147,7 +1145,6 @@ att_combat_eff(struct combat *com)
|
|||
{
|
||||
double eff = 1.0;
|
||||
double str;
|
||||
double sector_strength(struct sctstr *sp);
|
||||
struct shpstr ship;
|
||||
|
||||
if (com->type == EF_SECTOR) {
|
||||
|
|
|
@ -315,7 +315,6 @@ lnd_take_casualty(int combat_mode, struct llist *llp, int cas)
|
|||
void
|
||||
lnd_takemob(struct emp_qelem *list, double loss)
|
||||
{
|
||||
extern double combat_mob;
|
||||
struct emp_qelem *qp, *next;
|
||||
struct llist *llp;
|
||||
int new;
|
||||
|
|
|
@ -140,7 +140,7 @@ collateral_damage(coord x, coord y, int dam, struct emp_qelem *list)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
only_subs(struct emp_qelem *list)
|
||||
{
|
||||
struct emp_qelem *qp;
|
||||
|
@ -977,7 +977,6 @@ show_mission(int type, struct nstr_item *np)
|
|||
int
|
||||
oprange(struct genitem *gp, int type, int *radius)
|
||||
{
|
||||
double techfact(int, double);
|
||||
int range;
|
||||
struct shpstr ship;
|
||||
struct lndstr land;
|
||||
|
|
|
@ -60,8 +60,7 @@ move_ground(s_char *what, struct sctstr *start, struct sctstr *end,
|
|||
coord curx, cury, oldx, oldy;
|
||||
coord tmpx, tmpy;
|
||||
coord dx, dy;
|
||||
s_char *movstr, *BestLandPath(s_char *, struct sctstr *,
|
||||
struct sctstr *, double *, int);
|
||||
s_char *movstr;
|
||||
double sect_mcost;
|
||||
double total_mcost;
|
||||
double mv_cost;
|
||||
|
|
|
@ -133,7 +133,6 @@ retreat_ship1(struct shpstr *sp, s_char code, int orig)
|
|||
|
||||
/* Is this the originally scared ship, or a follower */
|
||||
{
|
||||
extern double techfact(int, double);
|
||||
struct sctstr sect;
|
||||
register int n;
|
||||
register int m;
|
||||
|
@ -425,7 +424,6 @@ retreat_land1(struct lndstr *lp, s_char code, int orig)
|
|||
|
||||
/* Is this the originally scared unit, or a follower */
|
||||
{
|
||||
extern double techfact(int, double);
|
||||
struct sctstr sect;
|
||||
register int n;
|
||||
register int m;
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
* (bailey@mcs.kent.edu)
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "misc.h"
|
||||
#include "player.h"
|
||||
#include "nuke.h"
|
||||
|
@ -55,8 +56,6 @@
|
|||
#include "nat.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
double sqrt(double);
|
||||
double logx(double, double);
|
||||
|
||||
/*
|
||||
* This cruft really belongs in the empglb.c file.
|
||||
|
|
|
@ -380,8 +380,6 @@ shp_mess(s_char *str, struct mlist *mlp)
|
|||
static int
|
||||
shp_check_nav(struct sctstr *sect)
|
||||
{
|
||||
extern struct dchrstr dchr[];
|
||||
|
||||
switch (dchr[sect->sct_type].d_flg & 03) {
|
||||
case NAVOK:
|
||||
break;
|
||||
|
|
|
@ -64,7 +64,6 @@ takeover(register struct sctstr *sp, natid newown)
|
|||
struct nstr_item ni;
|
||||
struct plnstr p;
|
||||
struct lndstr land;
|
||||
extern double hap_fact(struct natstr *, struct natstr *);
|
||||
extern int etu_per_update;
|
||||
extern int sect_mob_neg_factor;
|
||||
|
||||
|
|
|
@ -45,14 +45,13 @@
|
|||
#include "update.h"
|
||||
#include "subs.h"
|
||||
#include "common.h"
|
||||
#include "prototypes.h"
|
||||
|
||||
int
|
||||
dodistribute(struct sctstr *sp, int imex, s_char *path, double dist_i_cost,
|
||||
double dist_e_cost)
|
||||
/* import or export? */
|
||||
{
|
||||
struct sctstr *getdistsp();
|
||||
float distpathcost();
|
||||
struct ichrstr *ip;
|
||||
struct sctstr *dist;
|
||||
int amt;
|
||||
|
|
|
@ -72,9 +72,9 @@ static s_char *finish_path = "h"; /* Placeholder indicating path exists */
|
|||
#endif /* SAVE_FINISH_PATHS */
|
||||
|
||||
static void assemble_dist_paths(struct distinfo *distptrs);
|
||||
s_char *BestDistPath();
|
||||
s_char *BestDistPath(s_char *, struct sctstr *, struct sctstr *, double *, int);
|
||||
s_char *ReversePath(s_char *path);
|
||||
double pathcost();
|
||||
double pathcost(struct sctstr *, s_char *, int);
|
||||
|
||||
void
|
||||
finish_sects(int etu)
|
||||
|
@ -240,8 +240,7 @@ assemble_dist_paths(struct distinfo *distptrs)
|
|||
}
|
||||
}
|
||||
|
||||
s_char
|
||||
*
|
||||
s_char *
|
||||
ReversePath(s_char *path)
|
||||
{
|
||||
s_char *patharray = "aucdefjhigklmyopqrstbvwxnz";
|
||||
|
|
|
@ -121,7 +121,6 @@ upd_land(register struct lndstr *lp, int landno, register int etus,
|
|||
int vec[I_MAX + 1];
|
||||
int cvec[I_MAX + 1];
|
||||
int n;
|
||||
double techfact(int, double);
|
||||
int min = morale_base - (int)np->nat_level[NAT_HLEV];
|
||||
int mult;
|
||||
extern double money_land;
|
||||
|
@ -245,7 +244,6 @@ static int
|
|||
landrepair(register struct lndstr *land, int *vec, struct natstr *np,
|
||||
int *bp, int etus)
|
||||
{
|
||||
extern int mil_dbl_pay;
|
||||
extern int land_grow_scale;
|
||||
register int delta;
|
||||
struct sctstr *sp;
|
||||
|
|
|
@ -56,7 +56,7 @@ 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
|
||||
static int
|
||||
increase_mob(time_t * counter, float mult)
|
||||
{
|
||||
time_t secs;
|
||||
|
|
|
@ -241,7 +241,6 @@ nav_loadship(register struct shpstr *sp, natid cnum)
|
|||
int
|
||||
nav_ship(register struct shpstr *sp)
|
||||
{
|
||||
extern double techfact(int, double);
|
||||
struct sctstr *sectp;
|
||||
s_char *cp, item;
|
||||
int stopping;
|
||||
|
|
|
@ -59,8 +59,6 @@
|
|||
int
|
||||
check_nav(struct sctstr *sect)
|
||||
{
|
||||
extern struct dchrstr dchr[];
|
||||
|
||||
switch (dchr[sect->sct_type].d_flg & 03) {
|
||||
case NAVOK:
|
||||
break;
|
||||
|
|
|
@ -144,7 +144,6 @@ revolt(struct sctstr *sp)
|
|||
void
|
||||
guerrilla(struct sctstr *sp)
|
||||
{
|
||||
extern s_char *effadv();
|
||||
struct sctstr *nsp;
|
||||
int recruit;
|
||||
int move;
|
||||
|
@ -168,9 +167,7 @@ guerrilla(struct sctstr *sp)
|
|||
int val;
|
||||
int oldmob;
|
||||
struct lndstr *lp;
|
||||
s_char *nxtitemp(struct nstr_item *np, int owner);
|
||||
struct nstr_item ni;
|
||||
extern double hap_fact();
|
||||
|
||||
mc = cc = 0;
|
||||
recruit = 0;
|
||||
|
@ -463,7 +460,6 @@ take_casualties(struct sctstr *sp, int mc)
|
|||
int cantake;
|
||||
int nunits = 0, each, deq;
|
||||
struct lndstr *lp;
|
||||
s_char *nxtitemp(struct nstr_item *np, int owner);
|
||||
struct nstr_item ni;
|
||||
|
||||
/* casualties come out of mil first */
|
||||
|
|
|
@ -445,7 +445,6 @@ feed_ship(struct shpstr *sp, register int *vec, int etus, int *needed,
|
|||
int starved, lvec[I_MAX + 1];
|
||||
struct nstr_item ni;
|
||||
struct lndstr *lp;
|
||||
s_char *nxtitemp(struct nstr_item *np, int owner);
|
||||
|
||||
if (opt_NOFOOD)
|
||||
return 0; /* no food no work to do */
|
||||
|
|
|
@ -40,8 +40,7 @@
|
|||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
player_kill_idle(argv)
|
||||
void *argv;
|
||||
player_kill_idle(void *argv)
|
||||
{
|
||||
extern int max_idle;
|
||||
struct player *p;
|
||||
|
|
|
@ -43,8 +43,7 @@
|
|||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
delete_lostitems(argv)
|
||||
void *argv;
|
||||
delete_lostitems(void *argv)
|
||||
{
|
||||
extern int lost_items_timeout;
|
||||
time_t now;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue