Back up following macros by functions: ishexnumber, isideogram, isnumber,
isphonogram, isrune, isspecial. Fix ordering. Reviewed by: bde
This commit is contained in:
parent
ded8c91a78
commit
94da96bf18
@ -39,6 +39,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
|
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CTYPE_H_
|
#ifndef _CTYPE_H_
|
||||||
@ -81,10 +82,16 @@ int tolower __P((int));
|
|||||||
int toupper __P((int));
|
int toupper __P((int));
|
||||||
|
|
||||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
||||||
|
int digittoint __P((int));
|
||||||
int isascii __P((int));
|
int isascii __P((int));
|
||||||
int isblank __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 toascii __P((int));
|
||||||
int digittoint __P((int));
|
|
||||||
#endif
|
#endif
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
@ -105,18 +112,16 @@ __END_DECLS
|
|||||||
#define toupper(c) __toupper(c)
|
#define toupper(c) __toupper(c)
|
||||||
|
|
||||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
||||||
|
#define digittoint(c) __maskrune((c), 0xFF)
|
||||||
#define isascii(c) (((c) & ~0x7F) == 0)
|
#define isascii(c) (((c) & ~0x7F) == 0)
|
||||||
#define isblank(c) __istype((c), _B)
|
#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 ishexnumber(c) __istype((c), _X)
|
||||||
#define isideogram(c) __istype((c), _I)
|
#define isideogram(c) __istype((c), _I)
|
||||||
#define isnumber(c) __istype((c), _D)
|
#define isnumber(c) __istype((c), _D)
|
||||||
#define isphonogram(c) __istype((c), _Q)
|
#define isphonogram(c) __istype((c), _Q)
|
||||||
#define isrune(c) __istype((c), 0xFFFFFF00L)
|
#define isrune(c) __istype((c), 0xFFFFFF00L)
|
||||||
#define isspecial(c) __istype((c), _T)
|
#define isspecial(c) __istype((c), _T)
|
||||||
|
#define toascii(c) ((c) & 0x7F)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */
|
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
|
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CTYPE_H_
|
#ifndef _CTYPE_H_
|
||||||
@ -81,10 +82,16 @@ int tolower __P((int));
|
|||||||
int toupper __P((int));
|
int toupper __P((int));
|
||||||
|
|
||||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
||||||
|
int digittoint __P((int));
|
||||||
int isascii __P((int));
|
int isascii __P((int));
|
||||||
int isblank __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 toascii __P((int));
|
||||||
int digittoint __P((int));
|
|
||||||
#endif
|
#endif
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
@ -105,18 +112,16 @@ __END_DECLS
|
|||||||
#define toupper(c) __toupper(c)
|
#define toupper(c) __toupper(c)
|
||||||
|
|
||||||
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
||||||
|
#define digittoint(c) __maskrune((c), 0xFF)
|
||||||
#define isascii(c) (((c) & ~0x7F) == 0)
|
#define isascii(c) (((c) & ~0x7F) == 0)
|
||||||
#define isblank(c) __istype((c), _B)
|
#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 ishexnumber(c) __istype((c), _X)
|
||||||
#define isideogram(c) __istype((c), _I)
|
#define isideogram(c) __istype((c), _I)
|
||||||
#define isnumber(c) __istype((c), _D)
|
#define isnumber(c) __istype((c), _D)
|
||||||
#define isphonogram(c) __istype((c), _Q)
|
#define isphonogram(c) __istype((c), _Q)
|
||||||
#define isrune(c) __istype((c), 0xFFFFFF00L)
|
#define isrune(c) __istype((c), 0xFFFFFF00L)
|
||||||
#define isspecial(c) __istype((c), _T)
|
#define isspecial(c) __istype((c), _T)
|
||||||
|
#define toascii(c) ((c) & 0x7F)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */
|
/* See comments in <machine/ansi.h> about _BSD_CT_RUNE_T_. */
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* 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
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
@ -45,6 +47,14 @@ static char sccsid[] = "@(#)isctype.c 8.3 (Berkeley) 2/24/94";
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#undef digittoint
|
||||||
|
int
|
||||||
|
digittoint(c)
|
||||||
|
int c;
|
||||||
|
{
|
||||||
|
return (__maskrune((c), 0xFF));
|
||||||
|
}
|
||||||
|
|
||||||
#undef isalnum
|
#undef isalnum
|
||||||
int
|
int
|
||||||
isalnum(c)
|
isalnum(c)
|
||||||
@ -101,6 +111,22 @@ isgraph(c)
|
|||||||
return (__istype((c), _G));
|
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
|
#undef islower
|
||||||
int
|
int
|
||||||
islower(c)
|
islower(c)
|
||||||
@ -109,6 +135,22 @@ islower(c)
|
|||||||
return (__istype((c), _L));
|
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
|
#undef isprint
|
||||||
int
|
int
|
||||||
isprint(c)
|
isprint(c)
|
||||||
@ -125,6 +167,14 @@ ispunct(c)
|
|||||||
return (__istype((c), _P));
|
return (__istype((c), _P));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef isrune
|
||||||
|
int
|
||||||
|
isrune(c)
|
||||||
|
int c;
|
||||||
|
{
|
||||||
|
return (__istype((c), 0xFFFFFF00L));
|
||||||
|
}
|
||||||
|
|
||||||
#undef isspace
|
#undef isspace
|
||||||
int
|
int
|
||||||
isspace(c)
|
isspace(c)
|
||||||
@ -133,6 +183,14 @@ isspace(c)
|
|||||||
return (__istype((c), _S));
|
return (__istype((c), _S));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef isspecial
|
||||||
|
int
|
||||||
|
isspecial(c)
|
||||||
|
int c;
|
||||||
|
{
|
||||||
|
return (__istype((c), _T));
|
||||||
|
}
|
||||||
|
|
||||||
#undef isupper
|
#undef isupper
|
||||||
int
|
int
|
||||||
isupper(c)
|
isupper(c)
|
||||||
@ -173,10 +231,3 @@ toupper(c)
|
|||||||
return (__toupper(c));
|
return (__toupper(c));
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef digittoint
|
|
||||||
int
|
|
||||||
digittoint(c)
|
|
||||||
int c;
|
|
||||||
{
|
|
||||||
return (__maskrune((c), 0xFF));
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user