Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2. FUNCTION
  3.         <<strupr>>---force string to uppercase
  4.        
  5. INDEX
  6.         strupr
  7.  
  8. ANSI_SYNOPSIS
  9.         #include <string.h>
  10.         char *strupr(char *<[a]>);
  11.  
  12. TRAD_SYNOPSIS
  13.         #include <string.h>
  14.         char *strupr(<[a]>)
  15.         char *<[a]>;
  16.  
  17. DESCRIPTION
  18.         <<strupr>> converts each character in the string at <[a]> to
  19.         uppercase.
  20.  
  21. RETURNS
  22.         <<strupr>> returns its argument, <[a]>.
  23.  
  24. PORTABILITY
  25. <<strupr>> is not widely portable.
  26.  
  27. <<strupr>> requires no supporting OS subroutines.
  28.  
  29. QUICKREF
  30.         strupr
  31. */
  32.  
  33. #include <string.h>
  34. #include <ctype.h>
  35.  
  36. char *
  37. _DEFUN (strupr, (s),
  38.         char *s)
  39. {
  40.   unsigned char *ucs = (unsigned char *) s;
  41.   for ( ; *ucs != '\0'; ucs++)
  42.     {
  43.       *ucs = toupper(*ucs);
  44.     }
  45.   return s;
  46. }
  47.