- definitions of helper functions not specified by the standard (hidden in the
_PDCLIB_* namespace);
-- definitions of data objects, both internal (like digits.c) and specified by
- the standard (errno.c);
+- definitions of data objects, both internal (like _PDCLIB_digits) and specified by
+ the standard (_PDCLIB_errno);
- test drivers for functionality that does not have its own implementation
- file to put the test driver in.
+ file to put the test driver in (stdarg).
int strcoll( const char * s1, const char * s2 )
{
- while ( ( *s1 ) && ( _PDCLIB_lconv.ctype[(unsigned char)*s1].collation == _PDCLIB_lconv.ctype[(unsigned char)*s2].collation ) )
+ const _PDCLIB_ctype_t * ctype = _PDCLIB_lconv.ctype;
+
+ while ( ( *s1 ) && ( ctype[(unsigned char)*s1].collation == ctype[(unsigned char)*s2].collation ) )
{
++s1;
++s2;
}
- return ( _PDCLIB_lconv.ctype[(unsigned char)*s1].collation == _PDCLIB_lconv.ctype[(unsigned char)*s2].collation );
+ return ( ctype[(unsigned char)*s1].collation == ctype[(unsigned char)*s2].collation );
}
#endif
size_t strxfrm( char * _PDCLIB_restrict s1, const char * _PDCLIB_restrict s2, size_t n )
{
+ const _PDCLIB_ctype_t * ctype = _PDCLIB_lconv.ctype;
size_t len = strlen( s2 );
if ( len < n )
{
/* Cannot use strncpy() here as the filling of s1 with '\0' is not part
of the spec.
*/
- while ( n-- && ( *s1++ = _PDCLIB_lconv.ctype[(unsigned char)*s2++].collation ) );
+ while ( n-- && ( *s1++ = ctype[(unsigned char)*s2++].collation ) );
}
return len;
}