X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fwctype%2Fwctrans.c;fp=functions%2Fwctype%2Fwctrans.c;h=31f36be311acfcffb62a46692623873d5b33ea33;hb=6e6c4e6b52f2516e4bb6b9f37c1e2e18cb7448b5;hp=0000000000000000000000000000000000000000;hpb=75bf0c22663cec60d8164c8cf77e855a8b6ad459;p=pdclib 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