3 /* strcoll( const char *, const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 #include <_PDCLIB_locale.h>
15 int strcoll( const char * s1, const char * s2 )
17 const _PDCLIB_ctype_t * ctype = _PDCLIB_threadlocale()->_CType;
19 while ( ( *s1 ) && ( ctype[(unsigned char)*s1].collation == ctype[(unsigned char)*s2].collation ) )
24 return ( ctype[(unsigned char)*s1].collation == ctype[(unsigned char)*s2].collation );
30 #include <_PDCLIB_test.h>
34 char cmpabcde[] = "abcde";
36 TESTCASE( strcmp( abcde, cmpabcde ) == 0 );
37 TESTCASE( strcmp( abcde, abcdx ) < 0 );
38 TESTCASE( strcmp( abcdx, abcde ) > 0 );
39 TESTCASE( strcmp( empty, abcde ) < 0 );
40 TESTCASE( strcmp( abcde, empty ) > 0 );