summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/fileio.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2016-03-01 07:38:14 +1100
committer Vas Crabb <vas@vastheman.com>2016-03-01 07:38:14 +1100
commitba960afb5f3464df2a6e8588e8b59739fbc08535 (patch)
tree3f3af833f5eac2be2fece1285ebf5584a130bdd7 /src/emu/fileio.cpp
parenta830ea76270b7894a03922a172d58bfaefbc827f (diff)
Add function for flushing file buffers
Diffstat (limited to 'src/emu/fileio.cpp')
-rw-r--r--src/emu/fileio.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/emu/fileio.cpp b/src/emu/fileio.cpp
index 0de5e021800..d13e162f990 100644
--- a/src/emu/fileio.cpp
+++ b/src/emu/fileio.cpp
@@ -626,6 +626,17 @@ int emu_file::puts(const char *s)
//-------------------------------------------------
+// vfprintf - vfprintf to a text file
+//-------------------------------------------------
+
+int emu_file::vprintf(const char *fmt, va_list va)
+{
+ // write the data if we can
+ return (m_file != nullptr) ? core_vfprintf(m_file, fmt, va) : 0;
+}
+
+
+//-------------------------------------------------
// printf - vfprintf to a text file
//-------------------------------------------------
@@ -641,13 +652,14 @@ int CLIB_DECL emu_file::printf(const char *fmt, ...)
//-------------------------------------------------
-// mame_vfprintf - vfprintf to a text file
+// flush - flush file buffers
//-------------------------------------------------
-int emu_file::vprintf(const char *fmt, va_list va)
+void emu_file::flush()
{
- // write the data if we can
- return (m_file != nullptr) ? core_vfprintf(m_file, fmt, va) : 0;
+ // flush the buffers if we can
+ if (m_file != nullptr)
+ core_fflush(m_file);
}