Merge remote-tracking branch 'origin' into maix/norminette

This commit is contained in:
Maix0 2024-05-03 15:21:37 +02:00
commit f35e986145
107 changed files with 476 additions and 138 deletions

View file

@ -0,0 +1,22 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* handle_concat.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 15:49:12 by maiboyer #+# #+# */
/* Updated: 2024/05/02 15:52:16 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef HANDLE_CONCAT_H
#define HANDLE_CONCAT_H
#include "app/state.h"
#include "app/node.h"
#include "me/types.h"
t_error handle_concat(t_node *self, t_utils *shcat, t_str *ret);
#endif /* HANDLE_CONCAT_H */

View file

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* handle_raw_word.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 15:58:01 by maiboyer #+# #+# */
/* Updated: 2024/05/02 15:58:48 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef HANDLE_RAW_WORD_H
#define HANDLE_RAW_WORD_H
#include "app/node.h"
#include "app/state.h"
t_error handle_raw_string(t_node *self, t_utils *shcat, t_str *ret);
#endif /* HANDLE_RAW_WORD_H */

View file

@ -0,0 +1,22 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* handle_word.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 16:00:11 by maiboyer #+# #+# */
/* Updated: 2024/05/02 16:00:40 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef HANDLE_WORD_H
#define HANDLE_WORD_H
#include "app/state.h"
#include "app/node.h"
#include "me/types.h"
t_error handle_word(t_node *self, t_utils *shcat, t_str *ret);
#endif /* HANDLE_WORD_H */

35
includes/app/state.h Normal file
View file

@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* state.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 15:49:56 by maiboyer #+# #+# */
/* Updated: 2024/05/02 15:51:38 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef STATE_H
#define STATE_H
#include "app/node.h"
#include "me/types.h"
typedef struct s_parser
{
t_first_parser *parser;
} t_parser;
typedef struct s_utils
{
t_str name_shell;
t_str str_input;
t_str *strs_input;
t_str *path;
t_str *envp;
t_parser parser;
t_node current_node;
} t_utils;
#endif /* STATE_H */

View file

@ -6,57 +6,41 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 14:41:15 by rparodi #+# #+# */
/* Updated: 2024/04/30 16:41:57 by maiboyer ### ########.fr */
/* Updated: 2024/05/02 15:51:57 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
#define MINISHELL_H
# include "me/types.h"
# include "app/node.h"
#include "app/node.h"
#include "app/state.h"
#include "me/types.h"
# include <unistd.h>
# include <fcntl.h>
# include <stdlib.h>
# include <stdio.h>
# include <string.h>
# include <sys/types.h>
# include <sys/wait.h>
# include <stdlib.h>
# include <stdarg.h>
# include <readline/readline.h>
# include <readline/history.h>
#include <fcntl.h>
#include <readline/history.h>
#include <readline/readline.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
# define PATH_FILES "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
typedef struct s_parser
{
t_first_parser *parser;
} t_parser;
typedef struct s_utils
{
t_str name_shell;
t_str str_input;
t_str *strs_input;
t_str *path;
t_str *envp;
t_parser parser;
t_node current_node;
} t_utils;
#define PATH_FILES "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
t_i32 main(t_i32 argc, t_str argv[], t_str arge[]);
void ft_other_cmd(t_utils *shcat, t_usize i, t_usize prev_i);
t_i32 ft_strcmp(const char *s1, const char *s2);
t_i32 ft_check_type_operators(t_str operators);
t_str *ft_split(t_const_str s, t_i8 c);
t_str *ft_split(t_const_str s, t_i8 c);
t_str ft_strdup(t_const_str s);
char *ft_strjoin(char const *s1, char const *s2);
void *ft_calloc(t_usize nmemb, t_usize size);
char *ft_strjoin(char const *s1, char const *s2);
void *ft_calloc(t_usize nmemb, t_usize size);
size_t ft_strlen(t_const_str s);
t_usize ft_strlcpy(t_str dst, t_const_str src, t_usize size);
void *ft_memset(void *s, t_i32 c, t_usize n);
t_usize ft_strlcpy(t_str dst, t_const_str src, t_usize size);
void *ft_memset(void *s, t_i32 c, t_usize n);
void ft_bzero(void *s, t_usize n);
void ft_free_strs(t_str *strs);
void ft_pwd(void);