Home | History | Annotate | Download | only in gencat

Lines Matching defs:cat_hdr

558 	struct _nls_cat_hdr cat_hdr;
566 n = read(fd, &cat_hdr, sizeof(cat_hdr));
567 if (n < (ssize_t)sizeof(cat_hdr)) {
575 if (ntohl((uint32_t)cat_hdr.__magic) != _NLS_MAGIC)
576 errx(1, "%s: bad magic number (%#x)", CORRUPT, cat_hdr.__magic);
578 cat_hdr.__mem = ntohl(cat_hdr.__mem);
580 cat_hdr.__nsets = ntohl(cat_hdr.__nsets);
581 cat_hdr.__msg_hdr_offset = ntohl(cat_hdr.__msg_hdr_offset);
582 cat_hdr.__msg_txt_offset = ntohl(cat_hdr.__msg_txt_offset);
583 if ((cat_hdr.__mem < 0) ||
584 (cat_hdr.__msg_hdr_offset < 0) ||
585 (cat_hdr.__msg_txt_offset < 0) ||
586 (cat_hdr.__mem < (int32_t)(cat_hdr.__nsets * sizeof(struct _nls_set_hdr))) ||
587 (cat_hdr.__mem < cat_hdr.__msg_hdr_offset) ||
588 (cat_hdr.__mem < cat_hdr.__msg_txt_offset))
591 msgcat = xmalloc(cat_hdr.__mem);
593 n = read(fd, msgcat, cat_hdr.__mem);
594 if (n < cat_hdr.__mem) {
603 cat_hdr.__msg_hdr_offset);
604 strings = (char *)msgcat + cat_hdr.__msg_txt_offset;
607 for (s = 0; s < cat_hdr.__nsets; s++, set_hdr++) {
631 ((char *)msgcat + cat_hdr.__mem)))
658 struct _nls_cat_hdr *cat_hdr;
699 cat_hdr = (struct _nls_cat_hdr *) msgcat;
700 cat_hdr->__magic = htonl(_NLS_MAGIC);
701 cat_hdr->__nsets = htonl(nsets);
702 cat_hdr->__mem = htonl(msgcat_size - sizeof(struct _nls_cat_hdr));
703 cat_hdr->__msg_hdr_offset =
705 cat_hdr->__msg_txt_offset =