*/
-#define NEED_MEMSET 0
-#define NEED_MEMCPY 0
-#define NEED_MEMCMP 0
-#define NEED_STRLEN 0
-#define NEED_STRNLEN 0
-#define NEED_STRCMP 0
-#define NEED_STRNCMP 0
-#define NEED_STRCAT 0
-#define NEED_STRNCAT 0
-#define NEED_STRCPY 0
-#define NEED_STRNCPY 0
-#define NEED_STRDUP 0
-#define NEED_ATOI 0
-#define NEED_STRCHR 0
-#define NEED_STRRCHR 0
-#define NEED_STRPBRK 0
-
-
-
#include <palacios/vmm_types.h>
#include <palacios/vmm_string.h>
#include <palacios/vmm.h>
-#if NEED_MEMSET
+#ifdef CONFIG_BUILT_IN_MEMSET
void * memset(void * s, int c, size_t n) {
uchar_t * p = (uchar_t *) s;
}
#endif
-#if NEED_MEMCPY
+#ifdef CONFIG_BUILT_IN_MEMCPY
void * memcpy(void * dst, const void * src, size_t n) {
uchar_t * d = (uchar_t *) dst;
const uchar_t * s = (const uchar_t *)src;
#endif
-#if NEED_CMP
+#ifdef CONFIG_BUILT_IN_MEMCMP
int memcmp(const void * s1_, const void * s2_, size_t n) {
const char * s1 = s1_;
const char * s2 = s2_;
#endif
-#if NEED_STRLEN
+#ifdef CONFIG_BUILT_IN_STRLEN
size_t strlen(const char * s) {
size_t len = 0;
-#if NEED_STRNLEN
+#ifdef CONFIG_BUILT_IN_STRNLEN
/*
* This it a GNU extension.
* It is like strlen(), but it will check at most maxlen
#endif
-#if NEED_STRCMP
+#ifdef CONFIG_BUILT_IN_STRCMP
int strcmp(const char * s1, const char * s2) {
while (1) {
int cmp = (*s1 - *s2);
#endif
-#if NEED_STRNCMP
+#ifdef CONFIG_BUILT_IN_STRNCMP
int strncmp(const char * s1, const char * s2, size_t limit) {
size_t i = 0;
#endif
-#if NEED_STRCAT
+#ifdef CONFIG_BUILT_IN_STRCAT
char * strcat(char * s1, const char * s2) {
char * t1 = s1;
#endif
-#if NEED_STRNCAT
+#ifdef CONFIG_BUILT_IN_STRNCAT
char * strncat(char * s1, const char * s2, size_t limit) {
size_t i = 0;
char * t1;
-#if NEED_STRCPY
+#ifdef CONFIG_BUILT_IN_STRCPY
char * strcpy(char * dest, const char * src)
{
char *ret = dest;
#endif
-#if NEED_STRNCPY
+#ifdef CONFIG_BUILT_IN_STRNCPY
char * strncpy(char * dest, const char * src, size_t limit) {
char * ret = dest;
-#if NEED_STRDUP
+#ifdef CONFIG_BUILT_IN_STRDUP
char * strdup(const char * s1) {
char *ret;
-#if NEED_ATOI
+#ifdef CONFIG_BUILT_IN_ATOI
int atoi(const char * buf) {
int ret = 0;
#endif
-#if NEED_STRCHR
+#ifdef CONFIG_BUILT_IN_STRCHR
char * strchr(const char * s, int c) {
while (*s != '\0') {
if (*s == c)
#endif
-#if NEED_STRRCHR
+#ifdef CONFIG_BUILT_IN_STRRCHR
char * strrchr(const char * s, int c) {
size_t len = strlen(s);
const char * p = s + len;
}
#endif
-#if NEED_STRPBRK
+#ifdef CONFIG_BUILT_IN_STRPBRK
char * strpbrk(const char * s, const char * accept) {
size_t setLen = strlen(accept);