/* type and action object */
enum icu_chain_step_type type;
union {
- struct icu_casemap * casemap;
- struct icu_transform * transform;
- struct icu_tokenizer * tokenizer;
+ struct icu_casemap *casemap;
+ struct icu_transform *transform;
+ struct icu_tokenizer *tokenizer;
} u;
- struct icu_chain_step * previous;
+ struct icu_chain_step *previous;
};
struct icu_chain
char *locale;
int sort;
- UCollator * coll;
+ UCollator *coll;
/* linked list of chain steps */
- struct icu_chain_step * csteps;
+ struct icu_chain_step *csteps;
};
int icu_check_status(UErrorCode status)
}
static struct icu_chain_step *icu_chain_step_create(
- struct icu_chain * chain, enum icu_chain_step_type type,
- const uint8_t * rule,
- UErrorCode *status)
+ struct icu_chain *chain, enum icu_chain_step_type type,
+ const uint8_t *rule, UErrorCode *status)
{
- struct icu_chain_step * step = 0;
+ struct icu_chain_step *step = 0;
if (!chain || !type || !rule)
return 0;
}
-static void icu_chain_step_destroy(struct icu_chain_step * step)
+static void icu_chain_step_destroy(struct icu_chain_step *step)
{
if (!step)
return;
}
struct icu_chain *icu_chain_create(const char *locale, int sort,
- UErrorCode * status)
+ UErrorCode *status)
{
- struct icu_chain * chain
+ struct icu_chain *chain
= (struct icu_chain *) xmalloc(sizeof(*chain));
*status = U_ZERO_ERROR;
return chain;
}
-void icu_chain_destroy(struct icu_chain * chain)
+void icu_chain_destroy(struct icu_chain *chain)
{
if (chain)
{
}
static struct icu_chain_step *icu_chain_insert_step(
- struct icu_chain * chain, enum icu_chain_step_type type,
- const uint8_t * rule, UErrorCode *status);
+ struct icu_chain *chain, enum icu_chain_step_type type,
+ const uint8_t *rule, UErrorCode *status);
-struct icu_chain * icu_chain_xml_config(const xmlNode *xml_node,
- int sort,
- UErrorCode * status)
+struct icu_chain *icu_chain_xml_config(const xmlNode *xml_node,
+ int sort,
+ UErrorCode *status)
{
xmlNode *node = 0;
- struct icu_chain * chain = 0;
+ struct icu_chain *chain = 0;
*status = U_ZERO_ERROR;
return 0;
{
- xmlChar * xml_locale = xmlGetProp((xmlNode *) xml_node,
- (xmlChar *) "locale");
+ xmlChar *xml_locale = xmlGetProp((xmlNode *) xml_node,
+ (xmlChar *) "locale");
if (xml_locale)
{
for (node = xml_node->children; node; node = node->next)
{
xmlChar *xml_rule;
- struct icu_chain_step * step = 0;
+ struct icu_chain_step *step = 0;
if (node->type != XML_ELEMENT_NODE)
continue;
xml_rule = xmlGetProp(node, (xmlChar *) "rule");
+ yaz_log(YLOG_LOG, "rule=%s", xml_rule);
+
if (!strcmp((const char *) node->name, "casemap"))
step = icu_chain_insert_step(chain, ICU_chain_step_type_casemap,
(const uint8_t *) xml_rule, status);
static struct icu_chain_step *icu_chain_insert_step(
- struct icu_chain * chain, enum icu_chain_step_type type,
- const uint8_t * rule, UErrorCode *status)
+ struct icu_chain *chain, enum icu_chain_step_type type,
+ const uint8_t *rule, UErrorCode *status)
{
- struct icu_chain_step * step = 0;
+ struct icu_chain_step *step = 0;
if (!chain || !type || !rule)
return 0;
return iter->token_count;
}
-int icu_chain_assign_cstr(struct icu_chain * chain, const char * src8cstr,
+int icu_chain_assign_cstr(struct icu_chain *chain, const char *src8cstr,
UErrorCode *status)
{
if (chain->iter)
return 1;
}
-int icu_chain_next_token(struct icu_chain * chain, UErrorCode *status)
+int icu_chain_next_token(struct icu_chain *chain, UErrorCode *status)
{
*status = U_ZERO_ERROR;
return icu_iter_next(chain->iter);
}
-int icu_chain_token_number(struct icu_chain * chain)
+int icu_chain_token_number(struct icu_chain *chain)
{
if (chain && chain->iter)
return chain->iter->token_count;
return 0;
}
-const char * icu_chain_token_display(struct icu_chain * chain)
+const char *icu_chain_token_display(struct icu_chain *chain)
{
if (chain->iter)
return icu_iter_get_display(chain->iter);
return 0;
}
-const char * icu_chain_token_norm(struct icu_chain * chain)
+const char *icu_chain_token_norm(struct icu_chain *chain)
{
if (chain->iter)
return icu_iter_get_norm(chain->iter);
return 0;
}
-const char * icu_chain_token_sortkey(struct icu_chain * chain)
+const char *icu_chain_token_sortkey(struct icu_chain *chain)
{
if (chain->iter)
return icu_iter_get_sortkey(chain->iter);