/*
* String library
* Copyright (c) 2001,2004 David H. Hovemeyer <daveho@cs.umd.edu>
- * $Revision: 1.1 $
+ * (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
+ * (c) 2008, The V3VEE Project <http://www.v3vee.org>
+ * $Revision: 1.2 $
*
* This is free software. You are permitted to use,
* redistribute, and modify it as specified in the file "COPYING".
*/
+
+
+
/*
* NOTE:
* These are slow and simple implementations of a subset of
#include <palacios/vmm_string.h>
+#include <palacios/vmm.h>
+
+
-extern void *Malloc(size_t size);
+static float e = 0.00000001;
+double ceil(double x) {
+ if ((double)(x - (int)x) == 0) {
+ return (int)x;
+ }
+ return (int)(x + e) + 1;
+}
+
+#if 0
void* memset(void* s, int c, size_t n)
{
unsigned char* p = (unsigned char*) s;
return s;
}
+
void* memcpy(void *dst, const void* src, size_t n)
{
unsigned char* d = (unsigned char*) dst;
return dst;
}
+
int memcmp(const void *s1_, const void *s2_, size_t n)
{
const signed char *s1 = s1_, *s2 = s2_;
{
char *ret;
- ret = Malloc(strlen(s1) + 1);
+ ret = V3_Malloc(strlen(s1) + 1);
strcpy(ret, s1);
return ret;
return 0;
}
+#endif