27 #include <unicode/utrans.h>
32 UParseError parse_error;
33 UTransliterator *trans;
38 struct icu_transform *transform
39 = (
struct icu_transform *)
xmalloc(
sizeof(
struct icu_transform));
40 UErrorCode status = U_ZERO_ERROR;
42 transform->action = old->action;
44 transform->trans = utrans_clone(old->trans, &status);
45 assert(transform->trans);
56 struct icu_transform *transform
57 = (
struct icu_transform *)
xmalloc(
sizeof(
struct icu_transform));
59 transform->action = action;
68 switch (transform->action)
73 = utrans_openU(id16->
utf16,
78 &transform->parse_error, status);
83 = utrans_openU(id16->
utf16,
88 &transform->parse_error, status);
91 *status = U_UNSUPPORTED_ERROR;
97 if (U_SUCCESS(*status))
109 if (transform->trans)
110 utrans_close(transform->trans);
120 if (!transform || !transform->trans
121 || !src16 || !dest16)
133 utrans_transUChars(transform->trans,
138 if (U_FAILURE(*status))
Internal header for ICU utilities.
struct icu_buf_utf16 * icu_buf_utf16_copy(struct icu_buf_utf16 *dest16, const struct icu_buf_utf16 *src16)
struct icu_transform * icu_transform_create(const char *id, char action, const char *rules, UErrorCode *status)
struct icu_buf_utf16 * icu_buf_utf16_clear(struct icu_buf_utf16 *buf16)
UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 *dest16, const char *src8cstr, UErrorCode *status)
int icu_transform_trans(struct icu_transform *transform, struct icu_buf_utf16 *dest16, const struct icu_buf_utf16 *src16, UErrorCode *status)
void icu_buf_utf16_destroy(struct icu_buf_utf16 *buf16)
struct icu_transform * icu_transform_clone(struct icu_transform *old)
struct icu_buf_utf16 * icu_buf_utf16_create(size_t capacity)
void icu_transform_destroy(struct icu_transform *transform)
Header for memory handling functions.
#define xfree(x)
utility macro which calls xfree_f
#define xmalloc(x)
utility macro which calls malloc_f