This commit is contained in:
LuckyLaszlo
2021-10-31 01:10:57 +02:00
parent c0ef57499a
commit 22d4bbfdd0
9 changed files with 27 additions and 17 deletions

View File

@@ -27,13 +27,17 @@
# include <signal.h>
# include <dirent.h>
# include <termios.h>
# include <curses.h> // sudo apt install libncurses-dev (OR libncurses5-dev)
// sudo apt install libncurses-dev (OR libncurses5-dev)
# include <curses.h>
# include <term.h>
# include <stdio.h>
# include <readline/readline.h> // sudo apt install libreadline-dev
// sudo apt install libreadline-dev
# include <readline/readline.h>
# include <readline/history.h>
# include <stdio.h>
# include "minishell_structs.h"
# include "minishell_macro.h"
# include "minishell_term_colors.h"

View File

@@ -16,10 +16,10 @@
// Init
int init(t_all *c, char *envp[]);
int set_signals_handling(struct sigaction *ori_signal_behaviour,
struct sigaction *signal_behaviour);
struct sigaction *signal_behaviour);
int set_terminal_attributes(struct termios *ori_termios,
struct termios *interactive_termios,
int *termios_changed);
struct termios *interactive_termios,
int *termios_changed);
// Shell modes
void shell_loop(t_all *c);

View File

@@ -13,8 +13,7 @@
#ifndef MINISHELL_STRUCTS_H
# define MINISHELL_STRUCTS_H
struct s_all;
struct s_all *g_all;
struct s_all *g_all;
enum e_token_id
{
@@ -22,10 +21,12 @@ enum e_token_id
T_LESS = '<',
T_GREAT = '>',
T_PIPE = '|',
T_DLESS, //'<<'
T_DGREAT, //'>>'
T_DLESS,
T_DGREAT,
T_WORD
};
// T_DLESS == '<<'
// T_DGREAT == '>>'
typedef struct s_token
{
@@ -34,7 +35,7 @@ typedef struct s_token
enum e_token_id id;
} t_token;
typedef int (*t_builtin_ptr)(int,char **,struct s_all *);
typedef int (*t_builtin_ptr)(int,char **,struct s_all *);
typedef struct s_cmd
{