#include "data_structure.h"
#include "libft.h"
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <wait.h>
Go to the source code of this file.
Macros | |
#define | PROMPT_MESSAGE_CUSTOM 1 |
Make the prompt custom (with colors) | |
#define | FOLLOW_ZSH 1 |
Follow certain added functionnality of ZSH to minishell. | |
Functions | |
int | minishell (t_data *data) |
Minishell that handles all the shell functions. | |
int | is_interactive (void) |
Function to read the context where this function is called Verify if it's used in a tty or not,. | |
int | short_minishell_no_tty (t_data *data) |
Executes the shell in a restricted area where there is no prompt Should work exactly as the minishell function. | |
char * | get_prompt_message (t_garbage *garbage) |
Build the prompt message If an error occurs, returns the static default prompt message. | |
int | signal_init (void) |
Main function for initialising signals. | |
void | reset_signal_default (void) |
Function to reset signals to default. | |
void | ignore_signal (void) |
Function to ignore certain signals. | |
char ** | init_lexer_state (t_garbage *garbage, t_lexer_state *lex_st, const char *line) |
Initialize the lexer structure. | |
char ** | lexer (t_garbage *garbage, const char *line) |
Create tokens (small chunks) a line with the quotes and operators. | |
t_command * | tokeniser (t_data *data, char **tokens) |
Creates a t_command structure that contains all the tokens Fills the command with the environment. | |
char * | ft_substr_end_gb (t_garbage *garbage, char const *src, unsigned int start, size_t end) |
Allocate memory for a string and copy the content from src. | |
int | is_operator_char (char c) |
Is |, < or > | |
char ** | parse_line (t_data *data, char *line) |
Prototype for parsing. | |
void | free_array (t_garbage *garbage, char **array) |
Free array of strings. | |
void | free_command (t_garbage *garbage, t_command *command) |
Free one t_command structure with all that it contains. | |
void | free_commands (t_garbage *garbage, t_command **command) |
Free t_command linked list structure with all that it contains. | |
void | free_files_struct (t_garbage *garbage, t_file *file) |
Free linked list of t_file structure. | |
void | free_heredoc (t_garbage *garbage, t_tmp *tmp) |
Free heredoc structure. | |
void | free_tokens (t_garbage *garbage, t_token *token) |
Free t_tokens linked list structure. | |
void | print_list_files (t_command *command) |
Print the list of files in the command structure. | |
void | print_perm_files (t_command *command) |
Print the list of permissions of files in the command structure. | |
void | print_toks (char **tokens) |
Print tokens indexed. | |
void | print_command_fd (t_command *command) |
ssize_t | print_command (t_command *command) |
Print the command structure with it's tokens. | |
ssize_t | print_commands (t_command **command) |
Print the commands structure with it's tokens. | |
#define FOLLOW_ZSH 1 |
Follow certain added functionnality of ZSH to minishell.
#define PROMPT_MESSAGE_CUSTOM 1 |
Make the prompt custom (with colors)
looks like : "$USER$(hostname):$ colors : - user and hostname + ':'