X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_string.h;h=2e57bf97db0fcb52263266b2e51de6abe064167d;hb=26807ca4c1fd7ea21a615b29626e73a75873bead;hp=60155a08121936bc17169447e89070c81fd3191a;hpb=d38e1d6edeee83bfb1e3e3c6e2367faa5055bdfe;p=palacios.git diff --git a/palacios/include/palacios/vmm_string.h b/palacios/include/palacios/vmm_string.h index 60155a0..2e57bf9 100644 --- a/palacios/include/palacios/vmm_string.h +++ b/palacios/include/palacios/vmm_string.h @@ -34,7 +34,7 @@ #ifdef __V3VEE__ -#include +#include void* memset(void* s, int c, size_t n); @@ -56,10 +56,24 @@ char *strrchr(const char *s, int c); char *strpbrk(const char *s, const char *accept); -double ceil(double x); +#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') +#define isascii(c) (((c) & ~0x7f) == 0) +#define isupper(c) ((c) >= 'A' && (c) <= 'Z') +#define islower(c) ((c) >= 'a' && (c) <= 'z') +#define isalpha(c) (isupper(c) || islower(c)) +#define isdigit(c) ((c) >= '0' && (c) <= '9') +#define isxdigit(c) (isdigit(c) \ + || ((c) >= 'A' && (c) <= 'F') \ + || ((c) >= 'a' && (c) <= 'f')) +#define isprint(c) ((c) >= ' ' && (c) <= '~') + +#define toupper(c) ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z'))) +#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z'))) + + #endif // !__V3VEE__ #endif /* STRING_H */