summaryrefslogtreecommitdiff
path: root/fs/unicode/utf8n.h
diff options
context:
space:
mode:
authorOlaf Weber <olaf@sgi.com>2019-04-25 13:49:18 -0400
committerTheodore Ts'o <tytso@mit.edu>2019-04-25 13:49:18 -0400
commita8384c68797ee022f5fd7bcef5f4cc57863d4042 (patch)
tree5cab2a7a1e9aa4a284354236868aed6eccfb5d5c /fs/unicode/utf8n.h
parent44594c2fbf42528001dfb1597d26adb40ba6d178 (diff)
unicode: reduce the size of utf8data[]
Remove the Hangul decompositions from the utf8data trie, and do algorithmic decomposition to calculate them on the fly. To store the decomposition the caller of utf8lookup()/utf8nlookup() must provide a 12-byte buffer, which is used to synthesize a leaf with the decomposition. This significantly reduces the size of the utf8data[] array. Changes made by Gabriel: Rebase to mainline Fix checkpatch errors Extract robustness fixes and merge back to original mkutf8data.c patch Regenerate utf8data.h Signed-off-by: Olaf Weber <olaf@sgi.com> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/unicode/utf8n.h')
-rw-r--r--fs/unicode/utf8n.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/unicode/utf8n.h b/fs/unicode/utf8n.h
index 696e52124296..b63a9091dc39 100644
--- a/fs/unicode/utf8n.h
+++ b/fs/unicode/utf8n.h
@@ -76,6 +76,9 @@ extern int utf8nagemin(const struct utf8data *data, const char *s, size_t len);
extern ssize_t utf8len(const struct utf8data *data, const char *s);
extern ssize_t utf8nlen(const struct utf8data *data, const char *s, size_t len);
+/* Needed in struct utf8cursor below. */
+#define UTF8HANGULLEAF (12)
+
/*
* Cursor structure used by the normalizer.
*/
@@ -89,6 +92,7 @@ struct utf8cursor {
unsigned int slen;
short int ccc;
short int nccc;
+ unsigned char hangul[UTF8HANGULLEAF];
};
/*