solidc
Robust collection of general-purpose cross-platform C libraries and data structures designed for rapid and safe development in C
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
pipeline.h File Reference

Data pipeline utilities for processing streams. More...

#include <fcntl.h>
#include <sys/wait.h>
#include <unistd.h>
Include dependency graph for pipeline.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CommandNode
 Structure representing a command in a pipeline. More...
 

Typedefs

typedef struct CommandNode CommandNode
 Structure representing a command in a pipeline.
 

Functions

CommandNodecreate_command_node (char **args)
 Create a new CommandNode.
 
void execute_pipeline (CommandNode *head, int output_fd)
 Execute a pipeline of commands.
 
void free_pipeline (CommandNode *head)
 Free the linked list of commands.
 
void build_pipeline (CommandNode **commands)
 Build the pipeline using a NULL-terminated array of CommandNode pointers.
 

Detailed Description

Data pipeline utilities for processing streams.

Definition in file pipeline.h.

Function Documentation

◆ build_pipeline()

void build_pipeline ( CommandNode **  commands)

Build the pipeline using a NULL-terminated array of CommandNode pointers.

Parameters
commandsArray of CommandNode pointers, terminated by NULL.

Definition at line 250 of file pipeline.c.

References build_pipeline().

Referenced by build_pipeline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_command_node()

CommandNode * create_command_node ( char **  args)

Create a new CommandNode.

Parameters
argsArray of command arguments (NULL-terminated).
Returns
Pointer to the newly created CommandNode.

Definition at line 19 of file pipeline.c.

References create_command_node().

Referenced by create_command_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute_pipeline()

void execute_pipeline ( CommandNode head,
int  output_fd 
)

Execute a pipeline of commands.

Parameters
headPointer to the first CommandNode in the pipeline.
output_fdOptional file descriptor to capture the output of the last command. If -1, the output is not redirected.

Execute a pipeline of commands.

Parameters
headPointer to the first CommandNode in the pipeline.
output_fdOptional file descriptor to capture the output of the last command. If -1, the output is not redirected.

Definition at line 165 of file pipeline.c.

References execute_pipeline().

Referenced by execute_pipeline().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_pipeline()

void free_pipeline ( CommandNode head)

Free the linked list of commands.

Parameters
headPointer to the first CommandNode in the pipeline.

Definition at line 235 of file pipeline.c.

References free_pipeline().

Referenced by free_pipeline().

Here is the call graph for this function:
Here is the caller graph for this function: