runetype.c (15483) | runetype.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/runetype.c 61218 2000-06-03 12:24:08Z ache $ |
|
35 */ 36 37#include <stdio.h> 38#include <rune.h> 39 40unsigned long 41___runetype(c) 42 _BSD_CT_RUNE_T_ c; 43{ | 37 */ 38 39#include <stdio.h> 40#include <rune.h> 41 42unsigned long 43___runetype(c) 44 _BSD_CT_RUNE_T_ c; 45{ |
44#ifdef XPG4 | |
45 int x; 46 _RuneRange *rr = &_CurrentRuneLocale->runetype_ext; 47 _RuneEntry *re = rr->ranges; 48 49 if (c < 0 || c == EOF) 50 return(0L); 51 52 for (x = 0; x < rr->nranges; ++x, ++re) { 53 if (c < re->min) 54 return(0L); 55 if (c <= re->max) { 56 if (re->types) 57 return(re->types[c - re->min]); 58 else 59 return(re->map); 60 } 61 } | 46 int x; 47 _RuneRange *rr = &_CurrentRuneLocale->runetype_ext; 48 _RuneEntry *re = rr->ranges; 49 50 if (c < 0 || c == EOF) 51 return(0L); 52 53 for (x = 0; x < rr->nranges; ++x, ++re) { 54 if (c < re->min) 55 return(0L); 56 if (c <= re->max) { 57 if (re->types) 58 return(re->types[c - re->min]); 59 else 60 return(re->map); 61 } 62 } |
62#endif | 63 |
63 return(0L); 64} | 64 return(0L); 65} |