OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [string/] [strupr.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
/*
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 characters in the string at <[a]> to
19
        upper case.
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
#include <string.h>
33
#include <ctype.h>
34
 
35
char *
36
strupr (a)
37
     char *a;
38
{
39
  char *ret = a;
40
 
41
  while (*a != '\0')
42
    {
43
      if (islower (*a))
44
        *a = toupper (*a);
45
      ++a;
46
    }
47
 
48
  return ret;
49
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.