」 feat: testing readline

This commit is contained in:
2024-04-25 11:46:41 +02:00
parent 59b810ffa4
commit 5bd359eac0
69 changed files with 73 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -6,7 +6,7 @@
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ # # By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2024/04/24 10:49:52 by adjoly #+# #+# # # Created: 2024/04/24 10:49:52 by adjoly #+# #+# #
# Updated: 2024/04/24 10:50:53 by adjoly ### ########.fr # # Updated: 2024/04/25 10:59:23 by adjoly ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -16,9 +16,7 @@ CC = cc
OBJSDIR = obj/ OBJSDIR = obj/
SRCDIR = src/ SRC = $(shell find src -name '*.c')
SRC = $(find src -name '*.c')
I_DIR = include/ I_DIR = include/
@ -34,7 +32,7 @@ LIB = libft/libft.a \
$(NAME): $(OBJS) $(NAME): $(OBJS)
@make -s -C libft @make -s -C libft
@$(CC) $(FLAGS) $(OBJS) $(LIB) -o $(NAME) @$(CC) $(FLAGS) -lreadline $(OBJS) $(LIB) -o $(NAME)
@echo "[✔] Compiled" @echo "[✔] Compiled"
$(OBJSDIR)%.o: %.c $(OBJSDIR)%.o: %.c
@ -57,4 +55,3 @@ fclean: clean
re: fclean all re: fclean all
.PHONY: clean all re fclean .PHONY: clean all re fclean

21
compile_commands.json Normal file
View File

@ -0,0 +1,21 @@
[
{
"directory": "/nfs/homes/adjoly/Documents/ft_minipowershell",
"arguments": [
"cc",
"-I",
"include/",
"-I",
"libft/",
"-Werror",
"-Wall",
"-Wextra",
"-g",
"src/main.c",
"-c",
"-o",
"obj/src/main.o"
],
"file": "src/main.c"
}
]

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libft/libft.a Normal file

Binary file not shown.

BIN
libft/mem/ft_calloc.o Normal file

Binary file not shown.

BIN
libft/obj/is/ft_isalnum.o Normal file

Binary file not shown.

BIN
libft/obj/is/ft_isalpha.o Normal file

Binary file not shown.

BIN
libft/obj/is/ft_isascii.o Normal file

Binary file not shown.

BIN
libft/obj/is/ft_isdigit.o Normal file

Binary file not shown.

BIN
libft/obj/is/ft_isprint.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libft/obj/lst/ft_lstclear.o Normal file

Binary file not shown.

Binary file not shown.

BIN
libft/obj/lst/ft_lstiter.o Normal file

Binary file not shown.

BIN
libft/obj/lst/ft_lstlast.o Normal file

Binary file not shown.

BIN
libft/obj/lst/ft_lstmap.o Normal file

Binary file not shown.

BIN
libft/obj/lst/ft_lstnew.o Normal file

Binary file not shown.

BIN
libft/obj/lst/ft_lstsize.o Normal file

Binary file not shown.

BIN
libft/obj/mem/ft_bzero.o Normal file

Binary file not shown.

BIN
libft/obj/mem/ft_calloc.o Normal file

Binary file not shown.

BIN
libft/obj/mem/ft_memchr.o Normal file

Binary file not shown.

BIN
libft/obj/mem/ft_memcmp.o Normal file

Binary file not shown.

BIN
libft/obj/mem/ft_memcpy.o Normal file

Binary file not shown.

BIN
libft/obj/mem/ft_memmove.o Normal file

Binary file not shown.

BIN
libft/obj/mem/ft_memset.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libft/obj/print/ft_putnbr.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libft/obj/print/ft_putstr.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
libft/obj/str/ft_atoi.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_atoll.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_itoa.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_split.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strchr.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strdup.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_striteri.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strjoin.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strlcat.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strlcpy.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strlen.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strmapi.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strncmp.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strnstr.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strrchr.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_strtrim.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_substr.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_tolower.o Normal file

Binary file not shown.

BIN
libft/obj/str/ft_toupper.o Normal file

Binary file not shown.

BIN
libft/str/ft_strlen.o Normal file

Binary file not shown.

BIN
minishell Executable file

Binary file not shown.

BIN
obj/src/main.o Normal file

Binary file not shown.

48
src/main.c Normal file
View File

@ -0,0 +1,48 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/24 11:18:04 by adjoly #+# #+# */
/* Updated: 2024/04/25 11:30:17 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include <readline/readline.h>
#include <stdio.h>
#include "libft.h"
t_boolean is_str(char *src, char *dst)
{
while (*src++ == *dst++)
;
if (*src)
return (FALSE);
return (TRUE);
}
int main(int ac, char **av, char **env)
{
char *test;
char **lll;
(void)ac;
(void)av;
(void)env;
while (1)
{
test = readline("test>");
lll = ft_split(test, ' ');
if (is_str(*lll, "exit") == TRUE)
return (0);
if (is_str(*lll, "uwu") == TRUE)
{
printf("go burn in hell\n");
return (0);
}
printf("%s\n", test);
}
return (0);
}