diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-12 21:21:40 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-15 13:38:25 +0200 |
commit | ba99ef34e7b073c03519ef74f017091de6c9bee8 (patch) | |
tree | 8c134f72990200550ac96e46bd47d4cc0ba85810 /include/io/ostream.h | |
parent | e811851deba9c45f3d9b3c5b4ad5eaa7945382d5 (diff) |
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/io/ostream.h')
-rw-r--r-- | include/io/ostream.h | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/include/io/ostream.h b/include/io/ostream.h deleted file mode 100644 index d1781d2..0000000 --- a/include/io/ostream.h +++ /dev/null @@ -1,60 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ -/* - * ostream.h - * - * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at> - */ -#ifndef IO_OSTREAM_H -#define IO_OSTREAM_H - -#include "sqfs/predef.h" - -typedef struct sqfs_ostream_t sqfs_ostream_t; - -/** - * @interface sqfs_ostream_t - * - * @extends sqfs_object_t - * - * @brief An append-only data stream. - */ -struct sqfs_ostream_t { - sqfs_object_t base; - - /** - * @brief Append a block of data to an output stream. - * - * @param strm A pointer to an output stream. - * @param data A pointer to the data block to append. If NULL, - * synthesize a chunk of zero bytes. - * @param size The number of bytes to append. - * - * @return Zero on success, -1 on failure. - */ - int (*append)(sqfs_ostream_t *strm, const void *data, size_t size); - - /** - * @brief Process all pending, buffered data and flush it to disk. - * - * If the stream performs some kind of transformation (e.g. transparent - * data compression), flushing caues the wrapped format to insert a - * termination token. Only call this function when you are absolutely - * DONE appending data, shortly before destroying the stream. - * - * @param strm A pointer to an output stream. - * - * @return Zero on success, -1 on failure. - */ - int (*flush)(sqfs_ostream_t *strm); - - /** - * @brief Get the underlying filename of a output stream. - * - * @param strm The output stream to get the filename from. - * - * @return A string holding the underlying filename. - */ - const char *(*get_filename)(sqfs_ostream_t *strm); -}; - -#endif /* IO_OSTREAM_H */ |