diff options
Diffstat (limited to 'compat/strncasecmp.c')
| -rw-r--r-- | compat/strncasecmp.c | 50 | 
1 files changed, 22 insertions, 28 deletions
| diff --git a/compat/strncasecmp.c b/compat/strncasecmp.c index ca2bf91..0a69f35 100644 --- a/compat/strncasecmp.c +++ b/compat/strncasecmp.c @@ -1,4 +1,4 @@ -/*  +/*   * strncasecmp.c --   *   *	Source code for the "strncasecmp" library routine. @@ -6,21 +6,19 @@   * Copyright (c) 1988-1993 The Regents of the University of California.   * Copyright (c) 1995-1996 Sun Microsystems, Inc.   * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: strncasecmp.c,v 1.2 1998/09/14 18:39:45 stanton Exp $ + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES.   */  #include "tclPort.h"  /* - * This array is designed for mapping upper and lower case letter - * together for a case independent comparison.  The mappings are - * based upon ASCII character sequences. + * This array is designed for mapping upper and lower case letter together for + * a case independent comparison. The mappings are based upon ASCII character + * sequences.   */ -static unsigned char charmap[] = { +static const unsigned char charmap[] = {      0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,      0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,      0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, @@ -56,14 +54,11 @@ static unsigned char charmap[] = {  };  /* - * Here are the prototypes just in case they are not included - * in tclPort.h. + * Here are the prototypes just in case they are not included in tclPort.h.   */ -int		strncasecmp _ANSI_ARGS_((CONST char *s1, -			    CONST char *s2, size_t n)); -int		strcasecmp _ANSI_ARGS_((CONST char *s1, -			    CONST char *s2)); +int		strncasecmp(const char *s1, const char *s2, size_t n); +int		strcasecmp(const char *s1, const char *s2);  /*   *---------------------------------------------------------------------- @@ -73,9 +68,8 @@ int		strcasecmp _ANSI_ARGS_((CONST char *s1,   *	Compares two strings, ignoring case differences.   *   * Results: - *	Compares two null-terminated strings s1 and s2, returning -1, 0, - *	or 1 if s1 is lexicographically less than, equal to, or greater - *	than s2. + *	Compares two null-terminated strings s1 and s2, returning -1, 0, or 1 + *	if s1 is lexicographically less than, equal to, or greater than s2.   *   * Side effects:   *	None. @@ -84,9 +78,9 @@ int		strcasecmp _ANSI_ARGS_((CONST char *s1,   */  int -strcasecmp(s1, s2) -    CONST char *s1;			/* First string. */ -    CONST char *s2;			/* Second string. */ +strcasecmp( +    const char *s1,		/* First string. */ +    const char *s2)		/* Second string. */  {      unsigned char u1, u2; @@ -108,9 +102,9 @@ strcasecmp(s1, s2)   *	Compares two strings, ignoring case differences.   *   * Results: - *	Compares up to length chars of s1 and s2, returning -1, 0, or 1 - *	if s1 is lexicographically less than, equal to, or greater - *	than s2 over those characters. + *	Compares up to length chars of s1 and s2, returning -1, 0, or 1 if s1 + *	is lexicographically less than, equal to, or greater than s2 over + *	those characters.   *   * Side effects:   *	None. @@ -119,10 +113,10 @@ strcasecmp(s1, s2)   */  int -strncasecmp(s1, s2, length) -    CONST char *s1;		/* First string. */ -    CONST char *s2;		/* Second string. */ -    size_t length;		/* Maximum number of characters to compare +strncasecmp( +    const char *s1,		/* First string. */ +    const char *s2,		/* Second string. */ +    size_t length)		/* Maximum number of characters to compare  				 * (stop earlier if the end of either string  				 * is reached). */  { | 
