mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:06:04 +00:00
[UCRT] Import Microsoft.Windows.SDK.CRTSource version 10.0.22621.3
Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
This commit is contained in:
parent
f1b60c66f0
commit
04e0dc4a7a
568 changed files with 115483 additions and 0 deletions
52
sdk/lib/ucrt/convert/wctrans.cpp
Normal file
52
sdk/lib/ucrt/convert/wctrans.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// wctrans.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Implementations of the towctrans and wctrans functions.
|
||||
//
|
||||
#include <corecrt.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <wctype.h>
|
||||
|
||||
#pragma warning(disable:4244)
|
||||
|
||||
|
||||
|
||||
typedef wchar_t wctrans_t;
|
||||
|
||||
static struct wctab
|
||||
{
|
||||
char const* s;
|
||||
wctype_t value;
|
||||
}
|
||||
const tab[] =
|
||||
{
|
||||
{ "tolower", 2 },
|
||||
{ "toupper", 1 },
|
||||
{ nullptr, 0 }
|
||||
};
|
||||
|
||||
|
||||
|
||||
extern "C" wint_t __cdecl towctrans(wint_t const c, wctrans_t const value)
|
||||
{
|
||||
return value == 1 ? towupper(c) : towlower(c);
|
||||
}
|
||||
|
||||
extern "C" wctrans_t __cdecl wctrans(char const* const name)
|
||||
{
|
||||
for (unsigned n = 0; tab[n].s != 0; ++n)
|
||||
{
|
||||
if (strcmp(tab[n].s, name) == 0)
|
||||
return tab[n].value;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992-2007 by P.J. Plauger. ALL RIGHTS RESERVED.
|
||||
* Consult your license regarding permissions and restrictions.
|
||||
V5.03:0009 */
|
Loading…
Add table
Add a link
Reference in a new issue