diff_archive ();
tar_stat_destroy (¤t_stat_info);
- xheader_destroy (&extended_header);
}
access_mode = ACCESS_WRITE;
char *p;
int type;
- if (extended_header.buffer || extended_header.stk == NULL)
+ if (st->xhdr.buffer || st->xhdr.stk == NULL)
return old_header;
- xheader_finish (&extended_header);
+ xheader_finish (&st->xhdr);
memcpy (hp.buffer, old_header, sizeof (hp));
if (global)
{
type = XHDTYPE;
p = xheader_xhdr_name (st);
}
- xheader_write (type, p, &extended_header);
+ xheader_write (type, p, &st->xhdr);
free (p);
header = find_next_block ();
memcpy (header, &hp.buffer, sizeof (hp.buffer));
const char *p;
open_archive (ACCESS_WRITE);
- xheader_write_global ();
+ buffer_write_global_xheader ();
if (incremental_option)
{
}
/* Copy header. */
- if (extended_header.size)
+ if (current_stat_info.xhdr.size)
{
- write_recent_bytes (extended_header.buffer,
- extended_header.size);
+ write_recent_bytes (current_stat_info.xhdr.buffer,
+ current_stat_info.xhdr.size);
}
else
{
{
prev_status = status;
tar_stat_destroy (¤t_stat_info);
- xheader_destroy (&extended_header);
status = read_header (false);
switch (status)
}
else if (header->header.typeflag == XHDTYPE
|| header->header.typeflag == SOLARIS_XHDTYPE)
- xheader_read (header, OFF_FROM_HEADER (header->header.size));
+ xheader_read (&info->xhdr, header,
+ OFF_FROM_HEADER (header->header.size));
else if (header->header.typeflag == XGLTYPE)
{
- xheader_read (header, OFF_FROM_HEADER (header->header.size));
- xheader_decode_global ();
- xheader_destroy (&extended_header);
+ struct xheader xhdr;
+ memset (&xhdr, 0, sizeof xhdr);
+ xheader_read (&xhdr, header,
+ OFF_FROM_HEADER (header->header.size));
+ xheader_decode_global (&xhdr);
+ xheader_destroy (&xhdr);
}
/* Loop! */
&& ISOCTAL (header->star_header.ctime[0])
&& header->star_header.ctime[11] == ' ')
format = STAR_FORMAT;
- else if (extended_header.size)
+ else if (stat_info->xhdr.size)
format = POSIX_FORMAT;
else
format = USTAR_FORMAT;
file->stat_info->file_name = xheader_format_name (file->stat_info,
"%d/GNUSparseFile.%p/%f", 0);
- xheader_string_begin ();
+ xheader_string_begin (&file->stat_info->xhdr);
for (i = 0; i < file->stat_info->sparse_map_avail; i++)
{
if (i)
- xheader_string_add (",");
- xheader_string_add (umaxtostr (map[i].offset, nbuf));
- xheader_string_add (",");
- xheader_string_add (umaxtostr (map[i].numbytes, nbuf));
+ xheader_string_add (&file->stat_info->xhdr, ",");
+ xheader_string_add (&file->stat_info->xhdr,
+ umaxtostr (map[i].offset, nbuf));
+ xheader_string_add (&file->stat_info->xhdr, ",");
+ xheader_string_add (&file->stat_info->xhdr,
+ umaxtostr (map[i].numbytes, nbuf));
}
- if (!xheader_string_end ("GNU.sparse.map"))
+ if (!xheader_string_end (&file->stat_info->xhdr,
+ "GNU.sparse.map"))
{
free (file->stat_info->file_name);
file->stat_info->file_name = save_file_name;
free (st->gname);
free (st->sparse_map);
free (st->dumpdir);
+ xheader_destroy (&st->xhdr);
memset (st, 0, sizeof (*st));
}
name_gather ();
open_archive (ACCESS_UPDATE);
- xheader_write_global ();
+ buffer_write_global_xheader ();
while (!found_end)
{
}
tar_stat_destroy (¤t_stat_info);
- xheader_destroy (&extended_header);
previous_status = status;
}