MiniDevil As beautiful as a shell
output.c File Reference

Output buffer management: adds / clears command output lines. More...

#include "minishell_ui.h"
+ Include dependency graph for output.c:

Detailed Description

Output buffer management: adds / clears command output lines.

Definition in file output.c.

Functions

void out_add_line (t_out *out, const char *line)
 Append a duplicate of a line to the output buffer. More...
 
void out_clear (t_out *out)
 Free stored output lines and reset the scroll state. More...
 
void out_free (t_out *out)
 Clear all output lines and free the lines pointer array. More...
 
void add_welcome_msg (t_ui *ui)
 Fill the output buffer w/ an introductory welcome banner. More...
 

Function Documentation

◆ out_add_line()

void out_add_line ( t_out out,
const char *  line 
)

Append a duplicate of a line to the output buffer.

Do nothing if the buffers already reached MAX_LINES

Parameters
outOutput to append to
lineString to store

Definition at line 23 of file output.c.

References t_out::count, t_out::lines, and MAX_LINES.

Referenced by add_welcome_msg(), handle_fork_error(), init_pipe_and_fds(), process_output_char(), and read_output_from_fd().

+ Here is the caller graph for this function:

◆ out_clear()

void out_clear ( t_out out)

Free stored output lines and reset the scroll state.

Parameters
outOutput state to clear

Definition at line 37 of file output.c.

References t_out::count, t_out::lines, and t_out::scroll.

Referenced by cmd_execute(), exec_ui_builtin(), and out_free().

+ Here is the caller graph for this function:

◆ out_free()

void out_free ( t_out out)

Clear all output lines and free the lines pointer array.

Parameters
outOutput to release

Definition at line 57 of file output.c.

References t_out::lines, and out_clear().

Referenced by cleanup_term(), and exec_child().

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

◆ add_welcome_msg()

void add_welcome_msg ( t_ui ui)

Fill the output buffer w/ an introductory welcome banner.

Parameters
uiUI state for which output buffer receives the banner

Definition at line 68 of file output.c.

References t_ui::out, and out_add_line().

Referenced by ui_loop().

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

Go to the source code of this file.