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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: toupper.c,v 1.6 1997/01/27 00:32:33 ldp Exp $
  4.     $Log: toupper.c,v $
  5.     Revision 1.6  1997/01/27 00:32:33  ldp
  6.     Polish
  7.  
  8.     Revision 1.5  1996/12/10 14:00:16  aros
  9.     Moved #include into first column to allow makedepend to see it.
  10.  
  11.     Revision 1.4  1996/10/24 22:51:46  aros
  12.     Use proper Amiga datatypes (eg: ULONG not unsigned long)
  13.  
  14.     Revision 1.3  1996/10/24 15:51:39  aros
  15.     Use the official AROS macros over the __AROS versions.
  16.  
  17.     Revision 1.2  1996/09/13 17:16:35  digulla
  18.     Removed the macro TOUPPER. Use this library function instead
  19.  
  20.     Revision 1.1  1996/08/31 12:58:13  aros
  21.     Merged in/modified for FreeBSD.
  22.  
  23.  
  24.     Desc:
  25.     Lang: english
  26. */
  27. #include <exec/types.h>
  28. #include <aros/libcall.h>
  29. #include "utility_intern.h"
  30.  
  31. /*****************************************************************************
  32.  
  33.     NAME */
  34. #include <proto/utility.h>
  35.  
  36.     AROS_LH1I(UBYTE, ToUpper,
  37.  
  38. /*  SYNOPSIS */
  39.     AROS_LHA(ULONG, character, D0),
  40.  
  41. /*  LOCATION */
  42.     struct UtilityBase *, UtilityBase, 29, Utility)
  43.  
  44. /*  FUNCTION
  45.     Convert a character to uppercase
  46.  
  47.     INPUTS
  48.     character   - The character that you want changed.
  49.  
  50.     RESULT
  51.     The uppercase version of that character.
  52.  
  53.     NOTES
  54.     Currently only works for ASCII characters. Would not be difficult
  55.     to adapt for other character sets (Unicode for example).
  56.  
  57.     This function is patched by the locale.library, so you should be
  58.     prepared for different results when running under different
  59.     languages.
  60.  
  61.     EXAMPLE
  62.     STRPTR string; UBYTE chr;
  63.  
  64.     \* Convert a string to uppercase *\
  65.     while( chr = *string )
  66.     {
  67.         *string = ToUpper( chr );
  68.         string++;
  69.     }
  70.  
  71.     BUGS
  72.  
  73.     SEE ALSO
  74.     utility/ToLower()
  75.  
  76.     INTERNALS
  77.     This function is patched by locale.library.
  78.  
  79.     HISTORY
  80.     29-10-95    digulla automatically created from
  81.                 utility_lib.fd and clib/utility_protos.h
  82.     10-08-96    iaint   Created from tolower.c from AROSdev15
  83. *****************************************************************************/
  84. {
  85.     AROS_LIBFUNC_INIT
  86.  
  87.     return
  88.     (
  89.     (character >= 'a' && character <= 'z')
  90.     || (character >= 0xE0
  91.         && character <= 0xEE
  92.         && character != 0xE7)
  93.     ? character - 0x20
  94.     : character
  95.     );
  96.  
  97.     AROS_LIBFUNC_EXIT
  98. } /* ToLower */
  99.