mirror of
https://github.com/fluencelabs/musl
synced 2025-06-25 20:51:53 +00:00
consolidate str[n]casecmp_l into str[n]casecmp source files
this is mainly done for consistency with the ctype functions and to declutter the src/locale directory.
This commit is contained in:
@ -1,6 +0,0 @@
|
|||||||
#include <strings.h>
|
|
||||||
|
|
||||||
int strcasecmp_l(const char *l, const char *r, locale_t loc)
|
|
||||||
{
|
|
||||||
return strcasecmp(l, r);
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
#include <strings.h>
|
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
int strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc)
|
|
||||||
{
|
|
||||||
return strncasecmp(l, r, n);
|
|
||||||
}
|
|
@ -1,5 +1,6 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include "libc.h"
|
||||||
|
|
||||||
int strcasecmp(const char *_l, const char *_r)
|
int strcasecmp(const char *_l, const char *_r)
|
||||||
{
|
{
|
||||||
@ -7,3 +8,10 @@ int strcasecmp(const char *_l, const char *_r)
|
|||||||
for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
|
for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
|
||||||
return tolower(*l) - tolower(*r);
|
return tolower(*l) - tolower(*r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int __strcasecmp_l(const char *l, const char *r, locale_t loc)
|
||||||
|
{
|
||||||
|
return strcasecmp(l, r);
|
||||||
|
}
|
||||||
|
|
||||||
|
weak_alias(__strcasecmp_l, strcasecmp_l);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include "libc.h"
|
||||||
|
|
||||||
int strncasecmp(const char *_l, const char *_r, size_t n)
|
int strncasecmp(const char *_l, const char *_r, size_t n)
|
||||||
{
|
{
|
||||||
@ -8,3 +9,10 @@ int strncasecmp(const char *_l, const char *_r, size_t n)
|
|||||||
for (; *l && *r && n && (*l == *r || tolower(*l) == tolower(*r)); l++, r++, n--);
|
for (; *l && *r && n && (*l == *r || tolower(*l) == tolower(*r)); l++, r++, n--);
|
||||||
return tolower(*l) - tolower(*r);
|
return tolower(*l) - tolower(*r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int __strncasecmp_l(const char *l, const char *r, size_t n, locale_t loc)
|
||||||
|
{
|
||||||
|
return strncasecmp(l, r, n);
|
||||||
|
}
|
||||||
|
|
||||||
|
weak_alias(__strncasecmp_l, strncasecmp_l);
|
||||||
|
Reference in New Issue
Block a user