「✨」 feat: testing readline

This commit is contained in:
KeyZox committed 2024-04-25 11:46:41 +02:00
1 parent 59b810ffa4
commit 5bd359eac0
69 files changed
+73 -7

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -7
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,15 +16,13 @@ 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/
LIBFT_DIR = libft/ LIBFT_DIR = libft/
INCLUDE = -I $(I_DIR) -I $(LIBFT_DIR) INCLUDE = -I $(I_DIR) -I $(LIBFT_DIR)
OBJS = $(addprefix $(OBJSDIR), $(SRC:.c=.o)) OBJS = $(addprefix $(OBJSDIR), $(SRC:.c=.o))
@@ -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
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
View 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.
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.
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.
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.
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.
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.
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.
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.
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+48
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);
}