From ba99ef34e7b073c03519ef74f017091de6c9bee8 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 12 Jun 2023 21:21:40 +0200 Subject: Move sqfs_istream_t & sqfs_ostream_t into libsquashfs For now, only the interfaces and helper functions are moved, the concrete implementations remain in libio. Signed-off-by: David Oberhollenzer --- lib/tar/src/iterator.c | 4 ++-- lib/tar/src/read_header.c | 4 ++-- lib/tar/src/read_sparse_map_new.c | 4 ++-- lib/tar/src/read_sparse_map_old.c | 2 +- lib/tar/src/record_to_memory.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/tar/src') diff --git a/lib/tar/src/iterator.c b/lib/tar/src/iterator.c index 5920b46..93c931c 100644 --- a/lib/tar/src/iterator.c +++ b/lib/tar/src/iterator.c @@ -177,13 +177,13 @@ static int it_next(dir_iterator_t *it, dir_entry_t **out) return tar->state; retry: if (tar->record_size > 0) { - ret = istream_skip(tar->stream, tar->record_size); + ret = sqfs_istream_skip(tar->stream, tar->record_size); if (ret) goto fail; } if (tar->padding > 0) { - ret = istream_skip(tar->stream, tar->padding); + ret = sqfs_istream_skip(tar->stream, tar->padding); if (ret) goto fail; } diff --git a/lib/tar/src/read_header.c b/lib/tar/src/read_header.c index 3117d8a..16fc9d7 100644 --- a/lib/tar/src/read_header.c +++ b/lib/tar/src/read_header.c @@ -175,7 +175,7 @@ int read_header(sqfs_istream_t *fp, tar_header_decoded_t *out) memset(out, 0, sizeof(*out)); for (;;) { - ret = istream_read(fp, &hdr, sizeof(hdr)); + ret = sqfs_istream_read(fp, &hdr, sizeof(hdr)); if (ret < 0) goto fail; @@ -226,7 +226,7 @@ int read_header(sqfs_istream_t *fp, tar_header_decoded_t *out) goto fail; if (pax_size % 512) pax_size += 512 - (pax_size % 512); - istream_skip(fp, pax_size); + sqfs_istream_skip(fp, pax_size); continue; case TAR_TYPE_PAX: clear_header(out); diff --git a/lib/tar/src/read_sparse_map_new.c b/lib/tar/src/read_sparse_map_new.c index a1f37fd..4e317a8 100644 --- a/lib/tar/src/read_sparse_map_new.c +++ b/lib/tar/src/read_sparse_map_new.c @@ -41,7 +41,7 @@ sparse_map_t *read_gnu_new_sparse(sqfs_istream_t *fp, tar_header_decoded_t *out) if (out->record_size < 512) goto fail_format; - ret = istream_read(fp, buffer, 512); + ret = sqfs_istream_read(fp, buffer, 512); if (ret < 0) goto fail; @@ -68,7 +68,7 @@ sparse_map_t *read_gnu_new_sparse(sqfs_istream_t *fp, tar_header_decoded_t *out) if (out->record_size < 512) goto fail_format; - ret = istream_read(fp, buffer + 512, 512); + ret = sqfs_istream_read(fp, buffer + 512, 512); if (ret < 0) goto fail; diff --git a/lib/tar/src/read_sparse_map_old.c b/lib/tar/src/read_sparse_map_old.c index 832329b..1794073 100644 --- a/lib/tar/src/read_sparse_map_old.c +++ b/lib/tar/src/read_sparse_map_old.c @@ -59,7 +59,7 @@ sparse_map_t *read_gnu_old_sparse(sqfs_istream_t *fp, tar_header_t *hdr) return list; do { - ret = istream_read(fp, &sph, sizeof(sph)); + ret = sqfs_istream_read(fp, &sph, sizeof(sph)); if (ret < 0) goto fail; diff --git a/lib/tar/src/record_to_memory.c b/lib/tar/src/record_to_memory.c index 1bd31aa..597d6f8 100644 --- a/lib/tar/src/record_to_memory.c +++ b/lib/tar/src/record_to_memory.c @@ -18,7 +18,7 @@ char *record_to_memory(sqfs_istream_t *fp, size_t size) if (buffer == NULL) goto fail_errno; - ret = istream_read(fp, buffer, size); + ret = sqfs_istream_read(fp, buffer, size); if (ret < 0) goto fail; @@ -28,7 +28,7 @@ char *record_to_memory(sqfs_istream_t *fp, size_t size) } if (size % 512) { - if (istream_skip(fp, 512 - (size % 512))) + if (sqfs_istream_skip(fp, 512 - (size % 512))) goto fail; } -- cgit v1.2.3