xen: Add new string function

Add strcasecmp. The code is copied from Linux.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Julien Grall authored and Ian Campbell committed 2013-09-10 11:44:01 +01:00
1 parent e6fb0c4b80
commit 6bc02f74af
2 files changed
+18

No files matched your search

+15
View File
@@ -41,6 +41,21 @@ int strnicmp(const char *s1, const char *s2, size_t len)
}
#endif
#ifndef __HAVE_ARCH_STRCASECMP
int strcasecmp(const char *s1, const char *s2)
{
int c1, c2;
do
{
c1 = tolower(*s1++);
c2 = tolower(*s2++);
} while ( c1 == c2 && c1 != 0 );
return c1 - c2;
}
#endif
#ifndef __HAVE_ARCH_STRLCPY
/**
* strlcpy - Copy a %NUL terminated string into a sized buffer
+3
View File
@@ -43,6 +43,9 @@ extern int strncmp(const char *,const char *,__kernel_size_t);
#ifndef __HAVE_ARCH_STRNICMP
extern int strnicmp(const char *, const char *, __kernel_size_t);
#endif
#ifndef __HAVE_ARCH_STRCASECMP
extern int strcasecmp(const char *, const char *);
#endif
#ifndef __HAVE_ARCH_STRCHR
extern char * strchr(const char *,int);
#endif
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.