- Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathunicode.h
27 lines (22 loc) · 938 Bytes
/
unicode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2018 Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
*/
#ifndef_APFS_UNICODE_H
#define_APFS_UNICODE_H
#include<linux/nls.h>
/*
* This structure helps apfs_normalize_next() to retrieve one normalized
* (and case-folded) UTF-32 character at a time from a UTF-8 string.
*/
structapfs_unicursor {
constchar*utf8curr; /* Start of UTF-8 to decompose and reorder */
unsigned inttotal_len; /* Length of the whole UTF-8 string */
intlength; /* Length of normalization until next starter */
intlast_pos; /* Offset in substring of last char returned */
u8last_ccc; /* CCC of the last character returned */
};
externvoidapfs_init_unicursor(structapfs_unicursor*cursor, constchar*utf8str, unsigned inttotal_len);
externunicode_tapfs_normalize_next(structapfs_unicursor*cursor,
boolcase_fold);
#endif/* _APFS_UNICODE_H */