X-Git-Url: https://pd.if.org/git/?p=pdclib.old;a=blobdiff_plain;f=functions%2Fwctype%2Fwctrans.c;fp=functions%2Fwctype%2Fwctrans.c;h=31f36be311acfcffb62a46692623873d5b33ea33;hp=0000000000000000000000000000000000000000;hb=24f274eec4d6ac3868f3fdf03d2e1876c80be616;hpb=b641165a0d122178a33070e3434ab7b49397ad94 diff --git a/functions/wctype/wctrans.c b/functions/wctype/wctrans.c new file mode 100644 index 0000000..31f36be --- /dev/null +++ b/functions/wctype/wctrans.c @@ -0,0 +1,38 @@ +/* wctrans( const char * ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include +#ifndef REGTEST +#include +#include <_PDCLIB_locale.h> + +wctrans_t wctrans( const char * property ) +{ + if(!property) { + return 0; + } else if(strcmp(property, "tolower") == 0) { + return _PDCLIB_WCTRANS_TOLOWER; + } else if(strcmp(property, "toupper") == 0) { + return _PDCLIB_WCTRANS_TOUPPER; + } else { + return 0; + } +} + +#endif + +#ifdef TEST +#include <_PDCLIB_test.h> + +int main( void ) +{ + TESTCASE(wctrans("") == 0); + TESTCASE(wctrans("invalid") == 0); + TESTCASE(wctrans("toupper") != 0); + TESTCASE(wctrans("tolower") != 0); + return TEST_RESULTS; +} +#endif