]> git.pond.sub.org Git - empserver/blobdiff - include/prototypes.h
Fix automatic supply of defending and reacting units
[empserver] / include / prototypes.h
index 73d01ef1b927cb524e740d4387beb352cbed285e..1d3ac26fc1a30e1e167a7754dd0bbe197164d0cc 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
  *  ---
  *
  *  prototypes.h: Prototypes for server functions
- * 
+ *
  *  Known contributors to this file:
  *     Curtis Larsen, 1998
  *     Steve McClure, 1998,2000
@@ -54,7 +54,7 @@ extern void finish_server(void);
 /* in empthread.h */
 
 /*
- * src/lib/commands/ *.c 
+ * src/lib/commands/ *.c
  */
 extern int check_market(void);
 extern void gift(natid, natid, void *, char *);
@@ -66,7 +66,6 @@ extern int do_unit_move(struct emp_qelem *land_list, int *together,
             double *minmob, double *maxmob);
 extern int count_pop(int);
 extern int scuttle_tradeship(struct shpstr *, int);
-extern void scuttle_ship(struct shpstr *);
 extern void resnoise(struct sctstr *sptr, int public_amt, char *name,
                     int old, int new);
 extern int line_of_sight(char **rad, int ax, int ay, int bx, int by);
@@ -78,6 +77,7 @@ extern void trdswitchown(int, void *, int);
 extern int do_look(short);
 extern int radar(short);
 extern void update_power(void);
+extern int show_first_tel(char *);
 /* Commands */
 int acce(void);
 int add(void);
@@ -150,7 +150,6 @@ int load(void);
 int look(void);
 int lost(void);
 int lrad(void);
-int lrange(void);
 int lretr(void);
 int lsta(void);
 int ltend(void);
@@ -254,7 +253,7 @@ int xedit(void);
 int zdon(void);
 
 /*
- * src/lib/common/ *.c 
+ * src/lib/common/ *.c
  */
 /* bestpath.c */
 extern char *bestownedpath(char *, char *, int, int, int, int, int);
@@ -281,8 +280,6 @@ extern int logreopen(void);
 extern void logerror(char *, ...) ATTRIBUTE((format (printf, 1, 2)));
 /* more in misc.h */
 /* mapdist.c */
-extern int diffx(int, int);
-extern int diffy(int, int);
 extern int deltax(int, int);
 extern int deltay(int, int);
 extern int mapdist(int, int, int, int);
@@ -318,7 +315,7 @@ extern int demandupdatecheck(void);
 /* in xdump.h */
 
 /*
- * src/lib/gen/ *.c 
+ * src/lib/gen/ *.c
  */
 /* fnameat.c */
 extern char *fnameat(const char *, const char *);
@@ -347,13 +344,13 @@ extern char *plurize(char *buf, int max_len, int n);
 /* more in misc.h */
 
 /*
- * src/lib/global/ *.c 
+ * src/lib/global/ *.c
  */
 extern void global_init(void);
 
 
 /*
- * src/lib/player/ *.c 
+ * src/lib/player/ *.c
  */
 /* accept.c */
 extern void player_init(void);
@@ -369,9 +366,10 @@ extern int dispatch(char *, char *);
 extern int getcommand(char *);
 extern void init_player_commands(void);
 extern void log_last_commands(void);
-extern int gamedown(void);
-extern void daychange(time_t);
-extern int getminleft(time_t, int);
+extern void update_timeused_login(time_t now);
+extern void update_timeused(time_t now);
+extern void enforce_minimum_session_time(void);
+extern int may_play_now(struct natstr *, time_t);
 /* more under Commands */
 /* empmod.c */
 /* init_nats.c */
@@ -395,7 +393,7 @@ extern void stop_service(void);
 /* more in service.h */
 
 /*
- * src/lib/subs/ *.c 
+ * src/lib/subs/ *.c
  */
 /* askyn.c */
 extern int confirm(char *);
@@ -416,8 +414,6 @@ extern int check_plane_ok(struct plnstr *);
 extern int check_comm_ok(struct comstr *);
 extern int check_loan_ok(struct lonstr *);
 extern int check_trade_ok(struct trdstr *);
-/* chkmoney.c */
-extern int chkmoney(long, long, char *);
 /* coastal.c */
 extern void set_coastal(struct sctstr *, int, int);
 /* control.c */
@@ -454,8 +450,9 @@ extern void bitinit2(struct nstr_sect *, unsigned char *, int);
 extern int getele(char *, char *);
 /* land.c */
 extern char *prland(struct lndstr *);
-extern int lnd_postread(int, void *);
-extern int lnd_prewrite(int, void *);
+extern void lnd_oninit(void *);
+extern void lnd_postread(int, void *);
+extern void lnd_prewrite(int, void *, void *);
 /* landgun.c */
 extern double seagun(int, int);
 extern double fortgun(int, int);
@@ -475,7 +472,6 @@ extern int adj_units(coord, coord, natid);
 extern int islist(char *);
 /* maps.c */
 extern int do_map(int bmap, int unit_type, char *arg1, char *arg2);
-extern int draw_map(int, char, int, struct nstr_sect *);
 extern int display_region_map(int bmap, int unit_type, coord curx,
                              coord cury, char *arg);
 extern int bmaps_intersect(natid, natid);
@@ -488,11 +484,9 @@ extern int ground_interdict(coord, coord, natid, char *);
 extern int unit_interdict(coord, coord, natid, char *, int, int);
 extern int off_support(coord, coord, natid, natid);
 extern int def_support(coord, coord, natid, natid);
-extern int oprange(struct empobj *, int *);
+extern int oprange(struct empobj *);
+extern int in_oparea(struct empobj *, coord, coord);
 extern int cando(int, int);
-extern void show_mission(int, struct nstr_item *);
-extern int air_defense(coord, coord, natid, struct emp_qelem *,
-                      struct emp_qelem *);
 /* move.c */
 extern int check_lmines(coord, coord, double);
 extern int move_ground(struct sctstr *, struct sctstr *,
@@ -522,9 +516,9 @@ extern void init_nreport(void);
 extern void nreport(natid, int, natid, int);
 /* nuke.c */
 extern char *prnuke(struct nukstr *);
-extern int nuk_postread(int, void *);
-extern int nuk_prewrite(int, void *);
-extern int nuk_on_plane(struct nukstr *, int);
+extern void nuk_oninit(void *);
+extern void nuk_postread(int, void *);
+extern void nuk_prewrite(int, void *, void *);
 /* nxtitem.c */
 extern int nxtitem(struct nstr_item *, void *);
 /* nxtsct.c */
@@ -533,35 +527,33 @@ extern int nxtsct(struct nstr_sect *, struct sctstr *);
 extern int onearg(char *, char *);
 /* plane.c */
 extern char *prplane(struct plnstr *);
-extern int pln_postread(int, void *);
-extern int pln_prewrite(int, void *);
+extern void pln_oninit(void *);
+extern void pln_postread(int, void *);
+extern void pln_prewrite(int, void *, void *);
 /* plnsub.c */
-extern void count_planes(struct shpstr *);
+extern int get_planes(struct nstr_item *, struct nstr_item *,
+                     char *, char *);
 extern struct sctstr *get_assembly_point(char *, struct sctstr *, char *);
 extern int pln_onewaymission(struct sctstr *, int *, int *);
 extern int pln_oneway_to_carrier_ok(struct emp_qelem *,
                                    struct emp_qelem *, int);
 extern void pln_newlanding(struct emp_qelem *, coord, coord, int);
-extern int could_be_on_ship(struct plnstr *, struct shpstr *);
+extern int could_be_on_ship(struct plnstr *, struct shpstr *,
+                           int, int, int, int);
 extern int put_plane_on_ship(struct plnstr *, struct shpstr *);
 extern void pln_dropoff(struct emp_qelem *, struct ichrstr *,
-                       coord, coord, void *, int);
-extern void pln_mine(struct emp_qelem *list, struct sctstr *sectp);
+                       coord, coord, int);
+extern void pln_mine(struct emp_qelem *, coord, coord);
 extern int pln_capable(struct plnstr *, int, int);
 extern int pln_airbase_ok(struct plnstr *, int, int);
 extern int carrier_planes(struct shpstr *, int);
 extern void pln_sel(struct nstr_item *, struct emp_qelem *,
                    struct sctstr *, int, int, int, int);
-extern int pln_arm(struct emp_qelem *, int, char, struct ichrstr *,
-                  int, int);
+extern void pln_arm(struct emp_qelem *, int, char, struct ichrstr *, int);
 extern int pln_mobcost(int, struct plnstr *, int);
 extern void pln_put(struct emp_qelem *);
 extern void pln_put1(struct plist *);
-extern void take_plane_off_ship(struct plnstr *, struct shpstr *);
-extern void take_plane_off_land(struct plnstr *, struct lndstr *);
 extern void plane_sweep(struct emp_qelem *, coord, coord);
-extern void count_land_planes(struct lndstr *);
-extern int count_sect_planes(struct sctstr *);
 extern int put_plane_on_land(struct plnstr *, struct lndstr *);
 extern int pln_hitchance(struct plnstr *, int, int);
 extern int pln_damage(struct plnstr *, coord, coord, char, int *, int);
@@ -622,8 +614,8 @@ extern void satdisp_units(coord, coord);
 extern void satmap(int, int, int, int, int, int);
 extern void sathead(void);
 /* sect.c */
-extern int sct_postread(int, void *);
-extern int sct_prewrite(int, void *);
+extern void sct_postread(int, void *);
+extern void sct_prewrite(int, void *, void *);
 extern void item_prewrite(short *);
 extern int issector(char *);
 /* sectdamage.c */
@@ -631,8 +623,8 @@ extern int sect_damage(struct sctstr *, int);
 extern int sectdamage(struct sctstr *, int);
 /* ship.c */
 extern char *prship(struct shpstr *);
-extern int shp_postread(int, void *);
-extern int shp_prewrite(int, void *);
+extern void shp_postread(int, void *);
+extern void shp_prewrite(int, void *, void *);
 /* show.c */
 extern void show_bridge(int);
 extern void show_tower(int);
@@ -653,6 +645,7 @@ extern void show_sect_stats(int);
 extern void show_sect_capab(int);
 extern void show_item(int);
 extern void show_news(int);
+extern void show_product(int);
 extern void show_updates(int);
 /* shpsub.c */
 extern void shp_sel(struct nstr_item *, struct emp_qelem *);
@@ -667,7 +660,7 @@ extern void shp_missdef(struct shpstr *, natid);
 extern double shp_mobcost(struct shpstr *);
 extern void shp_set_tech(struct shpstr *, int);
 /* snxtitem.c */
-extern int snxtitem(struct nstr_item *, int, char *);
+extern int snxtitem(struct nstr_item *, int, char *, char *);
 extern void snxtitem_area(struct nstr_item *, int,
                          struct range *);
 extern void snxtitem_dist(struct nstr_item *, int, int, int, int);
@@ -676,6 +669,7 @@ extern void snxtitem_all(struct nstr_item *, int);
 extern void snxtitem_group(struct nstr_item *, int, char);
 extern void snxtitem_rewind(struct nstr_item *);
 extern int snxtitem_list(struct nstr_item *, int, int *, int);
+extern void snxtitem_cargo(struct nstr_item *, int, int, int);
 /* snxtsct.c */
 extern int snxtsct(struct nstr_sect *, char *);
 extern void snxtsct_area(struct nstr_sect *, struct range *);
@@ -688,11 +682,12 @@ extern void snxtsct_dist(struct nstr_sect *, coord, coord, int);
 extern void resupply_all(struct lndstr *);
 extern void resupply_commod(struct lndstr *, i_type);
 extern int supply_commod(int, int, int, i_type, int);
-extern int has_supply(struct lndstr *);
+extern int lnd_in_supply(struct lndstr *);
+extern int lnd_could_be_supplied(struct lndstr *);
 /* takeover.c */
-extern void takeover_land(struct lndstr *, natid, int);
+extern void takeover_land(struct lndstr *, natid);
 extern void takeover(struct sctstr *, natid);
-extern void takeover_ship(struct shpstr *, natid, int);
+extern void takeover_ship(struct shpstr *, natid);
 extern void takeover_plane(struct plnstr *, natid);
 /* trdsub.c */
 /* trechk.c */
@@ -705,9 +700,10 @@ extern int typed_wu(natid, natid, char *, int);
 extern int wu(natid, natid, char *, ...) ATTRIBUTE((format (printf, 3, 4)));
 
 /*
- * src/lib/update/ *.c 
+ * src/lib/update/ *.c
  */
 /* age.c */
+extern int age_people(int, int);
 extern void age_levels(int);
 /* anno.c */
 extern void delete_old_announcements(void);