diff options
Diffstat (limited to 'include/io/ostream.h')
-rw-r--r-- | include/io/ostream.h | 34 |
1 files changed, 2 insertions, 32 deletions
diff --git a/include/io/ostream.h b/include/io/ostream.h index 8fc8cef..7a57e48 100644 --- a/include/io/ostream.h +++ b/include/io/ostream.h @@ -23,15 +23,14 @@ typedef struct ostream_t { * @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. + * @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)(struct ostream_t *strm, const void *data, size_t size); - int (*append_sparse)(struct ostream_t *strm, size_t size); - /** * @brief Process all pending, buffered data and flush it to disk. * @@ -56,33 +55,4 @@ typedef struct ostream_t { const char *(*get_filename)(struct ostream_t *strm); } ostream_t; -enum { - OSTREAM_OPEN_OVERWRITE = 0x01, - OSTREAM_OPEN_SPARSE = 0x02, -}; - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Append a number of zero bytes to an output stream. - * - * @memberof ostream_t - * - * If the unerlying implementation supports sparse files, this function can be - * used to create a "hole". If the implementation does not support it, a - * fallback is used that just appends a block of zeros manualy. - * - * @param strm A pointer to an output stream. - * @param size The number of zero bytes to append. - * - * @return Zero on success, -1 on failure. - */ -SQFS_INTERNAL int ostream_append_sparse(ostream_t *strm, size_t size); - -#ifdef __cplusplus -} -#endif - #endif /* IO_OSTREAM_H */ |