summaryrefslogtreecommitdiff
path: root/lib/tar/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-06-29 18:21:58 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-07-08 19:17:35 +0200
commite6a19ba1a05f77f051187a6b1a828ee6d39ce052 (patch)
treec8a1566b10883edbe4a8bc9a724461f4003aaa10 /lib/tar/internal.h
parent359d71e90050a8b83f7bc7d2ecd4ff29c477cc22 (diff)
Cleanup: split libtar header, move to sub directory
Some of the on-disk format internals are moved to a separate header and some of the stuff from internal.h is moved to that format header. C++ guards are added in addtion. Everything PAX related is moved to pax_header.c, some internal functions are marked as static. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/internal.h')
-rw-r--r--lib/tar/internal.h36
1 files changed, 2 insertions, 34 deletions
diff --git a/lib/tar/internal.h b/lib/tar/internal.h
index b7c4c34..cfbb938 100644
--- a/lib/tar/internal.h
+++ b/lib/tar/internal.h
@@ -9,13 +9,8 @@
#include "config.h"
-#include "tar.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <ctype.h>
-#include <stdio.h>
+#include "tar/tar.h"
+#include "tar/format.h"
enum {
PAX_SIZE = 0x001,
@@ -38,37 +33,10 @@ enum {
ETV_POSIX,
};
-
-#define TAR_MAX_SYMLINK_LEN (65536)
-#define TAR_MAX_PATH_LEN (65536)
-#define TAR_MAX_PAX_LEN (65536)
-#define TAR_MAX_SPARSE_ENT (65536)
-
-
-int read_octal(const char *str, int digits, sqfs_u64 *out);
-
-int read_binary(const char *str, int digits, sqfs_u64 *out);
-
-int read_number(const char *str, int digits, sqfs_u64 *out);
-
-int pax_read_decimal(const char *str, sqfs_u64 *out);
-
-void update_checksum(tar_header_t *hdr);
-
-bool is_checksum_valid(const tar_header_t *hdr);
-
-sparse_map_t *read_sparse_map(const char *line);
-
sparse_map_t *read_gnu_old_sparse(istream_t *fp, tar_header_t *hdr);
sparse_map_t *read_gnu_new_sparse(istream_t *fp, tar_header_decoded_t *out);
-void free_sparse_list(sparse_map_t *sparse);
-
-size_t base64_decode(sqfs_u8 *out, const char *in, size_t len);
-
-void urldecode(char *str);
-
char *record_to_memory(istream_t *fp, size_t size);
int read_pax_header(istream_t *fp, sqfs_u64 entsize, unsigned int *set_by_pax,