9 Commits

Author SHA1 Message Date
Ernesto A. Fernández 09a7616c2f Support case sensitivity
Add support for case sensitivity to unicode.c, and take advantage of
this to simplify the testing procedure.
2018-11-13 00:39:35 -03:00
Ernesto A. Fernández 4755d6f68a Rework unicode functions so they cannot fail
The ->d_compare() dentry operation is not allowed to fail. Before
the APFS module can implement it, apfs_init_unicursor() and
apfs_normalize_next() must be reworked accordingly.
2018-07-26 18:38:04 -03:00
Ernesto A. Fernández 82973b2e0f Fix documentation for apfs_try_decompose_hangul()
This function will not actually normalize all Hangul, just precomposed
characters.
2018-07-19 13:14:54 -03:00
Ernesto A. Fernández 0f387d50a7 Further simplify ascii normalization
Convert ascii characters to UTF-32 by simple casting, without calling
utf8_to_utf32().
2018-06-10 16:49:59 -03:00
Ernesto A. Fernández 6e11fb3883 Optimize normalization for the ascii case
Handle ascii characters with the isascii() and tolower() kernel macros,
and skip the costly trie searches.
2018-06-09 22:38:05 -03:00
Ernesto A. Fernández 600e2f55d0 Give proper credit to Unicode and mkutf8data 2018-06-08 18:48:58 -03:00
Ernesto A. Fernández 5a0f3e712b Run tests during build
Move the head of unicode.c and unicode.h to separate files, and write
alternative versions for running tests in user space. Since there are
no official unicode tests for case folding, the mktrie script must also
produce another version of the case folding trie, with no values.

Setup the Makefile so that the tests are run with every recompilation,
printing the results to build/test.out.
2018-06-07 19:38:53 -03:00
Ernesto A. Fernández 68bdb08d9e Fix style issues in output code
Correct a few problems with whitespace that mktrie was introducing in
unicode.c. They were found by the checkpatch.pl script of the Linux
kernel. Also replace kmalloc() with kmalloc_array() for the cursor
buffer.
2018-06-07 19:37:06 -03:00
Ernesto A. Fernández c185595fa7 Add the C unicode functions to the repository
Soon this script will be putting the C code through the normalization
tests provided by Unicode. The most practical way to do this is to keep
the C functions inside the same repository, and later provide two build
options: one for use by the kernel module, and another for testing in
user space.
2018-06-07 17:57:45 -03:00