Back up following macros by functions: ishexnumber, isideogram, isnumber,

isphonogram, isrune, isspecial. Fix ordering.

Reviewed by: bde
This commit is contained in:
Alexey Zelkin 1999-12-17 15:12:21 +00:00
parent ded8c91a78
commit 94da96bf18
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54746
3 changed files with 78 additions and 17 deletions

View file

@ -39,6 +39,7 @@
* SUCH DAMAGE.
*
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
* $FreeBSD$
*/
#ifndef _CTYPE_H_
@ -81,10 +82,16 @@ int tolower __P((int));
int toupper __P((int));
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
int digittoint __P((int));
int isascii __P((int));
int isblank __P((int));
int ishexnumber __P((int));
int isideogram __P((int));
int isnumber __P((int));
int isphonogram __P((int));
int isrune __P((int));
int isspecial __P((int));
int toascii __P((int));
int digittoint __P((int));
#endif
__END_DECLS
@ -105,18 +112,16 @@ __END_DECLS
#define toupper(c) __toupper(c)
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#define digittoint(c) __maskrune((c), 0xFF)
#define isascii(c) (((c) & ~0x7F) == 0)
#define isblank(c) __istype((c), _B)
#define toascii(c) ((c) & 0x7F)
#define digittoint(c) __maskrune((c), 0xFF)
/* XXX the following macros are not backed up by functions. */
#define ishexnumber(c) __istype((c), _X)
#define isideogram(c) __istype((c), _I)
#define isnumber(c) __istype((c), _D)
#define isphonogram(c) __istype((c), _Q)
#define isrune(c) __istype((c), 0xFFFFFF00L)
#define isspecial(c) __istype((c), _T)
#define toascii(c) ((c) & 0x7F)
#endif
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */

View file

@ -39,6 +39,7 @@
* SUCH DAMAGE.
*
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
* $FreeBSD$
*/
#ifndef _CTYPE_H_
@ -81,10 +82,16 @@ int tolower __P((int));
int toupper __P((int));
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
int digittoint __P((int));
int isascii __P((int));
int isblank __P((int));
int ishexnumber __P((int));
int isideogram __P((int));
int isnumber __P((int));
int isphonogram __P((int));
int isrune __P((int));
int isspecial __P((int));
int toascii __P((int));
int digittoint __P((int));
#endif
__END_DECLS
@ -105,18 +112,16 @@ __END_DECLS
#define toupper(c) __toupper(c)
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
#define digittoint(c) __maskrune((c), 0xFF)
#define isascii(c) (((c) & ~0x7F) == 0)
#define isblank(c) __istype((c), _B)
#define toascii(c) ((c) & 0x7F)
#define digittoint(c) __maskrune((c), 0xFF)
/* XXX the following macros are not backed up by functions. */
#define ishexnumber(c) __istype((c), _X)
#define isideogram(c) __istype((c), _I)
#define isnumber(c) __istype((c), _D)
#define isphonogram(c) __istype((c), _Q)
#define isrune(c) __istype((c), 0xFFFFFF00L)
#define isspecial(c) __istype((c), _T)
#define toascii(c) ((c) & 0x7F)
#endif
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */

View file

@ -37,6 +37,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@ -45,6 +47,14 @@ static char sccsid[] = "@(#)isctype.c 8.3 (Berkeley) 2/24/94";
#include <ctype.h>
#undef digittoint
int
digittoint(c)
int c;
{
return (__maskrune((c), 0xFF));
}
#undef isalnum
int
isalnum(c)
@ -101,6 +111,22 @@ isgraph(c)
return (__istype((c), _G));
}
#undef ishexnumber
int
ishexnumber(c)
int c;
{
return (__istype((c), _X));
}
#undef isideogram
int
isideogram(c)
int c;
{
return (__istype((c), _I));
}
#undef islower
int
islower(c)
@ -109,6 +135,22 @@ islower(c)
return (__istype((c), _L));
}
#undef isnumber
int
isnumber(c)
int c;
{
return (__istype((c), _D));
}
#undef isphonogram
int
isphonogram(c)
int c;
{
return (__istype((c), _Q));
}
#undef isprint
int
isprint(c)
@ -125,6 +167,14 @@ ispunct(c)
return (__istype((c), _P));
}
#undef isrune
int
isrune(c)
int c;
{
return (__istype((c), 0xFFFFFF00L));
}
#undef isspace
int
isspace(c)
@ -133,6 +183,14 @@ isspace(c)
return (__istype((c), _S));
}
#undef isspecial
int
isspecial(c)
int c;
{
return (__istype((c), _T));
}
#undef isupper
int
isupper(c)
@ -173,10 +231,3 @@ toupper(c)
return (__toupper(c));
}
#undef digittoint
int
digittoint(c)
int c;
{
return (__maskrune((c), 0xFF));
}