Lines Matching defs:pax

44 struct pax {
76 * Set output format to 'restricted pax' format.
78 * This is the same as normal 'pax', but tries to suppress
79 * the pax header whenever possible. This is the default for
89 a->archive.archive_format_name = "restricted POSIX pax interchange";
94 * Set output format to 'pax' format.
100 struct pax *pax;
105 pax = (struct pax *)malloc(sizeof(*pax));
106 if (pax == NULL) {
107 archive_set_error(&a->archive, ENOMEM, "Can't allocate pax data");
110 memset(pax, 0, sizeof(*pax));
111 a->format_data = pax;
114 a->format_name = "pax";
121 a->archive.archive_format_name = "POSIX pax interchange";
297 * Add a key/value attribute to the pax header. This function handles
346 archive_write_pax_header_xattrs(struct pax *pax, struct archive_entry *entry)
384 add_pax_attr(&(pax->pax_header), s.s, encoded_value);
408 struct pax *pax;
423 pax = (struct pax *)a->format_data;
446 "Can't allocate pax data");
471 archive_string_empty(&(pax->pax_header)); /* Blank our work area. */
520 add_pax_attr(&(pax->pax_header), "hdrcharset", hdrcharset);
525 * 'path' to pax extended attrs. (Note that an unconvertible
531 add_pax_attr_w(&(pax->pax_header), "path", path_w);
538 add_pax_attr(&(pax->pax_header), "path", path);
541 add_pax_attr_w(&(pax->pax_header),
576 add_pax_attr(&(pax->pax_header),
580 add_pax_attr_w(&(pax->pax_header),
593 * 'linkpath' to pax extended attrs. */
600 add_pax_attr(&(pax->pax_header),
605 * pax extended attribute. */
606 add_pax_attr_w(&(pax->pax_header),
620 /* If file size is too large, add 'size' to pax extended attrs. */
622 add_pax_attr_int(&(pax->pax_header), "size",
627 /* If numeric GID is too large, add 'gid' to pax extended attrs. */
629 add_pax_attr_int(&(pax->pax_header), "gid",
635 * 'gname' to pax extended attrs. */
642 add_pax_attr(&(pax->pax_header),
645 add_pax_attr_w(&(pax->pax_header),
652 /* If numeric UID is too large, add 'uid' to pax extended attrs. */
654 add_pax_attr_int(&(pax->pax_header), "uid",
659 /* Add 'uname' to pax extended attrs if necessary. */
666 add_pax_attr(&(pax->pax_header),
669 add_pax_attr_w(&(pax->pax_header),
697 add_pax_attr_int(&(pax->pax_header), "SCHILY.devmajor",
704 * value even if they don't understand the pax
718 add_pax_attr_int(&(pax->pax_header), "SCHILY.devminor",
733 * high-resolution timestamp in "restricted pax" mode.
760 * The following items are handled differently in "pax
761 * restricted" format. In particular, in "pax restricted"
772 add_pax_attr_time(&(pax->pax_header), "mtime",
778 add_pax_attr_time(&(pax->pax_header), "ctime",
784 add_pax_attr_time(&(pax->pax_header), "atime",
792 add_pax_attr_time(&(pax->pax_header),
800 add_pax_attr(&(pax->pax_header), "SCHILY.fflags", p);
807 add_pax_attr_w(&(pax->pax_header),
813 add_pax_attr_w(&(pax->pax_header),
819 add_pax_attr_int(&(pax->pax_header), "SCHILY.dev",
821 add_pax_attr_int(&(pax->pax_header), "SCHILY.ino",
823 add_pax_attr_int(&(pax->pax_header), "SCHILY.nlink",
827 archive_write_pax_header_xattrs(pax, entry_original);
843 * XXX Full pax interchange format does permit a hardlink
847 * don't check here, then every pax archive will end up with
862 * for readers that don't support pax attribute extensions.
884 if (archive_strlen(&(pax->pax_header)) > 0) {
896 archive_strlen(&(pax->pax_header)));
952 pax->entry_bytes_remaining = 0;
953 pax->entry_padding = 0;
957 pax->entry_bytes_remaining = archive_strlen(&(pax->pax_header));
958 pax->entry_padding = 0x1ff & (-(int64_t)pax->entry_bytes_remaining);
960 r = (a->compressor.write)(a, pax->pax_header.s,
961 archive_strlen(&(pax->pax_header)));
967 r = write_nulls(a, pax->entry_padding);
972 pax->entry_bytes_remaining = pax->entry_padding = 0;
986 pax->entry_bytes_remaining = archive_entry_size(entry_main);
987 pax->entry_padding = 0x1ff & (-(int64_t)pax->entry_bytes_remaining);
1128 * The ustar header for the pax extended attributes must have a
1138 * practice, if the pax extended attributes get extracted as regular
1193 * TODO: Push this string into the 'pax' structure to avoid
1225 struct pax *pax;
1227 pax = (struct pax *)a->format_data;
1228 if (pax == NULL)
1231 archive_string_free(&pax->pax_header);
1232 free(pax);
1240 struct pax *pax;
1243 pax = (struct pax *)a->format_data;
1244 ret = write_nulls(a, pax->entry_bytes_remaining + pax->entry_padding);
1245 pax->entry_bytes_remaining = pax->entry_padding = 0;
1268 struct pax *pax;
1271 pax = (struct pax *)a->format_data;
1272 if (s > pax->entry_bytes_remaining)
1273 s = pax->entry_bytes_remaining;
1276 pax->entry_bytes_remaining -= s;