22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
-
+
-
+
-
+
-
+
-
-
+
|
/*
* A pointer to the actual data.
*
* Since constant strings don't have `_storage`, they have to allocate
* it on the first access. Strings created at runtime just set the
* pointer to `&_storage`.
*/
struct of_string_utf8_ivars {
struct OFUTF8StringIvars {
char *cString;
size_t cStringLength;
bool isUTF8;
size_t length;
bool hashed;
bool hasHash;
unsigned long hash;
bool freeWhenDone;
} *restrict _s;
struct of_string_utf8_ivars _storage;
struct OFUTF8StringIvars _storage;
}
@end
#ifdef __cplusplus
extern "C" {
#endif
extern int of_string_utf8_check(const char *, size_t, size_t *);
extern int OFUTF8StringCheck(const char *, size_t, size_t *);
extern size_t of_string_utf8_get_index(const char *, size_t);
extern size_t of_string_utf8_get_position(const char *, size_t, size_t);
extern size_t OFUTF8StringIndexToPosition(const char *, size_t, size_t);
#ifdef __cplusplus
}
#endif
OF_ASSUME_NONNULL_END
|