+static void
+add_chunk_header ()
+{
+ if (archive_format == POSIX_FORMAT)
+ {
+ off_t block_ordinal;
+ union block *blk;
+ struct tar_stat_info st;
+ static size_t real_s_part_no; /* FIXME */
+
+ real_s_part_no++;
+ memset (&st, 0, sizeof st);
+ st.orig_file_name = st.file_name = real_s_name;
+ st.stat.st_mode = S_IFREG|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH;
+ st.stat.st_uid = getuid ();
+ st.stat.st_gid = getgid ();
+ st.orig_file_name = xheader_format_name (&st,
+ "%d/GNUFileParts.%p/%f.%n",
+ real_s_part_no);
+ st.file_name = st.orig_file_name;
+ st.archive_file_size = st.stat.st_size = real_s_sizeleft;
+
+ block_ordinal = current_block_ordinal ();
+ blk = start_header (&st);
+ if (!blk)
+ abort (); /* FIXME */
+ finish_header (&st, blk, block_ordinal);
+ free (st.orig_file_name);
+ }
+}
+
+
+/* Add a volume label to the current archive */
+static void
+write_volume_label (void)
+{
+ if (multi_volume_option)
+ add_volume_label ();
+ else
+ _write_volume_label (volume_label_option);
+}
+
+/* Write GNU multi-volume header */
+static void
+gnu_add_multi_volume_header (void)
+{
+ int tmp;
+ union block *block = find_next_block ();
+
+ if (strlen (real_s_name) > NAME_FIELD_SIZE)
+ WARN ((0, 0,
+ _("%s: file name too long to be stored in a GNU multivolume header, truncated"),
+ quotearg_colon (real_s_name)));
+
+ memset (block, 0, BLOCKSIZE);
+
+ /* FIXME: Michael P Urban writes: [a long name file] is being written
+ when a new volume rolls around [...] Looks like the wrong value is
+ being preserved in real_s_name, though. */
+
+ strncpy (block->header.name, real_s_name, NAME_FIELD_SIZE);
+ block->header.typeflag = GNUTYPE_MULTIVOL;