From 061fbc12fe49ff49088a644def3227d3800cd8a7 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 2 Jun 2023 17:42:30 +0200 Subject: libio: consolidate add-hoc memory istream_t implementations In several places, there are ad-hoc istream_t implementations that read from a memory buffer to test something else stacked on top. This commit consolidates those ad-hoc implmentations into a proper one in libio, and uses the chance to remove external files for some older tests that rely on file I/O instead. Signed-off-by: David Oberhollenzer --- include/io/mem.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/io/mem.h (limited to 'include/io') diff --git a/include/io/mem.h b/include/io/mem.h new file mode 100644 index 0000000..1efd007 --- /dev/null +++ b/include/io/mem.h @@ -0,0 +1,23 @@ +/* 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 "io/istream.h" + +#ifdef __cplusplus +extern "C" { +#endif + +SQFS_INTERNAL 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 */ -- cgit v1.2.3