home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / utility / stricmp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  1.8 KB  |  85 lines

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