From 6e7b20a41c8a7f10392884e1741b031b579a93fa Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 23 Sep 2023 10:37:27 +0200 Subject: Cleanup: move memory/stdio streams to libcommon Signed-off-by: David Oberhollenzer --- include/common.h | 8 +++++++- include/io/mem.h | 24 ------------------------ include/io/std.h | 42 ------------------------------------------ 3 files changed, 7 insertions(+), 67 deletions(-) delete mode 100644 include/io/mem.h delete mode 100644 include/io/std.h (limited to 'include') diff --git a/include/common.h b/include/common.h index ab6fccf..13d79ba 100644 --- a/include/common.h +++ b/include/common.h @@ -22,7 +22,6 @@ #include "simple_writer.h" #include "compress_cli.h" #include "dir_tree.h" -#include "io/std.h" #include "compat.h" #include "fstree.h" @@ -54,4 +53,11 @@ void print_size(sqfs_u64 size, char *buffer, bool round_to_int); */ int parse_fstree_defaults(fstree_defaults_t *out, char *str); +int istream_open_stdin(sqfs_istream_t **out); + +int ostream_open_stdout(sqfs_ostream_t **out); + +sqfs_istream_t *istream_memory_create(const char *name, size_t bufsz, + const void *data, size_t size); + #endif /* COMMON_H */ diff --git a/include/io/mem.h b/include/io/mem.h deleted file mode 100644 index 20b04ab..0000000 --- a/include/io/mem.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ -/* - * mem.h - * - * Copyright (C) 2019 David Oberhollenzer - */ -#ifndef IO_MEM_STREAM_H -#define IO_MEM_STREAM_H - -#include "sqfs/predef.h" - -#ifdef __cplusplus -extern "C" { -#endif - -SQFS_INTERNAL -sqfs_istream_t *istream_memory_create(const char *name, size_t bufsz, - const void *data, size_t size); - -#ifdef __cplusplus -} -#endif - -#endif /* IO_MEM_STREAM_H */ diff --git a/include/io/std.h b/include/io/std.h deleted file mode 100644 index a9f436a..0000000 --- a/include/io/std.h +++ /dev/null @@ -1,42 +0,0 @@ -/* SPDX-License-Identifier: GPL-3.0-or-later */ -/* - * std.h - * - * Copyright (C) 2019 David Oberhollenzer - */ -#ifndef IO_STD_H -#define IO_STD_H - -#include "sqfs/io.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Create an input stream that reads from standard input. - * - * @memberof sqfs_istream_t - * - * @param out Returns a pointer to an input stream on success. - * - * @return Zero on success, a negative @ref SQFS_ERROR number on failure - */ -SQFS_INTERNAL int istream_open_stdin(sqfs_istream_t **out); - -/** - * @brief Create an output stream that writes to standard output. - * - * @memberof sqfs_ostream_t - * - * @param out Returns a pointer to an output stream on success. - * - * @return Zero on success, a negative @ref SQFS_ERROR number on failure - */ -SQFS_INTERNAL int ostream_open_stdout(sqfs_ostream_t **out); - -#ifdef __cplusplus -} -#endif - -#endif /* IO_STD_H */ -- cgit v1.2.3