Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


added xml parser for configuration
[palacios.git] / palacios / include / palacios / vmm_string.h
1 /* * String library
2  * Copyright (c) 2001,2004 David H. Hovemeyer <daveho@cs.umd.edu>
3  * Copyright (c) 2003, Jeffrey K. Hollingsworth <hollings@cs.umd.edu>
4  *
5  * Permission is hereby granted, free of charge, to any person
6  * obtaining a copy of this software and associated documentation
7  * files (the "Software"), to deal in the Software without restriction,
8  * including without limitation the rights to use, copy, modify, merge,
9  * publish, distribute, sublicense, and/or sell copies of the Software,
10  * and to permit persons to whom the Software is furnished to do so,
11  * subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be
14  * included in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
17  * ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
18  * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19  * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
20  * SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
21  * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
24  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  */
26
27 /* Modifications:
28  * 2008, Jack Lange <jarusl@cs.northwestern.edu> 
29  * 2008, Lei Xia <xiaxlei@gmail.com> 
30  */
31
32 #ifndef __VMM_STRING_H__
33 #define __VMM_STRING_H__
34
35 #ifdef __V3VEE__
36
37 #include <palacios/vmm_types.h>
38
39
40 void * memset(void* s, int c, size_t n);
41 void * memcpy(void *dst, const void* src, size_t n);
42 void * memmove(void *dst, const void *src, size_t n);
43 int memcmp(const void *s1, const void *s2, size_t n);
44 size_t strlen(const char* s);
45 size_t strnlen(const char *s, size_t maxlen);
46 int strcmp(const char* s1, const char* s2);
47 int strncmp(const char* s1, const char* s2, size_t limit);
48 char *strcat(char *s1, const char *s2);
49 char *strncat(char *s1, const char *s2, size_t limit);
50 char *strcpy(char *dest, const char *src);
51 char *strncpy(char *dest, const char *src, size_t limit);
52 char *strdup(const char *s1);
53 int atoi(const char * buf);
54 uint64_t atox(const char * buf);
55 int strtoi(const char * nptr, char ** endptr);
56 uint64_t strtox(const char * nptr, char ** endptr);
57 char *strchr(const char *s, int c);
58 char *strrchr(const char *s, int c);
59 char *strpbrk(const char *s, const char *accept);
60
61 size_t strspn(const char * s, const char * accept);
62 size_t strcspn(const char * s, const char * reject);
63 char * strstr(const char * haystack, const char * needle);
64
65
66 #define isspace(c)           (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v')
67 #define isascii(c)      (((c) & ~0x7f) == 0)
68 #define isupper(c)      ((c) >= 'A' && (c) <= 'Z')
69 #define islower(c)      ((c) >= 'a' && (c) <= 'z')
70 #define isalpha(c)      (isupper(c) || islower(c))
71 #define isdigit(c)      ((c) >= '0' && (c) <= '9')
72 #define isxdigit(c)     (isdigit(c) \
73                           || ((c) >= 'A' && (c) <= 'F') \
74                           || ((c) >= 'a' && (c) <= 'f'))
75 #define isprint(c)      ((c) >= ' ' && (c) <= '~')
76
77 #define toupper(c)      ((c) - 0x20 * (((c) >= 'a') && ((c) <= 'z')))
78 #define tolower(c)      ((c) + 0x20 * (((c) >= 'A') && ((c) <= 'Z')))
79
80
81 #endif // !__V3VEE__
82
83 #endif  /* STRING_H */