author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 25 Mar 2006 22:21:03 +0000 (23:21 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 26 Mar 2006 00:35:43 +0000 (16:35 -0800) | ||
commit | ae64bbc18c80bdad36c53336ba4f724ce128efca | |
tree | c0d9bffe292efeca06b5229b70d289c075cd5f5d | tree | snapshot |
parent | 2c6df2d5d1894d8951895334d80735868c6ac253 | commit | diff |
tar-tree: Introduce write_entry()
... and use it initially to write global extended header records.
Improvements compared to the old write_header():
- Uses a struct ustar_header instead of hardcoded offsets.
- Takes one struct strbuf as path argument instead of a (basedir,
prefix, name) tuple.
- Not only writes the tar header, but also the contents of the
file, if any.
- Does not write directly into the ring buffer. This allows the
code to be layed out more naturally, because there is no more
ordering constraint. Before we had to first finish writing the
extended header, now we can construct the extended and normal
headers in parallel.
- The typeflag parameter has been replaced by (reasonable) magic
values. path == NULL indicates an extended header, additionally
sha1 == NULL means it is a global extended header.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
... and use it initially to write global extended header records.
Improvements compared to the old write_header():
- Uses a struct ustar_header instead of hardcoded offsets.
- Takes one struct strbuf as path argument instead of a (basedir,
prefix, name) tuple.
- Not only writes the tar header, but also the contents of the
file, if any.
- Does not write directly into the ring buffer. This allows the
code to be layed out more naturally, because there is no more
ordering constraint. Before we had to first finish writing the
extended header, now we can construct the extended and normal
headers in parallel.
- The typeflag parameter has been replaced by (reasonable) magic
values. path == NULL indicates an extended header, additionally
sha1 == NULL means it is a global extended header.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
tar-tree.c | diff | blob | history | |
tar.h | [new file with mode: 0644] | blob |