Modified makefiles and add AST module

This commit is contained in:
Maix0 2024-05-25 16:36:35 +02:00
parent a614195a2e
commit 635e9cfe95
20 changed files with 165 additions and 382 deletions

View file

@ -6,15 +6,16 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/31 21:48:04 by rparodi #+# #+# */
/* Updated: 2024/03/31 21:51:41 by rparodi ### ########.fr */
/* Updated: 2024/05/25 16:09:28 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "../includes/minishell.h"
#include "me/str/str.h"
void ft_echo(t_str txt, t_str flag)
{
printf("%s", txt);
if (ft_strcmp(flag, "-n") != 0)
if (!str_compare(flag, "-n"))
printf("\n");
}

View file

@ -6,27 +6,30 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/31 22:14:33 by rparodi #+# #+# */
/* Updated: 2024/03/31 22:27:33 by rparodi ### ########.fr */
/* Updated: 2024/05/25 16:08:50 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "../includes/minishell.h"
#include "me/mem/mem.h"
#include "minishell.h"
void ft_pwd(void)
void ft_pwd(void)
{
t_str str;
t_usize size;
t_usize size;
size = 1024;
str = (t_str)ft_calloc((size + 1), sizeof(t_i8));
str = (t_str)mem_alloc_array((size + 1), sizeof(t_i8));
if (str == NULL)
ft_exit(NULL, 0);
while (getcwd(str, size) == NULL) {
while (getcwd(str, size) == NULL)
{
if (str)
free(str);
size *= 2;
str = (t_str)ft_calloc(sizeof(t_i8), size);
if (str == NULL) {
str = (t_str)mem_alloc_array(sizeof(t_i8), size);
if (str == NULL)
{
ft_exit(NULL, 0);
}
}