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/test/tar_fuzz.c | 2 +- lib/tar/test/tar_iterator.c | 4 ++-- lib/tar/test/tar_iterator2.c | 2 +- lib/tar/test/tar_iterator3.c | 8 ++++---- lib/tar/test/tar_simple.c | 2 +- lib/tar/test/tar_target_filled.c | 8 ++++---- lib/tar/test/tar_write_simple.c | 6 +++--- lib/tar/test/tar_xattr.c | 2 +- lib/tar/test/tar_xattr_bin.c | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) (limited to 'lib/tar/test') diff --git a/lib/tar/test/tar_fuzz.c b/lib/tar/test/tar_fuzz.c index bdea98e..92c0952 100644 --- a/lib/tar/test/tar_fuzz.c +++ b/lib/tar/test/tar_fuzz.c @@ -34,7 +34,7 @@ int main(int argc, char **argv) if (ret < 0) goto fail; - ret = istream_skip(fp, hdr.record_size); + ret = sqfs_istream_skip(fp, hdr.record_size); clear_header(&hdr); if (ret < 0) diff --git a/lib/tar/test/tar_iterator.c b/lib/tar/test/tar_iterator.c index 25e1389..f51ecd6 100644 --- a/lib/tar/test/tar_iterator.c +++ b/lib/tar/test/tar_iterator.c @@ -83,12 +83,12 @@ int main(int argc, char **argv) TEST_EQUAL_UI(((sqfs_object_t *)ti)->refcount, 1); /* read the data from the stream */ - ret = istream_read(ti, buffer, sizeof(buffer)); + ret = sqfs_istream_read(ti, buffer, sizeof(buffer)); TEST_EQUAL_I(ret, 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); - ret = istream_read(ti, buffer, sizeof(buffer)); + ret = sqfs_istream_read(ti, buffer, sizeof(buffer)); TEST_EQUAL_I(ret, 0); sqfs_drop(ti); diff --git a/lib/tar/test/tar_iterator2.c b/lib/tar/test/tar_iterator2.c index 6f472ae..7483e81 100644 --- a/lib/tar/test/tar_iterator2.c +++ b/lib/tar/test/tar_iterator2.c @@ -76,7 +76,7 @@ int main(int argc, char **argv) offset = 0; for (;;) { - ret = istream_read(ti, buffer, sizeof(buffer)); + ret = sqfs_istream_read(ti, buffer, sizeof(buffer)); TEST_ASSERT(ret >= 0); if (ret == 0) diff --git a/lib/tar/test/tar_iterator3.c b/lib/tar/test/tar_iterator3.c index 39e7b42..11c2fd2 100644 --- a/lib/tar/test/tar_iterator3.c +++ b/lib/tar/test/tar_iterator3.c @@ -86,10 +86,10 @@ int main(int argc, char **argv) TEST_EQUAL_I(ret, 0); TEST_NOT_NULL(ti); - TEST_ASSERT(istream_read(ti, buffer, sizeof(buffer)) == 5); + TEST_ASSERT(sqfs_istream_read(ti, buffer, sizeof(buffer)) == 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); - TEST_ASSERT(istream_read(ti, buffer, sizeof(buffer)) == 0); + TEST_ASSERT(sqfs_istream_read(ti, buffer, sizeof(buffer)) == 0); ti = sqfs_drop(ti); ret = it->next(it, &ent); @@ -105,10 +105,10 @@ int main(int argc, char **argv) TEST_EQUAL_I(ret, 0); TEST_NOT_NULL(ti); - TEST_ASSERT(istream_read(ti, buffer, sizeof(buffer)) == 5); + TEST_ASSERT(sqfs_istream_read(ti, buffer, sizeof(buffer)) == 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); - TEST_ASSERT(istream_read(ti, buffer, sizeof(buffer)) == 0); + TEST_ASSERT(sqfs_istream_read(ti, buffer, sizeof(buffer)) == 0); ti = sqfs_drop(ti); /* "deep" directory hierarchy containg a hard link */ diff --git a/lib/tar/test/tar_simple.c b/lib/tar/test/tar_simple.c index 656e59b..a666eb5 100644 --- a/lib/tar/test/tar_simple.c +++ b/lib/tar/test/tar_simple.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) TEST_STR_EQUAL(hdr.name, fname); TEST_ASSERT(!hdr.unknown_record); - TEST_ASSERT(istream_read(fp, buffer, 5) == 5); + TEST_ASSERT(sqfs_istream_read(fp, buffer, 5) == 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); clear_header(&hdr); diff --git a/lib/tar/test/tar_target_filled.c b/lib/tar/test/tar_target_filled.c index 815728a..4f061c0 100644 --- a/lib/tar/test/tar_target_filled.c +++ b/lib/tar/test/tar_target_filled.c @@ -50,10 +50,10 @@ int main(int argc, char **argv) "20_characters_here03/20_characters_here04/" "errored_file_tst"); TEST_EQUAL_UI(hdr.actual_size, 5); - TEST_ASSERT(istream_read(fp, buffer, 5) == 5); + TEST_ASSERT(sqfs_istream_read(fp, buffer, 5) == 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); - TEST_ASSERT(istream_skip(fp, 512 - 5) == 0); + TEST_ASSERT(sqfs_istream_skip(fp, 512 - 5) == 0); clear_header(&hdr); TEST_ASSERT(read_header(fp, &hdr) == 0); @@ -62,10 +62,10 @@ int main(int argc, char **argv) "20_characters_here03/20_characters_here04/" "some_test_file"); TEST_EQUAL_UI(hdr.actual_size, 5); - TEST_ASSERT(istream_read(fp, buffer, 5) == 5); + TEST_ASSERT(sqfs_istream_read(fp, buffer, 5) == 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); - TEST_ASSERT(istream_skip(fp, 512 - 5) == 0); + TEST_ASSERT(sqfs_istream_skip(fp, 512 - 5) == 0); clear_header(&hdr); /* "deep" directory hierarchy containg a hard link */ diff --git a/lib/tar/test/tar_write_simple.c b/lib/tar/test/tar_write_simple.c index 98ac25b..ca8d1e5 100644 --- a/lib/tar/test/tar_write_simple.c +++ b/lib/tar/test/tar_write_simple.c @@ -6,7 +6,7 @@ */ #include "config.h" #include "tar/tar.h" -#include "io/ostream.h" +#include "sqfs/io.h" #include "io/file.h" #include "util/test.h" #include "sqfs/xattr.h" @@ -191,11 +191,11 @@ int main(int argc, char **argv) fp = istream_open_file(STRVALUE(TESTPATH) "/" STRVALUE(TESTFILE)); TEST_NOT_NULL(fp); - ret = istream_read(fp, rd_buffer, sizeof(rd_buffer)); + ret = sqfs_istream_read(fp, rd_buffer, sizeof(rd_buffer)); TEST_ASSERT(ret > 0); TEST_EQUAL_UI(ret, sizeof(rd_buffer)); - ret = istream_read(fp, rd_buffer, sizeof(rd_buffer)); + ret = sqfs_istream_read(fp, rd_buffer, sizeof(rd_buffer)); TEST_EQUAL_I(ret, 0); sqfs_drop(fp); diff --git a/lib/tar/test/tar_xattr.c b/lib/tar/test/tar_xattr.c index 657b73d..26a2cd0 100644 --- a/lib/tar/test/tar_xattr.c +++ b/lib/tar/test/tar_xattr.c @@ -27,7 +27,7 @@ int main(int argc, char **argv) TEST_EQUAL_UI(hdr.mtime, 1543094477); TEST_STR_EQUAL(hdr.name, "input.txt"); TEST_ASSERT(!hdr.unknown_record); - TEST_ASSERT(istream_read(fp, buffer, 5) == 5); + TEST_ASSERT(sqfs_istream_read(fp, buffer, 5) == 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); diff --git a/lib/tar/test/tar_xattr_bin.c b/lib/tar/test/tar_xattr_bin.c index f897bce..94c8d76 100644 --- a/lib/tar/test/tar_xattr_bin.c +++ b/lib/tar/test/tar_xattr_bin.c @@ -35,7 +35,7 @@ int main(int argc, char **argv) TEST_EQUAL_UI(hdr.mtime, 1543094477); TEST_STR_EQUAL(hdr.name, "input.txt"); TEST_ASSERT(!hdr.unknown_record); - TEST_ASSERT(istream_read(fp, buffer, 5) == 5); + TEST_ASSERT(sqfs_istream_read(fp, buffer, 5) == 5); buffer[5] = '\0'; TEST_STR_EQUAL(buffer, "test\n"); -- cgit v1.2.3