Files
2ine-tms34010/native/nls.c
T
Ryan C. Gordon b4d0e571e7 Implemented some file i/o APIs and stubbed some threading primitives.
Now EMX's build of cpp.exe (GNU's C preprocessor) runs on Linux...granted,
it picks up the Linux /usr/include headers, but this is still a triumph!
2016-10-09 13:45:58 -04:00

36 lines
1002 B
C

#include "os2native.h"
#include "nls.h"
APIRET DosQueryDBCSEnv(ULONG buflen, PCOUNTRYCODE pcc, PCHAR buf)
{
// !!! FIXME: implement this for real.
TRACE_NATIVE("DosQueryDBCSEnv(%u, %p, %p)", (uint) buflen, pcc, buf);
if ((pcc->country != 0) || (pcc->codepage != 0))
return ERROR_CODE_PAGE_NOT_FOUND;
memset(buf, '\0', buflen);
return NO_ERROR;
} // DosQueryDBCSEnv
APIRET DosMapCase(ULONG cb, PCOUNTRYCODE pcc, PCHAR pch)
{
// !!! FIXME: implement this for real.
TRACE_NATIVE("DosMapCase(%u, %p, %p)", (uint) cb, pcc, pch);
if ((pcc->country != 0) || (pcc->codepage != 0))
return ERROR_CODE_PAGE_NOT_FOUND;
for (ULONG i = 0; i < cb; i++) {
const CHAR ch = *pch;
*(pch++) = ((ch >= 'A') && (ch <= 'Z')) ? ch - ('A' - 'a') : ch;
} // for
return NO_ERROR;
} // DosMapCase
LX_NATIVE_MODULE_INIT()
LX_NATIVE_EXPORT(DosQueryDBCSEnv, 6),
LX_NATIVE_EXPORT(DosMapCase, 7)
LX_NATIVE_MODULE_INIT_END()
// end of nls.c ...