From 2694532a5479d157903b6c600d9b1d5c145a4e4c Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 12 Jun 2023 19:40:41 +0200 Subject: libio: replace OSTREAM_OPEN_* flags with SQFS_FILE_OPEN_* flags Signed-off-by: David Oberhollenzer --- include/io/file.h | 11 +++-------- include/sqfs/io.h | 9 ++++++++- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/io/file.h b/include/io/file.h index 297047f..d4f6fc1 100644 --- a/include/io/file.h +++ b/include/io/file.h @@ -18,11 +18,6 @@ typedef HANDLE os_file_t; typedef int os_file_t; #endif -enum { - OSTREAM_OPEN_OVERWRITE = 0x01, - OSTREAM_OPEN_NO_SPARSE = 0x02, -}; - #ifdef __cplusplus extern "C" { #endif @@ -48,7 +43,7 @@ SQFS_INTERNAL istream_t *istream_open_handle(const char *path, os_file_t fd); * * @memberof ostream_t * - * If the flag OSTREAM_OPEN_NO_SPARSE is set, the underlying implementation + * If the flag SQFS_FILE_OPEN_NO_SPARSE is set, the underlying implementation * always writes chunks of zero bytes when passing a NULL pointer to append. * Otherwise, it tries to use seek/truncate style APIs to create sparse output * files. @@ -79,10 +74,10 @@ SQFS_INTERNAL istream_t *istream_open_file(const char *path); * @memberof ostream_t * * If the file does not yet exist, it is created. If it does exist this - * function fails, unless the flag OSTREAM_OPEN_OVERWRITE is set, in which + * function fails, unless the flag SQFS_FILE_OPEN_OVERWRITE is set, in which * case the file is opened and its contents are discarded. * - * If the flag OSTREAM_OPEN_NO_SPARSE is set, the underlying implementation + * If the flag SQFS_FILE_OPEN_NO_SPARSE is set, the underlying implementation * always writes chunks of zero bytes when passing a NULL pointer to append. * Otherwise, it tries to use seek/truncate style APIs to create sparse output * files. diff --git a/include/sqfs/io.h b/include/sqfs/io.h index 4cdb574..a1fb169 100644 --- a/include/sqfs/io.h +++ b/include/sqfs/io.h @@ -76,7 +76,14 @@ typedef enum { */ SQFS_FILE_OPEN_NO_CHARSET_XFRM = 0x04, - SQFS_FILE_OPEN_ALL_FLAGS = 0x07, + /** + * @brief Do not use sparse file I/O APIs, always fill in zero bytes + * + * This flag currently has no effect on @ref sqfs_open_file. + */ + SQFS_FILE_OPEN_NO_SPARSE = 0x08, + + SQFS_FILE_OPEN_ALL_FLAGS = 0x0F, } SQFS_FILE_OPEN_FLAGS; /** -- cgit v1.2.3