inline only user of ksh_min, make it more cool; drop ksh_min, ksh_max;
move ksh_isdigit etc. to ksh_isalpha etc. definitions
This commit is contained in:
21
sh.h
21
sh.h
@@ -169,7 +169,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef EXTERN
|
||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.726 2015/04/29 18:38:54 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.727 2015/04/29 19:11:57 tg Exp $");
|
||||
#endif
|
||||
#define MKSH_VERSION "R51 2015/04/19"
|
||||
|
||||
@@ -298,17 +298,6 @@ struct rusage {
|
||||
} while (/* CONSTCOND */ 0)
|
||||
#endif
|
||||
|
||||
#define ksh_isdigit(c) (((c) >= '0') && ((c) <= '9'))
|
||||
#define ksh_islower(c) (((c) >= 'a') && ((c) <= 'z'))
|
||||
#define ksh_isupper(c) (((c) >= 'A') && ((c) <= 'Z'))
|
||||
#define ksh_tolower(c) (((c) >= 'A') && ((c) <= 'Z') ? (c) - 'A' + 'a' : (c))
|
||||
#define ksh_toupper(c) (((c) >= 'a') && ((c) <= 'z') ? (c) - 'a' + 'A' : (c))
|
||||
#define ksh_isdash(s) (((s)[0] == '-') && ((s)[1] == '\0'))
|
||||
#define ksh_isspace(c) ((((c) >= 0x09) && ((c) <= 0x0D)) || ((c) == 0x20))
|
||||
#define ksh_eq(c,u,l) (((c) | 0x20) == (l))
|
||||
#define ksh_min(x,y) ((x) < (y) ? (x) : (y))
|
||||
#define ksh_max(x,y) ((x) > (y) ? (x) : (y))
|
||||
|
||||
#ifdef MKSH__NO_PATH_MAX
|
||||
#undef PATH_MAX
|
||||
#else
|
||||
@@ -937,6 +926,14 @@ extern unsigned char chtypes[];
|
||||
(chtypes[(unsigned char)(c)] & (t)) )
|
||||
#define ksh_isalphx(c) ctype((c), C_ALPHA)
|
||||
#define ksh_isalnux(c) ctype((c), C_ALPHA | C_DIGIT)
|
||||
#define ksh_isdigit(c) (((c) >= '0') && ((c) <= '9'))
|
||||
#define ksh_islower(c) (((c) >= 'a') && ((c) <= 'z'))
|
||||
#define ksh_isupper(c) (((c) >= 'A') && ((c) <= 'Z'))
|
||||
#define ksh_tolower(c) (((c) >= 'A') && ((c) <= 'Z') ? (c) - 'A' + 'a' : (c))
|
||||
#define ksh_toupper(c) (((c) >= 'a') && ((c) <= 'z') ? (c) - 'a' + 'A' : (c))
|
||||
#define ksh_isdash(s) (((s)[0] == '-') && ((s)[1] == '\0'))
|
||||
#define ksh_isspace(c) ((((c) >= 0x09) && ((c) <= 0x0D)) || ((c) == 0x20))
|
||||
#define ksh_eq(c,u,l) (((c) | 0x20) == (l))
|
||||
|
||||
EXTERN int ifs0 E_INIT(' '); /* for "$*" */
|
||||
|
||||
|
Reference in New Issue
Block a user