Improved versions of the is*ch() and tolowerch() macros that I like to use.
This commit is contained in:
parent
f1da56014e
commit
efdb85c8f4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=129975
@ -155,14 +155,14 @@ static void createdir(const struct conf_entry *ent, char *dirpart);
|
||||
static void createlog(const struct conf_entry *ent);
|
||||
|
||||
/*
|
||||
* All the following are defined to work on an 'int', in the
|
||||
* range 0 to 255, plus EOF. Define wrappers which can take
|
||||
* values of type 'char', either signed or unsigned.
|
||||
* All the following take a parameter of 'int', but expect values in the
|
||||
* range of unsigned char. Define wrappers which take values of type 'char',
|
||||
* whether signed or unsigned, and ensure they end up in the right range.
|
||||
*/
|
||||
#define isdigitch(Anychar) isdigit(((int) Anychar) & 255)
|
||||
#define isprintch(Anychar) isprint(((int) Anychar) & 255)
|
||||
#define isspacech(Anychar) isspace(((int) Anychar) & 255)
|
||||
#define tolowerch(Anychar) tolower(((int) Anychar) & 255)
|
||||
#define isdigitch(Anychar) isdigit((u_char)(Anychar))
|
||||
#define isprintch(Anychar) isprint((u_char)(Anychar))
|
||||
#define isspacech(Anychar) isspace((u_char)(Anychar))
|
||||
#define tolowerch(Anychar) tolower((u_char)(Anychar))
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
|
Loading…
Reference in New Issue
Block a user