home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / utility / stricmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.6 KB  |  79 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: stricmp.c,v 1.5 1996/10/24 15:51:38 aros Exp $
  4.     $Log: stricmp.c,v $
  5.     Revision 1.5  1996/10/24 15:51:38  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/09/13 17:33:30  digulla
  9.     Use the ToLower function instead of the macro
  10.  
  11.     Revision 1.3  1996/08/13 14:10:31  digulla
  12.     Replaced AROS_LA by AROS_LHA
  13.  
  14.     Revision 1.2  1996/08/01 17:41:41  digulla
  15.     Added standard header for all files
  16.  
  17.     Desc:
  18.     Lang: english
  19. */
  20. #include <exec/types.h>
  21. #include <aros/libcall.h>
  22. #include "utility_intern.h"
  23.  
  24. /*****************************************************************************
  25.  
  26.     NAME */
  27.     #include <clib/utility_protos.h>
  28.  
  29.     AROS_LH2(LONG, Stricmp,
  30.  
  31. /*  SYNOPSIS */
  32.     AROS_LHA(STRPTR, string1, A0),
  33.     AROS_LHA(STRPTR, string2, A1),
  34.  
  35. /*  LOCATION */
  36.     struct UtilityBase *, UtilityBase, 27, Utility)
  37.  
  38. /*  FUNCTION
  39.     Compares two strings treating lower and upper case characters
  40.     as identical.
  41.  
  42.     INPUTS
  43.     string1, string2 - The strings to compare.
  44.  
  45.     RESULT
  46.     <0  if string1 <  string2
  47.     ==0 if string1 == string2
  48.     >0  if string1 >  string2
  49.  
  50.     NOTES
  51.  
  52.     EXAMPLE
  53.  
  54.     BUGS
  55.  
  56.     SEE ALSO
  57.  
  58.     INTERNALS
  59.  
  60.     HISTORY
  61.  
  62. *****************************************************************************/
  63. {
  64.     AROS_LIBFUNC_INIT
  65.     UBYTE c1, c2;
  66.  
  67.     /* Loop as long as the strings are identical and valid. */
  68.     do
  69.     {
  70.     /* Get characters, convert them to lower case. */
  71.     c1=ToLower(*string1++);
  72.     c2=ToLower(*string2++);
  73.     }while(c1==c2&&c1);
  74.  
  75.     /* Get result. */
  76.     return (LONG)c1-(LONG)c2;
  77.     AROS_LIBFUNC_EXIT
  78. } /* Stricmp */
  79.