Lines Matching defs:domain
1146 /* The name of the current domain. This is a malloced string. This
1181 /* Free the domain data. */
1183 free_domain (struct loaded_domain *domain)
1187 jnlib_free (domain->data);
1188 jnlib_free (domain->mapped);
1189 for (os = domain->overflow_space; os; os = os2)
1194 jnlib_free (domain);
1205 struct loaded_domain *domain = NULL;
1255 domain = jnlib_calloc (1, sizeof *domain);
1256 if (!domain)
1261 domain->data = (char *) data;
1262 domain->data_native = (char *) data + size;
1263 domain->must_swap = data->magic != MAGIC;
1266 switch (SWAPIT (domain->must_swap, data->revision))
1278 nstrings = SWAPIT (domain->must_swap, data->nstrings);
1281 domain->nstrings = nstrings;
1282 domain->orig_tab = (struct string_desc *)
1283 ((char *) data + SWAPIT (domain->must_swap, data->orig_tab_offset));
1284 domain->trans_tab = (struct string_desc *)
1285 ((char *) data + SWAPIT (domain->must_swap, data->trans_tab_offset));
1286 domain->hash_size = SWAPIT (domain->must_swap, data->hash_tab_size);
1287 domain->hash_tab = (uint32_t *)
1288 ((char *) data + SWAPIT (domain->must_swap, data->hash_tab_offset));
1297 domain->mapped = jnlib_calloc (domain->nstrings, sizeof *domain->mapped);
1298 if (domain->mapped)
1299 return domain; /* Okay. */
1303 jnlib_free (domain);
1480 /* Store the domain information in the domainlist. */
1562 get_string (struct loaded_domain *domain, uint32_t idx,
1575 trans = (domain->data
1576 + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
1577 translen = SWAPIT(domain->must_swap, domain->trans_tab[idx].length);
1579 else if (!domain->mapped[idx])
1586 p_utf8 = (domain->data
1587 + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
1588 plen_utf8 = SWAPIT(domain->must_swap, domain->trans_tab[idx].length);
1601 p_tmp = (domain->data_native
1602 + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
1604 domain->mapped[idx] = buflen;
1623 os->next = domain->overflow_space;
1624 domain->overflow_space = os;
1625 domain->mapped[idx] = 1;
1637 else if (domain->mapped[idx] == 1)
1640 for (os=domain->overflow_space; os; os = os->next)
1656 trans = (domain->data_native
1657 + SWAPIT(domain->must_swap, domain->trans_tab[idx].offset));
1658 translen = domain->mapped[idx];
1673 struct loaded_domain *domain;
1686 domain = NULL;
1694 domain = dl->domain;
1697 if (dl && !domain && !load_failed && dl->fname)
1712 domain = load_domain (filename);
1720 if (domain)
1721 dl->domain = domain;
1731 /* Ooops - lost the domain. */
1732 free_domain (domain);
1733 domain = NULL;
1737 if (!domain)
1741 if (domain->hash_size > 2 && domain->hash_tab)
1746 uint32_t idx = hash_val % domain->hash_size;
1747 uint32_t incr = 1 + (hash_val % (domain->hash_size - 2));
1749 while ( (nstr = SWAPIT (domain->must_swap, domain->hash_tab[idx])) )
1752 if (nstr < domain->nstrings
1753 && SWAPIT(domain->must_swap,
1754 domain->orig_tab[nstr].length) >= len
1755 && !strcmp (msgid, (domain->data
1756 + SWAPIT(domain->must_swap,
1757 domain->orig_tab[nstr].offset))))
1759 return get_string (domain, nstr, !!msgid2, nplural);
1762 if (idx >= domain->hash_size - incr)
1763 idx -= domain->hash_size - incr;
1772 top = domain->nstrings;
1778 cmp_val = strcmp (msgid, (domain->data
1779 + SWAPIT(domain->must_swap,
1780 domain->orig_tab[nstr].offset)));
1787 return get_string (domain, nstr, !!msgid2, nplural);
1821 values on the stack. The used domain is the first one registered