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.
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.
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.
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.
Extend the script to also produce a trie for the canonical composition
codes. The possible codes are very few and all fit in 8 bits, so simply
use an array of bytes to represent the trie, with no need for a separate
value array.
Provide the unicode data files for version 9.0.0. Before this patch the
user needed to provide their own data for the build. Of course, this can
still be done by replacing the files in the ucd directory with different
versions.
Use the last bits of the value position to store its length, as the
hfsplus module does. We use three bits here, while hfsplus seems to
be using only two, which might be a bug.
Until now the generated trie was only providing the first stage in the
decomposition process. The full decomposition requires iterating several
times. In the hfsplus module the final result is given directly by the
trie, so do the same here.
The script is only parsing the decomposition data; extend it so that it
can also be used for full case folding.
Also remove a couple of printf() calls for debugging that are no longer
necessary.
Write a simple script that parses unicode decomposition data into tries
represented as C arrays. A big portion of the code was taken from a
version of the mkutf8data script by Olaf Weber [1], but adapted to work
with NFD, and to produce data structures more in line with those used
by hfsplus.
[1] https://marc.info/?l=linux-fsdevel&m=152584896931191&w=2