Files
kolibrios/programs/develop/libraries/iconv/libc_stub.h
Maxim Logaev 63ff372400
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 39s
Build system / Build (pull_request) Successful in 11m11s
Libs/iconv: Untied from Libc, export table added
Signed-off-by: Maxim Logaev <maxlogaev@proton.me>
2025-03-06 00:01:31 +01:00

33 lines
666 B
C

#ifndef _LIBC_STUB_
#define _LIBC_STUB_
#define NULL (void*)0
static int errno = 0;
#define EINVAL 1 /* Invalid argument */
#define EILSEQ 2 /* Illegal byte sequence */
#define E2BIG 3 /* Arg list too long */
typedef unsigned long size_t;
static inline int isupper(int c)
{
return (unsigned)c-'A' < 26;
}
static inline int tolower(int c)
{
if (isupper(c)) return c | 32;
return c;
}
static inline int strcasecmp(const char *_l, const char *_r)
{
const unsigned char *l=(unsigned char*)_l, *r=(unsigned char*)_r;
for (; *l && *r && (*l == *r || tolower(*l) == tolower(*r)); l++, r++);
return tolower(*l) - tolower(*r);
}
#endif // _LIBC_STUB_