toupper.c (15483) | toupper.c (61218) |
---|---|
1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Paul Borman at Krystal Technologies. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. | 1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Paul Borman at Krystal Technologies. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 18 unchanged lines hidden (view full) --- 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. |
35 * 36 * $FreeBSD: head/lib/libc/locale/toupper.c 61218 2000-06-03 12:24:08Z ache $ |
|
35 */ 36 37#include <stdio.h> 38#include <rune.h> 39 40_BSD_CT_RUNE_T_ 41___toupper(c) 42 _BSD_CT_RUNE_T_ c; 43{ | 37 */ 38 39#include <stdio.h> 40#include <rune.h> 41 42_BSD_CT_RUNE_T_ 43___toupper(c) 44 _BSD_CT_RUNE_T_ c; 45{ |
44#ifdef XPG4 | |
45 int x; 46 _RuneRange *rr = &_CurrentRuneLocale->mapupper_ext; 47 _RuneEntry *re = rr->ranges; 48 49 if (c < 0 || c == EOF) 50 return(c); 51 52 for (x = 0; x < rr->nranges; ++x, ++re) { 53 if (c < re->min) 54 return(c); 55 if (c <= re->max) 56 return(re->map + c - re->min); 57 } | 46 int x; 47 _RuneRange *rr = &_CurrentRuneLocale->mapupper_ext; 48 _RuneEntry *re = rr->ranges; 49 50 if (c < 0 || c == EOF) 51 return(c); 52 53 for (x = 0; x < rr->nranges; ++x, ++re) { 54 if (c < re->min) 55 return(c); 56 if (c <= re->max) 57 return(re->map + c - re->min); 58 } |
58#endif | 59 |
59 return(c); 60} | 60 return(c); 61} |