mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 11:26:51 +01:00
「✨」 feat: testing readline
This commit is contained in:
BIN
.cache/clangd/index/ft_printf.h.07F51124D6AA24A6.idx
Normal file
BIN
.cache/clangd/index/ft_printf.h.07F51124D6AA24A6.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/get_next_line.h.5231596403DB1E9C.idx
Normal file
BIN
.cache/clangd/index/get_next_line.h.5231596403DB1E9C.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/libft.h.0DAE5537444BB742.idx
Normal file
BIN
.cache/clangd/index/libft.h.0DAE5537444BB742.idx
Normal file
Binary file not shown.
BIN
.cache/clangd/index/main.c.44623E5FC82D0FCE.idx
Normal file
BIN
.cache/clangd/index/main.c.44623E5FC82D0FCE.idx
Normal file
Binary file not shown.
9
Makefile
9
Makefile
@ -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
21
compile_commands.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
BIN
libft/io/get_next_line/get_next_line.a
Normal file
BIN
libft/io/get_next_line/get_next_line.a
Normal file
Binary file not shown.
BIN
libft/io/get_next_line/get_next_line.o
Normal file
BIN
libft/io/get_next_line/get_next_line.o
Normal file
Binary file not shown.
BIN
libft/io/get_next_line/get_next_line_utils.o
Normal file
BIN
libft/io/get_next_line/get_next_line_utils.o
Normal file
Binary file not shown.
BIN
libft/libft.a
Normal file
BIN
libft/libft.a
Normal file
Binary file not shown.
BIN
libft/mem/ft_calloc.o
Normal file
BIN
libft/mem/ft_calloc.o
Normal file
Binary file not shown.
BIN
libft/obj/is/ft_isalnum.o
Normal file
BIN
libft/obj/is/ft_isalnum.o
Normal file
Binary file not shown.
BIN
libft/obj/is/ft_isalpha.o
Normal file
BIN
libft/obj/is/ft_isalpha.o
Normal file
Binary file not shown.
BIN
libft/obj/is/ft_isascii.o
Normal file
BIN
libft/obj/is/ft_isascii.o
Normal file
Binary file not shown.
BIN
libft/obj/is/ft_isdigit.o
Normal file
BIN
libft/obj/is/ft_isdigit.o
Normal file
Binary file not shown.
BIN
libft/obj/is/ft_isprint.o
Normal file
BIN
libft/obj/is/ft_isprint.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstadd_back.o
Normal file
BIN
libft/obj/lst/ft_lstadd_back.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstadd_front.o
Normal file
BIN
libft/obj/lst/ft_lstadd_front.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstclear.o
Normal file
BIN
libft/obj/lst/ft_lstclear.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstdelone.o
Normal file
BIN
libft/obj/lst/ft_lstdelone.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstiter.o
Normal file
BIN
libft/obj/lst/ft_lstiter.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstlast.o
Normal file
BIN
libft/obj/lst/ft_lstlast.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstmap.o
Normal file
BIN
libft/obj/lst/ft_lstmap.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstnew.o
Normal file
BIN
libft/obj/lst/ft_lstnew.o
Normal file
Binary file not shown.
BIN
libft/obj/lst/ft_lstsize.o
Normal file
BIN
libft/obj/lst/ft_lstsize.o
Normal file
Binary file not shown.
BIN
libft/obj/mem/ft_bzero.o
Normal file
BIN
libft/obj/mem/ft_bzero.o
Normal file
Binary file not shown.
BIN
libft/obj/mem/ft_calloc.o
Normal file
BIN
libft/obj/mem/ft_calloc.o
Normal file
Binary file not shown.
BIN
libft/obj/mem/ft_memchr.o
Normal file
BIN
libft/obj/mem/ft_memchr.o
Normal file
Binary file not shown.
BIN
libft/obj/mem/ft_memcmp.o
Normal file
BIN
libft/obj/mem/ft_memcmp.o
Normal file
Binary file not shown.
BIN
libft/obj/mem/ft_memcpy.o
Normal file
BIN
libft/obj/mem/ft_memcpy.o
Normal file
Binary file not shown.
BIN
libft/obj/mem/ft_memmove.o
Normal file
BIN
libft/obj/mem/ft_memmove.o
Normal file
Binary file not shown.
BIN
libft/obj/mem/ft_memset.o
Normal file
BIN
libft/obj/mem/ft_memset.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putchar.o
Normal file
BIN
libft/obj/print/ft_putchar.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putchar_fd.o
Normal file
BIN
libft/obj/print/ft_putchar_fd.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putendl_fd.o
Normal file
BIN
libft/obj/print/ft_putendl_fd.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putnbr.o
Normal file
BIN
libft/obj/print/ft_putnbr.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putnbr_fd.o
Normal file
BIN
libft/obj/print/ft_putnbr_fd.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putnbrbase.o
Normal file
BIN
libft/obj/print/ft_putnbrbase.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putnbrbase_fd.o
Normal file
BIN
libft/obj/print/ft_putnbrbase_fd.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putstr.o
Normal file
BIN
libft/obj/print/ft_putstr.o
Normal file
Binary file not shown.
BIN
libft/obj/print/ft_putstr_fd.o
Normal file
BIN
libft/obj/print/ft_putstr_fd.o
Normal file
Binary file not shown.
BIN
libft/obj/print/printf/ft_printf.o
Normal file
BIN
libft/obj/print/printf/ft_printf.o
Normal file
Binary file not shown.
BIN
libft/obj/print/printf/ft_putchar.o
Normal file
BIN
libft/obj/print/printf/ft_putchar.o
Normal file
Binary file not shown.
BIN
libft/obj/print/printf/ft_putnbr.o
Normal file
BIN
libft/obj/print/printf/ft_putnbr.o
Normal file
Binary file not shown.
BIN
libft/obj/print/printf/ft_putnbrbase.o
Normal file
BIN
libft/obj/print/printf/ft_putnbrbase.o
Normal file
Binary file not shown.
BIN
libft/obj/print/printf/ft_putstr.o
Normal file
BIN
libft/obj/print/printf/ft_putstr.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_atoi.o
Normal file
BIN
libft/obj/str/ft_atoi.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_atoll.o
Normal file
BIN
libft/obj/str/ft_atoll.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_itoa.o
Normal file
BIN
libft/obj/str/ft_itoa.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_split.o
Normal file
BIN
libft/obj/str/ft_split.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strchr.o
Normal file
BIN
libft/obj/str/ft_strchr.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strdup.o
Normal file
BIN
libft/obj/str/ft_strdup.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_striteri.o
Normal file
BIN
libft/obj/str/ft_striteri.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strjoin.o
Normal file
BIN
libft/obj/str/ft_strjoin.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strlcat.o
Normal file
BIN
libft/obj/str/ft_strlcat.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strlcpy.o
Normal file
BIN
libft/obj/str/ft_strlcpy.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strlen.o
Normal file
BIN
libft/obj/str/ft_strlen.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strmapi.o
Normal file
BIN
libft/obj/str/ft_strmapi.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strncmp.o
Normal file
BIN
libft/obj/str/ft_strncmp.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strnstr.o
Normal file
BIN
libft/obj/str/ft_strnstr.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strrchr.o
Normal file
BIN
libft/obj/str/ft_strrchr.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_strtrim.o
Normal file
BIN
libft/obj/str/ft_strtrim.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_substr.o
Normal file
BIN
libft/obj/str/ft_substr.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_tolower.o
Normal file
BIN
libft/obj/str/ft_tolower.o
Normal file
Binary file not shown.
BIN
libft/obj/str/ft_toupper.o
Normal file
BIN
libft/obj/str/ft_toupper.o
Normal file
Binary file not shown.
BIN
libft/str/ft_strlen.o
Normal file
BIN
libft/str/ft_strlen.o
Normal file
Binary file not shown.
BIN
obj/src/main.o
Normal file
BIN
obj/src/main.o
Normal file
Binary file not shown.
48
src/main.c
Normal file
48
src/main.c
Normal 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);
|
||||||
|
}
|
Reference in New Issue
Block a user