commit pour merge

This commit is contained in:
hugogogo
2021-12-17 12:00:32 +01:00
32 changed files with 621 additions and 565 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 02:59:58 by lperrey #+# #+# */
/* Updated: 2021/12/10 10:29:18 by hulamy ### ########.fr */
/* Updated: 2021/12/16 14:56:21 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -20,9 +20,6 @@ extern char **environ;
int init(t_all *c);
char *init_prompt(char *prompt_base);
char **retrieve_path(void);
int set_terminal_attributes(struct termios *ori_termios,
struct termios *interactive_termios,
int *termios_changed); // WIP, TEST, TEMP, PLACEHOLDER, NOT IMPORTANT, :)
void set_signals_behaviour(void);
// Shell modes
@@ -40,8 +37,8 @@ int valid_command_separator(const t_token *token_list);
size_t count_pipes(t_token *token_list);
t_cmd **pipeline_alloc(size_t cmd_nbr);
int pipeline_fill_argv(t_token *token_list, t_cmd **pipeline);
int words_expansions(t_token *token_list);
int token_expansions(t_token **t);
int expansions(t_token *token_list, t_cmd **pipeline);
int token_expansions(t_token *t);
int redirections(t_token *token_list, t_cmd **pipeline);
// Exec
@@ -72,6 +69,7 @@ typedef void (*t_free_f)(void *); // generic
// Error wrappers
int shell_error(char *s1, char *s2, char *s3, int ret_val);
int shell_perror(char *s1, char *s2, char *s3, int ret_val);
int ft_reti_perror_io(int ret, char *err_str, char *io_file);
// Generic
char *ft_strjoinfree(char *s1, char *s2);
@@ -82,13 +80,10 @@ int ft_isinset_str(char *str, char *set);
size_t ft_2d_arrlen(void *ptr); // Replace ft_arrlen()
char **ft_dup_2d_char_arr(char **ptr);
void *ft_resize_2d_arr(void *ptr, size_t add_nbr);
void print_matrix(char **matrix, char *sep);
t_list *ft_lstbeforelast(t_list *lst);
void *ft_lstnew_generic(size_t lst_size, size_t content_size);
typedef void *(*t_dup_f)(void *);
void *ft_dup_2d_arr(void *ptr, void *(*dup_func)(void *));
void ft_perror_io(char *err_str, char *io_file);
int ft_reti_perror_io(int ret, char *err_str, char *io_file);
void ft_free_null(void *ptr);
char *ft_getenv(char *env_var);
size_t ft_getenv_position(char *env_var);
@@ -97,7 +92,7 @@ int ft_is_posix_name(char *str);
char **ft_split_quotes(char const *s, char c);
char *ft_strdup_quotes(const char *s);
// signals.c
// Signals handler
void sigint_handler_interactive(int signum);
void sigint_handler_heredoc(int signum);

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 02:35:52 by lperrey #+# #+# */
/* Updated: 2021/12/01 16:49:37 by lperrey ### ########.fr */
/* Updated: 2021/12/16 06:34:29 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -42,11 +42,6 @@ typedef struct s_all
char *prompt_base;
char *prompt;
t_token *token_list;
// struct termios ori_termios;
// struct termios interactive_termios;
// int termios_changed;
// struct sigaction ori_signal_behaviour;
// struct sigaction signal_behaviour;
} t_all;
#endif