ctype.h (54746) | ctype.h (57035) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 25 unchanged lines hidden (view full) --- 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39 * SUCH DAMAGE. 40 * 41 * @(#)ctype.h 8.4 (Berkeley) 1/21/94 | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 25 unchanged lines hidden (view full) --- 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 39 * SUCH DAMAGE. 40 * 41 * @(#)ctype.h 8.4 (Berkeley) 1/21/94 |
42 * $FreeBSD: head/include/ctype.h 54746 1999-12-17 15:12:21Z phantom $ | 42 * $FreeBSD: head/include/ctype.h 57035 2000-02-08 07:43:26Z obrien $ |
43 */ 44 45#ifndef _CTYPE_H_ 46#define _CTYPE_H_ 47 48/* 49 * XXX <runetype.h> brings massive namespace pollution (rune_t and struct 50 * member names). 51 */ 52#include <runetype.h> 53 | 43 */ 44 45#ifndef _CTYPE_H_ 46#define _CTYPE_H_ 47 48/* 49 * XXX <runetype.h> brings massive namespace pollution (rune_t and struct 50 * member names). 51 */ 52#include <runetype.h> 53 |
54#define _A 0x00000100L /* Alpha */ 55#define _C 0x00000200L /* Control */ 56#define _D 0x00000400L /* Digit */ 57#define _G 0x00000800L /* Graph */ 58#define _L 0x00001000L /* Lower */ 59#define _P 0x00002000L /* Punct */ 60#define _S 0x00004000L /* Space */ 61#define _U 0x00008000L /* Upper */ 62#define _X 0x00010000L /* X digit */ 63#define _B 0x00020000L /* Blank */ 64#define _R 0x00040000L /* Print */ 65#define _I 0x00080000L /* Ideogram */ 66#define _T 0x00100000L /* Special */ 67#define _Q 0x00200000L /* Phonogram */ | 54#define _CTYPE_A 0x00000100L /* Alpha */ 55#define _CTYPE_C 0x00000200L /* Control */ 56#define _CTYPE_D 0x00000400L /* Digit */ 57#define _CTYPE_G 0x00000800L /* Graph */ 58#define _CTYPE_L 0x00001000L /* Lower */ 59#define _CTYPE_P 0x00002000L /* Punct */ 60#define _CTYPE_S 0x00004000L /* Space */ 61#define _CTYPE_U 0x00008000L /* Upper */ 62#define _CTYPE_X 0x00010000L /* X digit */ 63#define _CTYPE_B 0x00020000L /* Blank */ 64#define _CTYPE_R 0x00040000L /* Print */ 65#define _CTYPE_I 0x00080000L /* Ideogram */ 66#define _CTYPE_T 0x00100000L /* Special */ 67#define _CTYPE_Q 0x00200000L /* Phonogram */ |
68 69__BEGIN_DECLS 70int isalnum __P((int)); 71int isalpha __P((int)); 72int iscntrl __P((int)); 73int isdigit __P((int)); 74int isgraph __P((int)); 75int islower __P((int)); --- 16 unchanged lines hidden (view full) --- 92int isrune __P((int)); 93int isspecial __P((int)); 94int toascii __P((int)); 95#endif 96__END_DECLS 97 98#define __istype(c,f) (!!__maskrune((c),(f))) 99 | 68 69__BEGIN_DECLS 70int isalnum __P((int)); 71int isalpha __P((int)); 72int iscntrl __P((int)); 73int isdigit __P((int)); 74int isgraph __P((int)); 75int islower __P((int)); --- 16 unchanged lines hidden (view full) --- 92int isrune __P((int)); 93int isspecial __P((int)); 94int toascii __P((int)); 95#endif 96__END_DECLS 97 98#define __istype(c,f) (!!__maskrune((c),(f))) 99 |
100#define isalnum(c) __istype((c), _A|_D) 101#define isalpha(c) __istype((c), _A) 102#define iscntrl(c) __istype((c), _C) 103#define isdigit(c) __isctype((c), _D) /* ANSI -- locale independent */ 104#define isgraph(c) __istype((c), _G) 105#define islower(c) __istype((c), _L) 106#define isprint(c) __istype((c), _R) 107#define ispunct(c) __istype((c), _P) 108#define isspace(c) __istype((c), _S) 109#define isupper(c) __istype((c), _U) 110#define isxdigit(c) __isctype((c), _X) /* ANSI -- locale independent */ | 100#define isalnum(c) __istype((c), _CTYPE_A|_CTYPE_D) 101#define isalpha(c) __istype((c), _CTYPE_A) 102#define iscntrl(c) __istype((c), _CTYPE_C) 103#define isdigit(c) __isctype((c), _CTYPE_D) /* ANSI -- locale independent */ 104#define isgraph(c) __istype((c), _CTYPE_G) 105#define islower(c) __istype((c), _CTYPE_L) 106#define isprint(c) __istype((c), _CTYPE_R) 107#define ispunct(c) __istype((c), _CTYPE_P) 108#define isspace(c) __istype((c), _CTYPE_S) 109#define isupper(c) __istype((c), _CTYPE_U) 110#define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */ |
111#define tolower(c) __tolower(c) 112#define toupper(c) __toupper(c) 113 114#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 115#define digittoint(c) __maskrune((c), 0xFF) 116#define isascii(c) (((c) & ~0x7F) == 0) | 111#define tolower(c) __tolower(c) 112#define toupper(c) __toupper(c) 113 114#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 115#define digittoint(c) __maskrune((c), 0xFF) 116#define isascii(c) (((c) & ~0x7F) == 0) |
117#define isblank(c) __istype((c), _B) 118#define ishexnumber(c) __istype((c), _X) 119#define isideogram(c) __istype((c), _I) 120#define isnumber(c) __istype((c), _D) 121#define isphonogram(c) __istype((c), _Q) | 117#define isblank(c) __istype((c), _CTYPE_B) 118#define ishexnumber(c) __istype((c), _CTYPE_X) 119#define isideogram(c) __istype((c), _CTYPE_I) 120#define isnumber(c) __istype((c), _CTYPE_D) 121#define isphonogram(c) __istype((c), _CTYPE_Q) |
122#define isrune(c) __istype((c), 0xFFFFFF00L) | 122#define isrune(c) __istype((c), 0xFFFFFF00L) |
123#define isspecial(c) __istype((c), _T) | 123#define isspecial(c) __istype((c), _CTYPE_T) |
124#define toascii(c) ((c) & 0x7F) 125#endif 126 127/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */ 128__BEGIN_DECLS 129unsigned long ___runetype __P((_BSD_CT_RUNE_T_)); 130_BSD_CT_RUNE_T_ ___tolower __P((_BSD_CT_RUNE_T_)); 131_BSD_CT_RUNE_T_ ___toupper __P((_BSD_CT_RUNE_T_)); --- 56 unchanged lines hidden --- | 124#define toascii(c) ((c) & 0x7F) 125#endif 126 127/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */ 128__BEGIN_DECLS 129unsigned long ___runetype __P((_BSD_CT_RUNE_T_)); 130_BSD_CT_RUNE_T_ ___tolower __P((_BSD_CT_RUNE_T_)); 131_BSD_CT_RUNE_T_ ___toupper __P((_BSD_CT_RUNE_T_)); --- 56 unchanged lines hidden --- |