(num_teles, redir_fp, pipe_fp, exec_fd, sendeof, prompt, command)

(ac_intercept, all_missiles, ac_planedamage, ac_doflak, ac_landflak)
(ac_shipflak, ac_fireflak, can_fly, do_evade, att_calcodds)
(emp_setbitmap, lnd_hit_mine, conditions, get_wp, daemonize): Internal
linkage.
This commit is contained in:
Markus Armbruster 2006-05-20 13:54:45 +00:00
parent aac6312c74
commit 2ae6be9af6
18 changed files with 41 additions and 44 deletions

View file

@ -35,7 +35,6 @@
#define BUDG_H #define BUDG_H
void fill_update_array(int *bp, struct sctstr *sp); 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, i_type comm); int gt_bg_nmbr(int *bp, struct sctstr *sp, i_type comm);
void pt_bg_nmbr(int *bp, struct sctstr *sp, i_type comm, int amount); void pt_bg_nmbr(int *bp, struct sctstr *sp, i_type comm, int amount);
void get_materials(struct sctstr *sp, int *bp, int *mvec, int check); void get_materials(struct sctstr *sp, int *bp, int *mvec, int check);

View file

@ -69,7 +69,6 @@ struct combat {
#define A_LBOARD 5 #define A_LBOARD 5
/* src/lib/subs/attsub.c */ /* src/lib/subs/attsub.c */
extern double att_calcodds(int, int);
extern double att_combat_eff(struct combat *); extern double att_combat_eff(struct combat *);
extern void att_move_in_off(int, struct combat *, struct emp_qelem *, extern void att_move_in_off(int, struct combat *, struct emp_qelem *,
struct combat *); struct combat *);

View file

@ -218,7 +218,6 @@ extern void count_units(struct shpstr *);
extern void lnd_count_units(struct lndstr *); extern void lnd_count_units(struct lndstr *);
extern void lnd_mar(struct emp_qelem *, double *, double *, int *, natid); extern void lnd_mar(struct emp_qelem *, double *, double *, int *, natid);
extern void lnd_put(struct emp_qelem *, natid); extern void lnd_put(struct emp_qelem *, natid);
extern int lnd_hit_mine(struct lndstr *, struct lchrstr *);
extern void lnd_list(struct emp_qelem *); extern void lnd_list(struct emp_qelem *);
extern int lnd_hardtarget(struct lndstr *); extern int lnd_hardtarget(struct lndstr *);
extern int lnd_mar_one_sector(struct emp_qelem *, int, natid, int); extern int lnd_mar_one_sector(struct emp_qelem *, int, natid, int);

View file

@ -98,7 +98,6 @@ typedef short coord;
#define days(x) (60*60*24*(x)) #define days(x) (60*60*24*(x))
extern int debug; extern int debug;
extern int daemonize;
/* /*
* If EXPR is true, an internal error occured. * If EXPR is true, an internal error occured.

View file

@ -158,26 +158,15 @@ struct shiplist {
#define PLN_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm)) #define PLN_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm))
/* src/lib/subs/aircombat.c */ /* src/lib/subs/aircombat.c */
extern void ac_planedamage(struct plist *, natid, int, natid, int,
int, char *);
extern void ac_intercept(struct emp_qelem *, struct emp_qelem *,
struct emp_qelem *, natid, coord, coord);
extern void ac_combat_headers(natid, natid); extern void ac_combat_headers(natid, natid);
extern void ac_airtoair(struct emp_qelem *, struct emp_qelem *); extern void ac_airtoair(struct emp_qelem *, struct emp_qelem *);
extern void ac_doflak(struct emp_qelem *, struct sctstr *);
extern void ac_shipflak(struct emp_qelem *, coord, coord);
extern void ac_landflak(struct emp_qelem *, coord, coord);
extern void ac_fireflak(struct emp_qelem *, natid, natid, int);
extern int ac_flak_dam(int); extern int ac_flak_dam(int);
extern void ac_encounter(struct emp_qelem *, struct emp_qelem *, coord, extern void ac_encounter(struct emp_qelem *, struct emp_qelem *, coord,
coord, char *, int, int, coord, char *, int, int,
struct emp_qelem *, struct emp_qelem *); struct emp_qelem *, struct emp_qelem *);
extern int ac_isflying(struct plnstr *, struct emp_qelem *); extern int ac_isflying(struct plnstr *, struct emp_qelem *);
extern int do_evade(struct emp_qelem *, struct emp_qelem *);
extern void sam_intercept(struct emp_qelem *, struct emp_qelem *, extern void sam_intercept(struct emp_qelem *, struct emp_qelem *,
natid, natid, coord, coord, int); natid, natid, coord, coord, int);
extern int all_missiles(struct emp_qelem *);
extern int can_fly(int);
/* src/lib/subs/aswplnsubs.c */ /* src/lib/subs/aswplnsubs.c */
extern int on_shiplist(short, struct shiplist *); extern int on_shiplist(short, struct shiplist *);

View file

@ -420,7 +420,6 @@ extern int natpass(int, char *);
extern struct player *player; /* current player's context */ extern struct player *player; /* current player's context */
extern char *praddr(struct player *); extern char *praddr(struct player *);
extern void player_main(struct player *); extern void player_main(struct player *);
extern int command(void);
/* more under Commands */ /* more under Commands */
/* recvclient.c */ /* recvclient.c */
extern int recvclient(char *, int); extern int recvclient(char *, int);
@ -464,7 +463,6 @@ extern int shipdef(natid, natid, coord, coord);
/* getbit.c */ /* getbit.c */
extern int emp_getbit(int, int, unsigned char *); extern int emp_getbit(int, int, unsigned char *);
extern void emp_setbit(int, int, unsigned char *); extern void emp_setbit(int, int, unsigned char *);
extern void emp_setbitmap(int, int, unsigned char *, int *);
extern void bitinit2(struct nstr_sect *, unsigned char *, int); extern void bitinit2(struct nstr_sect *, unsigned char *, int);
/* getele.c */ /* getele.c */
extern int getele(char *, char *); extern int getele(char *, char *);

View file

@ -50,7 +50,6 @@ struct ioqueue;
extern char empirehost[]; extern char empirehost[];
extern char empireport[]; extern char empireport[];
extern int eight_bit_clean; extern int eight_bit_clean;
extern char num_teles[];
extern int sock; extern int sock;
extern char *SO; extern char *SO;
extern char *SE; extern char *SE;
@ -76,7 +75,6 @@ int tcp_connect(char *, char *);
int login(int s, char *uname, char *cname, char *cpass, int kill_proc, int); int login(int s, char *uname, char *cname, char *cpass, int kill_proc, int);
void saveargv(int ac, char **src, char **dst); void saveargv(int ac, char **src, char **dst);
void sendcmd(int s, char *cmd, char *arg); void sendcmd(int s, char *cmd, char *arg);
int sendeof(int sock);
void servercmd(struct ioqueue *ioq, FILE *auxfi); void servercmd(struct ioqueue *ioq, FILE *auxfi);
int serverio(int s, struct ioqueue *ioq); int serverio(int s, struct ioqueue *ioq);
int termio(int fd, int sock, FILE *auxfi); int termio(int fd, int sock, FILE *auxfi);

View file

@ -52,14 +52,14 @@
#include <io.h> #include <io.h>
#endif #endif
char num_teles[64]; static char num_teles[64];
static char the_prompt[1024]; static char the_prompt[1024];
static int mode; static int mode;
static int nbtu; static int nbtu;
static int nmin; static int nmin;
FILE *redir_fp; static FILE *redir_fp;
FILE *pipe_fp; static FILE *pipe_fp;
int exec_fd; static int exec_fd;
static void prompt(FILE *auxfi); static void prompt(FILE *auxfi);
static void doredir(char *p); static void doredir(char *p);

View file

@ -45,6 +45,8 @@
#include "misc.h" #include "misc.h"
#include "tags.h" #include "tags.h"
static int sendeof(int sock);
int int
termio(int fd, int sock, FILE *auxfi) termio(int fd, int sock, FILE *auxfi)
{ {
@ -243,7 +245,7 @@ termio(int fd, int sock, FILE *auxfi)
return 1; return 1;
} }
int static int
sendeof(int sock) sendeof(int sock)
{ {
#ifndef _WIN32 #ifndef _WIN32

View file

@ -45,7 +45,7 @@
#include "optlist.h" #include "optlist.h"
#include "commands.h" #include "commands.h"
char *prompt[] = { static char *prompt[] = {
"Improve what ('road' or 'rail')? ", "Improve what ('road' or 'rail')? ",
"Improve what ('road', 'rail' or 'defense')? " "Improve what ('road', 'rail' or 'defense')? "
}; };

View file

@ -59,6 +59,7 @@
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
static int command(void);
static int status(void); static int status(void);
struct player *player; struct player *player;
@ -139,7 +140,7 @@ player_main(struct player *p)
pr("Bye-bye\n"); pr("Bye-bye\n");
} }
int static int
command(void) command(void)
{ {
unsigned i; unsigned i;

View file

@ -53,10 +53,21 @@
#include "optlist.h" #include "optlist.h"
#include "server.h" #include "server.h"
static void getilist(struct emp_qelem *list, natid own, static void ac_intercept(struct emp_qelem *, struct emp_qelem *,
struct emp_qelem *a, struct emp_qelem *b, struct emp_qelem *, natid, coord, coord);
struct emp_qelem *c, struct emp_qelem *d); static int all_missiles(struct emp_qelem *);
static void ac_dog(struct plist *ap, struct plist *dp); static void ac_dog(struct plist *, struct plist *);
static void ac_planedamage(struct plist *, natid, int, natid, int,
int, char *);
static void ac_doflak(struct emp_qelem *, struct sctstr *);
static void ac_landflak(struct emp_qelem *, coord, coord);
static void ac_shipflak(struct emp_qelem *, coord, coord);
static void ac_fireflak(struct emp_qelem *, natid, natid, int);
static void getilist(struct emp_qelem *, natid,
struct emp_qelem *, struct emp_qelem *,
struct emp_qelem *, struct emp_qelem *);
static int can_fly(int);
static int do_evade(struct emp_qelem *, struct emp_qelem *);
void void
ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list, ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
@ -431,7 +442,7 @@ sam_intercept(struct emp_qelem *att_list, struct emp_qelem *def_list,
} }
} }
void static void
ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list, ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
struct emp_qelem *def_list, natid def_own, coord x, coord y) struct emp_qelem *def_list, natid def_own, coord x, coord y)
{ {
@ -572,7 +583,7 @@ ac_airtoair(struct emp_qelem *att_list, struct emp_qelem *int_list)
} }
} }
int static int
all_missiles(struct emp_qelem *att_list) all_missiles(struct emp_qelem *att_list)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;
@ -687,7 +698,7 @@ ac_dog(struct plist *ap, struct plist *dp)
* that the current queue pointer is invalid on return from the ac_planedamage * that the current queue pointer is invalid on return from the ac_planedamage
* call. (this has caused bugs in the past) * call. (this has caused bugs in the past)
*/ */
void static void
ac_planedamage(struct plist *plp, natid from, int dam, natid other, ac_planedamage(struct plist *plp, natid from, int dam, natid other,
int checkabort, int show, char *mesg) int checkabort, int show, char *mesg)
{ {
@ -764,7 +775,7 @@ ac_planedamage(struct plist *plp, natid from, int dam, natid other,
strcpy(mesg, dmess); strcpy(mesg, dmess);
} }
void static void
ac_doflak(struct emp_qelem *list, struct sctstr *from) ac_doflak(struct emp_qelem *list, struct sctstr *from)
{ {
int shell; int shell;
@ -799,7 +810,7 @@ ac_doflak(struct emp_qelem *list, struct sctstr *from)
} }
} }
void static void
ac_shipflak(struct emp_qelem *list, coord x, coord y) ac_shipflak(struct emp_qelem *list, coord x, coord y)
{ {
struct nstr_item ni; struct nstr_item ni;
@ -869,7 +880,7 @@ ac_shipflak(struct emp_qelem *list, coord x, coord y)
} }
} }
void static void
ac_landflak(struct emp_qelem *list, coord x, coord y) ac_landflak(struct emp_qelem *list, coord x, coord y)
{ {
struct nstr_item ni; struct nstr_item ni;
@ -937,7 +948,7 @@ ac_landflak(struct emp_qelem *list, coord x, coord y)
/* /*
* Called from shipflak, landflak, and doflak. * Called from shipflak, landflak, and doflak.
*/ */
void static void
ac_fireflak(struct emp_qelem *list, natid from, natid other, int guns) ac_fireflak(struct emp_qelem *list, natid from, natid other, int guns)
{ {
struct plnstr *pp; struct plnstr *pp;
@ -1097,7 +1108,7 @@ getilist(struct emp_qelem *list, natid own, struct emp_qelem *a,
int static int
can_fly(int p) can_fly(int p)
{ /* Can this plane fly from the ship or land unit it is on? */ { /* Can this plane fly from the ship or land unit it is on? */
struct plnstr plane; struct plnstr plane;
@ -1150,7 +1161,7 @@ can_fly(int p)
return 0; return 0;
} }
int static int
do_evade(struct emp_qelem *bomb_list, struct emp_qelem *esc_list) do_evade(struct emp_qelem *bomb_list, struct emp_qelem *esc_list)
{ {
struct emp_qelem *qp; struct emp_qelem *qp;

View file

@ -77,6 +77,7 @@ static int get_ototal(int combat_mode, struct combat *off,
struct emp_qelem *olist, double osupport, int check); struct emp_qelem *olist, double osupport, int check);
static int get_dtotal(struct combat *def, struct emp_qelem *list, static int get_dtotal(struct combat *def, struct emp_qelem *list,
double dsupport, int check); double dsupport, int check);
static double att_calcodds(int, int);
static int take_casualty(int combat_mode, struct combat *off, static int take_casualty(int combat_mode, struct combat *off,
struct emp_qelem *olist); struct emp_qelem *olist);

View file

@ -142,7 +142,7 @@ emp_setbit(int x, int y, unsigned char *bitmap)
bitmap[id / 8] |= bit(id & 07); bitmap[id / 8] |= bit(id & 07);
} }
void static void
emp_setbitmap(int x, int y, unsigned char *bitmap, int *bitmaps) emp_setbitmap(int x, int y, unsigned char *bitmap, int *bitmaps)
{ {
register int *mp; register int *mp;

View file

@ -54,6 +54,7 @@
#include "prototypes.h" #include "prototypes.h"
static void lnd_mess(char *, struct llist *); static void lnd_mess(char *, struct llist *);
static int lnd_hit_mine(struct lndstr *, struct lchrstr *);
int int
attack_val(int combat_mode, struct lndstr *lp) attack_val(int combat_mode, struct lndstr *lp)
@ -1006,7 +1007,7 @@ lnd_hardtarget(struct lndstr *lp)
(double)lp->lnd_spd / 2.0 - lp->lnd_vis)); (double)lp->lnd_spd / 2.0 - lp->lnd_vis));
} }
int static int
lnd_hit_mine(struct lndstr *lp, struct lchrstr *lcp) lnd_hit_mine(struct lndstr *lp, struct lchrstr *lcp)
{ {
double m; double m;

View file

@ -59,7 +59,7 @@ struct ccode {
char *desc[2]; char *desc[2];
}; };
struct ccode conditions[] = { static struct ccode conditions[] = {
{ 'i', { "retreated with a damaged friend", { 'i', { "retreated with a damaged friend",
"was damaged" } }, "was damaged" } },
{ 't', { "retreated with a torpedoed ship", { 't', { "retreated with a torpedoed ship",

View file

@ -44,7 +44,7 @@
static int bud_key[I_MAX + 2] = static int bud_key[I_MAX + 2] =
{ 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 7 }; { 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 5, 6, 0, 0, 7 };
int * static int *
get_wp(int *bp, struct sctstr *sp, int cm) get_wp(int *bp, struct sctstr *sp, int cm)
{ {
return (bp + (sp->sct_x + (sp->sct_y * WORLD_X)) + return (bp + (sp->sct_x + (sp->sct_y * WORLD_X)) +

View file

@ -81,7 +81,7 @@ static void loc_NTTerm(void);
static char pidfname[] = "server.pid"; static char pidfname[] = "server.pid";
/* Run as daemon? If yes, detach from controlling terminal etc. */ /* Run as daemon? If yes, detach from controlling terminal etc. */
int daemonize = 1; static int daemonize = 1;
static void static void
print_usage(char *program_name) print_usage(char *program_name)