summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emu/emu.h4
-rw-r--r--src/emu/emualloc.h5
-rw-r--r--src/emu/emucore.h5
-rw-r--r--src/emu/rendlay.cpp14
-rw-r--r--src/frontend/mame/ui/inifile.cpp2
-rw-r--r--src/lib/formats/cassimg.cpp2
-rw-r--r--src/lib/formats/ioprocs.cpp1
-rw-r--r--src/lib/util/avhuff.h2
-rw-r--r--src/lib/util/aviio.cpp6
-rw-r--r--src/lib/util/aviio.h1
-rw-r--r--src/lib/util/bitmap.cpp1
-rw-r--r--src/lib/util/bitmap.h1
-rw-r--r--src/lib/util/bitstream.h2
-rw-r--r--src/lib/util/cdrom.cpp4
-rw-r--r--src/lib/util/chd.h3
-rw-r--r--src/lib/util/chdcd.cpp1
-rw-r--r--src/lib/util/chdcodec.h4
-rw-r--r--src/lib/util/corealloc.h2
-rw-r--r--src/lib/util/corefile.cpp4
-rw-r--r--src/lib/util/corefile.h3
-rw-r--r--src/lib/util/corestr.cpp1
-rw-r--r--src/lib/util/corestr.h3
-rw-r--r--src/lib/util/coretmpl.h13
-rw-r--r--src/lib/util/coreutil.h2
-rw-r--r--src/lib/util/disasmintf.cpp14
-rw-r--r--src/lib/util/disasmintf.h2
-rw-r--r--src/lib/util/flac.cpp6
-rw-r--r--src/lib/util/flac.h1
-rw-r--r--src/lib/util/hash.cpp3
-rw-r--r--src/lib/util/hashing.cpp1
-rw-r--r--src/lib/util/hashing.h4
-rw-r--r--src/lib/util/huffman.h2
-rw-r--r--src/lib/util/jedparse.h3
-rw-r--r--src/lib/util/msdib.cpp2
-rw-r--r--src/lib/util/msdib.h1
-rw-r--r--src/lib/util/opresolv.cpp11
-rw-r--r--src/lib/util/options.cpp5
-rw-r--r--src/lib/util/palette.h4
-rw-r--r--src/lib/util/plaparse.cpp8
-rw-r--r--src/lib/util/plaparse.h1
-rw-r--r--src/lib/util/png.cpp1
-rw-r--r--src/lib/util/png.h1
-rw-r--r--src/lib/util/pool.cpp7
-rw-r--r--src/lib/util/pool.h3
-rw-r--r--src/lib/util/strformat.h2
-rw-r--r--src/lib/util/timeconv.h4
-rw-r--r--src/lib/util/un7z.cpp2
-rw-r--r--src/lib/util/unicode.cpp2
-rw-r--r--src/lib/util/unicode.h4
-rw-r--r--src/lib/util/unzip.cpp1
-rw-r--r--src/lib/util/unzip.h2
-rw-r--r--src/lib/util/vbiparse.cpp2
-rw-r--r--src/lib/util/vbiparse.h2
-rw-r--r--src/lib/util/vecstream.h47
-rw-r--r--src/lib/util/xmlfile.cpp2
-rw-r--r--src/lib/util/xmlfile.h1
-rw-r--r--src/lib/util/zippath.cpp1
-rw-r--r--src/osd/modules/file/posixdir.cpp1
-rw-r--r--src/osd/modules/file/posixdomain.cpp1
-rw-r--r--src/osd/modules/file/posixfile.cpp1
-rw-r--r--src/osd/modules/file/posixfile.h2
-rw-r--r--src/osd/modules/file/posixsocket.cpp1
-rw-r--r--src/osd/modules/file/stdfile.cpp1
-rw-r--r--src/osd/modules/file/windir.cpp2
-rw-r--r--src/osd/modules/file/winfile.h2
-rw-r--r--src/osd/modules/file/winptty.cpp1
-rw-r--r--src/osd/modules/file/winrtdir.cpp2
-rw-r--r--src/osd/modules/file/winrtfile.h2
-rw-r--r--src/osd/modules/file/winrtptty.cpp1
-rw-r--r--src/osd/modules/file/winrtsocket.cpp1
-rw-r--r--src/osd/modules/file/winsocket.cpp1
-rw-r--r--src/osd/modules/font/font_osx.cpp1
-rw-r--r--src/osd/modules/font/font_sdl.cpp1
-rw-r--r--src/osd/modules/font/font_windows.cpp1
-rw-r--r--src/osd/modules/midi/none.cpp1
-rw-r--r--src/osd/modules/midi/portmidi.cpp1
-rw-r--r--src/osd/osdcore.h373
-rw-r--r--src/osd/osdfile.h320
-rw-r--r--src/osd/windows/winutil.h2
-rw-r--r--src/tools/chdman.cpp6
-rw-r--r--src/tools/floptool.cpp1
-rw-r--r--src/tools/imgtool/charconv.h4
-rw-r--r--src/tools/imgtool/imghd.cpp2
-rw-r--r--src/tools/imgtool/imgtool.h1
-rw-r--r--src/tools/imgtool/main.cpp4
-rw-r--r--src/tools/imgtool/stream.cpp1
-rw-r--r--src/tools/imgtool/stream.h1
-rw-r--r--src/tools/jedutil.cpp1
-rw-r--r--src/tools/pngcmp.cpp2
-rw-r--r--src/tools/regrep.cpp6
-rw-r--r--src/tools/romcmp.cpp2
-rw-r--r--src/tools/split.cpp2
-rw-r--r--src/tools/srcclean.cpp2
-rw-r--r--src/tools/unidasm.cpp1
94 files changed, 477 insertions, 516 deletions
diff --git a/src/emu/emu.h b/src/emu/emu.h
index 0463ff8d332..9b67c78403d 100644
--- a/src/emu/emu.h
+++ b/src/emu/emu.h
@@ -28,6 +28,7 @@
// core emulator headers -- must be first (profiler needs attotime, attotime needs xtal)
#include "emucore.h"
+#include "osdcore.h"
#include "eminline.h"
#include "xtal.h"
#include "attotime.h"
@@ -37,9 +38,8 @@
#include "http.h"
// commonly-referenced utilities imported from lib/util
+#include "corestr.h"
#include "palette.h"
-#include "strformat.h"
-#include "vecstream.h"
// emulator-specific utilities
#include "hash.h"
diff --git a/src/emu/emualloc.h b/src/emu/emualloc.h
index 630c3d0a1fd..479c22686b5 100644
--- a/src/emu/emualloc.h
+++ b/src/emu/emualloc.h
@@ -13,12 +13,13 @@
#pragma once
-#include "osdcore.h"
-#include "coretmpl.h"
+#include "osdcomm.h"
+#include "corealloc.h"
#include <memory>
#include <mutex>
#include <new>
+#include <vector>
//**************************************************************************
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 53ee22130e0..b0df89343ec 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -28,7 +28,6 @@
#endif
// standard C++ includes
-#include <cassert>
#include <exception>
#include <string>
#include <type_traits>
@@ -37,9 +36,10 @@
// core system includes
#include "osdcomm.h"
#include "emualloc.h"
-#include "corestr.h"
+#include "coretmpl.h"
#include "bitmap.h"
#include "strformat.h"
+#include "vecstream.h"
#include "emufwd.h"
@@ -77,6 +77,7 @@ using util::make_bitmask;
using util::BIT;
using util::bitswap;
using util::iabs;
+using util::string_format;
// genf is a generic function pointer; cast function pointers to this instead of void *
diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp
index 44577c82185..e343435a6f0 100644
--- a/src/emu/rendlay.cpp
+++ b/src/emu/rendlay.cpp
@@ -438,27 +438,27 @@ private:
tmp.seekp(0);
util::stream_format(tmp, "scr%uphysicalxaspect", i);
- try_insert(std::string_view(tmp), s64(physaspect.first));
+ try_insert(util::buf_to_string_view(tmp), s64(physaspect.first));
tmp.seekp(0);
util::stream_format(tmp, "scr%uphysicalyaspect", i);
- try_insert(std::string_view(tmp), s64(physaspect.second));
+ try_insert(util::buf_to_string_view(tmp), s64(physaspect.second));
tmp.seekp(0);
util::stream_format(tmp, "scr%unativexaspect", i);
- try_insert(std::string_view(tmp), xaspect);
+ try_insert(util::buf_to_string_view(tmp), xaspect);
tmp.seekp(0);
util::stream_format(tmp, "scr%unativeyaspect", i);
- try_insert(std::string_view(tmp), yaspect);
+ try_insert(util::buf_to_string_view(tmp), yaspect);
tmp.seekp(0);
util::stream_format(tmp, "scr%uwidth", i);
- try_insert(std::string_view(tmp), w);
+ try_insert(util::buf_to_string_view(tmp), w);
tmp.seekp(0);
util::stream_format(tmp, "scr%uheight", i);
- try_insert(std::string_view(tmp), h);
+ try_insert(util::buf_to_string_view(tmp), h);
++i;
}
@@ -539,7 +539,7 @@ private:
else
{
m_buffer.write(&str[start], str.length() - start);
- return std::string_view(m_buffer);
+ return util::buf_to_string_view(m_buffer);
}
}
diff --git a/src/frontend/mame/ui/inifile.cpp b/src/frontend/mame/ui/inifile.cpp
index 1bcdce69aba..0d0e46b8f0d 100644
--- a/src/frontend/mame/ui/inifile.cpp
+++ b/src/frontend/mame/ui/inifile.cpp
@@ -570,7 +570,7 @@ void favorite_manager::save_favorites()
buf << info.devicetype << '\n';
util::stream_format(buf, "%d\n", info.available);
- file.puts(std::string_view(buf));
+ file.puts(util::buf_to_string_view(buf));
}
}
file.close();
diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp
index 2c46e61c485..ee271abc8a7 100644
--- a/src/lib/formats/cassimg.cpp
+++ b/src/lib/formats/cassimg.cpp
@@ -11,6 +11,8 @@
#include "cassimg.h"
#include "imageutl.h"
+#include "corealloc.h" // make_unique_clear
+
#include <algorithm>
#include <cassert>
#include <cstring>
diff --git a/src/lib/formats/ioprocs.cpp b/src/lib/formats/ioprocs.cpp
index 34810153f9a..78e009aa112 100644
--- a/src/lib/formats/ioprocs.cpp
+++ b/src/lib/formats/ioprocs.cpp
@@ -3,7 +3,6 @@
#include <cstdio>
#include <cstring>
#include <cassert>
-#include "osdcore.h"
#include "ioprocs.h"
#include "corefile.h"
diff --git a/src/lib/util/avhuff.h b/src/lib/util/avhuff.h
index 83b46195d6b..1462bad3c77 100644
--- a/src/lib/util/avhuff.h
+++ b/src/lib/util/avhuff.h
@@ -13,8 +13,6 @@
#pragma once
-#include "osdcore.h"
-#include "coretmpl.h"
#include "bitmap.h"
#include "huffman.h"
#include "flac.h"
diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp
index 7f74920f06b..03014611873 100644
--- a/src/lib/util/aviio.cpp
+++ b/src/lib/util/aviio.cpp
@@ -8,13 +8,15 @@
***************************************************************************/
+#include "aviio.h"
+#include "osdcomm.h"
+#include "osdfile.h"
+
#include <array>
#include <cassert>
#include <cstdlib>
#include <cstring>
-#include "aviio.h"
-
/***************************************************************************
CONSTANTS
diff --git a/src/lib/util/aviio.h b/src/lib/util/aviio.h
index c951f71b22f..4fdcf79b5bf 100644
--- a/src/lib/util/aviio.h
+++ b/src/lib/util/aviio.h
@@ -11,7 +11,6 @@
#ifndef MAME_LIB_UTIL_AVIIO_H
#define MAME_LIB_UTIL_AVIIO_H
-#include "osdcore.h"
#include "bitmap.h"
#include <cstdint>
diff --git a/src/lib/util/bitmap.cpp b/src/lib/util/bitmap.cpp
index cfad01ac82f..9722fea7218 100644
--- a/src/lib/util/bitmap.cpp
+++ b/src/lib/util/bitmap.cpp
@@ -11,6 +11,7 @@
#include "bitmap.h"
#include <cassert>
+#include <cstring>
#include <new>
diff --git a/src/lib/util/bitmap.h b/src/lib/util/bitmap.h
index 57ed0bc1775..4deb2550329 100644
--- a/src/lib/util/bitmap.h
+++ b/src/lib/util/bitmap.h
@@ -13,7 +13,6 @@
#pragma once
-#include "osdcore.h"
#include "palette.h"
#include <algorithm>
diff --git a/src/lib/util/bitstream.h b/src/lib/util/bitstream.h
index 3da6ec2c1cf..4f3817afe6f 100644
--- a/src/lib/util/bitstream.h
+++ b/src/lib/util/bitstream.h
@@ -13,7 +13,7 @@
#pragma once
-#include "osdcore.h"
+#include <cstdint>
//**************************************************************************
diff --git a/src/lib/util/cdrom.cpp b/src/lib/util/cdrom.cpp
index 94efa870d8d..12346a66868 100644
--- a/src/lib/util/cdrom.cpp
+++ b/src/lib/util/cdrom.cpp
@@ -1323,7 +1323,7 @@ chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc)
strcpy(submode, cdrom_get_type_string(toc->tracks[i].pgtype));
}
- metadata = string_format(CDROM_TRACK_METADATA2_FORMAT, i + 1, cdrom_get_type_string(toc->tracks[i].trktype),
+ metadata = util::string_format(CDROM_TRACK_METADATA2_FORMAT, i + 1, cdrom_get_type_string(toc->tracks[i].trktype),
cdrom_get_subtype_string(toc->tracks[i].subtype), toc->tracks[i].frames, toc->tracks[i].pregap,
submode, cdrom_get_subtype_string(toc->tracks[i].pgsub),
toc->tracks[i].postgap);
@@ -1331,7 +1331,7 @@ chd_error cdrom_write_metadata(chd_file *chd, const cdrom_toc *toc)
}
else
{
- metadata = string_format(GDROM_TRACK_METADATA_FORMAT, i + 1, cdrom_get_type_string(toc->tracks[i].trktype),
+ metadata = util::string_format(GDROM_TRACK_METADATA_FORMAT, i + 1, cdrom_get_type_string(toc->tracks[i].trktype),
cdrom_get_subtype_string(toc->tracks[i].subtype), toc->tracks[i].frames, toc->tracks[i].padframes,
toc->tracks[i].pregap, cdrom_get_type_string(toc->tracks[i].pgtype),
cdrom_get_subtype_string(toc->tracks[i].pgsub), toc->tracks[i].postgap);
diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h
index 254a99daae1..705967d3dda 100644
--- a/src/lib/util/chd.h
+++ b/src/lib/util/chd.h
@@ -14,10 +14,7 @@
#pragma once
#include "osdcore.h"
-#include "coretmpl.h"
-#include "corestr.h"
#include <string>
-#include "bitmap.h"
#include "corefile.h"
#include "hashing.h"
#include "chdcodec.h"
diff --git a/src/lib/util/chdcd.cpp b/src/lib/util/chdcd.cpp
index 92958105500..ef013b41f48 100644
--- a/src/lib/util/chdcd.cpp
+++ b/src/lib/util/chdcd.cpp
@@ -14,6 +14,7 @@
#include "chd.h"
#include "chdcd.h"
#include "corefile.h"
+#include "corestr.h"
diff --git a/src/lib/util/chdcodec.h b/src/lib/util/chdcodec.h
index e688b41a108..dc9c074fd37 100644
--- a/src/lib/util/chdcodec.h
+++ b/src/lib/util/chdcodec.h
@@ -13,8 +13,8 @@
#pragma once
-#include "osdcore.h"
-#include "coretmpl.h"
+#include <cstdint>
+#include <vector>
#define CHDCODEC_VERIFY_COMPRESSION 0
diff --git a/src/lib/util/corealloc.h b/src/lib/util/corealloc.h
index db8aacf6cb2..d70a0909f2b 100644
--- a/src/lib/util/corealloc.h
+++ b/src/lib/util/corealloc.h
@@ -13,8 +13,6 @@
#pragma once
-#include "osdcore.h"
-
#include <cstddef>
#include <cstdlib>
#include <cstring>
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp
index fe0747c66a8..cbe70bbf5fc 100644
--- a/src/lib/util/corefile.cpp
+++ b/src/lib/util/corefile.cpp
@@ -10,6 +10,8 @@
#include "corefile.h"
+#include "coretmpl.h"
+#include "osdcore.h"
#include "unicode.h"
#include "vecstream.h"
@@ -600,7 +602,7 @@ int core_text_file::vprintf(util::format_argument_pack<std::ostream> const &args
m_printf_buffer.reserve(1024);
m_printf_buffer.seekp(0, ovectorstream::beg);
util::stream_format<std::ostream, std::ostream>(m_printf_buffer, args);
- return puts(std::string_view(m_printf_buffer));
+ return puts(buf_to_string_view(m_printf_buffer));
}
diff --git a/src/lib/util/corefile.h b/src/lib/util/corefile.h
index 3af0bddafb6..a558a279324 100644
--- a/src/lib/util/corefile.h
+++ b/src/lib/util/corefile.h
@@ -13,8 +13,7 @@
#pragma once
-#include "corestr.h"
-#include "coretmpl.h"
+#include "osdfile.h"
#include "strformat.h"
#include <cstdint>
diff --git a/src/lib/util/corestr.cpp b/src/lib/util/corestr.cpp
index d4fc15b1bce..1e89015d456 100644
--- a/src/lib/util/corestr.cpp
+++ b/src/lib/util/corestr.cpp
@@ -9,7 +9,6 @@
****************************************************************************/
#include "corestr.h"
-#include "osdcore.h"
#include <algorithm>
#include <memory>
diff --git a/src/lib/util/corestr.h b/src/lib/util/corestr.h
index ee319d69deb..de294c0665c 100644
--- a/src/lib/util/corestr.h
+++ b/src/lib/util/corestr.h
@@ -13,9 +13,6 @@
#pragma once
-#include "osdcore.h"
-#include "strformat.h"
-
#include <string>
#include <cstring>
diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h
index e2e221e7374..cfc70442160 100644
--- a/src/lib/util/coretmpl.h
+++ b/src/lib/util/coretmpl.h
@@ -13,8 +13,7 @@
#pragma once
#include "osdcomm.h"
-#include "osdcore.h"
-#include "corealloc.h"
+#include "vecstream.h"
#include <array>
#include <cassert>
@@ -28,6 +27,7 @@
#include <numeric>
#include <set>
#include <stdexcept>
+#include <string_view>
#include <tuple>
#include <type_traits>
#include <utility>
@@ -913,6 +913,15 @@ private:
};
+// extract a string_view from an ovectorstream buffer
+template <typename CharT, typename Traits, typename Allocator>
+std::basic_string_view<CharT, Traits> buf_to_string_view(basic_ovectorstream<CharT, Traits, Allocator> &stream)
+{
+ // this works on the assumption that the value tellp returns is the same both before and after vec is called
+ return std::basic_string_view<CharT, Traits>(&stream.vec()[0], stream.tellp());
+}
+
+
template <typename E>
using enable_enum_t = typename std::enable_if_t<std::is_enum<E>::value, typename std::underlying_type_t<E> >;
diff --git a/src/lib/util/coreutil.h b/src/lib/util/coreutil.h
index a0166818da8..1f487232619 100644
--- a/src/lib/util/coreutil.h
+++ b/src/lib/util/coreutil.h
@@ -13,7 +13,7 @@
#pragma once
-#include "osdcomm.h"
+#include <cstdint>
/***************************************************************************
diff --git a/src/lib/util/disasmintf.cpp b/src/lib/util/disasmintf.cpp
index 9699f68e823..c78dc6b0f85 100644
--- a/src/lib/util/disasmintf.cpp
+++ b/src/lib/util/disasmintf.cpp
@@ -1,16 +1,16 @@
#include "disasmintf.h"
-util::u32 util::disasm_interface::interface_flags() const
+util::disasm_interface::u32 util::disasm_interface::interface_flags() const
{
return 0;
}
-util::u32 util::disasm_interface::page_address_bits() const
+util::disasm_interface::u32 util::disasm_interface::page_address_bits() const
{
throw ("unimplemented page_address_bits called");
}
-util::u32 util::disasm_interface::page2_address_bits() const
+util::disasm_interface::u32 util::disasm_interface::page2_address_bits() const
{
throw ("unimplemented page2_address_bits called");
}
@@ -25,22 +25,22 @@ util::disasm_interface::offs_t util::disasm_interface::pc_real_to_linear(offs_t
throw ("unimplemented pc_real_to_linear called");
}
-util::u8 util::disasm_interface::decrypt8(u8 value, offs_t pc, bool opcode) const
+util::disasm_interface::u8 util::disasm_interface::decrypt8(u8 value, offs_t pc, bool opcode) const
{
throw ("unimplemented decrypt8 called");
}
-util::u16 util::disasm_interface::decrypt16(u16 value, offs_t pc, bool opcode) const
+util::disasm_interface::u16 util::disasm_interface::decrypt16(u16 value, offs_t pc, bool opcode) const
{
throw ("unimplemented decrypt16 called");
}
-util::u32 util::disasm_interface::decrypt32(u32 value, offs_t pc, bool opcode) const
+util::disasm_interface::u32 util::disasm_interface::decrypt32(u32 value, offs_t pc, bool opcode) const
{
throw ("unimplemented decrypt32 called");
}
-util::u64 util::disasm_interface::decrypt64(u64 value, offs_t pc, bool opcode) const
+util::disasm_interface::u64 util::disasm_interface::decrypt64(u64 value, offs_t pc, bool opcode) const
{
throw ("unimplemented decrypt64 called");
}
diff --git a/src/lib/util/disasmintf.h b/src/lib/util/disasmintf.h
index 78c77a9abb2..4a07e722c53 100644
--- a/src/lib/util/disasmintf.h
+++ b/src/lib/util/disasmintf.h
@@ -13,7 +13,7 @@
#ifndef MAME_UTIL_DISASMINTF_H
#define MAME_UTIL_DISASMINTF_H
-#include "coretmpl.h"
+#include "osdcomm.h"
namespace util {
diff --git a/src/lib/util/flac.cpp b/src/lib/util/flac.cpp
index 9030249a7d0..5b912b89279 100644
--- a/src/lib/util/flac.cpp
+++ b/src/lib/util/flac.cpp
@@ -8,9 +8,11 @@
***************************************************************************/
-#include <cassert>
-
#include "flac.h"
+
+#include "osdcomm.h"
+
+#include <cassert>
#include <new>
diff --git a/src/lib/util/flac.h b/src/lib/util/flac.h
index 20e3f1b9378..2b814437cd5 100644
--- a/src/lib/util/flac.h
+++ b/src/lib/util/flac.h
@@ -13,7 +13,6 @@
#pragma once
-#include "osdcore.h"
#include "corefile.h"
#include <FLAC/all.h>
diff --git a/src/lib/util/hash.cpp b/src/lib/util/hash.cpp
index 78f10bbff7f..5f2fd6f267a 100644
--- a/src/lib/util/hash.cpp
+++ b/src/lib/util/hash.cpp
@@ -11,8 +11,9 @@
***************************************************************************/
#include "hash.h"
-#include "hashing.h"
+#include "corestr.h"
+#include <cassert>
#include <cctype>
diff --git a/src/lib/util/hashing.cpp b/src/lib/util/hashing.cpp
index 4e7d7a83005..e90c128a8a2 100644
--- a/src/lib/util/hashing.cpp
+++ b/src/lib/util/hashing.cpp
@@ -9,6 +9,7 @@
***************************************************************************/
#include "hashing.h"
+#include "strformat.h"
#include <zlib.h>
diff --git a/src/lib/util/hashing.h b/src/lib/util/hashing.h
index f2f06af686a..6cd73ac1846 100644
--- a/src/lib/util/hashing.h
+++ b/src/lib/util/hashing.h
@@ -12,11 +12,11 @@
#pragma once
-#include "osdcore.h"
-#include "corestr.h"
#include "md5.h"
#include <array>
+#include <cstdint>
+#include <cstring>
#include <functional>
#include <string>
#include <string_view>
diff --git a/src/lib/util/huffman.h b/src/lib/util/huffman.h
index 0eac393f380..b13fa4b1d5d 100644
--- a/src/lib/util/huffman.h
+++ b/src/lib/util/huffman.h
@@ -13,8 +13,8 @@
#pragma once
-#include "osdcore.h"
#include "bitstream.h"
+#include "osdcomm.h"
//**************************************************************************
diff --git a/src/lib/util/jedparse.h b/src/lib/util/jedparse.h
index f12101ca154..606daa318bd 100644
--- a/src/lib/util/jedparse.h
+++ b/src/lib/util/jedparse.h
@@ -13,7 +13,8 @@
#pragma once
-#include "osdcore.h"
+#include <cstddef>
+#include <cstdint>
diff --git a/src/lib/util/msdib.cpp b/src/lib/util/msdib.cpp
index da6b3d70ce3..c084442f44b 100644
--- a/src/lib/util/msdib.cpp
+++ b/src/lib/util/msdib.cpp
@@ -10,7 +10,9 @@
#include "msdib.h"
+#include "coretmpl.h"
#include "eminline.h"
+#include "osdcore.h"
#include <cassert>
#include <cstdlib>
diff --git a/src/lib/util/msdib.h b/src/lib/util/msdib.h
index 54767e216fb..79c1bb6e796 100644
--- a/src/lib/util/msdib.h
+++ b/src/lib/util/msdib.h
@@ -14,7 +14,6 @@
#include "bitmap.h"
#include "corefile.h"
-#include "osdcore.h"
#include <cstdint>
diff --git a/src/lib/util/opresolv.cpp b/src/lib/util/opresolv.cpp
index 034f9418426..2b269b59e04 100644
--- a/src/lib/util/opresolv.cpp
+++ b/src/lib/util/opresolv.cpp
@@ -8,14 +8,15 @@
****************************************************************************/
+#include "opresolv.h"
+
+#include "strformat.h"
+
+#include <algorithm>
+#include <cassert>
#include <cctype>
#include <cstdlib>
#include <cstring>
-#include <cassert>
-
-#include "pool.h"
-#include "corestr.h"
-#include "opresolv.h"
namespace util {
diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp
index 3e5cb001378..7aa8817f580 100644
--- a/src/lib/util/options.cpp
+++ b/src/lib/util/options.cpp
@@ -11,6 +11,7 @@
#include "options.h"
#include "corestr.h"
+#include "osdcomm.h"
#include <locale>
#include <string>
@@ -1000,12 +1001,12 @@ void core_options::set_value(const std::string &name, std::string &&value, int p
void core_options::set_value(const std::string &name, int value, int priority)
{
- set_value(name, string_format("%d", value), priority);
+ set_value(name, util::string_format("%d", value), priority);
}
void core_options::set_value(const std::string &name, float value, int priority)
{
- set_value(name, string_format("%f", value), priority);
+ set_value(name, util::string_format("%f", value), priority);
}
diff --git a/src/lib/util/palette.h b/src/lib/util/palette.h
index ff2c7bb80c9..ed9d4eb9311 100644
--- a/src/lib/util/palette.h
+++ b/src/lib/util/palette.h
@@ -13,8 +13,8 @@
#pragma once
-#include "osdcore.h"
-#include "coretmpl.h"
+#include <cstdint>
+#include <vector>
//**************************************************************************
diff --git a/src/lib/util/plaparse.cpp b/src/lib/util/plaparse.cpp
index 756d29f46da..76fbbad6983 100644
--- a/src/lib/util/plaparse.cpp
+++ b/src/lib/util/plaparse.cpp
@@ -2,7 +2,7 @@
// copyright-holders:Aaron Giles, hap
/***************************************************************************
- plaparse.h
+ plaparse.cpp
Simple parser for Berkeley standard PLA files into raw fusemaps.
It supports no more than one output matrix, and is limited to
@@ -10,12 +10,14 @@
***************************************************************************/
+#include "plaparse.h"
+
+#include "osdcomm.h"
+
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
-#include "jedparse.h"
-#include "plaparse.h"
diff --git a/src/lib/util/plaparse.h b/src/lib/util/plaparse.h
index b0d3cbbe4e3..779a80f126b 100644
--- a/src/lib/util/plaparse.h
+++ b/src/lib/util/plaparse.h
@@ -13,7 +13,6 @@
#pragma once
-#include "osdcore.h"
#include "jedparse.h"
diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp
index d03f993a7be..67e3366606b 100644
--- a/src/lib/util/png.cpp
+++ b/src/lib/util/png.cpp
@@ -10,6 +10,7 @@
#include "png.h"
+#include "osdcomm.h"
#include "unicode.h"
#include <zlib.h>
diff --git a/src/lib/util/png.h b/src/lib/util/png.h
index cc7a7204c16..8c80f0aa5ea 100644
--- a/src/lib/util/png.h
+++ b/src/lib/util/png.h
@@ -15,7 +15,6 @@
#include "bitmap.h"
#include "corefile.h"
-#include "osdcore.h"
#include <cstdint>
#include <list>
diff --git a/src/lib/util/pool.cpp b/src/lib/util/pool.cpp
index 6bf049db03d..faf1de170ae 100644
--- a/src/lib/util/pool.cpp
+++ b/src/lib/util/pool.cpp
@@ -8,11 +8,14 @@
***************************************************************************/
+#include "pool.h"
+
+#include "coreutil.h"
+#include "osdcomm.h"
+
#include <cstdarg>
#include <cstddef>
#include <cstdlib>
-#include "pool.h"
-#include "coreutil.h"
/***************************************************************************
diff --git a/src/lib/util/pool.h b/src/lib/util/pool.h
index 2d1c5af31a7..b1794fcba87 100644
--- a/src/lib/util/pool.h
+++ b/src/lib/util/pool.h
@@ -13,7 +13,8 @@
#pragma once
-#include "osdcore.h"
+#include <cstddef>
+#include <cstdint>
/***************************************************************************
diff --git a/src/lib/util/strformat.h b/src/lib/util/strformat.h
index 1f9818fa465..b8c9b4f1a99 100644
--- a/src/lib/util/strformat.h
+++ b/src/lib/util/strformat.h
@@ -1775,8 +1775,6 @@ using detail::make_format_argument_pack;
} // namespace util
-using util::string_format;
-
//**************************************************************************
// EXTERNAL TEMPLATE INSTANTIATIONS
diff --git a/src/lib/util/timeconv.h b/src/lib/util/timeconv.h
index 26decf0fd65..f1ed7d383e4 100644
--- a/src/lib/util/timeconv.h
+++ b/src/lib/util/timeconv.h
@@ -13,11 +13,11 @@
#pragma once
-#include "osdcore.h"
#include "coreutil.h"
-#include <chrono>
#include <algorithm>
+#include <chrono>
+#include <cstring>
#include <stdexcept>
diff --git a/src/lib/util/un7z.cpp b/src/lib/util/un7z.cpp
index a10bbbccf55..879da294c69 100644
--- a/src/lib/util/un7z.cpp
+++ b/src/lib/util/un7z.cpp
@@ -13,6 +13,8 @@
#include "unzip.h"
#include "corestr.h"
+#include "osdcore.h"
+#include "osdfile.h"
#include "unicode.h"
#include "timeconv.h"
diff --git a/src/lib/util/unicode.cpp b/src/lib/util/unicode.cpp
index b3568fbb8d4..de6ef06e5c9 100644
--- a/src/lib/util/unicode.cpp
+++ b/src/lib/util/unicode.cpp
@@ -10,6 +10,8 @@
#include "unicode.h"
+#include "osdcomm.h"
+
#ifdef _WIN32
#include "strconv.h"
#define UTF8PROC_DLLEXPORT
diff --git a/src/lib/util/unicode.h b/src/lib/util/unicode.h
index 37821122998..e2788b5e2ab 100644
--- a/src/lib/util/unicode.h
+++ b/src/lib/util/unicode.h
@@ -19,11 +19,11 @@
#pragma once
-#include "osdcore.h"
-
#include <string>
#include <string_view>
+#include <cstddef>
+#include <cstdint>
#include <cstdlib>
diff --git a/src/lib/util/unzip.cpp b/src/lib/util/unzip.cpp
index a659445e1cc..a275cc7df06 100644
--- a/src/lib/util/unzip.cpp
+++ b/src/lib/util/unzip.cpp
@@ -13,6 +13,7 @@
#include "corestr.h"
#include "hashing.h"
#include "osdcore.h"
+#include "osdfile.h"
#include "timeconv.h"
#include "lzma/C/LzmaDec.h"
diff --git a/src/lib/util/unzip.h b/src/lib/util/unzip.h
index a1388cd0b4c..b1ddb7a27d1 100644
--- a/src/lib/util/unzip.h
+++ b/src/lib/util/unzip.h
@@ -13,8 +13,6 @@
#ifndef MAME_LIB_UTIL_UNZIP_H
#define MAME_LIB_UTIL_UNZIP_H
-#include "osdcore.h"
-
#include <chrono>
#include <cstdint>
#include <memory>
diff --git a/src/lib/util/vbiparse.cpp b/src/lib/util/vbiparse.cpp
index 6b790ec7180..50c9e70da2f 100644
--- a/src/lib/util/vbiparse.cpp
+++ b/src/lib/util/vbiparse.cpp
@@ -8,9 +8,9 @@
***************************************************************************/
-#include "osdcore.h"
#include "vbiparse.h"
#include <cmath>
+#include <cstring>
#include <algorithm>
diff --git a/src/lib/util/vbiparse.h b/src/lib/util/vbiparse.h
index 8113cb5cb32..08e2359e117 100644
--- a/src/lib/util/vbiparse.h
+++ b/src/lib/util/vbiparse.h
@@ -13,7 +13,7 @@
#pragma once
-#include "osdcomm.h"
+#include <cstdint>
/***************************************************************************
CONSTANTS
diff --git a/src/lib/util/vecstream.h b/src/lib/util/vecstream.h
index 863bf39d94a..1af7dd0cd86 100644
--- a/src/lib/util/vecstream.h
+++ b/src/lib/util/vecstream.h
@@ -28,7 +28,6 @@
#include <ostream>
#include <streambuf>
#include <string>
-#include <string_view>
#include <type_traits>
#include <utility>
#include <vector>
@@ -45,7 +44,6 @@ public:
typedef typename std::basic_streambuf<CharT, Traits>::off_type off_type;
typedef Allocator allocator_type;
typedef std::vector<char_type, Allocator> vector_type;
- typedef std::basic_string_view<char_type> string_view_type;
basic_vectorbuf(std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) : std::basic_streambuf<CharT, Traits>(), m_mode(mode), m_storage(), m_threshold(nullptr)
{
@@ -74,16 +72,23 @@ public:
vector_type const &vec() const
{
- finalize();
+ if (m_mode & std::ios_base::out)
+ {
+ if (this->pptr() > m_threshold) m_threshold = this->pptr();
+ auto const base(this->pbase());
+ auto const end(m_threshold - base);
+ if (m_storage.size() > std::make_unsigned_t<decltype(end)>(end))
+ {
+ m_storage.resize(std::make_unsigned_t<decltype(end)>(end));
+ assert(&m_storage[0] == base);
+ auto const put_offset(this->pptr() - base);
+ const_cast<basic_vectorbuf *>(this)->setp(base, base + put_offset);
+ const_cast<basic_vectorbuf *>(this)->pbump(put_offset);
+ }
+ }
return m_storage;
}
- explicit operator string_view_type() const
- {
- finalize();
- return string_view_type(this->pbase(), this->pptr() - this->pbase());
- }
-
void vec(const vector_type &content)
{
m_storage = content;
@@ -302,24 +307,6 @@ private:
}
}
- void finalize() const
- {
- if (m_mode & std::ios_base::out)
- {
- if (this->pptr() > m_threshold) m_threshold = this->pptr();
- auto const base(this->pbase());
- auto const end(m_threshold - base);
- if (m_storage.size() > std::make_unsigned_t<decltype(end)>(end))
- {
- m_storage.resize(std::make_unsigned_t<decltype(end)>(end));
- assert(&m_storage[0] == base);
- auto const put_offset(this->pptr() - base);
- const_cast<basic_vectorbuf *>(this)->setp(base, base + put_offset);
- const_cast<basic_vectorbuf *>(this)->pbump(put_offset);
- }
- }
- }
-
std::ios_base::openmode m_mode;
mutable vector_type m_storage;
mutable CharT *m_threshold;
@@ -330,14 +317,12 @@ class basic_ivectorstream : public std::basic_istream<CharT, Traits>
{
public:
typedef typename basic_vectorbuf<CharT, Traits, Allocator>::vector_type vector_type;
- typedef typename basic_vectorbuf<CharT, Traits, Allocator>::string_view_type string_view_type;
basic_ivectorstream(std::ios_base::openmode mode = std::ios_base::in) : std::basic_istream<CharT, Traits>(&m_rdbuf), m_rdbuf(mode) { }
basic_ivectorstream(vector_type const &content, std::ios_base::openmode mode = std::ios_base::in) : std::basic_istream<CharT, Traits>(&m_rdbuf), m_rdbuf(content, mode) { }
basic_ivectorstream(vector_type &&content, std::ios_base::openmode mode = std::ios_base::in) : std::basic_istream<CharT, Traits>(&m_rdbuf), m_rdbuf(std::move(content), mode) { }
basic_vectorbuf<CharT, Traits, Allocator> *rdbuf() const { return static_cast<basic_vectorbuf<CharT, Traits, Allocator> *>(std::basic_istream<CharT, Traits>::rdbuf()); }
- explicit operator string_view_type() const { return string_view_type(*rdbuf()); }
vector_type const &vec() const { return rdbuf()->vec(); }
void vec(const vector_type &content) { rdbuf()->vec(content); }
void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); }
@@ -353,7 +338,6 @@ class basic_ovectorstream : public std::basic_ostream<CharT, Traits>
{
public:
typedef typename basic_vectorbuf<CharT, Traits, Allocator>::vector_type vector_type;
- typedef typename basic_vectorbuf<CharT, Traits, Allocator>::string_view_type string_view_type;
basic_ovectorstream(std::ios_base::openmode mode = std::ios_base::out) : std::basic_ostream<CharT, Traits>(&m_rdbuf), m_rdbuf(mode) { }
basic_ovectorstream(vector_type const &content, std::ios_base::openmode mode = std::ios_base::out) : std::basic_ostream<CharT, Traits>(&m_rdbuf), m_rdbuf(content, mode) { }
@@ -362,7 +346,6 @@ public:
basic_vectorbuf<CharT, Traits, Allocator> *rdbuf() const { return static_cast<basic_vectorbuf<CharT, Traits, Allocator> *>(std::basic_ostream<CharT, Traits>::rdbuf()); }
vector_type const &vec() const { return rdbuf()->vec(); }
- explicit operator string_view_type() const { return string_view_type(*rdbuf()); }
void vec(const vector_type &content) { rdbuf()->vec(content); }
void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); }
basic_ovectorstream &reserve(typename vector_type::size_type size) { rdbuf()->reserve(size); return *this; }
@@ -378,7 +361,6 @@ class basic_vectorstream : public std::basic_iostream<CharT, Traits>
{
public:
typedef typename basic_vectorbuf<CharT, Traits, Allocator>::vector_type vector_type;
- typedef typename basic_vectorbuf<CharT, Traits, Allocator>::string_view_type string_view_type;
basic_vectorstream(std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) : std::basic_iostream<CharT, Traits>(&m_rdbuf), m_rdbuf(mode) { }
basic_vectorstream(vector_type const &content, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) : std::basic_iostream<CharT, Traits>(&m_rdbuf), m_rdbuf(content, mode) { }
@@ -387,7 +369,6 @@ public:
basic_vectorbuf<CharT, Traits, Allocator> *rdbuf() const { return static_cast<basic_vectorbuf<CharT, Traits, Allocator> *>(std::basic_iostream<CharT, Traits>::rdbuf()); }
vector_type const &vec() const { return rdbuf()->vec(); }
- explicit operator string_view_type() const { return string_view_type(*rdbuf()); }
void vec(const vector_type &content) { rdbuf()->vec(content); }
void vec(vector_type &&content) { rdbuf()->vec(std::move(content)); }
basic_vectorstream &reserve(typename vector_type::size_type size) { rdbuf()->reserve(size); return *this; }
diff --git a/src/lib/util/xmlfile.cpp b/src/lib/util/xmlfile.cpp
index cfa6bbd8ff5..adcf56a15c7 100644
--- a/src/lib/util/xmlfile.cpp
+++ b/src/lib/util/xmlfile.cpp
@@ -10,6 +10,8 @@
#include "xmlfile.h"
+#include "osdcore.h"
+
#include <expat.h>
#include <algorithm>
diff --git a/src/lib/util/xmlfile.h b/src/lib/util/xmlfile.h
index b4bcf3e17e7..ba3a1176e25 100644
--- a/src/lib/util/xmlfile.h
+++ b/src/lib/util/xmlfile.h
@@ -12,7 +12,6 @@
#pragma once
-#include "osdcore.h"
#include "corefile.h"
#include <list>
diff --git a/src/lib/util/zippath.cpp b/src/lib/util/zippath.cpp
index 760c64fd066..249d5643d89 100644
--- a/src/lib/util/zippath.cpp
+++ b/src/lib/util/zippath.cpp
@@ -11,7 +11,6 @@
#include "zippath.h"
#include "unzip.h"
#include "corestr.h"
-#include "osdcore.h"
#include <cstdlib>
diff --git a/src/osd/modules/file/posixdir.cpp b/src/osd/modules/file/posixdir.cpp
index 2a755a513fe..9cd29a84600 100644
--- a/src/osd/modules/file/posixdir.cpp
+++ b/src/osd/modules/file/posixdir.cpp
@@ -40,6 +40,7 @@
#define _DARWIN_C_SOURCE // to get DT_xxx on OS X
#include "osdcore.h"
+#include "osdfile.h"
#include "modules/lib/osdlib.h"
#include "util/strformat.h"
diff --git a/src/osd/modules/file/posixdomain.cpp b/src/osd/modules/file/posixdomain.cpp
index 633187819a7..13d564d1738 100644
--- a/src/osd/modules/file/posixdomain.cpp
+++ b/src/osd/modules/file/posixdomain.cpp
@@ -13,6 +13,7 @@
#include <cassert>
#include <cerrno>
#include <cstdio>
+#include <cstring>
#include <sys/select.h>
#include <sys/socket.h>
diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp
index 764b148bc7d..a35f0fbd6d4 100644
--- a/src/osd/modules/file/posixfile.cpp
+++ b/src/osd/modules/file/posixfile.cpp
@@ -44,6 +44,7 @@
// MAME headers
#include "posixfile.h"
+#include "osdcore.h"
#include "unicode.h"
#include <cassert>
diff --git a/src/osd/modules/file/posixfile.h b/src/osd/modules/file/posixfile.h
index 6f585ff827a..d47c03d691e 100644
--- a/src/osd/modules/file/posixfile.h
+++ b/src/osd/modules/file/posixfile.h
@@ -9,7 +9,7 @@
//============================================================
-#include "osdcore.h"
+#include "osdfile.h"
#include <cstdint>
#include <string>
diff --git a/src/osd/modules/file/posixsocket.cpp b/src/osd/modules/file/posixsocket.cpp
index edb95816077..2ce5ad05d5c 100644
--- a/src/osd/modules/file/posixsocket.cpp
+++ b/src/osd/modules/file/posixsocket.cpp
@@ -13,6 +13,7 @@
#include <cassert>
#include <cerrno>
#include <cstdio>
+#include <cstring>
#include <arpa/inet.h>
#include <netdb.h>
diff --git a/src/osd/modules/file/stdfile.cpp b/src/osd/modules/file/stdfile.cpp
index 0bf38945f5a..74b4208505c 100644
--- a/src/osd/modules/file/stdfile.cpp
+++ b/src/osd/modules/file/stdfile.cpp
@@ -7,6 +7,7 @@
//============================================================
#include "osdcore.h"
+#include "osdfile.h"
#include <cassert>
#include <cstdint>
diff --git a/src/osd/modules/file/windir.cpp b/src/osd/modules/file/windir.cpp
index 73bcae13f04..e03b13782fd 100644
--- a/src/osd/modules/file/windir.cpp
+++ b/src/osd/modules/file/windir.cpp
@@ -12,7 +12,7 @@
#include <tchar.h>
// MAME headers
-#include "osdcore.h"
+#include "osdfile.h"
#include "strformat.h"
// MAMEOS headers
diff --git a/src/osd/modules/file/winfile.h b/src/osd/modules/file/winfile.h
index 9a6f1b8fc34..927cb299545 100644
--- a/src/osd/modules/file/winfile.h
+++ b/src/osd/modules/file/winfile.h
@@ -8,7 +8,7 @@
#ifndef MAME_OSD_WINDOWS_WINFILE_H
#define MAME_OSD_WINDOWS_WINFILE_H
-#include "osdcore.h"
+#include "osdfile.h"
#include <cstdint>
#include <string>
diff --git a/src/osd/modules/file/winptty.cpp b/src/osd/modules/file/winptty.cpp
index d4207d1d73d..65650fd4bfe 100644
--- a/src/osd/modules/file/winptty.cpp
+++ b/src/osd/modules/file/winptty.cpp
@@ -11,6 +11,7 @@
#include <windows.h>
#include <cstdlib>
+#include <cstring>
namespace {
diff --git a/src/osd/modules/file/winrtdir.cpp b/src/osd/modules/file/winrtdir.cpp
index 2d61097a3b4..f1ade923e81 100644
--- a/src/osd/modules/file/winrtdir.cpp
+++ b/src/osd/modules/file/winrtdir.cpp
@@ -12,10 +12,10 @@
#include <tchar.h>
// MAME headers
-#include "osdcore.h"
#include "strformat.h"
// MAMEOS headers
+#include "osdfile.h"
#include "strconv.h"
#include "../../windows/winutil.h"
diff --git a/src/osd/modules/file/winrtfile.h b/src/osd/modules/file/winrtfile.h
index 9a6f1b8fc34..927cb299545 100644
--- a/src/osd/modules/file/winrtfile.h
+++ b/src/osd/modules/file/winrtfile.h
@@ -8,7 +8,7 @@
#ifndef MAME_OSD_WINDOWS_WINFILE_H
#define MAME_OSD_WINDOWS_WINFILE_H
-#include "osdcore.h"
+#include "osdfile.h"
#include <cstdint>
#include <string>
diff --git a/src/osd/modules/file/winrtptty.cpp b/src/osd/modules/file/winrtptty.cpp
index b442409a79e..cda1f128503 100644
--- a/src/osd/modules/file/winrtptty.cpp
+++ b/src/osd/modules/file/winrtptty.cpp
@@ -10,6 +10,7 @@
#include <windows.h>
#include <cstdlib>
+#include <cstring>
namespace {
diff --git a/src/osd/modules/file/winrtsocket.cpp b/src/osd/modules/file/winrtsocket.cpp
index 3e4880605bf..d66551870f9 100644
--- a/src/osd/modules/file/winrtsocket.cpp
+++ b/src/osd/modules/file/winrtsocket.cpp
@@ -14,6 +14,7 @@
#include <cassert>
#include <cstdio>
+#include <cstring>
// standard windows headers
#include <windows.h>
diff --git a/src/osd/modules/file/winsocket.cpp b/src/osd/modules/file/winsocket.cpp
index 9fd0bb31165..948e57db822 100644
--- a/src/osd/modules/file/winsocket.cpp
+++ b/src/osd/modules/file/winsocket.cpp
@@ -17,6 +17,7 @@
#include <cassert>
#include <cstdio>
+#include <cstring>
// standard windows headers
#include <windows.h>
diff --git a/src/osd/modules/font/font_osx.cpp b/src/osd/modules/font/font_osx.cpp
index f26b75ad073..42c61b1fa6d 100644
--- a/src/osd/modules/font/font_osx.cpp
+++ b/src/osd/modules/font/font_osx.cpp
@@ -10,7 +10,6 @@
#ifdef SDLMAME_MACOSX
-#include "corealloc.h"
#include "fileio.h"
#include <ApplicationServices/ApplicationServices.h>
diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp
index 08c1f076970..585673a4159 100644
--- a/src/osd/modules/font/font_sdl.cpp
+++ b/src/osd/modules/font/font_sdl.cpp
@@ -11,7 +11,6 @@
#if defined(SDLMAME_UNIX) && !defined(SDLMAME_MACOSX) && !defined(SDLMAME_HAIKU) && !defined(SDLMAME_ANDROID)
#include "corestr.h"
-#include "corealloc.h"
#include "fileio.h"
#include "unicode.h"
diff --git a/src/osd/modules/font/font_windows.cpp b/src/osd/modules/font/font_windows.cpp
index 96701f96cfc..4387c6522c1 100644
--- a/src/osd/modules/font/font_windows.cpp
+++ b/src/osd/modules/font/font_windows.cpp
@@ -17,7 +17,6 @@
#include "strconv.h"
#include "unicode.h"
#include "corestr.h"
-#include "corealloc.h"
#include <cstring>
diff --git a/src/osd/modules/midi/none.cpp b/src/osd/modules/midi/none.cpp
index 25f83b45fbe..21837d1be3c 100644
--- a/src/osd/modules/midi/none.cpp
+++ b/src/osd/modules/midi/none.cpp
@@ -9,7 +9,6 @@
*******************************************************************c********/
#include "osdcore.h"
-#include "corealloc.h"
#include "modules/osdmodule.h"
#include "midi_module.h"
diff --git a/src/osd/modules/midi/portmidi.cpp b/src/osd/modules/midi/portmidi.cpp
index d6bd3b0e031..9cb5ddac39b 100644
--- a/src/osd/modules/midi/portmidi.cpp
+++ b/src/osd/modules/midi/portmidi.cpp
@@ -12,7 +12,6 @@
#include <portmidi.h>
#include "osdcore.h"
-#include "corealloc.h"
#include "modules/osdmodule.h"
#include "midi_module.h"
diff --git a/src/osd/osdcore.h b/src/osd/osdcore.h
index 4c4cab081e6..dd6ab5837d5 100644
--- a/src/osd/osdcore.h
+++ b/src/osd/osdcore.h
@@ -16,196 +16,14 @@
#include "strformat.h"
-#include <chrono>
#include <cstdarg>
#include <cstdint>
#include <iosfwd>
-#include <memory>
#include <string>
#include <utility>
#include <vector>
-/***************************************************************************
- FILE I/O INTERFACES
-***************************************************************************/
-
-/* Make sure we have a path separator (default to /) */
-#ifndef PATH_SEPARATOR
-#if defined(_WIN32)
-#define PATH_SEPARATOR "\\"
-#else
-#define PATH_SEPARATOR "/"
-#endif
-#endif
-
-/// \defgroup openflags File open flags
-/// \{
-
-/// Open file for reading.
-#define OPEN_FLAG_READ 0x0001
-
-/// Open file for writing.
-#define OPEN_FLAG_WRITE 0x0002
-
-/// Create the file, or truncate it if it exists.
-#define OPEN_FLAG_CREATE 0x0004
-
-/// Create non-existent directories in the path.
-#define OPEN_FLAG_CREATE_PATHS 0x0008
-
-/// Do not decompress into memory on open.
-#define OPEN_FLAG_NO_PRELOAD 0x0010
-
-/// \}
-
-
-/// \brief Interface to file-like resources
-///
-/// This interface is used to access file-like and stream-like
-/// resources. Examples include plain files, TCP socket, named pipes,
-/// pseudo-terminals, and compressed archive members.
-class osd_file
-{
-public:
- /// \brief Result of a file operation
- ///
- /// Returned by most members of osd_file, and also used by other
- /// classes that access files or other file-like resources.
- enum class error
- {
- /// Operation completed successfully.
- NONE,
-
- /// Operation failed, but there is no more specific code to
- /// describe the failure.
- FAILURE,
-
- /// Operation failed due to an error allocating memory.
- OUT_OF_MEMORY,
-
- /// The requested file, path or resource was not found.
- NOT_FOUND,
-
- /// Current permissions do not allow the requested access.
- ACCESS_DENIED,
-
- /// Requested access is not permitted because the file or
- /// resource is currently open for exclusive access.
- ALREADY_OPEN,
-
- /// Request cannot be completed due to resource exhaustion
- /// (maximum number of open files or other objects has been
- /// reached).
- TOO_MANY_FILES,
-
- /// The request cannot be completed because invalid data was
- /// encountered (for example an inconsistent filesystem, or a
- /// corrupt archive file).
- INVALID_DATA,
-
- /// The requested access mode is invalid, or not appropriate for
- /// the file or resource.
- INVALID_ACCESS
- };
-
- /// \brief Smart pointer to a file handle
- typedef std::unique_ptr<osd_file> ptr;
-
- /// \brief Open a new file handle
- ///
- /// This function is called by core_fopen and several other places
- /// in the core to access files. These functions will construct
- /// paths by concatenating various search paths held in the
- /// options.c options database with partial paths specified by the
- /// core. The core assumes that the path separator is the first
- /// character of the string PATH_SEPARATOR, but does not interpret
- /// any path separators in the search paths, so if you use a
- /// different path separator in a search path, you may get a mixture
- /// of PATH_SEPARATORs (from the core) and alternate path separators
- /// (specified by users and placed into the options database).
- /// \param [in] path Path to the file to open.
- /// \param [in] openflags Combination of #OPEN_FLAG_READ,
- /// #OPEN_FLAG_WRITE, #OPEN_FLAG_CREATE and
- /// #OPEN_FLAG_CREATE_PATHS specifying the requested access mode
- /// and open behaviour.
- /// \param [out] file Receives the file handle if the operation
- /// succeeds. Not valid if the operation fails.
- /// \param [out] filesize Receives the size of the opened file if
- /// the operation succeeded. Not valid if the operation failed.
- /// Will be zero for stream-like objects (e.g. TCP sockets or
- /// named pipes).
- /// \return Result of the operation.
- static error open(std::string const &path, std::uint32_t openflags, ptr &file, std::uint64_t &filesize);
-
- /// \brief Create a new pseudo-terminal (PTY) pair
- ///
- /// \param [out] file Receives the handle of the master side of the
- /// pseudo-terminal if the operation succeeds. Not valid if the
- /// operation fails.
- /// \param [out] name Receives the name of the slave side of the
- /// pseudo-terminal if the operation succeeds. Not valid if the
- /// operation fails.
- /// \return Result of the operation.
- static error openpty(ptr &file, std::string &name);
-
- /// \brief Close an open file
- virtual ~osd_file() { }
-
- /// \brief Read from an open file
- ///
- /// Read data from an open file at specified offset. Note that the
- /// seek and read are not guaranteed to be atomic, which may cause
- /// issues in multi-threaded applications.
- /// \param [out] buffer Pointer to memory that will receive the data
- /// read.
- /// \param [in] offset Byte offset within the file to read at,
- /// relative to the start of the file. Ignored for stream-like
- /// objects (e.g. TCP sockets or named pipes).
- /// \param [in] length Number of bytes to read. Fewer bytes may be
- /// read if the end of file is reached, or if no data is
- /// available.
- /// \param [out] actual Receives the number of bytes read if the
- /// operation succeeds. Not valid if the operation fails.
- /// \return Result of the operation.
- virtual error read(void *buffer, std::uint64_t offset, std::uint32_t length, std::uint32_t &actual) = 0;
-
- /// \brief Write to an open file
- ///
- /// Write data to an open file at specified offset. Note that the
- /// seek and write are not guaranteed to be atomic, which may cause
- /// issues in multi-threaded applications.
- /// \param [in] buffer Pointer to memory containing data to write.
- /// \param [in] offset Byte offset within the file to write at,
- /// relative to the start of the file. Ignored for stream-like
- /// objects (e.g. TCP sockets or named pipes).
- /// \param [in] length Number of bytes to write.
- /// \param [out] actual Receives the number of bytes written if the
- /// operation succeeds. Not valid if the operation fails.
- /// \return Result of the operation.
- virtual error write(void const *buffer, std::uint64_t offset, std::uint32_t length, std::uint32_t &actual) = 0;
-
- /// \brief Change the size of an open file
- ///
- /// \param [in] offset Desired size of the file.
- /// \return Result of the operation.
- virtual error truncate(std::uint64_t offset) = 0;
-
- /// \brief Flush file buffers
- ///
- /// This flushes any data cached by the application, but does not
- /// guarantee that all prior writes have reached persistent storage.
- /// \return Result of the operation.
- virtual error flush() = 0;
-
- /// \brief Delete a file
- ///
- /// \param [in] filename Path to the file to delete.
- /// \return Result of the operation.
- static error remove(std::string const &filename);
-};
-
-
/// \brief Get environment variable value
///
/// \param [in] name Name of the environment variable as a
@@ -222,35 +40,6 @@ int osd_getpid();
/*-----------------------------------------------------------------------------
- osd_get_physical_drive_geometry: if the given path points to a physical
- drive, return the geometry of that drive
-
- Parameters:
-
- filename - pointer to a path which might describe a physical drive
-
- cylinders - pointer to a uint32_t to receive the number of cylinders
- of the physical drive
-
- heads - pointer to a uint32_t to receive the number of heads per
- cylinder of the physical drive
-
- sectors - pointer to a uint32_t to receive the number of sectors per
- cylinder of the physical drive
-
- bps - pointer to a uint32_t to receive the number of bytes per sector
- of the physical drive
-
- Return value:
-
- true if the filename points to a physical drive and if the values
- pointed to by cylinders, heads, sectors, and bps are valid; false in
- any other case
------------------------------------------------------------------------------*/
-bool osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps);
-
-
-/*-----------------------------------------------------------------------------
osd_uchar_from_osdchar: convert the given character or sequence of
characters from the OS-default encoding to a Unicode character
@@ -271,115 +60,6 @@ bool osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders,
int osd_uchar_from_osdchar(char32_t *uchar, const char *osdchar, size_t count);
-/*-----------------------------------------------------------------------------
- osd_is_valid_filename_char: is the given character legal for filenames?
-
- Parameters:
-
- uchar - the character to check
-
- Return value:
-
- Whether this character is legal in a filename
------------------------------------------------------------------------------*/
-
-bool osd_is_valid_filename_char(char32_t uchar);
-
-
-/*-----------------------------------------------------------------------------
- osd_is_valid_filepath_char: is the given character legal for paths?
-
- Parameters:
-
- uchar - the character to check
-
- Return value:
-
- Whether this character is legal in a file path
------------------------------------------------------------------------------*/
-
-bool osd_is_valid_filepath_char(char32_t uchar);
-
-
-/***************************************************************************
- DIRECTORY INTERFACES
-***************************************************************************/
-
-namespace osd
-{
- // directory is an opaque type which represents an open directory
- class directory
- {
- public:
- typedef std::unique_ptr<directory> ptr;
-
- // osd::directory::entry contains basic information about a file when iterating through
- // a directory
- class entry
- {
- public:
- enum class entry_type
- {
- NONE,
- FILE,
- DIR,
- OTHER
- };
-
- const char * name; // name of the entry
- entry_type type; // type of the entry
- std::uint64_t size; // size of the entry
- std::chrono::system_clock::time_point last_modified; // last modified time
- };
-
- // -----------------------------------------------------------------------------
- // osd::directory::open: open a directory for iteration
- //
- // Parameters:
- //
- // dirname - path to the directory in question
- //
- // Return value:
- //
- // upon success, this function should return an directory pointer
- // which contains opaque data necessary to traverse the directory; on
- // failure, this function should return nullptr
- // -----------------------------------------------------------------------------
- static ptr open(std::string const &dirname);
-
- // -----------------------------------------------------------------------------
- // osd::directory::~directory: close an open directory
- // -----------------------------------------------------------------------------
- virtual ~directory() { }
-
- // -----------------------------------------------------------------------------
- // osd::directory::read: return information about the next entry in the directory
- //
- // Return value:
- //
- // a constant pointer to an entry representing the current item
- // in the directory, or nullptr, indicating that no more entries are
- // present
- // -----------------------------------------------------------------------------
- virtual const entry *read() = 0;
- };
-};
-
-
-/*-----------------------------------------------------------------------------
- osd_is_absolute_path: returns whether the specified path is absolute
-
- Parameters:
-
- path - the path in question
-
- Return value:
-
- non-zero if the path is absolute, zero otherwise
------------------------------------------------------------------------------*/
-bool osd_is_absolute_path(const std::string &path);
-
-
/***************************************************************************
TIMING INTERFACES
@@ -701,45 +381,6 @@ std::string osd_get_clipboard_text();
/***************************************************************************
- DIRECTORY INTERFACES
-***************************************************************************/
-
-/*-----------------------------------------------------------------------------
- osd_stat: return a directory entry for a path
-
- Parameters:
-
- path - path in question
-
- Return value:
-
- an allocated pointer to an osd::directory::entry representing
- info on the path; even if the file does not exist.
-
------------------------------------------------------------------------------*/
-std::unique_ptr<osd::directory::entry> osd_stat(std::string const &path);
-
-/***************************************************************************
- PATH INTERFACES
-***************************************************************************/
-
-/*-----------------------------------------------------------------------------
- osd_get_full_path: retrieves the full path
-
- Parameters:
-
- path - the path in question
- dst - reference to receive new path
-
- Return value:
-
- file error
-
------------------------------------------------------------------------------*/
-osd_file::error osd_get_full_path(std::string &dst, std::string const &path);
-
-
-/***************************************************************************
MIDI I/O INTERFACES
***************************************************************************/
@@ -766,20 +407,6 @@ void osd_list_network_adapters();
***************************************************************************/
/*-----------------------------------------------------------------------------
- osd_get_volume_name: retrieves the volume name
-
- Parameters:
-
- idx - order number of volume
-
- Return value:
-
- pointer to volume name
-
------------------------------------------------------------------------------*/
-const char *osd_get_volume_name(int idx);
-
-/*-----------------------------------------------------------------------------
osd_subst_env: substitute environment variables with values
Parameters:
diff --git a/src/osd/osdfile.h b/src/osd/osdfile.h
new file mode 100644
index 00000000000..7ee384560b7
--- /dev/null
+++ b/src/osd/osdfile.h
@@ -0,0 +1,320 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/// \file
+/// \brief Core OS-dependent file interface
+///
+/// The prototypes in this file describe the interfaces that the MAME
+/// core and various tools rely on to interact with the outside world.
+/// They are broken out into several categories.
+
+#ifndef MAME_OSD_OSDFILE_H
+#define MAME_OSD_OSDFILE_H
+
+#pragma once
+
+#include <chrono>
+#include <cstdint>
+#include <memory>
+#include <string>
+
+
+/***************************************************************************
+ FILE I/O INTERFACES
+***************************************************************************/
+
+/* Make sure we have a path separator (default to /) */
+#ifndef PATH_SEPARATOR
+#if defined(_WIN32)
+#define PATH_SEPARATOR "\\"
+#else
+#define PATH_SEPARATOR "/"
+#endif
+#endif
+
+/// \defgroup openflags File open flags
+/// \{
+
+/// Open file for reading.
+constexpr uint32_t OPEN_FLAG_READ = 0x0001;
+
+/// Open file for writing.
+constexpr uint32_t OPEN_FLAG_WRITE = 0x0002;
+
+/// Create the file, or truncate it if it exists.
+constexpr uint32_t OPEN_FLAG_CREATE = 0x0004;
+
+/// Create non-existent directories in the path.
+constexpr uint32_t OPEN_FLAG_CREATE_PATHS = 0x0008;
+
+/// Do not decompress into memory on open.
+constexpr uint32_t OPEN_FLAG_NO_PRELOAD = 0x0010;
+
+/// \}
+
+
+/// \brief Interface to file-like resources
+///
+/// This interface is used to access file-like and stream-like
+/// resources. Examples include plain files, TCP socket, named pipes,
+/// pseudo-terminals, and compressed archive members.
+class osd_file
+{
+public:
+ /// \brief Result of a file operation
+ ///
+ /// Returned by most members of osd_file, and also used by other
+ /// classes that access files or other file-like resources.
+ enum class error
+ {
+ /// Operation completed successfully.
+ NONE,
+
+ /// Operation failed, but there is no more specific code to
+ /// describe the failure.
+ FAILURE,
+
+ /// Operation failed due to an error allocating memory.
+ OUT_OF_MEMORY,
+
+ /// The requested file, path or resource was not found.
+ NOT_FOUND,
+
+ /// Current permissions do not allow the requested access.
+ ACCESS_DENIED,
+
+ /// Requested access is not permitted because the file or
+ /// resource is currently open for exclusive access.
+ ALREADY_OPEN,
+
+ /// Request cannot be completed due to resource exhaustion
+ /// (maximum number of open files or other objects has been
+ /// reached).
+ TOO_MANY_FILES,
+
+ /// The request cannot be completed because invalid data was
+ /// encountered (for example an inconsistent filesystem, or a
+ /// corrupt archive file).
+ INVALID_DATA,
+
+ /// The requested access mode is invalid, or not appropriate for
+ /// the file or resource.
+ INVALID_ACCESS
+ };
+
+ /// \brief Smart pointer to a file handle
+ typedef std::unique_ptr<osd_file> ptr;
+
+ /// \brief Open a new file handle
+ ///
+ /// This function is called by core_fopen and several other places
+ /// in the core to access files. These functions will construct
+ /// paths by concatenating various search paths held in the
+ /// options.c options database with partial paths specified by the
+ /// core. The core assumes that the path separator is the first
+ /// character of the string PATH_SEPARATOR, but does not interpret
+ /// any path separators in the search paths, so if you use a
+ /// different path separator in a search path, you may get a mixture
+ /// of PATH_SEPARATORs (from the core) and alternate path separators
+ /// (specified by users and placed into the options database).
+ /// \param [in] path Path to the file to open.
+ /// \param [in] openflags Combination of #OPEN_FLAG_READ,
+ /// #OPEN_FLAG_WRITE, #OPEN_FLAG_CREATE and
+ /// #OPEN_FLAG_CREATE_PATHS specifying the requested access mode
+ /// and open behaviour.
+ /// \param [out] file Receives the file handle if the operation
+ /// succeeds. Not valid if the operation fails.
+ /// \param [out] filesize Receives the size of the opened file if
+ /// the operation succeeded. Not valid if the operation failed.
+ /// Will be zero for stream-like objects (e.g. TCP sockets or
+ /// named pipes).
+ /// \return Result of the operation.
+ static error open(std::string const &path, std::uint32_t openflags, ptr &file, std::uint64_t &filesize);
+
+ /// \brief Create a new pseudo-terminal (PTY) pair
+ ///
+ /// \param [out] file Receives the handle of the master side of the
+ /// pseudo-terminal if the operation succeeds. Not valid if the
+ /// operation fails.
+ /// \param [out] name Receives the name of the slave side of the
+ /// pseudo-terminal if the operation succeeds. Not valid if the
+ /// operation fails.
+ /// \return Result of the operation.
+ static error openpty(ptr &file, std::string &name);
+
+ /// \brief Close an open file
+ virtual ~osd_file() { }
+
+ /// \brief Read from an open file
+ ///
+ /// Read data from an open file at specified offset. Note that the
+ /// seek and read are not guaranteed to be atomic, which may cause
+ /// issues in multi-threaded applications.
+ /// \param [out] buffer Pointer to memory that will receive the data
+ /// read.
+ /// \param [in] offset Byte offset within the file to read at,
+ /// relative to the start of the file. Ignored for stream-like
+ /// objects (e.g. TCP sockets or named pipes).
+ /// \param [in] length Number of bytes to read. Fewer bytes may be
+ /// read if the end of file is reached, or if no data is
+ /// available.
+ /// \param [out] actual Receives the number of bytes read if the
+ /// operation succeeds. Not valid if the operation fails.
+ /// \return Result of the operation.
+ virtual error read(void *buffer, std::uint64_t offset, std::uint32_t length, std::uint32_t &actual) = 0;
+
+ /// \brief Write to an open file
+ ///
+ /// Write data to an open file at specified offset. Note that the
+ /// seek and write are not guaranteed to be atomic, which may cause
+ /// issues in multi-threaded applications.
+ /// \param [in] buffer Pointer to memory containing data to write.
+ /// \param [in] offset Byte offset within the file to write at,
+ /// relative to the start of the file. Ignored for stream-like
+ /// objects (e.g. TCP sockets or named pipes).
+ /// \param [in] length Number of bytes to write.
+ /// \param [out] actual Receives the number of bytes written if the
+ /// operation succeeds. Not valid if the operation fails.
+ /// \return Result of the operation.
+ virtual error write(void const *buffer, std::uint64_t offset, std::uint32_t length, std::uint32_t &actual) = 0;
+
+ /// \brief Change the size of an open file
+ ///
+ /// \param [in] offset Desired size of the file.
+ /// \return Result of the operation.
+ virtual error truncate(std::uint64_t offset) = 0;
+
+ /// \brief Flush file buffers
+ ///
+ /// This flushes any data cached by the application, but does not
+ /// guarantee that all prior writes have reached persistent storage.
+ /// \return Result of the operation.
+ virtual error flush() = 0;
+
+ /// \brief Delete a file
+ ///
+ /// \param [in] filename Path to the file to delete.
+ /// \return Result of the operation.
+ static error remove(std::string const &filename);
+};
+
+
+/// \brief Describe geometry of physical drive
+///
+/// If the given path points to a physical drive, return the geometry of
+/// that drive.
+///
+/// \param [in] filename Pointer to a path which might describe a
+/// physical drive.
+/// \param [out] cylinders Pointer to a uint32_t to receive the number of
+/// cylinders of the physical drive.
+/// \param [out] heads Pointer to a uint32_t to receive the number of
+/// heads per cylinder of the physical drive.
+/// \param [out] sectors Pointer to a uint32_t to receive the number of
+/// sectors per cylinder of the physical drive.
+/// \param [out] bps Pointer to a uint32_t to receive the number of
+/// bytes per sector of the physical drive.
+/// \return true if the filename points to a physical drive and if the
+/// values pointed to by cylinders, heads, sectors, and bps are valid;
+/// false in any other case
+bool osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps);
+
+
+/// \brief Is the given character legal for filenames?
+///
+/// \param [in] uchar The character to check.
+/// \return Whether this character is legal in a filename.
+bool osd_is_valid_filename_char(char32_t uchar);
+
+
+/// \brief Is the given character legal for paths?
+///
+/// \param [in] uchar The character to check.
+/// \return Whether this character is legal in a file path.
+bool osd_is_valid_filepath_char(char32_t uchar);
+
+
+/***************************************************************************
+ DIRECTORY INTERFACES
+***************************************************************************/
+
+namespace osd
+{
+ // directory is an opaque type which represents an open directory
+ class directory
+ {
+ public:
+ typedef std::unique_ptr<directory> ptr;
+
+ // osd::directory::entry contains basic information about a file when iterating through
+ // a directory
+ class entry
+ {
+ public:
+ enum class entry_type
+ {
+ NONE,
+ FILE,
+ DIR,
+ OTHER
+ };
+
+ const char * name; // name of the entry
+ entry_type type; // type of the entry
+ std::uint64_t size; // size of the entry
+ std::chrono::system_clock::time_point last_modified; // last modified time
+ };
+
+ /// \brief Open a directory for iteration.
+ ///
+ /// \param [in] dirname Path to the directory in question.
+ /// \return Upon success, a directory pointer which contains opaque
+ /// data necessary to traverse the directory; on failure, nullptr.
+ static ptr open(std::string const &dirname);
+
+ /// \brief Close an open directory.
+ virtual ~directory() { }
+
+ /// \brief Return information about the next entry in the directory.
+ ///
+ /// \return A constant pointer to an entry representing the current
+ /// item in the directory, or nullptr, indicating that no more
+ /// entries are present.
+ virtual const entry *read() = 0;
+ };
+};
+
+
+/// \brief Return a directory entry for a path.
+///
+/// \param [in] path The path in question.
+/// \return An allocated pointer to an osd::directory::entry representing
+/// info on the path; even if the file does not exist.
+std::unique_ptr<osd::directory::entry> osd_stat(std::string const &path);
+
+
+/***************************************************************************
+ PATH INTERFACES
+***************************************************************************/
+
+/// \brief Returns whether the specified path is absolute.
+///
+/// \param [in] path The path in question.
+/// \return true if the path is absolute, false otherwise.
+bool osd_is_absolute_path(const std::string &path);
+
+
+/// \brief Retrieves the full path.
+/// \param [in] path The path in question.
+/// \param [out] dst Reference to receive new path.
+/// \return File error.
+osd_file::error osd_get_full_path(std::string &dst, std::string const &path);
+
+
+/// \brief Retrieves the volume name.
+///
+/// \param [in] idx Order number of volume.
+/// \return Pointer to volume name.
+const char *osd_get_volume_name(int idx);
+
+
+#endif // MAME_OSD_OSDFILE_H
diff --git a/src/osd/windows/winutil.h b/src/osd/windows/winutil.h
index 57470bf1372..4e0eac0d27a 100644
--- a/src/osd/windows/winutil.h
+++ b/src/osd/windows/winutil.h
@@ -9,7 +9,7 @@
#ifndef __WINUTIL__
#define __WINUTIL__
-#include "osdcore.h"
+#include "osdfile.h"
#include <string>
#include <vector>
#include <chrono>
diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp
index 516e2f5b057..6bd15339b62 100644
--- a/src/tools/chdman.cpp
+++ b/src/tools/chdman.cpp
@@ -7,9 +7,6 @@
****************************************************************************/
#include <stdio.h> // must be stdio.h and here otherwise issues with I64FMT in MINGW
-// osd
-#include "osdcore.h"
-
// lib/util
#include "avhuff.h"
#include "aviio.h"
@@ -18,6 +15,7 @@
#include "corefile.h"
#include "hashing.h"
#include "md5.h"
+#include "strformat.h"
#include "vbiparse.h"
#include <cassert>
@@ -33,6 +31,8 @@
#include <new>
#include <unordered_map>
+using util::string_format;
+
//**************************************************************************
diff --git a/src/tools/floptool.cpp b/src/tools/floptool.cpp
index 364e74af68b..2a33a92a979 100644
--- a/src/tools/floptool.cpp
+++ b/src/tools/floptool.cpp
@@ -19,6 +19,7 @@
#include <cassert>
#include "corestr.h"
+#include "osdcomm.h"
#include "formats/mfi_dsk.h"
#include "formats/dfi_dsk.h"
diff --git a/src/tools/imgtool/charconv.h b/src/tools/imgtool/charconv.h
index 14a2befa233..7df16f8a615 100644
--- a/src/tools/imgtool/charconv.h
+++ b/src/tools/imgtool/charconv.h
@@ -14,6 +14,10 @@
#include "unicode.h"
+#include <sstream>
+#include <utility>
+#include <vector>
+
namespace imgtool
{
// ======================> charconverter
diff --git a/src/tools/imgtool/imghd.cpp b/src/tools/imgtool/imghd.cpp
index b868b692c63..45ac262a9ba 100644
--- a/src/tools/imgtool/imghd.cpp
+++ b/src/tools/imgtool/imghd.cpp
@@ -81,7 +81,7 @@ imgtoolerr_t imghd_create(imgtool::stream &stream, uint32_t hunksize, uint32_t c
}
/* write the metadata */
- const std::string metadata = string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, seclen);
+ const std::string metadata = util::string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, seclen);
err = (imgtoolerr_t)chd.write_metadata(HARD_DISK_METADATA_TAG, 0, metadata);
if (rc != CHDERR_NONE)
{
diff --git a/src/tools/imgtool/imgtool.h b/src/tools/imgtool/imgtool.h
index a2e9e732172..ca8d19aed85 100644
--- a/src/tools/imgtool/imgtool.h
+++ b/src/tools/imgtool/imgtool.h
@@ -21,6 +21,7 @@
#include "opresolv.h"
#include "library.h"
#include "filter.h"
+#include "osdcomm.h"
/* ----------------------------------------------------------------------- */
diff --git a/src/tools/imgtool/main.cpp b/src/tools/imgtool/main.cpp
index 55f37284d3c..e0ff03cca62 100644
--- a/src/tools/imgtool/main.cpp
+++ b/src/tools/imgtool/main.cpp
@@ -248,7 +248,7 @@ static int cmd_dir(const struct command *c, int argc, char *argv[])
{
std::string filesize_string = ent.directory
? "<DIR>"
- : string_format("%u", (unsigned int) ent.filesize);
+ : util::string_format("%u", (unsigned int) ent.filesize);
if (!ent.lastmodified_time.empty())
{
@@ -748,7 +748,7 @@ static void listoptions(const util::option_guide &opt_guide, const char *opt_spe
const util::option_resolution::entry &entry = *iter;
std::stringstream description_buffer;
- std::string opt_name = string_format("--%s", entry.identifier());
+ std::string opt_name = util::string_format("--%s", entry.identifier());
const char *opt_desc = entry.display_name();
// is this option relevant?
diff --git a/src/tools/imgtool/stream.cpp b/src/tools/imgtool/stream.cpp
index 9f6cba27353..da4cf87f8eb 100644
--- a/src/tools/imgtool/stream.cpp
+++ b/src/tools/imgtool/stream.cpp
@@ -13,7 +13,6 @@
#include <zlib.h>
#include "unzip.h"
-#include "osdcore.h"
#include "imgtool.h"
diff --git a/src/tools/imgtool/stream.h b/src/tools/imgtool/stream.h
index 2b7afbacd5e..73d0dcb494d 100644
--- a/src/tools/imgtool/stream.h
+++ b/src/tools/imgtool/stream.h
@@ -13,6 +13,7 @@
#include "imgterrs.h"
#include "corefile.h"
+#include "osdcomm.h"
namespace imgtool
{
diff --git a/src/tools/jedutil.cpp b/src/tools/jedutil.cpp
index 3f4700e22cd..0c27c1b4480 100644
--- a/src/tools/jedutil.cpp
+++ b/src/tools/jedutil.cpp
@@ -145,6 +145,7 @@
#include "corestr.h"
#include "jedparse.h"
+#include "osdcomm.h"
#include "plaparse.h"
diff --git a/src/tools/pngcmp.cpp b/src/tools/pngcmp.cpp
index 714700a3824..43fc9324a06 100644
--- a/src/tools/pngcmp.cpp
+++ b/src/tools/pngcmp.cpp
@@ -13,7 +13,7 @@
#include <cstring>
#include <cctype>
#include <cassert>
-#include "osdcore.h"
+#include "osdfile.h"
#include "png.h"
#include <new>
diff --git a/src/tools/regrep.cpp b/src/tools/regrep.cpp
index 49637c2eb16..304e195fa10 100644
--- a/src/tools/regrep.cpp
+++ b/src/tools/regrep.cpp
@@ -12,9 +12,13 @@
#include <cctype>
#include <new>
#include <cassert>
-#include "osdcore.h"
+#include "corefile.h"
+#include "corestr.h"
+#include "osdcomm.h"
#include "png.h"
+using util::string_format;
+
/***************************************************************************
CONSTANTS & DEFINES
diff --git a/src/tools/romcmp.cpp b/src/tools/romcmp.cpp
index 95db9a5c200..4862f74a769 100644
--- a/src/tools/romcmp.cpp
+++ b/src/tools/romcmp.cpp
@@ -9,7 +9,7 @@
***************************************************************************/
#include "unzip.h"
-#include "osdcore.h"
+#include "osdfile.h"
#include "osdcomm.h"
#include "hash.h"
diff --git a/src/tools/split.cpp b/src/tools/split.cpp
index 1748edf7625..c3f4489f225 100644
--- a/src/tools/split.cpp
+++ b/src/tools/split.cpp
@@ -149,7 +149,7 @@ static int split_file(const char *filename, const char *basename, uint32_t split
splitfile->printf("hash=%s file=%s.%03d\n", computedhash.c_str(), basefilename.c_str(), partnum);
// compute the full filename for this guy
- outfilename = string_format("%s.%03d", basename, partnum);
+ outfilename = util::string_format("%s.%03d", basename, partnum);
// create it
filerr = util::core_file::open(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, outfile);
diff --git a/src/tools/srcclean.cpp b/src/tools/srcclean.cpp
index 2cf5bf36519..055cce35784 100644
--- a/src/tools/srcclean.cpp
+++ b/src/tools/srcclean.cpp
@@ -51,7 +51,7 @@
#include "corefile.h"
#include "corestr.h"
-#include "osdcore.h"
+#include "osdcomm.h"
#include "strformat.h"
#include <algorithm>
diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp
index 58f730b1c39..81232078454 100644
--- a/src/tools/unidasm.cpp
+++ b/src/tools/unidasm.cpp
@@ -9,6 +9,7 @@
****************************************************************************/
// the disassemblers assume they're in MAME and emu.h is a PCH, so we minimally pander to them
+#include "coretmpl.h"
#include "disasmintf.h"
using offs_t = osd::u32;