Update to version 11479
authorSanjeev <as2902.b@samsung.com>
Mon, 15 Nov 2010 04:49:37 +0000 (13:49 +0900)
committerSanjeev <as2902.b@samsung.com>
Mon, 15 Nov 2010 04:49:37 +0000 (13:49 +0900)
drd/scripts/ppc-cross/kernel-config/2.6.22/.svn/entries
exp-dhat/docs/.svn/entries
memcheck/mc_replace_strmem.c

index 4b80819..49f0af5 100644 (file)
@@ -1,7 +1,7 @@
 10
 
 dir
-11477
+11479
 svn://svn.valgrind.org/valgrind/trunk/drd/scripts/ppc-cross/kernel-config/2.6.22
 svn://svn.valgrind.org/valgrind
 
index 3782346..7782268 100644 (file)
@@ -1,7 +1,7 @@
 10
 
 dir
-11477
+11479
 svn://svn.valgrind.org/valgrind/trunk/exp-dhat/docs
 svn://svn.valgrind.org/valgrind
 
index d500367..ebef4d8 100644 (file)
@@ -403,6 +403,118 @@ STRNCMP(VG_Z_DYLD,        strncmp)
 #endif
 
 
+#define STRCASECMP(soname, fnname) \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2 ); \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2 ) \
+   { \
+      extern int tolower(int); \
+      register unsigned char c1; \
+      register unsigned char c2; \
+      while (True) { \
+         c1 = tolower(*(unsigned char *)s1); \
+         c2 = tolower(*(unsigned char *)s2); \
+         if (c1 != c2) break; \
+         if (c1 == 0) break; \
+         s1++; s2++; \
+      } \
+      if ((unsigned char)c1 < (unsigned char)c2) return -1; \
+      if ((unsigned char)c1 > (unsigned char)c2) return 1; \
+      return 0; \
+   }
+
+STRCASECMP(VG_Z_LIBC_SONAME, strcasecmp)
+#if defined(VGO_linux)
+STRCASECMP(VG_Z_LIBC_SONAME, __GI_strcasecmp)
+#endif
+
+
+#define STRNCASECMP(soname, fnname) \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2, SizeT nmax ); \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2, SizeT nmax ) \
+   { \
+      extern int tolower(int); \
+      SizeT n = 0; \
+      while (True) { \
+         if (n >= nmax) return 0; \
+         if (*s1 == 0 && *s2 == 0) return 0; \
+         if (*s1 == 0) return -1; \
+         if (*s2 == 0) return 1; \
+         \
+         if (tolower(*(unsigned char*)s1) < tolower(*(unsigned char*)s2)) return -1; \
+         if (tolower(*(unsigned char*)s1) > tolower(*(unsigned char*)s2)) return 1; \
+         \
+         s1++; s2++; n++; \
+      } \
+   }
+
+STRNCASECMP(VG_Z_LIBC_SONAME, strncasecmp)
+#if defined(VGO_linux)
+STRNCASECMP(VG_Z_LIBC_SONAME, __GI_strncasecmp)
+#elif defined(VGO_darwin)
+STRNCASECMP(VG_Z_DYLD,        strncasecmp)
+#endif
+
+
+#define STRCASECMP_L(soname, fnname) \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2, void* locale ); \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2, void* locale ) \
+   { \
+      extern int tolower_l(int, void*) __attribute__((weak));    \
+      register unsigned char c1; \
+      register unsigned char c2; \
+      while (True) { \
+         c1 = tolower_l(*(unsigned char *)s1, locale); \
+         c2 = tolower_l(*(unsigned char *)s2, locale); \
+         if (c1 != c2) break; \
+         if (c1 == 0) break; \
+         s1++; s2++; \
+      } \
+      if ((unsigned char)c1 < (unsigned char)c2) return -1; \
+      if ((unsigned char)c1 > (unsigned char)c2) return 1; \
+      return 0; \
+   }
+
+STRCASECMP_L(VG_Z_LIBC_SONAME, strcasecmp_l)
+#if defined(VGO_linux)
+STRCASECMP_L(VG_Z_LIBC_SONAME, __GI_strcasecmp_l)
+#endif
+
+
+#define STRNCASECMP_L(soname, fnname) \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2, SizeT nmax, void* locale ); \
+   int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
+          ( const char* s1, const char* s2, SizeT nmax, void* locale ) \
+   { \
+      extern int tolower_l(int, void*) __attribute__((weak));    \
+      SizeT n = 0; \
+      while (True) { \
+         if (n >= nmax) return 0; \
+         if (*s1 == 0 && *s2 == 0) return 0; \
+         if (*s1 == 0) return -1; \
+         if (*s2 == 0) return 1; \
+         \
+         if (tolower_l(*(unsigned char*)s1, locale) < tolower_l(*(unsigned char*)s2, locale)) return -1; \
+         if (tolower_l(*(unsigned char*)s1, locale) > tolower_l(*(unsigned char*)s2, locale)) return 1; \
+         \
+         s1++; s2++; n++; \
+      } \
+   }
+
+STRNCASECMP_L(VG_Z_LIBC_SONAME, strncasecmp_l)
+#if defined(VGO_linux)
+STRNCASECMP_L(VG_Z_LIBC_SONAME, __GI_strncasecmp_l)
+#elif defined(VGO_darwin)
+STRNCASECMP_L(VG_Z_DYLD,        strncasecmp_l)
+#endif
+
+
 #define STRCMP(soname, fnname) \
    int VG_REPLACE_FUNCTION_ZU(soname,fnname) \
           ( const char* s1, const char* s2 ); \