From 09eff7243a6e8e37d9615df7b951ffa3c03c0ae2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 19 Jan 2022 16:08:29 +0100 Subject: Fixing and upgrading Fl_Preferences (#374) * Added filename function to Fl_Preferences Static function to get filename before opening. Member to get filename after opening. Bug fixes for memory mapped preferences. * ERROR is a macro on Windows, don't use it * Added Fl_Preferences::dirty(). User can now check if the database will be written when flushed or destroyed. Flush returns a crude error code. * Fl_Preferences::get binary data returns # of bytes read. * Verified group deletion code * Fl_Preferences ignores locale. This will make .prefs files interchangeable between different computers. * Updating the Preferences Mode to ignore locale. * Fixes in docs. --- src/Fl_System_Driver.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Fl_System_Driver.cxx') diff --git a/src/Fl_System_Driver.cxx b/src/Fl_System_Driver.cxx index 71a60c034..75bbf3ef9 100644 --- a/src/Fl_System_Driver.cxx +++ b/src/Fl_System_Driver.cxx @@ -404,6 +404,14 @@ int Fl_System_Driver::clocale_printf(FILE *output, const char *format, va_list a return vfprintf(output, format, args); } +int Fl_System_Driver::clocale_snprintf(char *output, size_t output_size, const char *format, va_list args) { + return vsnprintf(output, output_size, format, args); +} + +int Fl_System_Driver::clocale_sscanf(const char *input, const char *format, va_list args) { + return vsscanf(input, format, args); +} + int Fl_System_Driver::filename_expand(char *to,int tolen, const char *from) { char *temp = new char[tolen]; strlcpy(temp,from, tolen); -- cgit v1.2.3