xref: /freebsd/lib/libc/locale/toupper.c (revision a316b26e50bbed7cf655fbba726ab87d8ab7599d)
1 #include <stdio.h>
2 #include <rune.h>
3 
4 _BSD_RUNE_T_
5 ___toupper(c)
6 	_BSD_RUNE_T_ c;
7 {
8 	int x;
9 	_RuneRange *rr = &_CurrentRuneLocale->mapupper_ext;
10 	_RuneEntry *re = rr->ranges;
11 
12 	if (c == EOF)
13 		return(EOF);
14 	for (x = 0; x < rr->nranges; ++x, ++re) {
15 		if (c < re->min)
16 			return(c);
17 		if (c <= re->max)
18 			return(re->map + c - re->min);
19 	}
20 	return(c);
21 }
22 
23