#ifndef REGTEST
#include <_PDCLIB_io.h>
#include <_PDCLIB_locale.h>
+#include <_PDCLIB_clocale.h>
#include <threads.h>
/* In a POSIX system, stdin / stdout / stderr are equivalent to the (int) file
FILE * stderr = &_PDCLIB_serr;
tss_t _PDCLIB_locale_tss;
-/* Todo: Better solution than this! */
-__attribute__((constructor)) void init_stdio(void)
-{
- tss_create(&_PDCLIB_locale_tss, (tss_dtor_t) freelocale);
- mtx_init(&stdin->lock, mtx_recursive);
- mtx_init(&stdout->lock, mtx_recursive);
- mtx_init(&stderr->lock, mtx_recursive);
-}
/* FIXME: This approach is a possible attack vector. */
FILE * _PDCLIB_filelist = &_PDCLIB_sin;
1 kByte (+ 4 byte) of <ctype.h> data.
Each line: flags, lowercase, uppercase, collation.
*/
-static
-_PDCLIB_ctype_t global_ctype[] = {
+static const _PDCLIB_ctype_t global_ctype[] = {
{ /* EOF */ 0, 0, 0, 0 },
{ /* NUL */ _PDCLIB_CTYPE_CNTRL, 0x00, 0x00, 0x00 },
{ /* SOH */ _PDCLIB_CTYPE_CNTRL, 0x01, 0x01, 0x01 },
{ 0x00, 0xFF, 0xFF, 0xFF }
};
-extern struct _PDCLIB_charcodec _PDCLIB_ascii_codec;
+extern const struct _PDCLIB_charcodec _PDCLIB_ascii_codec;
struct _PDCLIB_locale _PDCLIB_global_locale = {
._Codec = &_PDCLIB_ascii_codec,
._Conv = {
},
};
+/* Todo: Better solution than this! */
+__attribute__((constructor)) void init_stdio(void)
+{
+ _PDCLIB_initclocale( &_PDCLIB_global_locale );
+ tss_create(&_PDCLIB_locale_tss, (tss_dtor_t) freelocale);
+ mtx_init(&stdin->lock, mtx_recursive);
+ mtx_init(&stdout->lock, mtx_recursive);
+ mtx_init(&stderr->lock, mtx_recursive);
+}
+
#endif
#ifdef TEST