cosmopolitan/libc/mem/alg.h
Justine Tunney 7c83f4abc8
Make improvements
- wcsstr() is now linearly complex
- strstr16() is now linearly complex
- strstr() is now vectorized on aarch64 (10x)
- strstr() now uses KMP on pathological cases
- memmem() is now vectorized on aarch64 (10x)
- memmem() now uses KMP on pathological cases
- Disable shared_ptr::owner_before until fixed
- Make iswlower(), iswupper() consistent with glibc
- Remove figure space from iswspace() implementation
- Include line and paragraph separator in iswcntrl()
- Use Musl wcwidth(), iswalpha(), iswpunct(), towlower(), towupper()
2024-09-01 01:27:47 -07:00

32 lines
1.4 KiB
C

#ifndef COSMOPOLITAN_LIBC_ALG_ALG_H_
#define COSMOPOLITAN_LIBC_ALG_ALG_H_
COSMOPOLITAN_C_START_
void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *)) paramsnonnull() nosideeffect;
void qsort3(void *, size_t, size_t, int (*)(const void *, const void *))
paramsnonnull();
void qsort(void *, size_t, size_t, int (*)(const void *, const void *))
paramsnonnull();
void qsort_r(void *, size_t, size_t,
int (*)(const void *, const void *, void *), void *)
paramsnonnull((1, 4));
void smoothsort(void *, size_t, size_t, int (*)(const void *, const void *));
void smoothsort_r(void *, size_t, size_t,
int (*)(const void *, const void *, void *), void *);
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
int heapsort_r(void *, size_t, size_t,
int (*)(const void *, const void *, void *), void *);
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
int mergesort_r(void *, size_t, size_t,
int (*)(const void *, const void *, void *), void *);
#ifdef _COSMO_SOURCE
void djbsort(int32_t *, size_t) libcesque;
int radix_sort_int32(int32_t *, size_t) libcesque;
int radix_sort_int64(int64_t *, size_t) libcesque;
double levenshtein(const char *, const char *) libcesque;
#endif
COSMOPOLITAN_C_END_
#endif /* COSMOPOLITAN_LIBC_ALG_ALG_H_ */