Lines Matching refs:domain

103 typedef struct domain {  struct
113 struct domain *next; argument
361 destroy_domain(domain_t *domain) { in destroy_domain() argument
366 for (ptr = domain->trans_to_raw[i]; ptr;) { in destroy_domain()
372 domain->trans_to_raw[i] = NULL; in destroy_domain()
376 for (ptr = domain->raw_to_trans[i]; ptr;) { in destroy_domain()
385 domain->raw_to_trans[i] = NULL; in destroy_domain()
387 while (domain->base_classifications) { in destroy_domain()
388 base_classification_t *next = domain->base_classifications->next; in destroy_domain()
389 free(domain->base_classifications->trans); in destroy_domain()
390 ebitmap_destroy(&domain->base_classifications->level->cat); in destroy_domain()
391 free(domain->base_classifications->level); in destroy_domain()
392 free(domain->base_classifications); in destroy_domain()
393 domain->base_classifications = next; in destroy_domain()
395 pcre_free(domain->base_classification_regexp); in destroy_domain()
396 while (domain->groups) in destroy_domain()
397 destroy_group(&domain->groups, domain->groups); in destroy_domain()
398 free(domain->name); in destroy_domain()
399 free(domain); in destroy_domain()
406 domain_t *domain = calloc(1, sizeof(domain_t)); in create_domain() local
407 if (!domain) { in create_domain()
410 domain->name = strdup(name); in create_domain()
411 if (!domain->name) { in create_domain()
418 *d = domain; in create_domain()
420 return domain; in create_domain()
424 destroy_domain(domain); in create_domain()
603 add_base_classification(domain_t *domain, char *raw, char *trans) { in add_base_classification() argument
620 for (i=&domain->base_classifications; *i; i=&(*i)->next) in add_base_classification()
630 add_cache(domain_t *domain, char *raw, char *trans) { in add_cache() argument
644 if (add_to_hashtable(domain->raw_to_trans, map->raw, map) < 0) in add_cache()
647 if (add_to_hashtable(domain->trans_to_raw, map->trans, map) < 0) in add_cache()
723 static domain_t *domain; in process_trans() local
778 domain = create_domain(tok); in process_trans()
783 if (!domain) { in process_trans()
784 domain = create_domain("Default"); in process_trans()
785 if (!domain) in process_trans()
816 group = create_group(&domain->groups, tok); in process_trans()
846 if (add_base_classification(domain, raw, tok) < 0) { in process_trans()
851 if (add_cache(domain, raw, tok) < 0) in process_trans()
934 find_in_hashtable(const char *range, domain_t *domain, context_map_node_t **table) { in find_in_hashtable() argument
938 trans = strdup((table == domain->raw_to_trans) ? map->trans: map->raw); in find_in_hashtable()
985 build_regexps(domain_t *domain) { in build_regexps() argument
994 for (n_el = 0, bc = domain->base_classifications; bc; bc = bc->next) { in build_regexps()
1004 for (i=0, bc = domain->base_classifications; bc; bc = bc->next) { in build_regexps()
1017 log_debug(">>> %s classification regexp=%s\n", domain->name, buffer); in build_regexps()
1018 build_regexp(&domain->base_classification_regexp, buffer); in build_regexps()
1020 for (g = domain->groups; g; g = g->next) { in build_regexps()
1029 log_debug(">>> %s %s prefix regexp=%s\n", domain->name, g->name, buffer); in build_regexps()
1070 log_debug(">>> %s %s modifier regexp=%s\n", domain->name, g->name, buffer); in build_regexps()
1080 log_debug(">>> %s %s suffix regexp=%s\n", domain->name, g->name, buffer); in build_regexps()
1089 compute_raw_from_trans(const char *level, domain_t *domain) { in compute_raw_from_trans() argument
1117 if (!domain->base_classification_regexp) in compute_raw_from_trans()
1118 if (build_regexps(domain) < 0) in compute_raw_from_trans()
1120 if (!domain->base_classification_regexp) in compute_raw_from_trans()
1123 …rc = pcre_exec(domain->base_classification_regexp, 0, work, work_len, 0, PCRE_ANCHORED, ovector, O… in compute_raw_from_trans()
1129 for (bc = domain->base_classifications; bc; bc = bc->next) { in compute_raw_from_trans()
1161 for (g = domain->groups; g && !change && !complete; g = g->next) { in compute_raw_from_trans()
1281 compute_trans_from_raw(const char *level, domain_t *domain) { in compute_trans_from_raw() argument
1320 for (bc = domain->base_classifications; bc && !done; bc = bc->next) { in compute_trans_from_raw()
1335 for (g = domain->groups; g; g = g->next) { in compute_trans_from_raw()
1365 for (g = domain->groups; g && hamming; g = g->next) { in compute_trans_from_raw()
1505 domain_t *domain = domains; in trans_context() local
1506 for (;domain; domain = domain->next) { in trans_context()
1507 trans = find_in_hashtable(range, domain, domain->raw_to_trans); in trans_context()
1519 trans = compute_trans_from_raw(range, domain); in trans_context()
1521 if (add_cache(domain, range, trans) < 0) { in trans_context()
1528 ltrans = find_in_hashtable(lrange, domain, domain->raw_to_trans); in trans_context()
1530 ltrans = compute_trans_from_raw(lrange, domain); in trans_context()
1532 if (add_cache(domain, lrange, ltrans) < 0) { in trans_context()
1546 utrans = find_in_hashtable(urange, domain, domain->raw_to_trans); in trans_context()
1548 utrans = compute_trans_from_raw(urange, domain); in trans_context()
1550 if (add_cache(domain, urange, utrans) < 0) { in trans_context()
1629 domain_t *domain = domains; in untrans_context() local
1630 for (;domain; domain = domain->next) { in untrans_context()
1631 raw = find_in_hashtable(range, domain, domain->trans_to_raw); in untrans_context()
1643 raw = compute_raw_from_trans(range, domain); in untrans_context()
1645 char *canonical = find_in_hashtable(raw, domain, domain->raw_to_trans); in untrans_context()
1647 canonical = compute_trans_from_raw(raw, domain); in untrans_context()
1649 if (add_cache(domain, raw, canonical) < 0) { in untrans_context()
1656 if (add_cache(domain, raw, range) < 0) { in untrans_context()
1666 lraw = find_in_hashtable(lrange, domain, domain->trans_to_raw); in untrans_context()
1668 lraw = compute_raw_from_trans(lrange, domain); in untrans_context()
1670 char *canonical = find_in_hashtable(lraw, domain, domain->raw_to_trans); in untrans_context()
1672 canonical = compute_trans_from_raw(lraw, domain); in untrans_context()
1674 if (add_cache(domain, lraw, canonical) < 0) { in untrans_context()
1682 if (add_cache(domain, lraw, lrange) < 0) { in untrans_context()
1697 uraw = find_in_hashtable(urange, domain, domain->trans_to_raw); in untrans_context()
1699 uraw = compute_raw_from_trans(urange, domain); in untrans_context()
1701 char *canonical = find_in_hashtable(uraw, domain, domain->raw_to_trans); in untrans_context()
1703 canonical = compute_trans_from_raw(uraw, domain); in untrans_context()
1705 if (add_cache(domain, uraw, canonical) < 0) { in untrans_context()
1714 if (add_cache(domain, uraw, urange) < 0) { in untrans_context()