PatchworkOS
3984a1d
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
pipeline.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
sys/io.h
>
4
#include <
sys/list.h
>
5
#include <
sys/proc.h
>
6
7
typedef
struct
8
{
9
const
char
**
argv
;
10
uint64_t
argc
;
11
fd_t
stdin
;
12
fd_t
stdout
;
13
fd_t
stderr
;
14
bool
shouldCloseStdin
;
15
bool
shouldCloseStdout
;
16
bool
shouldCloseStderr
;
17
pid_t
pid
;
18
}
cmd_t
;
19
20
typedef
struct
21
{
22
cmd_t
*
cmds
;
23
uint64_t
capacity
;
24
uint64_t
amount
;
25
char
status[
MAX_PATH
];
26
}
pipeline_t
;
27
28
uint64_t
pipeline_init
(
pipeline_t
*
pipeline
,
const
char
* cmdline,
fd_t
stdin
,
fd_t
stdout
,
fd_t
stderr
);
29
30
void
pipeline_deinit
(
pipeline_t
*
pipeline
);
31
32
void
pipeline_execute
(
pipeline_t
*
pipeline
);
33
34
void
pipeline_wait
(
pipeline_t
*
pipeline
);
MAX_PATH
#define MAX_PATH
Maximum length of filepaths.
Definition
MAX_PATH.h:11
y
int64_t y
Definition
main.c:153
fd_t
__UINT64_TYPE__ fd_t
A file descriptor.
Definition
fd_t.h:12
pid_t
__UINT64_TYPE__ pid_t
Process Identifier.
Definition
pid_t.h:11
io.h
list.h
pipeline_deinit
void pipeline_deinit(pipeline_t *pipeline)
Definition
pipeline.c:264
pipeline_wait
void pipeline_wait(pipeline_t *pipeline)
Definition
pipeline.c:435
pipeline_init
uint64_t pipeline_init(pipeline_t *pipeline, const char *cmdline, fd_t stdin, fd_t stdout, fd_t stderr)
Definition
pipeline.c:13
pipeline_execute
void pipeline_execute(pipeline_t *pipeline)
Definition
pipeline.c:427
proc.h
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:17
stdout
FILE * stdout
Definition
std_streams.c:18
stderr
FILE * stderr
Definition
std_streams.c:19
stdin
FILE * stdin
Definition
std_streams.c:17
cmd_t
Definition
pipeline.h:8
cmd_t::pid
pid_t pid
Definition
pipeline.h:17
cmd_t::argc
uint64_t argc
Definition
pipeline.h:10
cmd_t::stderr
fd_t stderr
Definition
pipeline.h:13
cmd_t::shouldCloseStdin
bool shouldCloseStdin
Definition
pipeline.h:14
cmd_t::shouldCloseStdout
bool shouldCloseStdout
Definition
pipeline.h:15
cmd_t::stdin
fd_t stdin
Definition
pipeline.h:11
cmd_t::stdout
fd_t stdout
Definition
pipeline.h:12
cmd_t::argv
const char ** argv
Definition
pipeline.h:9
cmd_t::shouldCloseStderr
bool shouldCloseStderr
Definition
pipeline.h:16
pipeline_t
Definition
pipeline.h:21
pipeline_t::amount
uint64_t amount
Definition
pipeline.h:24
pipeline_t::cmds
cmd_t * cmds
Definition
pipeline.h:22
pipeline_t::capacity
uint64_t capacity
Definition
pipeline.h:23
src
programs
core
shell
pipeline.h
Generated on Sat Jan 10 2026 00:03:16 for PatchworkOS by
1.9.8