aboutsummaryrefslogtreecommitdiff
path: root/src/wcwidth.h
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2026-01-29 11:02:33 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2026-01-29 13:55:39 +0100
commit1159329b247d6532fecb375e7008aca979261eaa (patch)
tree0b56caf9a03ba47c2c77d5313662ea27f198752d /src/wcwidth.h
parentdfd0d4b8ca3607ae39b1d2cbad4e3a7180dd6754 (diff)
downloadluasystem-1159329b247d6532fecb375e7008aca979261eaa.tar.gz
luasystem-1159329b247d6532fecb375e7008aca979261eaa.tar.bz2
luasystem-1159329b247d6532fecb375e7008aca979261eaa.zip
fix(wcwidth): add a generator for width ranges
The generator script will parse official unicode data to create the actual ranges for 0, double, and ambiguous width characters.
Diffstat (limited to 'src/wcwidth.h')
-rw-r--r--src/wcwidth.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wcwidth.h b/src/wcwidth.h
index 6cb6f6d..9d345f9 100644
--- a/src/wcwidth.h
+++ b/src/wcwidth.h
@@ -1,7 +1,8 @@
1// wcwidth.h 1// wcwidth.h
2 2
3// Windows does not have a wcwidth function, so we use compatibilty code from 3// Windows does not have a wcwidth function, so we use compatibilty code from
4// http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c by Markus Kuhn 4// http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c by Markus Kuhn, this is
5// however heavily modified.
5 6
6#ifndef MK_WCWIDTH_H 7#ifndef MK_WCWIDTH_H
7#define MK_WCWIDTH_H 8#define MK_WCWIDTH_H
@@ -16,7 +17,7 @@ typedef uint32_t mk_wchar_t; // Windows wchar_t can be 16-bit, we need 32-bit
16typedef wchar_t mk_wchar_t; // Posix wchar_t is 32-bit so just use that 17typedef wchar_t mk_wchar_t; // Posix wchar_t is 32-bit so just use that
17#endif 18#endif
18 19
19int mk_wcwidth(mk_wchar_t ucs); 20int mk_wcwidth(mk_wchar_t ucs, int ambiguous_width);
20int mk_wcswidth(const mk_wchar_t *pwcs, size_t n); 21int mk_wcswidth(const mk_wchar_t *pwcs, size_t n, int ambiguous_width);
21 22
22#endif // MK_WCWIDTH_H 23#endif // MK_WCWIDTH_H