aboutsummaryrefslogtreecommitdiff
path: root/include/io
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-02 17:42:30 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-03 23:36:14 +0200
commit061fbc12fe49ff49088a644def3227d3800cd8a7 (patch)
treea9390a1c0610b3a93dddb7882956f1cb9a9ea37c /include/io
parent3f7f3654d243275332d964f9ecbb79f9eb83a5d1 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/io')
-rw-r--r--include/io/mem.h23
1 files changed, 23 insertions, 0 deletions
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 <goliath@infraroot.at>
+ */
+#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 */