UTF8String.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
5 #ifndef _UTF8String_H_
6 #define _UTF8String_H_
7 
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef OCTET_STRING_t UTF8String_t; /* Implemented via OCTET STRING */
15 
18 
19 #define UTF8String_free OCTET_STRING_free
20 
21 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
23 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
24 
25 #define UTF8String_compare OCTET_STRING_compare
26 #define UTF8String_copy OCTET_STRING_copy
27 
29 
30 #if !defined(ASN_DISABLE_BER_SUPPORT)
31 #define UTF8String_decode_ber OCTET_STRING_decode_ber
32 #define UTF8String_encode_der OCTET_STRING_encode_der
33 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
34 
35 #if !defined(ASN_DISABLE_XER_SUPPORT)
36 #define UTF8String_decode_xer OCTET_STRING_decode_xer_utf8
37 #define UTF8String_encode_xer OCTET_STRING_encode_xer_utf8
38 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
39 
40 #if !defined(ASN_DISABLE_JER_SUPPORT)
41 #define UTF8String_decode_jer OCTET_STRING_decode_jer_utf8
42 #define UTF8String_encode_jer OCTET_STRING_encode_jer_utf8
43 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
44 
45 #if !defined(ASN_DISABLE_UPER_SUPPORT)
46 #define UTF8String_decode_uper OCTET_STRING_decode_uper
47 #define UTF8String_encode_uper OCTET_STRING_encode_uper
48 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
49 #if !defined(ASN_DISABLE_APER_SUPPORT)
50 #define UTF8String_decode_aper OCTET_STRING_decode_aper
51 #define UTF8String_encode_aper OCTET_STRING_encode_aper
52 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
53 
54 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
56 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
57 
58 /*
59  * Returns length of the given UTF-8 string in characters,
60  * or a negative error code:
61  * -1: UTF-8 sequence truncated
62  * -2: Illegal UTF-8 sequence start
63  * -3: Continuation expectation failed
64  * -4: Not minimal length encoding
65  * -5: Invalid arguments
66  */
67 ssize_t UTF8String_length(const UTF8String_t *st);
68 
69 /*
70  * Convert the UTF-8 string into a sequence of wide characters.
71  * Returns the number of characters necessary.
72  * Returned value might be greater than dstlen.
73  * In case of conversion error, 0 is returned.
74  *
75  * If st points to a valid UTF-8 string, calling
76  * UTF8String_to_wcs(st, 0, 0);
77  * is equivalent to
78  * UTF8String_length(const UTF8String_t *st);
79  */
80 size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen);
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif /* _UTF8String_H_ */
UTF8String_to_wcs
size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen)
Definition: UTF8String.c:222
asn_TYPE_operation_s
Definition: constr_TYPE.h:184
asn_struct_print_f
int() asn_struct_print_f(const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, int level, asn_app_consume_bytes_f *callback, void *app_key)
Definition: constr_TYPE.h:129
asn_random_fill_f
asn_random_fill_result_t() asn_random_fill_f(const struct asn_TYPE_descriptor_s *td, void **struct_ptr, const struct asn_encoding_constraints_s *memb_constraints, size_t max_length)
Definition: asn_random_fill.h:32
asn_DEF_UTF8String
asn_TYPE_descriptor_t asn_DEF_UTF8String
Definition: UTF8String.c:74
UTF8String_t
OCTET_STRING_t UTF8String_t
Definition: UTF8String.h:14
UTF8String_print
asn_struct_print_f UTF8String_print
Definition: UTF8String.h:22
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
asn_OP_UTF8String
asn_TYPE_operation_t asn_OP_UTF8String
Definition: UTF8String.c:16
UTF8String_random_fill
asn_random_fill_f UTF8String_random_fill
Definition: UTF8String.h:55
UTF8String_length
ssize_t UTF8String_length(const UTF8String_t *st)
Definition: UTF8String.c:213
asn_constr_check_f
int() asn_constr_check_f(const struct asn_TYPE_descriptor_s *type_descriptor, const void *struct_ptr, asn_app_constraint_failed_f *optional_callback, void *optional_app_key)
Definition: constraints.h:41
OCTET_STRING
Definition: OCTET_STRING.h:14
UTF8String_constraint
asn_constr_check_f UTF8String_constraint
Definition: UTF8String.h:28
OCTET_STRING.h


etsi_its_vam_ts_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:30:55