diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp index 8bb232e28e..5197104d08 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 #include diff --git a/src/console.cpp b/src/console.cpp index a85b21c4c5..2713744d2b 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 #include #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 0576233e8a..f92024a5d6 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 23c3b8d187..1b811b9cc2 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 3d3c11c8f4..dc7b23978d 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 676671c6be..1a088d8c45 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 #include diff --git a/src/engine.cpp b/src/engine.cpp index f816113b75..8920bc4b58 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 513286dea1..12ee608689 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 #else diff --git a/src/fios.cpp b/src/fios.cpp index f1d1691d95..b83520e218 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 #include diff --git a/src/fontcache.cpp b/src/fontcache.cpp index d988ed7c56..efde18eedc 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 20e5771045..54f7765405 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 8a18d95c8d..322c450dd4 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 38588dfa25..781de27e7c 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 c39d86280d..3df9d06948 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 ec0d667134..9d7bcedf00 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 ca13135d21..18d8662dae 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 097c9c8587..56347723fb 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 a59df8ebfe..645455aae6 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 7385b2adef..164e9157d1 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 821c0132ed..af33bdb0ea 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 5368bbd68d..e4c4b3ed92 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 64b37a0a92..901c7175c3 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 d313751834..fe4c1f7746 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 59f11fa395..625c048212 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 badfde5573..8c3b91b0c0 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 6cb8e1d471..28d6c09842 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 7b13a6572e..a157180571 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 40220e2547..21f14356f4 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 573acadfa2..741e83b40b 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 fa531f5ed8..2b24efff6f 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 22427a29fe..95fc46ce1a 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 3fc2de622a..e835eed6a5 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 eb766871f0..f1b03e2376 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 90855aa271..fdaa662304 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 dd8fb28e48..cd6611859b 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 f1b85c6975..f116264c01 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 da2d824607..d2bd70db6c 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 918c99cb15..2e3b5ae930 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 4fbad58999..dfa1ae2fe7 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 1b014651f2..0d1661b2c3 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 16b5d062d4..85baa684cb 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 8b585f75a2..2ee41caab7 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 28174c5de4..af6999ed45 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 b55b78b74d..3109bd61dc 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 628d517cfd..0e7d200dcf 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 55890bb4cb..0f5ba6cd22 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 7d05bfc458..72ca2ce60d 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 b5d6208d20..1c5bed3a7f 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 #include #include diff --git a/src/string.cpp b/src/string.cpp index 056f310de8..2fc71621e7 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 #include // required for tolower() diff --git a/src/string.h b/src/string_func.h similarity index 92% rename from src/string.h rename to src/string_func.h index bdbe9b46a2..6a8a6ced32 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 0000000000..4d9a39f301 --- /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 264947e916..e92c2fce4d 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 612c4a5d29..5f0f6bd789 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 407ad8ebda..9aeefdaceb 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 35ae237024..9c70168b4a 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 8d9e6863c4..3336f7936a 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 13e8378356..9ab974d259 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 b9d32e7a19..259cd6bbab 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 c9e3a10afd..9e372b793f 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 a7d4267bc0..2aaecd7c68 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 037c9beb1f..f5cacbbbc1 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 316c76c936..fb8d707614 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"