summaryrefslogtreecommitdiff
path: root/src/syntax.h
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-23 21:08:47 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-23 21:08:47 +0200
commit8b660b1ca5c72ca4f2e5cfea282d619ed683446c (patch)
tree0e53d312d311a35d7c5927548104686fd343ea16 /src/syntax.h
parent7a106ea8332ed6d95504fd3181f7b5f81a6c3072 (diff)
define Channel type
Diffstat (limited to 'src/syntax.h')
-rw-r--r--src/syntax.h13
1 files changed, 12 insertions, 1 deletions
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 <unistd.h>
#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;