1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-06-15 23:35:50 +00:00
Files
gnulib/lib/wctrans-impl.h
Bruno Haible 52c4f309aa New module 'wctrans'.
* modules/wctrans: New file.
* lib/wctype.in.h (wctrans): New declaration.
* lib/wctrans.c: New file.
* lib/wctrans-impl.h: New file.
* m4/wctrans.m4: New file.
* m4/wctype_h.m4 (gl_WCTYPE_H): Test whether wctrans is declared.
(gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_WCTRANS.
* modules/wctype-h (Makefile.am): Substitute GNULIB_WCTRANS.
* tests/test-wctype-h-c++.cc: Test the declaration of wctrans.
* doc/posix-functions/wctrans.texi: Mention the new module.
2011-02-09 20:54:32 +01:00

38 lines
1.2 KiB
C

/* Get descriptor for a wide character case conversion.
Copyright (C) 2011 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2011.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
wctrans_t
wctrans (const char *name)
{
if (name[0] == 't'
&& name[1] == 'o')
switch (name[2])
{
case 'l':
if (strcmp (name + 3, "ower") == 0)
return (wctrans_t) towlower;
break;
case 'u':
if (strcmp (name + 3, "pper") == 0)
return (wctrans_t) towupper;
break;
default:
break;
}
return NULL;
}