diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2025-12-05 22:36:10 -0700 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2026-01-06 16:52:56 -0700 |
| commit | 0d9bbb74c6de959ab7c6b93b7a97f9f2e643e8e8 (patch) | |
| tree | 25596fd04e3623571a155e9c2b1e2503aa9dd4f6 /libutf.h | |
| parent | 6ced61ef5f366001877823ed8aff978035fa53c8 (diff) | |
| download | vis-0d9bbb74c6de959ab7c6b93b7a97f9f2e643e8e8.tar.gz vis-0d9bbb74c6de959ab7c6b93b7a97f9f2e643e8e8.tar.xz | |
replace oversized libutf with smaller version
this is taken from one of my other projects. there was no reason
for there to be 2x the code
tests checking for surrogate characters and non characters were
removed. I see no reason why the user shouldn't be allowed to
insert those characters in text (they exist in the standard).
Also, in the case of non-characters only the first two were being
checked and not the other 64.
Diffstat (limited to 'libutf.h')
| -rw-r--r-- | libutf.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/libutf.h b/libutf.h deleted file mode 100644 index 30255cc..0000000 --- a/libutf.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef LIBUTF_H -#define LIBUTF_H - -/* libutf8 © 2012-2015 Connor Lane Smith <cls@lubutu.com> */ -#include <stddef.h> -#include <stdint.h> - -#if __STDC_VERSION__ >= 201112L -#include <uchar.h> -#ifdef __STDC_UTF_32__ -#define RUNE_C INT32_C -typedef char32_t Rune; -#endif -#endif - -#ifndef RUNE_C -#ifdef INT32_C -#define RUNE_C INT32_C -typedef uint_least32_t Rune; -#else -#define RUNE_C(x) x##L -typedef unsigned long Rune; -#endif -#endif - -#define UTFmax 4 /* maximum bytes per rune */ - -#define Runeself 0x80 /* rune and utf are equal (<) */ -#define Runemax RUNE_C(0x10FFFF) /* maximum rune value */ - -VIS_INTERNAL int runelen(Rune r); -VIS_INTERNAL int runetochar(char *s, const Rune *p); - -#endif |
