static void icu_chain_step_destroy(struct icu_chain_step *step) { if (!step) return; icu_chain_step_destroy(step->previous); switch (step->type) { case ICU_chain_step_type_display: break; case ICU_chain_step_type_casemap: icu_casemap_destroy(step->u.casemap); break; case ICU_chain_step_type_transform: case ICU_chain_step_type_transliterate: icu_transform_destroy(step->u.transform); break; case ICU_chain_step_type_tokenize: icu_tokenizer_destroy(step->u.tokenizer); break; case YAZ_chain_step_type_stemming: yaz_stemmer_destroy(step->u.stemmer); break; case ICU_chain_step_type_join: icu_buf_utf16_destroy(step->u.join); break; default: break; } xfree(step); }
struct icu_casemap *icu_casemap_create(char action, UErrorCode *status) { struct icu_casemap *casemap = (struct icu_casemap *) xmalloc(sizeof(struct icu_casemap)); casemap->action = action; switch (casemap->action) { case 'l': case 'L': case 'u': case 'U': case 't': case 'T': case 'f': case 'F': break; default: icu_casemap_destroy(casemap); return 0; } return casemap; }