X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_string.h;h=78c3cf004f8ea38eaaabf020d16d827047e3d45f;hp=c5cf8b80493f21cd285041c402c84b0e0743a333;hb=123a1ba27ea09c8fa77a1b36ce625b43d7c48b14;hpb=e70e95962c26832628d586e07f9cd1a2e1852d72 diff --git a/palacios/include/palacios/vmm_string.h b/palacios/include/palacios/vmm_string.h index c5cf8b8..78c3cf0 100644 --- a/palacios/include/palacios/vmm_string.h +++ b/palacios/include/palacios/vmm_string.h @@ -34,27 +34,54 @@ #ifdef __V3VEE__ -#include +#include -void* memset(void* s, int c, size_t n); -void* memcpy(void *dst, const void* src, size_t n); -//void *memmove(void *dst, const void *src, size_t n); + +void * memset(void* s, int c, size_t n); +void * memcpy(void *dst, const void* src, size_t n); +void * memmove(void *dst, const void *src, size_t n); int memcmp(const void *s1, const void *s2, size_t n); size_t strlen(const char* s); size_t strnlen(const char *s, size_t maxlen); int strcmp(const char* s1, const char* s2); +int strcasecmp(const char* s1, const char* s2); int strncmp(const char* s1, const char* s2, size_t limit); +int strncasecmp(const char* s1, const char* s2, size_t limit); char *strcat(char *s1, const char *s2); +char *strncat(char *s1, const char *s2, size_t limit); char *strcpy(char *dest, const char *src); char *strncpy(char *dest, const char *src, size_t limit); char *strdup(const char *s1); -int atoi(const char *buf); +int atoi(const char * buf); +uint64_t atox(const char * buf); +int strtoi(const char * nptr, char ** endptr); +uint64_t strtox(const char * nptr, char ** endptr); char *strchr(const char *s, int c); char *strrchr(const char *s, int c); char *strpbrk(const char *s, const char *accept); +size_t strspn(const char * s, const char * accept); +size_t strcspn(const char * s, const char * reject); +char * strstr(const char * haystack, const char * needle); + +void str_tolower(char * s); +void str_toupper(char * s); + + + +#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) <= '~') -double ceil(double x); +#define toupper(c) ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z'))) +#define tolower(c) ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z'))) #endif // !__V3VEE__