Changeset 021c508 in mainline for uspace/lib/posix/ctype.c
- Timestamp:
- 2011-06-24T02:17:09Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d185132
- Parents:
- 4d4988e (diff), 67c64b9f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/ctype.c
r4d4988e r021c508 38 38 #include "ctype.h" 39 39 40 // TODO: propose for inclusion in libc 41 40 42 /** 41 * 42 * @param ch 43 * Checks whether character is a hexadecimal digit. 44 * 45 * @param c 43 46 * @return 44 47 */ 45 int posix_isxdigit(int c h)48 int posix_isxdigit(int c) 46 49 { 47 return isdigit(ch) || 48 (ch >= 'a' && ch <= 'f') || 49 (ch >= 'A' && ch <= 'F'); 50 return isdigit(c) || 51 (c >= 'a' && c <= 'f') || 52 (c >= 'A' && c <= 'F'); 53 } 54 55 /** 56 * Checks whether character is a word separator. 57 * 58 * @param c 59 * @return 60 */ 61 int posix_isblank(int c) 62 { 63 return c == ' ' || c == '\t'; 64 } 65 66 /** 67 * Checks whether character is a control character. 68 * 69 * @param c 70 * @return 71 */ 72 int posix_iscntrl(int c) 73 { 74 return c < 0x20 || c == 0x7E; 75 } 76 77 /** 78 * Checks whether character is any printing character except space. 79 * 80 * @param c 81 * @return 82 */ 83 int posix_isgraph(int c) 84 { 85 return posix_isprint(c) && c != ' '; 86 } 87 88 /** 89 * Checks whether character is a printing character. 90 * 91 * @param c 92 * @return 93 */ 94 int posix_isprint(int c) 95 { 96 return !posix_iscntrl(c); 97 } 98 99 /** 100 * Checks whether character is a punctuation. 101 * 102 * @param c 103 * @return 104 */ 105 int posix_ispunct(int c) 106 { 107 return !isspace(c) && !isalnum(c); 50 108 } 51 109
Note:
See TracChangeset
for help on using the changeset viewer.