From 723306c417b3b0f8e6a3904906d6c5612cace432 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 4 Jun 2023 14:36:25 +0200 Subject: libio: Move istream_t precache logic into backend implementation The end goal is to remove direct buffer access from the istream_t interfaces and make that opaque. For the tar implementation, this already safes us needless buffer copying, as we essentially allow the user to read-through from the underlying stream. Signed-off-by: David Oberhollenzer --- include/io/istream.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/io') diff --git a/include/io/istream.h b/include/io/istream.h index 3280327..9c34678 100644 --- a/include/io/istream.h +++ b/include/io/istream.h @@ -96,7 +96,10 @@ SQFS_INTERNAL sqfs_s32 istream_read(istream_t *strm, void *data, size_t size); * * @return 0 on success, -1 on failure. */ -SQFS_INTERNAL int istream_precache(istream_t *strm); +SQFS_INLINE int istream_precache(istream_t *strm) +{ + return strm->precache(strm); +} /** * @brief Get the underlying filename of an input stream. -- cgit v1.2.3