Debian Codegraph @

skeletons/UTF8String.h

raw symbols SCIP
1 /*-
2 * Copyright (c) 2003, 2004 Lev Walkin <[email protected]>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
4 */
5 #ifndef _UTF8String_H_
6 #define _UTF8String_H_
7
8 #include <OCTET_STRING.h>
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */
15
16 extern asn_TYPE_descriptor_t asn_DEF_UTF8String;
17
18 asn_struct_print_f UTF8String_print;
19 asn_constr_check_f UTF8String_constraint;
20
21 /*
22 * Returns length of the given UTF-8 string in characters,
23 * or a negative error code:
24 * -1: UTF-8 sequence truncated
25 * -2: Illegal UTF-8 sequence start
26 * -3: Continuation expectation failed
27 * -4: Not minimal length encoding
28 * -5: Invalid arguments
29 */
30 ssize_t UTF8String_length(const UTF8String_t *st);
31
32 /*
33 * Convert the UTF-8 string into a sequence of wide characters.
34 * Returns the number of characters necessary.
35 * Returned value might be greater than dstlen.
36 * In case of conversion error, 0 is returned.
37 *
38 * If st points to a valid UTF-8 string, calling
39 * UTF8String_to_wcs(st, 0, 0);
40 * is equivalent to
41 * UTF8String_length(const UTF8String_t *st);
42 */
43 size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen);
44
45 #ifdef __cplusplus
46 }
47 #endif
48
49 #endif /* _UTF8String_H_ */