#include #include #include "string.h" int memcmp(const void *s1, const void *s2, size_t n) { unsigned char *a = (unsigned char *) s1; unsigned char *b = (unsigned char *) s2; for (size_t i=0;i> (i * 4)) & 0xF; if (digit < 10) buf[9 - i] = '0' + digit; else buf[9 - i] = 'A' + (digit - 10); } return buf; } #define R(a, b) (c >= a && c <= b) bool isupper(char c) {return R('A', 'Z');} bool islower(char c) {return R('a', 'z');} bool isalpha(char c) {return isupper(c) || islower(c);} bool isdigit(char c) {return R('0', '9');} bool isxdigit(char c) {return isdigit(c) || R('A', 'F') || R('a', 'f');} bool isalnum(char c) {return isdigit(c) || isalpha(c);} bool isspace(char c) {return c == ' ' || (unsigned)c-'\t' < 5;} char toupper(char c) {if (islower(c)) return (c + ('A' - 'a')); else return c;} char tolower(char c) {if (isupper(c)) return (c - ('A' - 'a')); else return c;}