diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-08-02 21:03:46 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-08-02 21:07:20 -0700 |
commit | 6238b47b58480cd9c092600c05338dbe261b71ce (patch) | |
tree | 83055587295af222003e505c52ea3dbae3e0c3aa /arch/x86/boot/ctype.h | |
parent | 8fee13a48e4879fba57725f6d9513df4bfa8e9f3 (diff) |
x86, setup: move isdigit.h to ctype.h, header files on top.
It is a subset of <ctype.h> functionality, so name it ctype.h. Also,
reorganize header files so #include statements are clustered near the
top as they should be.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <4C5752F2.8030206@kernel.org>
Diffstat (limited to 'arch/x86/boot/ctype.h')
-rw-r--r-- | arch/x86/boot/ctype.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/boot/ctype.h b/arch/x86/boot/ctype.h new file mode 100644 index 000000000000..25e13403193c --- /dev/null +++ b/arch/x86/boot/ctype.h @@ -0,0 +1,21 @@ +#ifndef BOOT_ISDIGIT_H + +#define BOOT_ISDIGIT_H + +static inline int isdigit(int ch) +{ + return (ch >= '0') && (ch <= '9'); +} + +static inline int isxdigit(int ch) +{ + if (isdigit(ch)) + return true; + + if ((ch >= 'a') && (ch <= 'f')) + return true; + + return (ch >= 'A') && (ch <= 'F'); +} + +#endif |