[API break] Make date/boolean formats thread safe

Store the preferred date and boolean formats in the MdbHandle rather
than in global memory.
This commit is contained in:
Evan Miller
2020-08-19 21:26:06 -04:00
parent 7b51824c89
commit 5d078838ed
4 changed files with 41 additions and 35 deletions

View File

@@ -179,6 +179,8 @@ MdbHandle *mdb_open(const char *filename, MdbFileFlags flags)
mdb = (MdbHandle *) g_malloc0(sizeof(MdbHandle));
mdb_set_default_backend(mdb, "access");
mdb_set_date_fmt(mdb, "%x %X");
mdb_set_boolean_fmt_numbers(mdb);
#ifdef HAVE_ICONV
mdb->iconv_in = (iconv_t)-1;
mdb->iconv_out = (iconv_t)-1;