summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-07 14:23:25 +0000
committerrubidium <rubidium@openttd.org>2008-01-07 14:23:25 +0000
commita3ccdcea3663963939f75a9cc842f915b8e49767 (patch)
treed691be4529ae6acb6f5b7682aec3ff759e342438 /src
parent38115acf5adbcf66643d1f96e30b9abc6dec15a3 (diff)
downloadopenttd-a3ccdcea3663963939f75a9cc842f915b8e49767.tar.xz
(svn r11777) -Codechange: split the string header and make do not include it when it's not necessary.
Diffstat (limited to 'src')
-rw-r--r--src/blitter/factory.hpp2
-rw-r--r--src/console.cpp2
-rw-r--r--src/console_cmds.cpp2
-rw-r--r--src/debug.cpp2
-rw-r--r--src/driver.cpp1
-rw-r--r--src/driver.h2
-rw-r--r--src/engine.cpp2
-rw-r--r--src/fileio.cpp2
-rw-r--r--src/fios.cpp2
-rw-r--r--src/fontcache.cpp1
-rw-r--r--src/genworld_gui.cpp2
-rw-r--r--src/gfx.cpp1
-rw-r--r--src/gfxinit.cpp1
-rw-r--r--src/group_cmd.cpp2
-rw-r--r--src/group_gui.cpp1
-rw-r--r--src/main_gui.cpp2
-rw-r--r--src/misc.cpp2
-rw-r--r--src/misc_cmd.cpp2
-rw-r--r--src/misc_gui.cpp2
-rw-r--r--src/music/extmidi.cpp1
-rw-r--r--src/music/libtimidity.cpp1
-rw-r--r--src/namegen.cpp2
-rw-r--r--src/network/core/packet.cpp2
-rw-r--r--src/network/network.cpp2
-rw-r--r--src/network/network_client.cpp2
-rw-r--r--src/network/network_data.cpp2
-rw-r--r--src/network/network_gui.cpp3
-rw-r--r--src/network/network_server.cpp2
-rw-r--r--src/network/network_udp.cpp2
-rw-r--r--src/newgrf.cpp2
-rw-r--r--src/newgrf_config.cpp2
-rw-r--r--src/newgrf_gui.cpp1
-rw-r--r--src/newgrf_text.cpp2
-rw-r--r--src/newgrf_townname.cpp2
-rw-r--r--src/news_gui.cpp2
-rw-r--r--src/openttd.cpp1
-rw-r--r--src/order_cmd.cpp1
-rw-r--r--src/os2.cpp1
-rw-r--r--src/player_gui.cpp1
-rw-r--r--src/players.cpp2
-rw-r--r--src/roadveh_gui.cpp1
-rw-r--r--src/screenshot.cpp1
-rw-r--r--src/settings.cpp2
-rw-r--r--src/settings_gui.cpp2
-rw-r--r--src/signs.cpp2
-rw-r--r--src/spritecache.cpp1
-rw-r--r--src/station_cmd.cpp2
-rw-r--r--src/strgen/strgen.cpp2
-rw-r--r--src/string.cpp2
-rw-r--r--src/string_func.h (renamed from src/string.h)21
-rw-r--r--src/string_type.h19
-rw-r--r--src/strings.cpp2
-rw-r--r--src/textbuf_gui.h2
-rw-r--r--src/texteff.cpp1
-rw-r--r--src/timetable_gui.cpp2
-rw-r--r--src/town_cmd.cpp2
-rw-r--r--src/unix.cpp1
-rw-r--r--src/vehicle.cpp1
-rw-r--r--src/vehicle_gui.cpp1
-rw-r--r--src/waypoint.cpp2
-rw-r--r--src/win32.cpp1
-rw-r--r--src/window_gui.h1
62 files changed, 70 insertions, 70 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp
index 8bb232e28..5197104d0 100644
--- a/src/blitter/factory.hpp
+++ b/src/blitter/factory.hpp
@@ -4,8 +4,8 @@
#define BLITTER_FACTORY_HPP
#include "base.hpp"
-#include "../string.h"
#include "../debug.h"
+#include "../string_func.h"
#include <string>
#include <map>
diff --git a/src/console.cpp b/src/console.cpp
index a85b21c4c..2713744d2 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -10,7 +10,6 @@
#include "window_gui.h"
#include "player.h"
#include "variables.h"
-#include "string.h"
#include <stdarg.h>
#include <string.h>
#include "console.h"
@@ -19,6 +18,7 @@
#include "network/network_server.h"
#include "core/alloc_func.hpp"
#include "window_func.h"
+#include "string_func.h"
#define ICON_BUFFER 79
#define ICON_HISTORY_SIZE 20
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index 0576233e8..f92024a5d 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -9,7 +9,6 @@
#include "engine.h"
#include "landscape.h"
#include "saveload.h"
-#include "string.h"
#include "variables.h"
#include "network/network_data.h"
#include "network/network_client.h"
@@ -30,6 +29,7 @@
#include "map_func.h"
#include "date_func.h"
#include "vehicle_func.h"
+#include "string_func.h"
// ** scriptfile handling ** //
static FILE *_script_file;
diff --git a/src/debug.cpp b/src/debug.cpp
index 23c3b8d18..1b811b9cc 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -8,7 +8,7 @@
#include "openttd.h"
#include "console.h"
#include "debug.h"
-#include "string.h"
+#include "string_func.h"
#include "network/core/core.h"
#if defined(ENABLE_NETWORK)
diff --git a/src/driver.cpp b/src/driver.cpp
index 3d3c11c8f..dc7b23978 100644
--- a/src/driver.cpp
+++ b/src/driver.cpp
@@ -6,7 +6,6 @@
#include "openttd.h"
#include "debug.h"
#include "driver.h"
-#include "string.h"
#include "sound/sound_driver.hpp"
#include "music/music_driver.hpp"
diff --git a/src/driver.h b/src/driver.h
index 676671c6b..1a088d8c4 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -7,7 +7,7 @@
#include "debug.h"
#include "core/enum_type.hpp"
-#include "string.h"
+#include "string_func.h"
#include <string>
#include <map>
diff --git a/src/engine.cpp b/src/engine.cpp
index f816113b7..8920bc4b5 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -17,7 +17,6 @@
#include "newgrf_cargo.h"
#include "table/engines.h"
#include "group.h"
-#include "string.h"
#include "misc/autoptr.hpp"
#include "strings_func.h"
#include "viewport.h"
@@ -26,6 +25,7 @@
#include "date_func.h"
#include "autoreplace_base.h"
#include "autoreplace_gui.h"
+#include "string_func.h"
EngineInfo _engine_info[TOTAL_NUM_ENGINES];
RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES];
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 513286dea..12ee60868 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -5,12 +5,12 @@
#include "stdafx.h"
#include "openttd.h"
#include "fileio.h"
-#include "string.h"
#include "variables.h"
#include "debug.h"
#include "fios.h"
#include "core/alloc_func.hpp"
#include "core/math_func.hpp"
+#include "string_func.h"
#ifdef WIN32
#include <windows.h>
#else
diff --git a/src/fios.cpp b/src/fios.cpp
index f1d1691d9..b83520e21 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -6,7 +6,6 @@
#include "stdafx.h"
#include "openttd.h"
-#include "string.h"
#include "variables.h"
#include "heightmap.h"
#include "table/strings.h"
@@ -14,6 +13,7 @@
#include "fileio.h"
#include "core/alloc_func.hpp"
#include "functions.h"
+#include "string_func.h"
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index d988ed7c5..efde18eed 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -8,7 +8,6 @@
#include "table/sprites.h"
#include "table/control_codes.h"
#include "spritecache.h"
-#include "string.h"
#include "fontcache.h"
#include "spriteloader/spriteloader.hpp"
#include "blitter/factory.hpp"
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 20e577104..54f776540 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -14,7 +14,6 @@
#include "player.h"
#include "command_func.h"
#include "variables.h"
-#include "string.h"
#include "settings_func.h"
#include "debug.h"
#include "genworld.h"
@@ -26,6 +25,7 @@
#include "date_func.h"
#include "sound_func.h"
#include "fios.h"
+#include "string_func.h"
/**
* In what 'mode' the GenerateLandscapeWindowProc is.
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 8a18d95c8..322c450dd 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -6,7 +6,6 @@
#include "openttd.h"
#include "gfx_func.h"
#include "spritecache.h"
-#include "string.h"
#include "table/palettes.h"
#include "table/sprites.h"
#include "variables.h"
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 38588dfa2..781de27e7 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -10,7 +10,6 @@
#include "table/sprites.h"
#include "fileio.h"
#include "fios.h"
-#include "string.h"
#include "newgrf.h"
#include "md5.h"
#include "variables.h"
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index c39d86280..3df9d0694 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -13,7 +13,6 @@
#include "group.h"
#include "train.h"
#include "aircraft.h"
-#include "string.h"
#include "vehicle_gui.h"
#include "misc/autoptr.hpp"
#include "strings_func.h"
@@ -22,6 +21,7 @@
#include "vehicle_func.h"
#include "autoreplace_base.h"
#include "autoreplace_func.h"
+#include "string_func.h"
/**
* Update the num engines of a groupID. Decrease the old one and increase the new one
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index ec0d66713..9d7bcedf0 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -22,6 +22,7 @@
#include "window_func.h"
#include "vehicle_func.h"
#include "autoreplace_gui.h"
+#include "string_func.h"
struct Sorting {
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index ca13135d2..18d8662da 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -26,7 +26,6 @@
#include "train.h"
#include "roadveh.h"
#include "bridge_map.h"
-#include "string.h"
#include "screenshot.h"
#include "genworld.h"
#include "vehicle_gui.h"
@@ -49,6 +48,7 @@
#include "transparency.h"
#include "strings_func.h"
#include "zoom_func.h"
+#include "string_func.h"
static int _rename_id = 1;
static int _rename_what = -1;
diff --git a/src/misc.cpp b/src/misc.cpp
index 097c9c858..56347723f 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -8,7 +8,6 @@
#include "landscape.h"
#include "news.h"
#include "player.h"
-#include "string.h"
#include "table/strings.h"
#include "table/sprites.h"
#include "saveload.h"
@@ -27,6 +26,7 @@
#include "date_func.h"
#include "vehicle_func.h"
#include "texteff.hpp"
+#include "string_func.h"
char _name_array[512][32];
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index a59df8ebf..645455aae 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "openttd.h"
-#include "string.h"
#include "table/strings.h"
#include "command_func.h"
#include "economy_func.h"
@@ -20,6 +19,7 @@
#include "gfx_func.h"
#include "functions.h"
#include "vehicle_func.h"
+#include "string_func.h"
/** Change the player's face.
* @param tile unused
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 7385b2ade..164e9157d 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -24,7 +24,6 @@
#include "player.h"
#include "town.h"
#include "network/network.h"
-#include "string.h"
#include "variables.h"
#include "train.h"
#include "tgp.h"
@@ -39,6 +38,7 @@
#include "window_func.h"
#include "date_func.h"
#include "sound_func.h"
+#include "string_func.h"
/* Variables to display file lists */
FiosItem *_fios_list;
diff --git a/src/music/extmidi.cpp b/src/music/extmidi.cpp
index 821c0132e..af33bdb0e 100644
--- a/src/music/extmidi.cpp
+++ b/src/music/extmidi.cpp
@@ -4,7 +4,6 @@
#include "../stdafx.h"
#include "../openttd.h"
#include "../sound_func.h"
-#include "../string.h"
#include "../variables.h"
#include "../debug.h"
#include "extmidi.h"
diff --git a/src/music/libtimidity.cpp b/src/music/libtimidity.cpp
index 5368bbd68..e4c4b3ed9 100644
--- a/src/music/libtimidity.cpp
+++ b/src/music/libtimidity.cpp
@@ -3,7 +3,6 @@
#include "../stdafx.h"
#include "../openttd.h"
#include "../sound.h"
-#include "../string.h"
#include "../variables.h"
#include "../debug.h"
#include "libtimidity.h"
diff --git a/src/namegen.cpp b/src/namegen.cpp
index 64b37a0a9..901c7175c 100644
--- a/src/namegen.cpp
+++ b/src/namegen.cpp
@@ -7,7 +7,7 @@
#include "debug.h"
#include "namegen.h"
#include "table/namegen.h"
-#include "string.h"
+#include "string_func.h"
static inline uint32 SeedChance(int shift_by, int max, uint32 seed)
{
diff --git a/src/network/core/packet.cpp b/src/network/core/packet.cpp
index d31375183..fe4c1f774 100644
--- a/src/network/core/packet.cpp
+++ b/src/network/core/packet.cpp
@@ -7,7 +7,7 @@
#ifdef ENABLE_NETWORK
#include "../../stdafx.h"
-#include "../../string.h"
+#include "../../string_func.h"
#include "packet.h"
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 59f11fa39..625c04821 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -9,7 +9,6 @@ extern const char _openttd_revision[];
#include "../openttd.h"
#include "../debug.h"
-#include "../string.h"
#include "../strings_func.h"
#include "../map_func.h"
#include "../command_func.h"
@@ -32,6 +31,7 @@ extern const char _openttd_revision[];
#include "../texteff.hpp"
#include "../core/random_func.hpp"
#include "../window_func.h"
+#include "../string_func.h"
#ifdef DEBUG_DUMP_COMMANDS
#include "../core/alloc_func.hpp"
#endif
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index badfde557..8c3b91b0c 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -4,7 +4,6 @@
#include "../stdafx.h"
#include "../debug.h"
-#include "../string.h"
#include "../openttd.h"
#include "network_data.h"
#include "core/tcp.h"
@@ -22,6 +21,7 @@
#include "../md5.h"
#include "../strings_func.h"
#include "../window_func.h"
+#include "../string_func.h"
// This file handles all the client-commands
diff --git a/src/network/network_data.cpp b/src/network/network_data.cpp
index 6cb8e1d47..28d6c0984 100644
--- a/src/network/network_data.cpp
+++ b/src/network/network_data.cpp
@@ -5,11 +5,11 @@
#include "../stdafx.h"
#include "../debug.h"
#include "network_data.h"
-#include "../string.h"
#include "network_client.h"
#include "../command_func.h"
#include "../callback_table.h"
#include "../core/alloc_func.hpp"
+#include "../string_func.h"
// Add a command to the local command queue
void NetworkAddCommandQueue(NetworkTCPSocketHandler *cs, CommandPacket *cp)
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 7b13a6572..a15718057 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -3,7 +3,6 @@
#ifdef ENABLE_NETWORK
#include "../stdafx.h"
#include "../openttd.h"
-#include "../string.h"
#include "../strings_func.h"
#include "../table/sprites.h"
#include "network.h"
@@ -21,12 +20,12 @@
#include "../variables.h"
#include "network_server.h"
#include "network_udp.h"
-#include "../string.h"
#include "../town.h"
#include "../newgrf.h"
#include "../functions.h"
#include "../window_func.h"
#include "../core/alloc_func.hpp"
+#include "../string_func.h"
#define BGC 5
#define BTC 15
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 40220e254..21f14356f 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -5,7 +5,6 @@
#include "../stdafx.h"
#include "../openttd.h" // XXX StringID
#include "../debug.h"
-#include "../string.h"
#include "../strings_func.h"
#include "network_data.h"
#include "core/tcp.h"
@@ -23,6 +22,7 @@
#include "../genworld.h"
#include "../core/alloc_func.hpp"
#include "../fileio.h"
+#include "../string_func.h"
// This file handles all the server-commands
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 573acadfa..741e83b40 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -11,7 +11,6 @@
#include "../stdafx.h"
#include "../debug.h"
-#include "../string.h"
#include "network_data.h"
#include "../date_func.h"
#include "../map_func.h"
@@ -20,6 +19,7 @@
#include "../variables.h"
#include "../newgrf_config.h"
#include "../core/endian_func.hpp"
+#include "../string_func.h"
#include "core/udp.h"
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index fa531f5ed..2b24efff6 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -15,7 +15,6 @@
#include "sprite.h"
#include "newgrf.h"
#include "variables.h"
-#include "string.h"
#include "table/strings.h"
#include "bridge.h"
#include "town.h"
@@ -46,6 +45,7 @@
#include "date_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
+#include "string_func.h"
/* TTDPatch extended GRF format codec
* (c) Petr Baudis 2004 (GPL'd)
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 22427a29f..95fc46ce1 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -6,13 +6,13 @@
#include "openttd.h"
#include "debug.h"
#include "variables.h"
-#include "string.h"
#include "saveload.h"
#include "md5.h"
#include "network/network_data.h"
#include "newgrf.h"
#include "newgrf_config.h"
#include "core/alloc_func.hpp"
+#include "string_func.h"
#include "fileio.h"
#include "fios.h"
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 3fc2de622..e835eed6a 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -15,6 +15,7 @@
#include "strings_func.h"
#include "window_func.h"
#include "core/alloc_func.hpp"
+#include "string_func.h"
/** Parse an integerlist string and set each found value
* @param p the string to be parsed. Each element in the list is seperated by a
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index eb766871f..f1b03e237 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -12,7 +12,6 @@
#include "stdafx.h"
#include "debug.h"
#include "openttd.h"
-#include "string.h"
#include "variables.h"
#include "table/strings.h"
#include "newgrf.h"
@@ -21,6 +20,7 @@
#include "strings_func.h"
#include "core/alloc_func.hpp"
#include "newgrf_storage.h"
+#include "string_func.h"
#define GRFTAB 28
#define TABSIZE 11
diff --git a/src/newgrf_townname.cpp b/src/newgrf_townname.cpp
index 90855aa27..fdaa66230 100644
--- a/src/newgrf_townname.cpp
+++ b/src/newgrf_townname.cpp
@@ -10,8 +10,8 @@
#include "openttd.h"
#include "table/strings.h"
#include "newgrf_townname.h"
-#include "string.h"
#include "core/alloc_func.hpp"
+#include "string_func.h"
static GRFTownName *_grf_townnames = NULL;
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index dd8fb28e4..cd6611859 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -10,13 +10,13 @@
#include "viewport.h"
#include "news.h"
#include "variables.h"
-#include "string.h"
#include "transparency.h"
#include "strings_func.h"
#include "window_func.h"
#include "date_func.h"
#include "vehicle_base.h"
#include "sound_func.h"
+#include "string_func.h"
/** @file news_gui.cpp
*
diff --git a/src/openttd.cpp b/src/openttd.cpp
index f1b85c697..f116264c0 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#define VARDEF
-#include "string.h"
#include "debug.h"
#include "driver.h"
#include "saveload.h"
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index da2d82460..d2bd70db6 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -22,6 +22,7 @@
#include "functions.h"
#include "window_func.h"
#include "settings_type.h"
+#include "string_func.h"
DEFINE_OLD_POOL_GENERIC(Order, Order)
diff --git a/src/os2.cpp b/src/os2.cpp
index 918c99cb1..2e3b5ae93 100644
--- a/src/os2.cpp
+++ b/src/os2.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "openttd.h"
#include "variables.h"
-#include "string.h"
#include "table/strings.h"
#include "gui.h"
#include "fileio.h"
diff --git a/src/player_gui.cpp b/src/player_gui.cpp
index 4fbad5899..dfa1ae2fe 100644
--- a/src/player_gui.cpp
+++ b/src/player_gui.cpp
@@ -26,6 +26,7 @@
#include "functions.h"
#include "window_func.h"
#include "date_func.h"
+#include "string_func.h"
static void DoShowPlayerFinances(PlayerID player, bool show_small, bool show_stickied);
static void DoSelectPlayerFace(PlayerID player, bool show_big);
diff --git a/src/players.cpp b/src/players.cpp
index 1b014651f..0d1661b2c 100644
--- a/src/players.cpp
+++ b/src/players.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "openttd.h"
#include "engine.h"
-#include "string.h"
#include "table/strings.h"
#include "table/sprites.h"
#include "player.h"
@@ -30,6 +29,7 @@
#include "sound_func.h"
#include "autoreplace_func.h"
#include "autoreplace_gui.h"
+#include "string_func.h"
/**
* Sets the local player and updates the patch settings that are set on a
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index 16b5d062d..85baa684c 100644
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -17,6 +17,7 @@
#include "newgrf_engine.h"
#include "strings_func.h"
#include "vehicle_func.h"
+#include "string_func.h"
void DrawRoadVehDetails(const Vehicle *v, int x, int y)
diff --git a/src/screenshot.cpp b/src/screenshot.cpp
index 8b585f75a..2ee41caab 100644
--- a/src/screenshot.cpp
+++ b/src/screenshot.cpp
@@ -9,7 +9,6 @@
#include "player.h"
#include "screenshot.h"
#include "variables.h"
-#include "string.h"
#include "blitter/factory.hpp"
#include "fileio.h"
#include "strings_func.h"
diff --git a/src/settings.cpp b/src/settings.cpp
index 28174c5de..af6999ed4 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -23,7 +23,6 @@
#include "openttd.h"
#include "currency.h"
#include "screenshot.h"
-#include "string.h"
#include "variables.h"
#include "network/network.h"
#include "settings_internal.h"
@@ -48,6 +47,7 @@
#endif
#include "spritecache.h"
#include "transparency.h"
+#include "string_func.h"
GameOptions _opt;
GameOptions _opt_newgame;
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index b55b78b74..3109bd61d 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "openttd.h"
#include "currency.h"
-#include "string.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "gui.h"
@@ -25,6 +24,7 @@
#include "window_func.h"
#include "vehicle_base.h"
#include "core/alloc_func.hpp"
+#include "string_func.h"
static uint32 _difficulty_click_a;
static uint32 _difficulty_click_b;
diff --git a/src/signs.cpp b/src/signs.cpp
index 628d517cf..0e7d200dc 100644
--- a/src/signs.cpp
+++ b/src/signs.cpp
@@ -11,7 +11,6 @@
#include "saveload.h"
#include "command_func.h"
#include "variables.h"
-#include "string.h"
#include "misc/autoptr.hpp"
#include "strings_func.h"
#include "viewport.h"
@@ -19,6 +18,7 @@
#include "functions.h"
#include "window_func.h"
#include "map_func.h"
+#include "string_func.h"
SignID _new_sign_id;
uint _total_signs;
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index 55890bb4c..0f5ba6cd2 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "openttd.h"
#include "variables.h"
-#include "string.h"
#include "debug.h"
#include "spritecache.h"
#include "table/sprites.h"
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 7d05bfc45..72ca2ce60 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "openttd.h"
-#include "string.h"
#include "aircraft.h"
#include "bridge_map.h"
#include "cmd_helper.h"
@@ -45,6 +44,7 @@
#include "window_func.h"
#include "date_func.h"
#include "vehicle_func.h"
+#include "string_func.h"
DEFINE_OLD_POOL_GENERIC(Station, Station)
DEFINE_OLD_POOL_GENERIC(RoadStop, RoadStop)
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index b5d6208d2..1c5bed3a7 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -1,10 +1,10 @@
/* $Id$ */
#include "../stdafx.h"
-#include "../string.h"
#include "../table/control_codes.h"
#include "../core/alloc_func.hpp"
#include "../core/endian_func.hpp"
+#include "../string_func.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/src/string.cpp b/src/string.cpp
index 056f310de..2fc71621e 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -4,10 +4,10 @@
#include "stdafx.h"
#include "openttd.h"
-#include "string.h"
#include "table/control_codes.h"
#include "debug.h"
#include "core/alloc_func.hpp"
+#include "string_func.h"
#include <stdarg.h>
#include <ctype.h> // required for tolower()
diff --git a/src/string.h b/src/string_func.h
index bdbe9b46a..6a8a6ced3 100644
--- a/src/string.h
+++ b/src/string_func.h
@@ -1,11 +1,12 @@
/* $Id$ */
-/** @file string.h */
+/** @file string.h Functions related to low-level strings. */
-#ifndef STRING_H
-#define STRING_H
+#ifndef STRING_FUNC_H
+#define STRING_FUNC_H
#include "core/bitmath_func.hpp"
+#include "string_type.h"
/**
* usage ttd_strlcpy(dst, src, lengthof(dst));
@@ -36,15 +37,6 @@ void str_validate(char *str);
/** Scans the string for colour codes and strips them */
void str_strip_colours(char *str);
-/**
- * Valid filter types for IsValidChar.
- */
-enum CharSetFilter {
- CS_ALPHANUMERAL, ///< Both numeric and alphabetic and spaces and stuff
- CS_NUMERAL, ///< Only numeric ones
- CS_ALPHA, ///< Only alphabetic values
-};
-
/** Convert the given string to lowercase, only works with ASCII! */
void strtolower(char *str);
@@ -63,8 +55,6 @@ static inline int ttd_strnlen(const char *str, int maxlen)
/** Convert the md5sum number to a 'hexadecimal' string, return next pos in buffer */
char *md5sumToString(char *buf, const char *last, const uint8 md5sum[16]);
-typedef uint32 WChar;
-
/**
* Only allow certain keys. You can define the filter to be used. This makes
* sure no invalid keys can get into an editbox, like BELL.
@@ -166,5 +156,4 @@ static inline bool IsWhitespace(WChar c)
;
}
-
-#endif /* STRING_H */
+#endif /* STRING_FUNC_H */
diff --git a/src/string_type.h b/src/string_type.h
new file mode 100644
index 000000000..4d9a39f30
--- /dev/null
+++ b/src/string_type.h
@@ -0,0 +1,19 @@
+/* $Id$ */
+
+/** @file string_type.h Types for strings. */
+
+#ifndef STRING_TYPE_H
+#define STRING_TYPE_H
+
+/**
+ * Valid filter types for IsValidChar.
+ */
+enum CharSetFilter {
+ CS_ALPHANUMERAL, ///< Both numeric and alphabetic and spaces and stuff
+ CS_NUMERAL, ///< Only numeric ones
+ CS_ALPHA, ///< Only alphabetic values
+};
+
+typedef uint32 WChar;
+
+#endif /* STRING_TYPE_H */
diff --git a/src/strings.cpp b/src/strings.cpp
index 264947e91..e92c2fce4 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "openttd.h"
#include "currency.h"
-#include "string.h"
#include "table/strings.h"
#include "namegen.h"
#include "station.h"
@@ -34,6 +33,7 @@
#include "core/endian_func.hpp"
#include "date_func.h"
#include "vehicle_base.h"
+#include "string_func.h"
/* for opendir/readdir/closedir */
# include "fios.h"
diff --git a/src/textbuf_gui.h b/src/textbuf_gui.h
index 612c4a5d2..5f0f6bd78 100644
--- a/src/textbuf_gui.h
+++ b/src/textbuf_gui.h
@@ -5,8 +5,8 @@
#ifndef TEXTBUF_GUI_H
#define TEXTBUF_GUI_H
-#include "string.h"
#include "window_type.h"
+#include "string_type.h"
struct Textbuf {
char *buf; ///< buffer in which text is saved
diff --git a/src/texteff.cpp b/src/texteff.cpp
index 407ad8ebd..9aeefdace 100644
--- a/src/texteff.cpp
+++ b/src/texteff.cpp
@@ -9,7 +9,6 @@
#include "viewport.h"
#include "saveload.h"
#include "console.h"
-#include "string.h"
#include "variables.h"
#include "table/sprites.h"
#include "blitter/factory.hpp"
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp
index 35ae23702..9c70168b4 100644
--- a/src/timetable_gui.cpp
+++ b/src/timetable_gui.cpp
@@ -11,11 +11,11 @@
#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
-#include "string.h"
#include "cargotype.h"
#include "depot.h"
#include "strings_func.h"
#include "vehicle_base.h"
+#include "string_func.h"
static int GetOrderFromTimetableWndPt(Window *w, int y, const Vehicle *v)
{
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 8d9e6863c..3336f7936 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -40,8 +40,8 @@
#include "transparency.h"
#include "tunnelbridge_map.h"
#include "strings_func.h"
-#include "string.h"
#include "window_func.h"
+#include "string_func.h"
/* Initialize the town-pool */
diff --git a/src/unix.cpp b/src/unix.cpp
index 13e837835..9ab974d25 100644
--- a/src/unix.cpp
+++ b/src/unix.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "openttd.h"
-#include "string.h"
#include "table/strings.h"
#include "variables.h"
#include "textbuf_gui.h"
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index b9d32e7a1..259cd6bba 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -46,6 +46,7 @@
#include "variables.h"
#include "autoreplace_func.h"
#include "autoreplace_gui.h"
+#include "string_func.h"
#define INVALID_COORD (0x7fffffff)
#define GEN_HASH(x, y) ((GB((y), 6, 6) << 6) + GB((x), 7, 6))
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index c9e3a10af..9e372b793 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -34,6 +34,7 @@
#include "vehicle_func.h"
#include "autoreplace_gui.h"
#include "core/alloc_func.hpp"
+#include "string_func.h"
struct Sorting {
Listing aircraft;
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index a7d4267bc..2aaecd7c6 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -19,7 +19,6 @@
#include "table/strings.h"
#include "yapf/yapf.h"
#include "newgrf.h"
-#include "string.h"
#include "misc/autoptr.hpp"
#include "strings_func.h"
#include "viewport.h"
@@ -29,6 +28,7 @@
#include "date_func.h"
#include "vehicle_func.h"
#include "vehicle_base.h"
+#include "string_func.h"
enum {
MAX_WAYPOINTS_PER_TOWN = 64,
diff --git a/src/win32.cpp b/src/win32.cpp
index 037c9beb1..f5cacbbbc 100644
--- a/src/win32.cpp
+++ b/src/win32.cpp
@@ -6,7 +6,6 @@
#include "openttd.h"
#include "debug.h"
#include "saveload.h"
-#include "string.h"
#include "gfx_func.h"
#include "textbuf_gui.h"
#include "fileio.h"
diff --git a/src/window_gui.h b/src/window_gui.h
index 316c76c93..fb8d70761 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -5,7 +5,6 @@
#ifndef WINDOW_GUI_H
#define WINDOW_GUI_H
-#include "string.h"
#include "order.h"
#include "rail_type.h"
#include "road_type.h"