From d5e2c6a3146c20354ab11f1dae48ab755996fa96 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 8 Sep 2023 18:49:54 +0200 Subject: libsqfs: bring sqfs_file_t in line with stream API Rename the open function to sqfs_file_open, use an argument for the return pointer and pass back and error number on failure. Also add an inermediate function to open an sqfs_file_t using a handle, similar to the stream API. The get_file_size function is moved to the native wrappers and some of the implementation is cleaned up a little. Signed-off-by: David Oberhollenzer --- extras/mk42sqfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'extras/mk42sqfs.c') diff --git a/extras/mk42sqfs.c b/extras/mk42sqfs.c index 87e1523..abad4b4 100644 --- a/extras/mk42sqfs.c +++ b/extras/mk42sqfs.c @@ -71,8 +71,7 @@ int main(int argc, char **argv) (void)argc; (void)argv; /* get a file object referring to our destination file */ - file = sqfs_open_file("42.sqfs", SQFS_FILE_OPEN_OVERWRITE); - if (file == NULL) { + if (sqfs_file_open(&file, "42.sqfs", SQFS_FILE_OPEN_OVERWRITE)) { fputs("Error opening output file.\n", stderr); return EXIT_FAILURE; } -- cgit v1.2.3