diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-11-19 23:38:02 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-11-19 23:38:02 +0100 |
commit | 4132a111276f4410b7326559d8235df652b0560b (patch) | |
tree | 67cfcf7b71eeba3999cb74c54b2f8894dc2d84b2 /src/ctype.c | |
parent | fix memory leak at failure of execveat (issue #3) (diff) | |
download | slibc-4132a111276f4410b7326559d8235df652b0560b.tar.gz slibc-4132a111276f4410b7326559d8235df652b0560b.tar.bz2 slibc-4132a111276f4410b7326559d8235df652b0560b.tar.xz |
etymology for some functions
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/ctype.c')
-rw-r--r-- | src/ctype.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/ctype.c b/src/ctype.c index 3923def..a5eb75c 100644 --- a/src/ctype.c +++ b/src/ctype.c @@ -23,6 +23,8 @@ * Check whether a character is an alphabetical * character or a decimal digit. * + * @etymology (Is) character either (al)phabetical or (num)erical [(al)pha(num)erical]? + * * @param c The character. * @return Whether the character is in * ['0', '9'], ['A', 'Z'], or ['a', 'z']. @@ -36,6 +38,8 @@ int (isalnum)(int c) /** * Check whether a character is an alphabetical character. * + * @etymology (Is) character (alpha)betical? + * * @param c The character. * @return Whether the character is in * ['A', 'Z'] or ['a', 'z']. @@ -50,6 +54,8 @@ int (isalpha)(int c) * Check whether a character is a regular blank space * or a horizontal tabulation. * + * @etymology (Is) character a (blank) space? + * * @param c The character. * @return Whether the character is a ' ' or a '\t'. */ @@ -63,6 +69,8 @@ int (isblank)(int c) * Check whether a character is a non-printable * ASCII character. * + * @etymology (Is) character a (c)o(ntr)o(l) character? + * * @param c The character. * @return Whether the character is lower than ' '. */ @@ -75,6 +83,8 @@ int (iscntrl)(int c) /** * Check whether a character is a decimal digit. * + * @etymology (Is) character a (digit)? + * * @param c The character. * @return Whether the character is in ['0', '9']. */ @@ -87,6 +97,8 @@ int (isdigit)(int c) /** * Check whether a character is has a printable glyph. * + * @etymology (Is) character (graph)ical? + * * @param c The character. * @return Whether the character is greater than ' '. */ @@ -100,6 +112,8 @@ int (isgraph)(int c) * Check whether a character is a lowercase * alphabetical character. * + * @etymology (Is) character a (lower)case character? + * * @param c The character. * @return Whether the character is in ['a', 'z']. */ @@ -113,6 +127,8 @@ int (islower)(int c) * Check whether a character is has a printable glyph * or a blank space. * + * @etymology (Is) character (print)able? + * * @param c The character. * @return Whether the character is at least * as great as ' '. @@ -128,6 +144,8 @@ int (isprint)(int c) * that is, a printable character but a blank space, * numerical or alphabetical. * + * @etymology (Is) character a (punct)uation? + * * @param c The character. * @return Whether the character is a punctuation. */ @@ -140,6 +158,8 @@ int (ispunct)(int c) /** * Check whether a character is a whitespace character. * + * @etymology (Is) character white(space)? + * * @param c The character. * @return Whether the character is a ' ', '\f', * '\n', '\r', '\t', or '\v'. @@ -154,6 +174,8 @@ int (isspace)(int c) * Check whether a character is an uppercase * alphabetical character. * + * @etymology (Is) character a (upper)case character? + * * @param c The character. * @return Whether the character is in ['A', 'Z']. */ @@ -168,6 +190,8 @@ int (isupper)(int c) * hexadecimal digit. Both uppercase and * lowercase is supported. * + * @etymology (Is) character a he(x)adecimal digit? + * * @param c The character. * @return Whether the character is in * ['0', '9'], ['A', 'Z'], or ['a', 'z']. @@ -183,11 +207,13 @@ int (isxdigit)(int c) * Convert a uppercase ASCII character to * an lowercase ASCII character. * - * The function's behaviour is unspecifed + * The function's behaviour is unspecified * of the character is not alphabetical. * You should consider running * `(isupper(c) ? tolower(c) : c)` instead. * + * @etymology Convert character (to) (lower)case! + * * @param c The character. * @return The character in lowercase. * Guaranteed to be unchanged if the @@ -203,11 +229,13 @@ int (tolower)(int c) * Convert a lowercase ASCII character to * an uppercase ASCII character. * - * The function's behaviour is unspecifed + * The function's behaviour is unspecified * of the character is not alphabetical. * You should consider running * `(isupper(c) ? tolower(c) : c)` instead. * + * @etymology Convert character (to) (upper)case! + * * @param c The character. * @return The character in uppercase. * Guaranteed to be unchanged if the @@ -223,6 +251,8 @@ int (toupper)(int c) /** * Check whether a character is an ASCII character. * + * @etymology (Is) character an (ASCII) character? + * * @param c The character * @return Whether the character is an ASCII character. */ @@ -238,6 +268,12 @@ int (isascii)(int c) * Note that this does not make a proper character set * convertion and the result is virtually arbitrary. * + * Justification for existence: + * The highest bit has historically been used as a + * parity bit. + * + * @etymology Truncate character (to) fit (ASCII) character set! + * * @param c The character. * @return The character with the 8:th bit cleared. */ |