From 8b660b1ca5c72ca4f2e5cfea282d619ed683446c Mon Sep 17 00:00:00 2001 From: Ákos Kőrösi Date: Sat, 23 May 2026 21:08:47 +0200 Subject: define Channel type --- src/syntax.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/syntax.h') diff --git a/src/syntax.h b/src/syntax.h index 80ab067..07d5437 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -1,5 +1,6 @@ # pragma once +#include #include "utils.h" @@ -190,10 +191,20 @@ typedef struct { DECLARE_VEC(FdRedirect, FdRedirectVec) + +typedef struct { + int fd; + bool parent_proc_closable; + bool child_proc_closable; +} Channel; + +static const Channel STDIN_CHA = {.fd = STDIN_FILENO, .parent_proc_closable = false, .child_proc_closable = false}; +static const Channel STDOUT_CHA = {.fd = STDOUT_FILENO, .parent_proc_closable = false, .child_proc_closable = false}; + typedef struct { char** args; FdRedirectVec redirects; - int stdin_fd, stdout_fd; + Channel read_cha, write_cha; IntVec parent_open_fds; IntVec child_open_fds; } ExecutableCommand; -- cgit v1.2.3