Changeset 62 for pjproject/trunk/pjlib/include/pj/ctype.h
- Timestamp:
- Nov 20, 2005 7:55:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/ctype.h
r51 r62 25 25 */ 26 26 27 #include <pj/types.h> 27 28 #include <pj/compat/ctype.h> 29 30 PJ_BEGIN_DECL 28 31 29 32 /** … … 100 103 101 104 /** 102 * Returns a non-zero value if c is a particular representation of103 * an hexadecimal digit character.104 * @param c The integer character to test.105 * @return Non-zero value if c is a particular representation of106 * an hexadecimal digit character.107 */108 PJ_INLINE(int) pj_isxdigit(int c){ return isxdigit(c); }109 110 /**111 105 * Returns a non-zero value if c is a either a space (' ') or horizontal 112 106 * tab ('\\t') character. … … 131 125 PJ_INLINE(int) pj_toupper(int c) { return toupper(c); } 132 126 127 /** 128 * Returns a non-zero value if c is a particular representation of 129 * an hexadecimal digit character. 130 * @param c The integer character to test. 131 * @return Non-zero value if c is a particular representation of 132 * an hexadecimal digit character. 133 */ 134 PJ_INLINE(int) pj_isxdigit(int c){ return isxdigit(c); } 135 136 /** 137 * Array of hex digits, in lowerspace. 138 */ 139 extern char pj_hex_digits[]; 140 141 /** 142 * Convert a value to hex representation. 143 * @param value Integral value to convert. 144 * @param p Buffer to hold the hex representation, which must be 145 * at least two bytes length. 146 */ 147 PJ_INLINE(void) pj_val_to_hex_digit(unsigned value, char *p) 148 { 149 *p++ = pj_hex_digits[ (value & 0xF0) >> 4 ]; 150 *p = pj_hex_digits[ (value & 0x0F) ]; 151 } 152 153 /** 154 * Convert hex digit c to integral value. 155 * @param c The hex digit character. 156 * @return The integral value between 0 and 15. 157 */ 158 PJ_INLINE(unsigned) pj_hex_digit_to_val(unsigned c) 159 { 160 if (c <= '9') 161 return (c-'0') & 0x0F; 162 else if (c <= 'F') 163 return (c-'A'+10) & 0x0F; 164 else 165 return (c-'a'+10) & 0x0F; 166 } 167 133 168 /** @} */ 169 170 PJ_END_DECL 134 171 135 172 #endif /* __PJ_CTYPE_H__ */
Note: See TracChangeset
for help on using the changeset viewer.