home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
INCLUDE
/
CTYPE.H
< prev
next >
Wrap
Text File
|
1993-09-17
|
6KB
|
148 lines
#pragma info( none )
#ifndef __CHKHDR__
#pragma info( none )
#endif
#pragma info( restore )
#ifndef __ctype_h
#define __ctype_h
#ifdef __cplusplus
extern "C" {
#endif
/********************************************************************/
/* <ctype.h> header file */
/* */
/* Licensed Materials - Property of IBM */
/* */
/* IBM C/C++ Tools Version 2.01 */
/* Copyright (C) International Business Machines Corp., 1991,1993 */
/* All rights reserved */
/* */
/* US Government Users Restricted Rights - */
/* Use, duplication, or disclosure restricted */
/* by GSA ADP Schedule Contract with IBM Corp. */
/* */
/********************************************************************/
int _Optlink isalnum( int );
int _Optlink isalpha( int );
int _Optlink iscntrl( int );
int _Optlink isdigit( int );
int _Optlink isgraph( int );
int _Optlink islower( int );
int _Optlink isprint( int );
int _Optlink ispunct( int );
int _Optlink isspace( int );
int _Optlink isupper( int );
int _Optlink isxdigit( int );
int _Optlink tolower( int );
int _Optlink toupper( int );
/* masks for using external character table */
#define __A 0x0100U /* alphabetic (isalpha) */
#define __U 0x0080U /* uppercase (isupper) */
#define __L 0x0040U /* lowercase (islower) */
#define __C 0x0020U /* control (iscntrl) */
#define __P 0x0010U /* punctuation (ispunct) */
#define __W 0x0008U /* whitespace (isspace) */
#define __S 0x0004U /* space */
#define __D 0x0002U /* decimal (isdigit) */
#define __X 0x0001U /* hexadecimal (isxdigit) */
/* indexes of toupper/tolower tables in _ctype table */
#define _TOUPPER_INDEX 257
#define _TOLOWER_INDEX 514
extern const unsigned short *_ctype;
#ifdef __cplusplus
inline int isalnum ( int c )
{ return _ctype[(c)] & (__A | __D); }
inline int isalpha ( int c )
{ return _ctype[(c)] & __A; }
inline int iscntrl ( int c )
{ return _ctype[(c)] & __C; }
inline int isdigit ( int c )
{ return _ctype[(c)] & __D; }
inline int isgraph ( int c )
{ return _ctype[(c)] & (__P | __A | __D); }
inline int islower ( int c )
{ return _ctype[(c)] & __L; }
inline int isprint ( int c )
{ return _ctype[(c)] & (__P | __A | __D | __S); }
inline int ispunct ( int c )
{ return _ctype[(c)] & __P; }
inline int isspace ( int c )
{ return _ctype[(c)] & __W; }
inline int isupper ( int c )
{ return _ctype[(c)] & __U; }
inline int isxdigit( int c )
{ return _ctype[(c)] & __X; }
inline int tolower ( int c )
{ return (signed short)_ctype[(c) + _TOLOWER_INDEX]; }
inline int toupper ( int c )
{ return (signed short)_ctype[(c) + _TOUPPER_INDEX]; }
#else
#pragma info( none )
#define isalnum( c ) ( _ctype[(c)] & (__A | __D) )
#define isalpha( c ) ( _ctype[(c)] & __A )
#define iscntrl( c ) ( _ctype[(c)] & __C )
#define isdigit( c ) ( _ctype[(c)] & __D )
#define isgraph( c ) ( _ctype[(c)] & (__P | __A | __D) )
#define islower( c ) ( _ctype[(c)] & __L )
#define isprint( c ) ( _ctype[(c)] & (__P | __A | __D | __S) )
#define ispunct( c ) ( _ctype[(c)] & __P )
#define isspace( c ) ( _ctype[(c)] & __W )
#define isupper( c ) ( _ctype[(c)] & __U )
#define isxdigit( c ) ( _ctype[(c)] & __X )
#define tolower( c ) (signed short)( _ctype[(c) + _TOLOWER_INDEX] )
#define toupper( c ) (signed short)( _ctype[(c) + _TOUPPER_INDEX] )
#pragma info( restore )
#endif
#if defined(__EXTENDED__)
int _Optlink _tolower( int );
int _Optlink _toupper( int );
int _Optlink _isascii( int );
int _Optlink _iscsymf( int );
int _Optlink _iscsym( int );
int _Optlink _toascii( int );
#pragma info( none )
#define _tolower( c ) ( (c) + 'a' - 'A' )
#define _toupper( c ) ( (c) + 'A' - 'a' )
#define _isascii( c ) ( (unsigned)(c) < 0x80 )
#define _iscsymf( c ) ( isalpha( c ) || (c) == '_' )
#define _iscsym( c ) ( isalnum( c ) || (c) == '_' )
#define _toascii( c ) ( (c) & 0x7f )
#ifdef __cplusplus
inline int isascii( int c ) { return _isascii( c ); }
inline int iscsymf( int c ) { return _iscsymf( c ); }
inline int iscsym ( int c ) { return _iscsym ( c ); }
inline int toascii( int c ) { return _toascii( c ); }
#else
#define isascii( c ) _isascii( c )
#define iscsymf( c ) _iscsymf( c )
#define iscsym( c ) _iscsym( c )
#define toascii( c ) _toascii( c )
#endif
#pragma info( restore )
#endif
#ifdef __cplusplus
}
#endif
#endif
#pragma info( none )
#ifndef __CHKHDR__
#pragma info( restore )
#endif
#pragma info( restore )