aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-07 14:44:17 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-07 14:46:40 +0200
commit267d5318e1cbf69a071b5188dda50310af2f2f8b (patch)
tree9b17035763ab4c69458f28fe37258713c45920a5 /include
parent3a7d758d1d5a9b6499bdc3f75077932ba66f89d7 (diff)
Cleanup: Move padd_file function to libtar
It's only ever used for padding tarballs. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/tar.h8
-rw-r--r--include/util.h7
2 files changed, 8 insertions, 7 deletions
diff --git a/include/tar.h b/include/tar.h
index d0a483c..e86d775 100644
--- a/include/tar.h
+++ b/include/tar.h
@@ -109,6 +109,8 @@ typedef struct {
#define TAR_MAGIC_OLD "ustar "
#define TAR_VERSION_OLD " "
+#define TAR_RECORD_SIZE (512)
+
/*
Returns < 0 on failure, > 0 if cannot encode, 0 on success.
Prints error/warning messages to stderr.
@@ -130,4 +132,10 @@ int read_header(int fd, tar_header_decoded_t *out);
void clear_header(tar_header_decoded_t *hdr);
+/*
+ Write zero bytes to an output file to padd it to the tar record size.
+ Returns 0 on success. On failure, prints error message to stderr.
+*/
+int padd_file(int outfd, sqfs_u64 size);
+
#endif /* TAR_H */
diff --git a/include/util.h b/include/util.h
index b6102a3..3b1d16b 100644
--- a/include/util.h
+++ b/include/util.h
@@ -89,13 +89,6 @@ SQFS_INTERNAL
int popd(void);
/*
- Write zero bytes to an output file to padd it to specified block size.
- Returns 0 on success. On failure, prints error message to stderr.
-*/
-SQFS_INTERNAL
-int padd_file(int outfd, sqfs_u64 size, size_t blocksize);
-
-/*
Helper for allocating data structures with flexible array members.
'base_size' is the size of the struct itself, 'item_size' the size of a