fx.io: import system-level streams and uni-directional pipes

This commit is contained in:
2026-06-10 19:08:36 +01:00
parent 15784c3404
commit 2512611f8f
5 changed files with 240 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
#ifndef FX_IO_PIPE_H_
#define FX_IO_PIPE_H_
#include <fx/io/stream.h>
FX_API fx_status fx_pipe_create(fx_iostream **reader, fx_iostream **writer);
#endif
+29
View File
@@ -0,0 +1,29 @@
#ifndef FX_IO_STREAM_H_
#define FX_IO_STREAM_H_
#include <fx/int.h>
#include <fx/macros.h>
#include <fx/stream.h>
FX_DECLS_BEGIN;
#define FX_IO_TYPE_STREAM (fx_iostream_get_type())
FX_DECLARE_TYPE(fx_iostream);
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_iostream)
FX_TYPE_CLASS_DECLARATION_END(fx_iostream)
FX_API fx_type_id fx_iostream_get_type(void);
FX_API fx_iostream *fx_iostream_create(
fx_stream_mode mode,
uptr os_handle,
bool close_handle_on_release);
FX_API uptr fx_iostream_get_os_handle(const fx_iostream *stream);
FX_API uptr fx_iostream_steal_os_handle(fx_iostream *stream);
FX_DECLS_END;
#endif