[Freeciv-Dev] (PR#9881) fc_types.h
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9881 >
Here's a patch that adds a few more commonly-used declarations to
fc_types.h. I removed the unnecessary declarations from other header
files (except in the GUI subdirectories).
I only added globally-used structures to the header. AI or client-only
structures I didn't add, even though they are in some places used in
common/.
Also in the process I reordered #includes as necessary. Most of the
includes are out-of-order now that utility/ and common/ are separate.
jason
Index: ai/advdiplomacy.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdiplomacy.h,v
retrieving revision 1.1
diff -u -r1.1 advdiplomacy.h
--- ai/advdiplomacy.h 8 Aug 2003 22:11:41 -0000 1.1
+++ ai/advdiplomacy.h 3 Sep 2004 01:58:12 -0000
@@ -13,7 +13,8 @@
#ifndef FC__ADVDIPLOMACY_H
#define FC__ADVDIPLOMACY_H
-struct player;
+#include "fc_types.h"
+
struct ai_choice;
struct Treaty;
struct Clause;
Index: ai/advdomestic.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advdomestic.h,v
retrieving revision 1.6
diff -u -r1.6 advdomestic.h
--- ai/advdomestic.h 21 Jul 2002 00:48:38 -0000 1.6
+++ ai/advdomestic.h 3 Sep 2004 01:58:12 -0000
@@ -13,8 +13,8 @@
#ifndef FC__ADVDOMESTIC_H
#define FC__ADVDOMESTIC_H
-struct player;
-struct city;
+#include "fc_types.h"
+
struct ai_choice;
void ai_eval_threat_init(struct player *pplayer);
Index: ai/advmilitary.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advmilitary.h,v
retrieving revision 1.20
diff -u -r1.20 advmilitary.h
--- ai/advmilitary.h 2 Sep 2004 14:58:23 -0000 1.20
+++ ai/advmilitary.h 3 Sep 2004 01:58:12 -0000
@@ -13,11 +13,9 @@
#ifndef FC__ADVMILITARY_H
#define FC__ADVMILITARY_H
+#include "fc_types.h"
#include "unittype.h"
-struct city;
-struct player;
-struct unit;
struct ai_choice;
Unit_Type_id ai_choose_defender_versus(struct city *pcity, Unit_Type_id v);
Index: ai/advspace.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advspace.h,v
retrieving revision 1.4
diff -u -r1.4 advspace.h
--- ai/advspace.h 2 Feb 2004 07:23:45 -0000 1.4
+++ ai/advspace.h 3 Sep 2004 01:58:12 -0000
@@ -15,7 +15,8 @@
#include "shared.h"
-struct player;
+#include "fc_types.h"
+
struct player_spaceship;
bool ai_spaceship_autoplace(struct player *pplayer,
Index: ai/aiair.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiair.h,v
retrieving revision 1.4
diff -u -r1.4 aiair.h
--- ai/aiair.h 18 Dec 2002 17:36:18 -0000 1.4
+++ ai/aiair.h 3 Sep 2004 01:58:12 -0000
@@ -15,11 +15,9 @@
#include "shared.h" /* bool type */
+#include "fc_types.h"
+
struct ai_choice;
-struct city;
-struct government;
-struct player;
-struct unit;
void ai_manage_airunit(struct player *pplayer, struct unit *punit);
bool ai_choose_attacker_air(struct player *pplayer, struct city *pcity,
Index: ai/aicity.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aicity.h,v
retrieving revision 1.23
diff -u -r1.23 aicity.h
--- ai/aicity.h 2 Sep 2004 14:58:23 -0000 1.23
+++ ai/aicity.h 3 Sep 2004 01:58:12 -0000
@@ -13,10 +13,9 @@
#ifndef FC__AICITY_H
#define FC__AICITY_H
+#include "fc_types.h"
#include "unit.h" /* enum unit_move_type */
-struct player;
-struct city;
struct ai_choice;
struct ai_data;
Index: ai/aidata.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aidata.h,v
retrieving revision 1.15
diff -u -r1.15 aidata.h
--- ai/aidata.h 29 Aug 2004 19:43:37 -0000 1.15
+++ ai/aidata.h 3 Sep 2004 01:58:12 -0000
@@ -18,8 +18,7 @@
#include "shared.h" /* bool type */
-struct player;
-struct unit;
+#include "fc_types.h"
/*
* This file and aidata.c contains global data structures for the AI
Index: ai/aidiplomat.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aidiplomat.h,v
retrieving revision 1.3
diff -u -r1.3 aidiplomat.h
--- ai/aidiplomat.h 18 Dec 2002 17:36:18 -0000 1.3
+++ ai/aidiplomat.h 3 Sep 2004 01:58:12 -0000
@@ -13,11 +13,10 @@
#ifndef FC__AIDIPLOMAT_H
#define FC__AIDIPLOMAT_H
-#include "city.h" /* struct ai_choice */
#include "shared.h" /* bool type */
-struct player;
-struct unit;
+#include "fc_types.h"
+#include "city.h" /* struct ai_choice */
void ai_manage_diplomat(struct player *pplayer, struct unit *punit);
void ai_choose_diplomat_defensive(struct player *pplayer,
Index: ai/aiexplorer.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiexplorer.h,v
retrieving revision 1.1
diff -u -r1.1 aiexplorer.h
--- ai/aiexplorer.h 6 Aug 2004 16:14:17 -0000 1.1
+++ ai/aiexplorer.h 3 Sep 2004 01:58:12 -0000
@@ -15,7 +15,7 @@
#include "shared.h" /* bool type */
-struct unit;
+#include "fc_types.h"
/*
* Handle eXplore mode of a unit (explorers are always in eXplore mode
Index: ai/aiferry.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiferry.h,v
retrieving revision 1.1
diff -u -r1.1 aiferry.h
--- ai/aiferry.h 20 Jun 2004 07:41:14 -0000 1.1
+++ ai/aiferry.h 3 Sep 2004 01:58:12 -0000
@@ -15,8 +15,8 @@
#include "shared.h" /* bool type */
-struct player;
-struct unit;
+#include "fc_types.h"
+
struct pf_path;
/*
Index: ai/aihand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aihand.h,v
retrieving revision 1.7
diff -u -r1.7 aihand.h
--- ai/aihand.h 29 Apr 2003 08:40:11 -0000 1.7
+++ ai/aihand.h 3 Sep 2004 01:58:12 -0000
@@ -13,10 +13,9 @@
#ifndef FC__AIHAND_H
#define FC__AIHAND_H
+#include "fc_types.h"
#include "city.h" /* enum choice_type */
-struct player;
-
void ai_do_first_activities(struct player *pplayer);
void ai_do_last_activities(struct player *pplayer);
Index: ai/aihunt.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aihunt.h,v
retrieving revision 1.2
diff -u -r1.2 aihunt.h
--- ai/aihunt.h 2 May 2004 08:09:31 -0000 1.2
+++ ai/aihunt.h 3 Sep 2004 01:58:12 -0000
@@ -15,10 +15,9 @@
#include "shared.h" /* bool type */
+#include "fc_types.h"
+
struct ai_choice;
-struct city;
-struct player;
-struct unit;
void ai_hunter_choice(struct player *pplayer, struct city *pcity,
struct ai_choice *choice);
Index: ai/ailog.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/ailog.h,v
retrieving revision 1.7
diff -u -r1.7 ailog.h
--- ai/ailog.h 29 Apr 2004 19:59:21 -0000 1.7
+++ ai/ailog.h 3 Sep 2004 01:58:12 -0000
@@ -13,10 +13,10 @@
#ifndef FC__AILOG_H
#define FC__AILOG_H
+#include "fc_types.h"
+
#include "gotohand.h" /* enum goto_result */
-struct unit;
-struct city;
struct ai_data;
/*
Index: ai/aitech.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aitech.h,v
retrieving revision 1.5
diff -u -r1.5 aitech.h
--- ai/aitech.h 11 Jan 2002 11:11:50 -0000 1.5
+++ ai/aitech.h 3 Sep 2004 01:58:12 -0000
@@ -13,7 +13,7 @@
#ifndef FC__AITECH_H
#define FC__AITECH_H
-struct player;
+#include "fc_types.h"
void ai_manage_tech(struct player *pplayer);
void ai_next_tech_goal(struct player *pplayer);
Index: ai/aitools.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aitools.h,v
retrieving revision 1.45
diff -u -r1.45 aitools.h
--- ai/aitools.h 5 Aug 2004 11:34:18 -0000 1.45
+++ ai/aitools.h 3 Sep 2004 01:58:12 -0000
@@ -14,13 +14,12 @@
#define FC__AITOOLS_H
#include "shared.h" /* bool type */
+
+#include "fc_types.h"
#include "unit.h" /* enum ai_unit_task */
#include "unittype.h" /* Unit_Type_id */
struct ai_choice;
-struct city;
-struct government;
-struct player;
struct pf_path;
#ifdef DEBUG
Index: ai/aiunit.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.h,v
retrieving revision 1.53
diff -u -r1.53 aiunit.h
--- ai/aiunit.h 6 Aug 2004 14:46:28 -0000 1.53
+++ ai/aiunit.h 3 Sep 2004 01:58:12 -0000
@@ -14,6 +14,7 @@
#define FC__AIUNIT_H
#include "combat.h"
+#include "fc_types.h"
#include "unittype.h"
/*
@@ -41,9 +42,6 @@
(ut->pop_cost * 3 + ut->happy_cost + ut->shield_cost \
+ ut->food_cost + ut->gold_cost)
-struct player;
-struct city;
-struct unit;
struct ai_choice;
struct pf_path;
Index: client/citydlg_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/citydlg_common.h,v
retrieving revision 1.23
diff -u -r1.23 citydlg_common.h
--- client/citydlg_common.h 17 Jul 2004 05:53:20 -0000 1.23
+++ client/citydlg_common.h 3 Sep 2004 01:58:12 -0000
@@ -16,11 +16,11 @@
#include <stddef.h> /* size_t */
-#include "city.h" /* enum specialist_type */
-#include "improvement.h" /* Impr_Type_id */
#include "shared.h" /* bool type */
-struct city;
+#include "city.h" /* enum specialist_type */
+#include "fc_types.h"
+
struct canvas;
struct citizen_type {
Index: client/cityrepdata.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/cityrepdata.h,v
retrieving revision 1.9
diff -u -r1.9 cityrepdata.h
--- client/cityrepdata.h 4 Feb 2003 22:13:27 -0000 1.9
+++ client/cityrepdata.h 3 Sep 2004 01:58:12 -0000
@@ -15,7 +15,7 @@
#include "shared.h" /* bool type */
-struct city;
+#include "fc_types.h"
/* abbreviate long city names to this length in the city report: */
#define REPORT_CITYNAME_ABBREV 15
Index: client/climisc.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.h,v
retrieving revision 1.49
diff -u -r1.49 climisc.h
--- client/climisc.h 1 May 2004 03:34:57 -0000 1.49
+++ client/climisc.h 3 Sep 2004 01:58:12 -0000
@@ -13,13 +13,12 @@
#ifndef FC__CLIMISC_H
#define FC__CLIMISC_H
-#include "events.h"
#include "shared.h" /* MAX_LEN_NAME */
-struct city;
+#include "fc_types.h"
+#include "events.h"
+
struct Clause;
-struct player;
-struct unit;
typedef int cid;
typedef int wid;
Index: client/mapview_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.h,v
retrieving revision 1.73
diff -u -r1.73 mapview_common.h
--- client/mapview_common.h 2 Aug 2004 16:59:14 -0000 1.73
+++ client/mapview_common.h 3 Sep 2004 01:58:12 -0000
@@ -14,15 +14,15 @@
#ifndef FC__MAPVIEW_COMMON_H
#define FC__MAPVIEW_COMMON_H
-#include "map.h"
#include "shared.h" /* bool type */
+#include "fc_types.h"
+#include "map.h"
+
#include "colors_g.h"
#include "tilespec.h"
-struct unit;
-
struct canvas_store; /* opaque type, real type is gui-dep */
struct mapview_canvas {
Index: client/plrdlg_common.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/plrdlg_common.h,v
retrieving revision 1.6
diff -u -r1.6 plrdlg_common.h
--- client/plrdlg_common.h 15 Aug 2004 09:47:04 -0000 1.6
+++ client/plrdlg_common.h 3 Sep 2004 01:58:12 -0000
@@ -13,10 +13,10 @@
#ifndef FC__PLRDLG_COMMON_H
#define FC__PLRDLG_COMMON_H
-struct player;
-
#include "shared.h" /* bool type */
+#include "fc_types.h"
+
void plrdlg_freeze(void);
void plrdlg_thaw(void);
void plrdlg_force_thaw(void);
Index: client/text.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/text.h,v
retrieving revision 1.5
diff -u -r1.5 text.h
--- client/text.h 15 Aug 2004 09:47:04 -0000 1.5
+++ client/text.h 3 Sep 2004 01:58:12 -0000
@@ -14,10 +14,9 @@
#ifndef FC__TEXT_H
#define FC__TEXT_H
-struct city;
-struct player;
+#include "fc_types.h"
+
struct player_spaceship;
-struct unit;
/****************************************************************************
These functions return static strings with generally useful text.
Index: client/tilespec.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.h,v
retrieving revision 1.84
diff -u -r1.84 tilespec.h
--- client/tilespec.h 25 Aug 2004 18:24:18 -0000 1.84
+++ client/tilespec.h 3 Sep 2004 01:58:12 -0000
@@ -18,13 +18,13 @@
#ifndef FC__TILESPEC_H
#define FC__TILESPEC_H
+#include "fc_types.h"
+
#include "citydlg_common.h" /* enum citizen_type */
#include "colors_g.h"
#include "options.h"
struct Sprite; /* opaque; gui-dep */
-struct unit;
-struct player;
struct drawn_sprite {
enum {
Index: client/agents/agents.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/agents/agents.h,v
retrieving revision 1.9
diff -u -r1.9 agents.h
--- client/agents/agents.h 14 Apr 2004 17:18:36 -0000 1.9
+++ client/agents/agents.h 3 Sep 2004 01:58:12 -0000
@@ -16,6 +16,8 @@
#include "shared.h" /* bool type */
+#include "fc_types.h"
+
/*
* Besides callback for convenience client/agents/agents also
* implements a "flattening" of the call stack i.e. to ensure that
@@ -27,9 +29,6 @@
#define MAX_AGENT_NAME_LEN 10
-struct city;
-struct unit;
-
enum callback_type {
CB_NEW, CB_REMOVE, CB_CHANGE, CB_LAST
};
Index: client/include/citydlg_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/citydlg_g.h,v
retrieving revision 1.6
diff -u -r1.6 citydlg_g.h
--- client/include/citydlg_g.h 19 Feb 2002 16:41:21 -0000 1.6
+++ client/include/citydlg_g.h 3 Sep 2004 01:58:12 -0000
@@ -13,10 +13,9 @@
#ifndef FC__CITYDLG_G_H
#define FC__CITYDLG_G_H
-#include "citydlg_common.h"
+#include "fc_types.h"
-struct unit;
-struct city;
+#include "citydlg_common.h"
void popup_city_dialog(struct city *pcity, bool make_modal);
void popdown_city_dialog(struct city *pcity);
Index: client/include/cityrep_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/cityrep_g.h,v
retrieving revision 1.5
diff -u -r1.5 cityrep_g.h
--- client/include/cityrep_g.h 14 Nov 2003 12:26:57 -0000 1.5
+++ client/include/cityrep_g.h 3 Sep 2004 01:58:12 -0000
@@ -15,7 +15,7 @@
#include "shared.h" /* bool type */
-struct city;
+#include "fc_types.h"
void popup_city_report_dialog(bool make_modal);
void city_report_dialog_update(void);
Index: client/include/dialogs_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/dialogs_g.h,v
retrieving revision 1.18
diff -u -r1.18 dialogs_g.h
--- client/include/dialogs_g.h 6 Jun 2004 21:02:16 -0000 1.18
+++ client/include/dialogs_g.h 3 Sep 2004 01:58:12 -0000
@@ -13,15 +13,13 @@
#ifndef FC__DIALOGS_G_H
#define FC__DIALOGS_G_H
-#include "nation.h" /* Nation_Type_id */
#include "shared.h" /* bool type */
+
+#include "fc_types.h"
+#include "nation.h" /* Nation_Type_id */
#include "terrain.h" /* enum tile_special_type */
-struct city;
-struct government;
struct packet_nations_selected_info;
-struct tile;
-struct unit;
void popup_notify_goto_dialog(const char *headline, const char *lines,
int map_x, int map_y);
Index: client/include/gui_main_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/gui_main_g.h,v
retrieving revision 1.9
diff -u -r1.9 gui_main_g.h
--- client/include/gui_main_g.h 3 May 2003 20:20:16 -0000 1.9
+++ client/include/gui_main_g.h 3 Sep 2004 01:58:12 -0000
@@ -15,7 +15,7 @@
#include "shared.h" /* bool type */
-struct unit;
+#include "fc_types.h"
void ui_init(void);
void ui_main(int argc, char *argv[]);
Index: client/include/inteldlg_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/inteldlg_g.h,v
retrieving revision 1.2
diff -u -r1.2 inteldlg_g.h
--- client/include/inteldlg_g.h 18 Jul 2004 04:19:27 -0000 1.2
+++ client/include/inteldlg_g.h 3 Sep 2004 01:58:12 -0000
@@ -13,7 +13,7 @@
#ifndef FC__INTELDLG_G_H
#define FC__INTELDLG_G_H
-struct player;
+#include "fc_types.h"
void popup_intel_dialog(struct player *p);
void update_intel_dialog(struct player *p);
Index: client/include/mapctrl_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/mapctrl_g.h,v
retrieving revision 1.11
diff -u -r1.11 mapctrl_g.h
--- client/include/mapctrl_g.h 14 Nov 2003 12:26:58 -0000 1.11
+++ client/include/mapctrl_g.h 3 Sep 2004 01:58:12 -0000
@@ -15,10 +15,9 @@
#include "shared.h" /* bool type */
-#include "mapctrl_common.h"
+#include "fc_types.h"
-struct unit;
-struct city;
+#include "mapctrl_common.h"
void popup_newcity_dialog(struct unit *punit, char *suggestname);
Index: client/include/mapview_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/mapview_g.h,v
retrieving revision 1.56
diff -u -r1.56 mapview_g.h
--- client/include/mapview_g.h 26 Jul 2004 04:05:59 -0000 1.56
+++ client/include/mapview_g.h 3 Sep 2004 01:58:12 -0000
@@ -15,10 +15,10 @@
#include "shared.h" /* bool type */
+#include "fc_types.h"
+
#include "mapview_common.h"
-struct unit;
-struct city;
struct Sprite;
void update_info_label(void);
Index: client/include/spaceshipdlg_g.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/include/spaceshipdlg_g.h,v
retrieving revision 1.1
diff -u -r1.1 spaceshipdlg_g.h
--- client/include/spaceshipdlg_g.h 14 Jul 1999 11:15:54 -0000 1.1
+++ client/include/spaceshipdlg_g.h 3 Sep 2004 01:58:12 -0000
@@ -13,7 +13,7 @@
#ifndef FC__SPACESHIPDLG_G_H
#define FC__SPACESHIPDLG_G_H
-struct player;
+#include "fc_types.h"
void popup_spaceship_dialog(struct player *pplayer);
void popdown_spaceship_dialog(struct player *pplayer);
Index: common/city.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/city.h,v
retrieving revision 1.157
diff -u -r1.157 city.h
--- common/city.h 14 Aug 2004 21:29:43 -0000 1.157
+++ common/city.h 3 Sep 2004 01:58:12 -0000
@@ -13,14 +13,11 @@
#ifndef FC__CITY_H
#define FC__CITY_H
+#include "fc_types.h"
#include "improvement.h"
#include "unit.h" /* struct unit_list */
#include "worklist.h"
-struct player;
-struct government;
-struct tile;
-
enum production_class_type {
TYPE_UNIT, TYPE_NORMAL_IMPROVEMENT, TYPE_WONDER
};
Index: common/combat.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/combat.h,v
retrieving revision 1.12
diff -u -r1.12 combat.h
--- common/combat.h 28 May 2004 20:45:19 -0000 1.12
+++ common/combat.h 3 Sep 2004 01:58:12 -0000
@@ -13,6 +13,7 @@
#ifndef FC__COMBAT_H
#define FC__COMBAT_H
+#include "fc_types.h"
#include "unittype.h"
/*
@@ -23,9 +24,6 @@
*/
#define POWER_FACTOR 10
-struct unit;
-struct player;
-
bool can_player_attack_tile(struct player *pplayer, int x, int y);
bool can_unit_attack_unit_at_tile(struct unit *punit, struct unit *pdefender,
int dest_x, int dest_y);
Index: common/connection.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/connection.h,v
retrieving revision 1.34
diff -u -r1.34 connection.h
--- common/connection.h 10 Apr 2004 03:47:49 -0000 1.34
+++ common/connection.h 3 Sep 2004 01:58:12 -0000
@@ -31,7 +31,8 @@
#include "shared.h" /* MAX_LEN_ADDR, bool type */
-struct player;
+#include "fc_types.h"
+
struct hash_table;
struct timer_list;
Index: common/fc_types.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/fc_types.h,v
retrieving revision 1.4
diff -u -r1.4 fc_types.h
--- common/fc_types.h 1 Sep 2004 03:16:47 -0000 1.4
+++ common/fc_types.h 3 Sep 2004 01:58:12 -0000
@@ -41,5 +41,9 @@
struct city;
+struct government;
+struct player;
+struct tile;
+struct unit;
#endif /* FC__FC_TYPES_H */
Index: common/game.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/game.h,v
retrieving revision 1.148
diff -u -r1.148 game.h
--- common/game.h 16 Aug 2004 15:42:59 -0000 1.148
+++ common/game.h 3 Sep 2004 01:58:14 -0000
@@ -19,10 +19,12 @@
#include <sys/time.h>
#endif
+#include "shared.h"
+
#include "connection.h" /* struct conn_list */
+#include "fc_types.h"
#include "improvement.h" /* Impr_Status */
#include "player.h"
-#include "shared.h"
/* Changing these will probably break network compatability. */
#define MAX_LEN_DEMOGRAPHY 16
@@ -47,9 +49,6 @@
CLIENT_GAME_OVER_STATE
};
-struct unit;
-struct city;
-
#define OVERFLIGHT_NOTHING 1
#define OVERFLIGHT_FRIGHTEN 2
Index: common/generate_packets.py
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/generate_packets.py,v
retrieving revision 1.13
diff -u -r1.13 generate_packets.py
--- common/generate_packets.py 2 Sep 2004 05:28:55 -0000 1.13
+++ common/generate_packets.py 3 Sep 2004 01:58:14 -0000
@@ -1485,11 +1485,12 @@
#ifndef FC__HAND_GEN_H
#define FC__HAND_GEN_H
-struct player;
-struct connection;
+#include "shared.h"
+#include "fc_types.h"
#include "packets.h"
-#include "shared.h"
+
+struct connection;
bool server_handle_packet(enum packet_type type, void *packet,
struct player *pplayer, struct connection *pconn);
Index: common/government.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/government.h,v
retrieving revision 1.30
diff -u -r1.30 government.h
--- common/government.h 18 Aug 2004 18:11:05 -0000 1.30
+++ common/government.h 3 Sep 2004 01:58:14 -0000
@@ -15,8 +15,8 @@
#include "shared.h"
-struct city;
-struct player;
+#include "fc_types.h"
+
struct Sprite; /* opaque; client-gui specific */
#define G_MAGIC (127) /* magic constant, used as flag value */
Index: common/idex.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/idex.h,v
retrieving revision 1.2
diff -u -r1.2 idex.h
--- common/idex.h 7 Jun 2002 04:26:00 -0000 1.2
+++ common/idex.h 3 Sep 2004 01:58:14 -0000
@@ -18,8 +18,7 @@
id values to unit and city pointers.
***************************************************************************/
-struct city;
-struct unit;
+#include "fc_types.h"
void idex_init(void);
void idex_free(void);
Index: common/improvement.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/improvement.h,v
retrieving revision 1.31
diff -u -r1.31 improvement.h
--- common/improvement.h 1 Sep 2004 03:16:47 -0000 1.31
+++ common/improvement.h 3 Sep 2004 01:58:14 -0000
@@ -23,8 +23,6 @@
#include "terrain.h" /* Terrain_type_id etc */
#include "unittype.h" /* Unit_Class_id, Unit_Type_id */
-struct player;
-
/* Improvement status (for cities' lists of improvements)
* An enum or bitfield would be neater here, but we use a typedef for
* a) less memory usage and b) compatibility with old behaviour */
Index: common/nation.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/nation.h,v
retrieving revision 1.29
diff -u -r1.29 nation.h
--- common/nation.h 29 Aug 2004 19:03:31 -0000 1.29
+++ common/nation.h 3 Sep 2004 01:58:14 -0000
@@ -14,6 +14,8 @@
#define FC__NATION_H
#include "shared.h" /* MAX_LEN_NAME */
+
+#include "fc_types.h"
#include "terrain.h" /* T_COUNT */
#define MAX_NUM_TECH_GOALS 10
@@ -36,7 +38,6 @@
typedef int Team_Type_id;
struct Sprite; /* opaque; client-gui specific */
-struct player;
/*
* The city_name structure holds information about a default choice for
Index: common/player.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.h,v
retrieving revision 1.121
diff -u -r1.121 player.h
--- common/player.h 29 Aug 2004 19:03:31 -0000 1.121
+++ common/player.h 3 Sep 2004 01:58:14 -0000
@@ -15,6 +15,7 @@
#include "city.h"
#include "connection.h"
+#include "fc_types.h"
#include "improvement.h" /* Impr_Status */
#include "nation.h"
#include "shared.h"
@@ -22,8 +23,6 @@
#include "tech.h"
#include "unit.h"
-struct tile;
-
#define PLAYER_DEFAULT_TAX_RATE 0
#define PLAYER_DEFAULT_SCIENCE_RATE 100
#define PLAYER_DEFAULT_LUXURY_RATE 0
Index: common/tech.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/tech.h,v
retrieving revision 1.46
diff -u -r1.46 tech.h
--- common/tech.h 12 Aug 2004 20:58:59 -0000 1.46
+++ common/tech.h 3 Sep 2004 01:58:14 -0000
@@ -15,10 +15,9 @@
#include "shared.h"
+#include "fc_types.h"
#include "nation.h" /* Nation_Type_id */
-struct player;
-
typedef int Tech_Type_id;
/*
Above typedef replaces old "enum tech_type_id"; see comments about
Index: common/unit.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unit.h,v
retrieving revision 1.122
diff -u -r1.122 unit.h
--- common/unit.h 26 Aug 2004 18:37:52 -0000 1.122
+++ common/unit.h 3 Sep 2004 01:58:14 -0000
@@ -14,12 +14,11 @@
#define FC__UNIT_H
#include "mem.h" /* unit_list_iterate_safe */
+
+#include "fc_types.h"
#include "terrain.h" /* enum tile_special_type */
#include "unittype.h"
-struct player;
-struct city;
-struct tile;
struct unit_order;
struct map_position {
Index: common/unittype.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/unittype.h,v
retrieving revision 1.30
diff -u -r1.30 unittype.h
--- common/unittype.h 20 Jul 2004 10:54:30 -0000 1.30
+++ common/unittype.h 3 Sep 2004 01:58:14 -0000
@@ -15,11 +15,9 @@
#include "shared.h"
-struct player;
-struct city;
-struct government;
+#include "fc_types.h"
+
struct Sprite; /* opaque; client-gui specific */
-struct unit;
typedef int Unit_Type_id;
/*
Index: common/aicore/aisupport.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/aisupport.h,v
retrieving revision 1.2
diff -u -r1.2 aisupport.h
--- common/aicore/aisupport.h 3 Feb 2004 20:21:14 -0000 1.2
+++ common/aicore/aisupport.h 3 Sep 2004 01:58:14 -0000
@@ -13,8 +13,7 @@
#ifndef FC__AISUPPORT_H
#define FC__AISUPPORT_H
-struct player;
-struct city;
+#include "fc_types.h"
struct player *player_leading_spacerace(void);
int player_distance_to_player(struct player *pplayer, struct player *target);
Index: server/airgoto.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/airgoto.h,v
retrieving revision 1.2
diff -u -r1.2 airgoto.h
--- server/airgoto.h 15 Nov 2002 22:15:01 -0000 1.2
+++ server/airgoto.h 3 Sep 2004 01:58:14 -0000
@@ -15,9 +15,9 @@
#include "shared.h" /* bool type */
+#include "fc_types.h"
+
struct refuel;
-struct player;
-struct unit;
unsigned int get_refuel_x(struct refuel *pRefuel);
unsigned int get_refuel_y(struct refuel *pRefuel);
Index: server/barbarian.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/barbarian.h,v
retrieving revision 1.9
diff -u -r1.9 barbarian.h
--- server/barbarian.h 5 May 2003 12:41:39 -0000 1.9
+++ server/barbarian.h 3 Sep 2004 01:58:14 -0000
@@ -16,7 +16,7 @@
#include "shared.h" /* bool type */
-struct player;
+#include "fc_types.h"
#define MIN_UNREST_DIST 5
#define MAX_UNREST_DIST 8
Index: server/cityhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityhand.h,v
retrieving revision 1.29
diff -u -r1.29 cityhand.h
--- server/cityhand.h 14 Feb 2004 02:21:25 -0000 1.29
+++ server/cityhand.h 3 Sep 2004 01:58:14 -0000
@@ -13,13 +13,13 @@
#ifndef FC__CITYHAND_H
#define FC__CITYHAND_H
-struct player;
-struct city;
-struct connection;
-struct conn_list;
+#include "fc_types.h"
#include "hand_gen.h"
+struct connection;
+struct conn_list;
+
void really_handle_city_sell(struct player *pplayer, struct city *pcity,
Impr_Type_id id);
void really_handle_city_buy(struct player *pplayer, struct city *pcity);
Index: server/cityturn.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/cityturn.h,v
retrieving revision 1.35
diff -u -r1.35 cityturn.h
--- server/cityturn.h 7 Jul 2004 07:32:03 -0000 1.35
+++ server/cityturn.h 3 Sep 2004 01:58:14 -0000
@@ -16,9 +16,8 @@
#include "shared.h" /* bool type */
-struct city;
-struct player;
-struct unit;
+#include "fc_types.h"
+
struct conn_list;
struct cm_result;
Index: server/connecthand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/connecthand.h,v
retrieving revision 1.7
diff -u -r1.7 connecthand.h
--- server/connecthand.h 2 Feb 2004 07:23:46 -0000 1.7
+++ server/connecthand.h 3 Sep 2004 01:58:14 -0000
@@ -15,13 +15,13 @@
#include "shared.h" /* bool type */
+#include "fc_types.h"
+
struct connection;
struct conn_list;
struct packet_authentication_reply;
struct packet_login_request;
struct packet_server_join_req;
-struct player;
-struct user;
bool handle_login_request(struct connection *pconn,
struct packet_server_join_req *req);
Index: server/diplhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplhand.h,v
retrieving revision 1.10
diff -u -r1.10 diplhand.h
--- server/diplhand.h 25 May 2004 15:21:07 -0000 1.10
+++ server/diplhand.h 3 Sep 2004 01:58:14 -0000
@@ -15,13 +15,14 @@
#define REPUTATION_LOSS_NUKE (GAME_MAX_REPUTATION * 0.03)
+#include "fc_types.h"
+
+#include "hand_gen.h"
+
struct Treaty;
-struct player;
struct packet_diplomacy_info;
struct connection;
-#include "hand_gen.h"
-
void establish_embassy(struct player *pplayer, struct player *aplayer);
void diplhand_init(void);
Index: server/diplomats.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplomats.h,v
retrieving revision 1.3
diff -u -r1.3 diplomats.h
--- server/diplomats.h 14 Feb 2004 02:21:26 -0000 1.3
+++ server/diplomats.h 3 Sep 2004 01:58:14 -0000
@@ -13,13 +13,11 @@
#ifndef FC__DIPLOMATS_H
#define FC__DIPLOMATS_H
+#include "fc_types.h"
#include "unit.h" /* Unit_Type_id, enum unit_activity */
#include "gotohand.h" /* enum goto_move_restriction */
-struct player;
-struct city;
-
void diplomat_embassy(struct player *pplayer, struct unit *pdiplomat,
struct city *pcity);
void diplomat_investigate(struct player *pplayer, struct unit *pdiplomat,
Index: server/maphand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/maphand.h,v
retrieving revision 1.45
diff -u -r1.45 maphand.h
--- server/maphand.h 31 Aug 2004 08:17:51 -0000 1.45
+++ server/maphand.h 3 Sep 2004 01:58:14 -0000
@@ -13,6 +13,7 @@
#ifndef FC__MAPHAND_H
#define FC__MAPHAND_H
+#include "fc_types.h"
#include "map.h"
#include "packets.h"
#include "terrain.h"
@@ -21,7 +22,6 @@
enum ocean_land_change { OLC_NONE, OLC_OCEAN_TO_LAND, OLC_LAND_TO_OCEAN };
-struct player;
struct section_file;
struct conn_list;
Index: server/plrhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.h,v
retrieving revision 1.65
diff -u -r1.65 plrhand.h
--- server/plrhand.h 17 Jun 2004 19:50:41 -0000 1.65
+++ server/plrhand.h 3 Sep 2004 01:58:15 -0000
@@ -15,13 +15,14 @@
#include <stdarg.h>
+#include "shared.h" /* fc__attribute */
+
#include "events.h"
+#include "fc_types.h"
#include "packets.h"
-#include "shared.h" /* fc__attribute */
#include "hand_gen.h"
-struct player;
struct section_file;
struct connection;
struct conn_list;
Index: server/sanitycheck.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sanitycheck.h,v
retrieving revision 1.5
diff -u -r1.5 sanitycheck.h
--- server/sanitycheck.h 28 May 2004 06:47:10 -0000 1.5
+++ server/sanitycheck.h 3 Sep 2004 01:58:15 -0000
@@ -13,7 +13,7 @@
#ifndef FC__SANITYCHECK_H
#define FC__SANITYCHECK_H
-struct city;
+#include "fc_types.h"
#if ((IS_BETA_VERSION || IS_DEVEL_VERSION) && !defined NDEBUG) \
|| defined DEBUG
Index: server/score.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/score.h,v
retrieving revision 1.2
diff -u -r1.2 score.h
--- server/score.h 20 Oct 2003 08:30:22 -0000 1.2
+++ server/score.h 3 Sep 2004 01:58:15 -0000
@@ -13,7 +13,7 @@
#ifndef FC__SCORE_H
#define FC__SCORE_H
-struct player;
+#include "fc_types.h"
int civ_score(struct player *pplayer);
Index: server/settlers.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/settlers.h,v
retrieving revision 1.26
diff -u -r1.26 settlers.h
--- server/settlers.h 6 Aug 2004 16:46:24 -0000 1.26
+++ server/settlers.h 3 Sep 2004 01:58:15 -0000
@@ -13,12 +13,9 @@
#ifndef FC__SETTLERS_H
#define FC__SETTLERS_H
+#include "fc_types.h"
#include "map.h"
-struct player;
-struct unit;
-struct city;
-
void auto_settlers_init(void);
void auto_settlers_player(struct player *pplayer);
int find_boat(struct player *pplayer, int *x, int *y, int cap);
Index: server/spacerace.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/spacerace.h,v
retrieving revision 1.4
diff -u -r1.4 spacerace.h
--- server/spacerace.h 2 Feb 2004 07:23:46 -0000 1.4
+++ server/spacerace.h 3 Sep 2004 01:58:15 -0000
@@ -13,9 +13,9 @@
#ifndef FC__SPACERACE_H
#define FC__SPACERACE_H
+#include "fc_types.h"
#include "packets.h"
-struct player;
struct player_spaceship;
struct conn_list;
Index: server/srv_main.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.h,v
retrieving revision 1.21
diff -u -r1.21 srv_main.h
--- server/srv_main.h 21 Aug 2004 18:32:37 -0000 1.21
+++ server/srv_main.h 3 Sep 2004 01:58:15 -0000
@@ -13,11 +13,11 @@
#ifndef FC__SRV_MAIN_H
#define FC__SRV_MAIN_H
+#include "fc_types.h"
#include "game.h"
#include "packets.h"
struct connection;
-struct unit;
BV_DEFINE(bv_draw, MAX_NUM_PLAYERS);
Index: server/stdinhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.h,v
retrieving revision 1.28
diff -u -r1.28 stdinhand.h
--- server/stdinhand.h 10 Apr 2004 03:47:50 -0000 1.28
+++ server/stdinhand.h 3 Sep 2004 01:58:15 -0000
@@ -14,8 +14,7 @@
#define FC__STDINHAND_H
#include "connection.h" /* enum cmdlevel_id */
-
-struct player;
+#include "fc_types.h"
#define SERVER_COMMAND_PREFIX '/'
/* the character to mark chatlines as server commands */
Index: server/unittools.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.h,v
retrieving revision 1.69
diff -u -r1.69 unittools.h
--- server/unittools.h 30 Jul 2004 18:35:03 -0000 1.69
+++ server/unittools.h 3 Sep 2004 01:58:15 -0000
@@ -13,14 +13,12 @@
#ifndef FC__UNITTOOLS_H
#define FC__UNITTOOLS_H
+#include "fc_types.h"
#include "packets.h" /* enum unit_info_use */
#include "unit.h"
#include "gotohand.h"
-struct city;
-struct player;
-
/* battle related */
int find_a_unit_type(int role, int role_tech);
bool maybe_make_veteran(struct unit *punit);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#9881) fc_types.h,
Jason Short <=
|
|