ctype.h

来自「嵌入式点菜系嵌入式点菜系统源码供参考c51c51统源码供参考嵌入式点菜系统源码供」· C头文件 代码 · 共 59 行

H
59
字号
/*			- CTYPE.H -

   The ANSI character testing function declarations.
	   
   Note: Only 7-bit ASCII is supported by these functions.

   Version: 3.20 [ICLM]
		    
*/

#ifndef _CTYPE_INCLUDED
#define _CTYPE_INCLUDED

#define	_U	01
#define	_L	02
#define	_N	04
#define	_S	010
#define _P	020
#define _C	040
#define _X	0100
#define _B	0200

#if __TID__ & 0x8000
#pragma function=intrinsic(0)
#endif

extern const unsigned char _ctype_[129];

int toupper(int c);	/* "toupper" is also available as a function */
int tolower(int c);	/* "tolower" is also available as a function */

#if __TID__ & 0x8000
#pragma function=default
#endif


#define	isalpha(c)	((_ctype_+1)[c]&(_U|_L))
#define	isupper(c)	((_ctype_+1)[c]&_U)
#define	islower(c)	((_ctype_+1)[c]&_L)
#define	isdigit(c)	((_ctype_+1)[c]&_N)
#define	isxdigit(c)	((_ctype_+1)[c]&(_N|_X))
#define	isspace(c)	((_ctype_+1)[c]&_S)
#define ispunct(c)	((_ctype_+1)[c]&_P)
#define isalnum(c)	((_ctype_+1)[c]&(_U|_L|_N))
#define isprint(c)	((_ctype_+1)[c]&(_P|_U|_L|_N|_B))
#define isgraph(c)	((_ctype_+1)[c]&(_P|_U|_L|_N))
#define iscntrl(c)	((_ctype_+1)[c]&_C)
#define toupper(c)	(islower((c))? (c)&0x5F: (c))
#define tolower(c)	(isupper((c))? (c)|0x20: (c))

#endif







⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?