*
* String functions for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2011 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
void
_cups_strcpy(char *dst, /* I - Destination string */
- const char *src) /* I - Source string */
+ const char *src) /* I - Source string */
{
while (*src)
*dst++ = *src++;
* '_cups_strcasecmp()' - Do a case-insensitive comparison.
*/
-#ifndef HAVE_STRCASECMP
int /* O - Result of comparison (-1, 0, or 1) */
_cups_strcasecmp(const char *s, /* I - First string */
- const char *t) /* I - Second string */
+ const char *t) /* I - Second string */
{
while (*s != '\0' && *t != '\0')
{
- if (tolower(*s & 255) < tolower(*t & 255))
+ if (_cups_tolower(*s) < _cups_tolower(*t))
return (-1);
- else if (tolower(*s & 255) > tolower(*t & 255))
+ else if (_cups_tolower(*s) > _cups_tolower(*t))
return (1);
s ++;
else
return (-1);
}
-#endif /* !HAVE_STRCASECMP */
/*
* '_cups_strncasecmp()' - Do a case-insensitive comparison on up to N chars.
*/
-#ifndef HAVE_STRNCASECMP
int /* O - Result of comparison (-1, 0, or 1) */
_cups_strncasecmp(const char *s, /* I - First string */
const char *t, /* I - Second string */
{
while (*s != '\0' && *t != '\0' && n > 0)
{
- if (tolower(*s & 255) < tolower(*t & 255))
+ if (_cups_tolower(*s) < _cups_tolower(*t))
return (-1);
- else if (tolower(*s & 255) > tolower(*t & 255))
+ else if (_cups_tolower(*s) > _cups_tolower(*t))
return (1);
s ++;
else
return (-1);
}
-#endif /* !HAVE_STRNCASECMP */
#ifndef HAVE_STRLCAT