mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 15:28:30 +00:00
Fold LIBC_UNICODE into LIBC_STR
This commit is contained in:
parent
17aea99bb3
commit
367d06d9e4
173 changed files with 170 additions and 355 deletions
|
@ -27,7 +27,7 @@
|
|||
#include "libc/str/thompike.h"
|
||||
#include "libc/str/tpenc.h"
|
||||
#include "libc/str/utf16.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
typedef int (*out_f)(const char *, void *, size_t);
|
||||
typedef int (*emit_f)(out_f, void *, uint64_t);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
long long strtoll_l(const char *nptr, char **endptr, int base, locale_t l) {
|
||||
return strtoll(nptr, endptr, base);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
unsigned long long strtoull_l(const char *nptr, char **endptr, int base,
|
||||
locale_t l) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr, int base,
|
||||
locale_t l) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
unsigned long long wcstoull_l(const wchar_t *nptr, wchar_t **endptr, int base,
|
||||
locale_t l) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_LANGINFO_H_
|
||||
#define COSMOPOLITAN_LIBC_ISYSTEM_LANGINFO_H_
|
||||
#include "libc/unicode/langinfo.h"
|
||||
#include "libc/str/langinfo.h"
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_LANGINFO_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_LOCALE_H_
|
||||
#define COSMOPOLITAN_LIBC_ISYSTEM_LOCALE_H_
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_LOCALE_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_NL_TYPES_H_
|
||||
#define COSMOPOLITAN_LIBC_ISYSTEM_NL_TYPES_H_
|
||||
#include "libc/unicode/nltypes.h"
|
||||
#include "libc/str/nltypes.h"
|
||||
#endif /* COSMOPOLITAN_LIBC_ISYSTEM_NL_TYPES_H_ */
|
||||
|
|
|
@ -30,7 +30,6 @@ o/$(MODE)/libc: o/$(MODE)/libc/calls \
|
|||
o/$(MODE)/libc/thread \
|
||||
o/$(MODE)/libc/time \
|
||||
o/$(MODE)/libc/tinymath \
|
||||
o/$(MODE)/libc/unicode \
|
||||
o/$(MODE)/libc/x \
|
||||
o/$(MODE)/libc/zipos \
|
||||
$(LIBC_CHECKS)
|
||||
|
|
|
@ -42,7 +42,6 @@ LIBC_LOG_A_DIRECTDEPS = \
|
|||
LIBC_SYSV_CALLS \
|
||||
LIBC_TIME \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_UNICODE \
|
||||
THIRD_PARTY_DLMALLOC \
|
||||
THIRD_PARTY_GDTOA
|
||||
|
||||
|
|
|
@ -44,7 +44,6 @@ LIBC_SOCK_A_DIRECTDEPS = \
|
|||
LIBC_STUBS \
|
||||
LIBC_SYSV_CALLS \
|
||||
LIBC_TIME \
|
||||
LIBC_UNICODE \
|
||||
LIBC_SYSV
|
||||
|
||||
LIBC_SOCK_A_DEPS := \
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include "libc/stdio/iconv.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
// clang-format off
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
void freelocale(locale_t l) {
|
||||
// TODO: implement me
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int isdigit_l(int c, locale_t l) {
|
||||
return iswdigit(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int islower_l(int c, locale_t l) {
|
||||
return islower(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int isupper_l(int c, locale_t l) {
|
||||
return isupper(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswalpha_l(wint_t c, locale_t l) {
|
||||
return iswalpha(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswblank_l(wint_t c, locale_t l) {
|
||||
return iswblank(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswcntrl_l(wint_t c, locale_t l) {
|
||||
return iswcntrl(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswdigit_l(wint_t c, locale_t l) {
|
||||
return iswdigit(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswlower_l(wint_t c, locale_t l) {
|
||||
return iswlower(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswprint_l(wint_t c, locale_t l) {
|
||||
return iswprint(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswpunct_l(wint_t c, locale_t l) {
|
||||
return iswpunct(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswspace_l(wint_t c, locale_t l) {
|
||||
return iswspace(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswupper_l(wint_t c, locale_t l) {
|
||||
return iswupper(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int iswxdigit_l(wint_t c, locale_t l) {
|
||||
return iswxdigit(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int isxdigit_l(int c, locale_t l) {
|
||||
return iswxdigit(c);
|
|
@ -27,9 +27,9 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/nexgen32e/gettls.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/unicode/langinfo.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/unicode/nltypes.h"
|
||||
#include "libc/str/langinfo.h"
|
||||
#include "libc/str/locale.h"
|
||||
#include "libc/str/nltypes.h"
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
Musl libc (MIT License)\\n\
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_UNICODE_LANGINFO_H_
|
||||
#define COSMOPOLITAN_LIBC_UNICODE_LANGINFO_H_
|
||||
#ifndef COSMOPOLITAN_LIBC_STR_LANGINFO_H_
|
||||
#define COSMOPOLITAN_LIBC_STR_LANGINFO_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -83,4 +83,4 @@ char *nl_langinfo(int);
|
|||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_UNICODE_LANGINFO_H_ */
|
||||
#endif /* COSMOPOLITAN_LIBC_STR_LANGINFO_H_ */
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_UNICODE_LOCALE_H_
|
||||
#define COSMOPOLITAN_LIBC_UNICODE_LOCALE_H_
|
||||
#ifndef COSMOPOLITAN_LIBC_STR_LOCALE_H_
|
||||
#define COSMOPOLITAN_LIBC_STR_LOCALE_H_
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/time/struct/tm.h"
|
||||
|
||||
|
@ -79,4 +79,4 @@ wint_t towupper_l(wint_t, locale_t);
|
|||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_UNICODE_LOCALE_H_ */
|
||||
#endif /* COSMOPOLITAN_LIBC_STR_LOCALE_H_ */
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/limits.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
static const struct lconv kLocaleConv = {
|
||||
.decimal_point = ".",
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
locale_t newlocale(int catmask, const char *locale, locale_t base) {
|
||||
// TODO: implement me
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_UNICODE_NLTYPES_H_
|
||||
#define COSMOPOLITAN_LIBC_UNICODE_NLTYPES_H_
|
||||
#ifndef COSMOPOLITAN_LIBC_STR_NLTYPES_H_
|
||||
#define COSMOPOLITAN_LIBC_STR_NLTYPES_H_
|
||||
|
||||
#define NL_SETD 1
|
||||
#define NL_CAT_LOCALE 1
|
||||
|
@ -16,4 +16,4 @@ int catclose(nl_catd);
|
|||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_UNICODE_NLTYPES_H_ */
|
||||
#endif /* COSMOPOLITAN_LIBC_STR_NLTYPES_H_ */
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
/**
|
||||
* Sets program locale.
|
|
@ -94,6 +94,32 @@ o/$(MODE)/libc/fmt/strsignal.greg.o: private \
|
|||
-ffreestanding \
|
||||
$(NO_MAGIC)
|
||||
|
||||
o/$(MODE)/libc/str/eastasianwidth.bin: \
|
||||
libc/str/eastasianwidth.txt \
|
||||
o/$(MODE)/tool/decode/mkwides.com
|
||||
@$(COMPILE) -AMKWIDES -T$@ o/$(MODE)/tool/decode/mkwides.com -o $@ $<
|
||||
o/$(MODE)/libc/str/eastasianwidth.bin.lz4: \
|
||||
o/$(MODE)/libc/str/eastasianwidth.bin \
|
||||
o/$(MODE)/third_party/lz4cli/lz4cli.com
|
||||
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
|
||||
o/$(MODE)/libc/str/eastasianwidth.s: \
|
||||
o/$(MODE)/libc/str/eastasianwidth.bin.lz4 \
|
||||
o/$(MODE)/tool/build/lz4toasm.com
|
||||
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kEastAsianWidth -o $@ $<
|
||||
|
||||
o/$(MODE)/libc/str/combiningchars.bin: \
|
||||
libc/str/strdata.txt \
|
||||
o/$(MODE)/tool/decode/mkcombos.com
|
||||
@$(COMPILE) -AMKCOMBOS -T$@ o/$(MODE)/tool/decode/mkcombos.com -o $@ $<
|
||||
o/$(MODE)/libc/str/combiningchars.bin.lz4: \
|
||||
o/$(MODE)/libc/str/combiningchars.bin \
|
||||
o/$(MODE)/third_party/lz4cli/lz4cli.com
|
||||
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
|
||||
o/$(MODE)/libc/str/combiningchars.s: \
|
||||
o/$(MODE)/libc/str/combiningchars.bin.lz4 \
|
||||
o/$(MODE)/tool/build/lz4toasm.com
|
||||
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kCombiningChars -o $@ $<
|
||||
|
||||
LIBC_STR_LIBS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)))
|
||||
LIBC_STR_SRCS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_SRCS))
|
||||
LIBC_STR_HDRS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_HDRS))
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int strcoll_l(const char *p, const char *q, locale_t l) {
|
||||
return strcmp(p, q);
|
|
@ -23,7 +23,7 @@
|
|||
#include "libc/nexgen32e/bsf.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/str/thompike.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
/**
|
||||
* Returns monospace display width of UTF-8 string.
|
|
@ -19,7 +19,7 @@
|
|||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/str/oldutf16.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
/**
|
||||
* Returns monospace display width of UTF-16 or UCS-2 string.
|
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
/**
|
||||
* Returns monospace display width of UTF-8 string.
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
/**
|
||||
* Returns monospace display width of UTF-16 or UCS-2 string.
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
size_t strxfrm_l(char *dest, const char *src, size_t count, locale_t l) {
|
||||
return strxfrm(dest, src, count);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int tolower_l(int c, locale_t l) {
|
||||
return tolower(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int toupper_l(int c, locale_t l) {
|
||||
return toupper(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
wint_t towlower_l(wint_t c, locale_t l) {
|
||||
return towlower(c);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
wint_t towupper_l(wint_t c, locale_t l) {
|
||||
return towupper(c);
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_UNICODE_UNICODE_H_
|
||||
#define COSMOPOLITAN_LIBC_UNICODE_UNICODE_H_
|
||||
#ifndef COSMOPOLITAN_LIBC_STR_UNICODE_H_
|
||||
#define COSMOPOLITAN_LIBC_STR_UNICODE_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -41,4 +41,4 @@ struct lconv *localeconv(void);
|
|||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_UNICODE_UNICODE_H_ */
|
||||
#endif /* COSMOPOLITAN_LIBC_STR_UNICODE_H_ */
|
15
libc/str/update.sh
Executable file
15
libc/str/update.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
[ -d libc/unicode ] || exit
|
||||
[ -x o//examples/curl.com ] || make -j8 o//examples/curl.com || exit
|
||||
mkdir -p o/tmp/ || exit
|
||||
|
||||
shineget() {
|
||||
echo $2
|
||||
o//examples/curl.com $2 >o/tmp/$$ || exit
|
||||
mv o/tmp/$$ $1 || exit
|
||||
}
|
||||
|
||||
shineget libc/str/blocks.txt https://www.unicode.org/Public/UCD/latest/ucd/Blocks.txt
|
||||
shineget libc/str/unicodedata.txt https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
|
||||
shineget libc/str/eastasianwidth.txt https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
|
||||
shineget libc/str/SpecialCasing.txt https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/sysv/errfuns.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
locale_t uselocale(locale_t l) {
|
||||
// TODO: implement me!
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
int wcscoll_l(const wchar_t *p, const wchar_t *q, locale_t l) {
|
||||
return wcscmp(p, q);
|
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
/**
|
||||
* Returns monospace display width of wide character string.
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/limits.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
/**
|
||||
* Returns monospace display width of wide character string.
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t count, locale_t l) {
|
||||
return wcsxfrm(dest, src, count);
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/likely.h"
|
||||
#include "libc/unicode/unicode.h"
|
||||
#include "libc/str/unicode.h"
|
||||
|
||||
extern const uint8_t kEastAsianWidth[];
|
||||
extern const uint32_t kEastAsianWidthBits;
|
|
@ -108,7 +108,6 @@ LIBC_TESTLIB_A_DIRECTDEPS = \
|
|||
LIBC_SYSV_CALLS \
|
||||
LIBC_TIME \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_UNICODE \
|
||||
LIBC_X \
|
||||
LIBC_ZIPOS \
|
||||
THIRD_PARTY_DLMALLOC \
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/intrin/pthread.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
|
||||
#define CTHREAD_CREATE_DETACHED 1
|
||||
#define CTHREAD_CREATE_JOINABLE 0
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "libc/time/tz.internal.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "libc/str/locale.h"
|
||||
// clang-format off
|
||||
// converts broken-down timestamp to string
|
||||
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
||||
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
||||
|
||||
PKGS += LIBC_UNICODE
|
||||
|
||||
LIBC_UNICODE_ARTIFACTS += LIBC_UNICODE_A
|
||||
LIBC_UNICODE = $(LIBC_UNICODE_A_DEPS) $(LIBC_UNICODE_A)
|
||||
LIBC_UNICODE_A = o/$(MODE)/libc/unicode/unicode.a
|
||||
LIBC_UNICODE_A_FILES := $(wildcard libc/unicode/*)
|
||||
LIBC_UNICODE_A_HDRS = $(filter %.h,$(LIBC_UNICODE_A_FILES))
|
||||
LIBC_UNICODE_A_SRCS_A = $(filter %.s,$(LIBC_UNICODE_A_FILES))
|
||||
LIBC_UNICODE_A_SRCS_S = $(filter %.S,$(LIBC_UNICODE_A_FILES))
|
||||
LIBC_UNICODE_A_SRCS_C = $(filter %.c,$(LIBC_UNICODE_A_FILES))
|
||||
|
||||
LIBC_UNICODE_A_SRCS = \
|
||||
$(LIBC_UNICODE_A_SRCS_A) \
|
||||
$(LIBC_UNICODE_A_SRCS_S) \
|
||||
$(LIBC_UNICODE_A_SRCS_C)
|
||||
|
||||
LIBC_UNICODE_A_OBJS = \
|
||||
$(LIBC_UNICODE_A_SRCS_A:%.s=o/$(MODE)/%.o) \
|
||||
$(LIBC_UNICODE_A_SRCS_S:%.S=o/$(MODE)/%.o) \
|
||||
$(LIBC_UNICODE_A_SRCS_C:%.c=o/$(MODE)/%.o)
|
||||
|
||||
LIBC_UNICODE_A_CHECKS = \
|
||||
$(LIBC_UNICODE_A).pkg \
|
||||
$(LIBC_UNICODE_A_HDRS:%=o/$(MODE)/%.ok)
|
||||
|
||||
LIBC_UNICODE_A_DIRECTDEPS = \
|
||||
LIBC_INTRIN \
|
||||
LIBC_NEXGEN32E \
|
||||
LIBC_STR \
|
||||
LIBC_STUBS
|
||||
|
||||
LIBC_UNICODE_A_DEPS := \
|
||||
$(call uniq,$(foreach x,$(LIBC_UNICODE_A_DIRECTDEPS),$($(x))))
|
||||
|
||||
$(LIBC_UNICODE_A): \
|
||||
libc/unicode/ \
|
||||
$(LIBC_UNICODE_A).pkg \
|
||||
$(LIBC_UNICODE_A_OBJS)
|
||||
|
||||
$(LIBC_UNICODE_A).pkg: \
|
||||
$(LIBC_UNICODE_A_OBJS) \
|
||||
$(foreach x,$(LIBC_UNICODE_A_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
LIBC_UNICODE_LIBS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)))
|
||||
LIBC_UNICODE_SRCS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_SRCS))
|
||||
LIBC_UNICODE_HDRS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_HDRS))
|
||||
LIBC_UNICODE_BINS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_BINS))
|
||||
LIBC_UNICODE_CHECKS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_CHECKS))
|
||||
LIBC_UNICODE_OBJS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_OBJS))
|
||||
LIBC_UNICODE_TESTS = $(foreach x,$(LIBC_UNICODE_ARTIFACTS),$($(x)_TESTS))
|
||||
|
||||
.PHONY: o/$(MODE)/libc/unicode
|
||||
o/$(MODE)/libc/unicode: $(LIBC_UNICODE) $(LIBC_UNICODE_CHECKS)
|
||||
|
||||
o/$(MODE)/libc/unicode/eastasianwidth.bin: \
|
||||
libc/unicode/eastasianwidth.txt \
|
||||
o/$(MODE)/tool/decode/mkwides.com
|
||||
@$(COMPILE) -AMKWIDES -T$@ o/$(MODE)/tool/decode/mkwides.com -o $@ $<
|
||||
o/$(MODE)/libc/unicode/eastasianwidth.bin.lz4: \
|
||||
o/$(MODE)/libc/unicode/eastasianwidth.bin \
|
||||
o/$(MODE)/third_party/lz4cli/lz4cli.com
|
||||
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
|
||||
o/$(MODE)/libc/unicode/eastasianwidth.s: \
|
||||
o/$(MODE)/libc/unicode/eastasianwidth.bin.lz4 \
|
||||
o/$(MODE)/tool/build/lz4toasm.com
|
||||
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kEastAsianWidth -o $@ $<
|
||||
|
||||
o/$(MODE)/libc/unicode/combiningchars.bin: \
|
||||
libc/unicode/unicodedata.txt \
|
||||
o/$(MODE)/tool/decode/mkcombos.com
|
||||
@$(COMPILE) -AMKCOMBOS -T$@ o/$(MODE)/tool/decode/mkcombos.com -o $@ $<
|
||||
o/$(MODE)/libc/unicode/combiningchars.bin.lz4: \
|
||||
o/$(MODE)/libc/unicode/combiningchars.bin \
|
||||
o/$(MODE)/third_party/lz4cli/lz4cli.com
|
||||
@$(COMPILE) -ALZ4 -T$@ o/$(MODE)/third_party/lz4cli/lz4cli.com -q -f -9 --content-size $< $@
|
||||
o/$(MODE)/libc/unicode/combiningchars.s: \
|
||||
o/$(MODE)/libc/unicode/combiningchars.bin.lz4 \
|
||||
o/$(MODE)/tool/build/lz4toasm.com
|
||||
@$(COMPILE) -ABIN2ASM -T$@ o/$(MODE)/tool/build/lz4toasm.com -s kCombiningChars -o $@ $<
|
|
@ -1,15 +0,0 @@
|
|||
#!/bin/sh
|
||||
[ -d libc/unicode ] || exit
|
||||
[ -x o//examples/curl.com ] || make -j8 o//examples/curl.com || exit
|
||||
mkdir -p o/tmp/ || exit
|
||||
|
||||
shineget() {
|
||||
echo $2
|
||||
o//examples/curl.com $2 >o/tmp/$$ || exit
|
||||
mv o/tmp/$$ $1 || exit
|
||||
}
|
||||
|
||||
shineget libc/unicode/blocks.txt https://www.unicode.org/Public/UCD/latest/ucd/Blocks.txt
|
||||
shineget libc/unicode/unicodedata.txt https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
|
||||
shineget libc/unicode/eastasianwidth.txt https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
|
||||
shineget libc/unicode/SpecialCasing.txt https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
Loading…
Add table
Add a link
Reference in a new issue