Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork130
Made WCharacter.h more clear#26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -22,6 +22,12 @@ | ||
#include <ctype.h> | ||
// This Mentions that the following code is | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is useless. It only changes how the function names are mangled. Since the functions are not compiled into an object file nor a static library, it doesn't matter if they're extern "C" or not. They're inline, in C++ and in C. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't think this is true for any | ||
// Compatible with Standard C | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
// WCharacter.h prototypes | ||
inline bool isAlphaNumeric(int c) __attribute__((always_inline)); | ||
inline bool isAlpha(int c) __attribute__((always_inline)); | ||
@@ -45,73 +51,73 @@ inline int toUpperCase(int c)__attribute__((always_inline)); | ||
// It is equivalent to (isalpha(c) || isdigit(c)). | ||
inline bool isAlphaNumeric(int c) | ||
{ | ||
return isalnum(c)!= 0; | ||
} | ||
// Checks for an alphabetic character. | ||
// It is equivalent to (isupper(c) || islower(c)). | ||
inline bool isAlpha(int c) | ||
{ | ||
return isalpha(c)!= 0; | ||
} | ||
// Checks whether c is a 7-bit unsigned char value | ||
// that fits into the ASCII character set. | ||
inline bool isAscii(int c) | ||
{ | ||
return isascii(c)!= 0; | ||
} | ||
// Checks for a blank character, that is, a space or a tab. | ||
inline bool isWhitespace(int c) | ||
{ | ||
return isblank(c)!= 0; | ||
} | ||
// Checks for a control character. | ||
inline bool isControl(int c) | ||
{ | ||
return iscntrl(c)!= 0; | ||
} | ||
// Checks for a digit (0 through 9). | ||
inline bool isDigit(int c) | ||
{ | ||
return isdigit(c)!= 0; | ||
} | ||
// Checks for any printable character except space. | ||
inline bool isGraph(int c) | ||
{ | ||
return isgraph(c)!= 0; | ||
} | ||
// Checks for a lower-case character. | ||
inline bool isLowerCase(int c) | ||
{ | ||
return islower(c)!= 0; | ||
} | ||
// Checks for any printable character including space. | ||
inline bool isPrintable(int c) | ||
{ | ||
return isprint(c)!= 0; | ||
} | ||
// Checks for any printable character which is not a space | ||
// or an alphanumeric character. | ||
inline bool isPunct(int c) | ||
{ | ||
return ispunct(c)!= 0; | ||
} | ||
@@ -120,22 +126,22 @@ inline bool isPunct(int c) | ||
// return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). | ||
inline bool isSpace(int c) | ||
{ | ||
return isspace(c)!= 0; | ||
} | ||
// Checks for an uppercase letter. | ||
inline bool isUpperCase(int c) | ||
{ | ||
return isupper(c)!= 0; | ||
} | ||
// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 | ||
// 8 9 a b c d e f A B C D E F. | ||
inline bool isHexadecimalDigit(int c) | ||
{ | ||
return isxdigit(c)!= 0; | ||
} | ||
@@ -165,4 +171,9 @@ inline int toUpperCase(int c) | ||
return toupper (c); | ||
} | ||
// End extern C | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |