From 5a102e93a1a3f2d45a27edb532766c2584ca6f81 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Tue, 31 Jan 2023 14:40:15 +0100 Subject: [PATCH] init --- Makefile | 28 ++++++ libftx/Makefile | 35 ++++++++ libftx/extra/Makefile | 39 ++++++++ libftx/extra/extra.h | 36 ++++++++ libftx/extra/ft_contain_only.c | 41 +++++++++ libftx/extra/ft_freer.c | 58 ++++++++++++ libftx/extra/ft_is_in.c | 27 ++++++ libftx/extra/ft_random_generator.c | 38 ++++++++ libftx/extra/ft_strchri.c | 27 ++++++ libftx/extra/ft_strcmp.c | 23 +++++ libftx/extra/ft_strfjoin.c | 42 +++++++++ libftx/extra/ft_strgen.c | 31 +++++++ libftx/extra/ft_strmerger.c | 33 +++++++ libftx/extra/ft_strndup.c | 32 +++++++ libftx/extra/ft_tabrealloc-5f29f43f.o.tmp | 0 libftx/extra/ft_tabrealloc.c | 31 +++++++ libftx/extra/ft_ultoa.o | Bin 0 -> 4688 bytes libftx/extra/ft_ultoa_base.c | 89 ++++++++++++++++++ libftx/gnl/Makefile | 39 ++++++++ libftx/gnl/get_next_line.c | 104 ++++++++++++++++++++++ libftx/gnl/get_next_line.h | 25 ++++++ libftx/gnl/get_next_line_utils.o | Bin 0 -> 5424 bytes libftx/libft/Makefile | 87 ++++++++++++++++++ libftx/libft/ft_atoi.c | 39 ++++++++ libftx/libft/ft_bzero.c | 18 ++++ libftx/libft/ft_calloc.c | 26 ++++++ libftx/libft/ft_isalnum.c | 22 +++++ libftx/libft/ft_isalpha.c | 20 +++++ libftx/libft/ft_isascii.c | 18 ++++ libftx/libft/ft_isdigit.c | 20 +++++ libftx/libft/ft_isprint.c | 18 ++++ libftx/libft/ft_itoa.c | 55 ++++++++++++ libftx/libft/ft_lstadd_back.c | 26 ++++++ libftx/libft/ft_lstadd_front.c | 21 +++++ libftx/libft/ft_lstclear.c | 27 ++++++ libftx/libft/ft_lstdelone.c | 25 ++++++ libftx/libft/ft_lstiter.c | 24 +++++ libftx/libft/ft_lstlast.c | 22 +++++ libftx/libft/ft_lstmap.c | 39 ++++++++ libftx/libft/ft_lstnew.c | 25 ++++++ libftx/libft/ft_lstsize.c | 26 ++++++ libftx/libft/ft_memchr.c | 31 +++++++ libftx/libft/ft_memcmp.c | 29 ++++++ libftx/libft/ft_memcpy.c | 32 +++++++ libftx/libft/ft_memmove.c | 37 ++++++++ libftx/libft/ft_memset.c | 28 ++++++ libftx/libft/ft_putchar_fd.c | 18 ++++ libftx/libft/ft_putendl_fd.c | 21 +++++ libftx/libft/ft_putnbr_fd.c | 34 +++++++ libftx/libft/ft_putstr_fd.c | 21 +++++ libftx/libft/ft_split.c | 92 +++++++++++++++++++ libftx/libft/ft_strchr.c | 24 +++++ libftx/libft/ft_strdup.c | 31 +++++++ libftx/libft/ft_striteri.c | 27 ++++++ libftx/libft/ft_strjoin.c | 38 ++++++++ libftx/libft/ft_strlcat.c | 25 ++++++ libftx/libft/ft_strlcpy.c | 28 ++++++ libftx/libft/ft_strlen.c | 25 ++++++ libftx/libft/ft_strmapi.c | 33 +++++++ libftx/libft/ft_strncmp.c | 25 ++++++ libftx/libft/ft_strnstr.c | 35 ++++++++ libftx/libft/ft_strrchr.c | 24 +++++ libftx/libft/ft_strtrim.c | 44 +++++++++ libftx/libft/ft_substr.c | 35 ++++++++ libftx/libft/ft_tolower.c | 18 ++++ libftx/libft/ft_toupper.c | 18 ++++ libftx/libft/libft.h | 71 +++++++++++++++ libftx/libftx.h | 89 ++++++++++++++++++ libftx/printf/Makefile | 39 ++++++++ libftx/printf/ft_dprintX.c | 18 ++++ libftx/printf/ft_dprintarg.c | 36 ++++++++ libftx/printf/ft_dprintflag.c | 23 +++++ libftx/printf/ft_dprintl_base.c | 34 +++++++ libftx/printf/ft_dprintptr.c | 27 ++++++ libftx/printf/ft_dprintstrtab.c | 29 ++++++ libftx/printf/ft_dprintul.c | 18 ++++ libftx/printf/ft_dprintul_base.c | 81 +++++++++++++++++ libftx/printf/ft_dprintx.c | 18 ++++ libftx/printf/ft_isarg.c | 29 ++++++ libftx/printf/ft_isdigit.c | 20 +++++ libftx/printf/ft_printf.c | 24 +++++ libftx/printf/ft_printf.h | 41 +++++++++ libftx/printf/ft_putchar_fd.c | 19 ++++ libftx/printf/ft_putstr_fd.c | 25 ++++++ libftx/printf/ft_skipflag.c | 30 +++++++ libftx/printf/ft_strlen.c | 25 ++++++ libftx/printf/ft_vdprintf.c | 54 +++++++++++ libftx/printf/libftprintf.a | Bin 0 -> 30760 bytes main.c | 3 + minishell.h | 14 +++ 90 files changed, 2876 insertions(+) create mode 100644 Makefile create mode 100644 libftx/Makefile create mode 100644 libftx/extra/Makefile create mode 100644 libftx/extra/extra.h create mode 100644 libftx/extra/ft_contain_only.c create mode 100644 libftx/extra/ft_freer.c create mode 100644 libftx/extra/ft_is_in.c create mode 100644 libftx/extra/ft_random_generator.c create mode 100644 libftx/extra/ft_strchri.c create mode 100644 libftx/extra/ft_strcmp.c create mode 100644 libftx/extra/ft_strfjoin.c create mode 100644 libftx/extra/ft_strgen.c create mode 100644 libftx/extra/ft_strmerger.c create mode 100644 libftx/extra/ft_strndup.c create mode 100644 libftx/extra/ft_tabrealloc-5f29f43f.o.tmp create mode 100644 libftx/extra/ft_tabrealloc.c create mode 100644 libftx/extra/ft_ultoa.o create mode 100644 libftx/extra/ft_ultoa_base.c create mode 100644 libftx/gnl/Makefile create mode 100644 libftx/gnl/get_next_line.c create mode 100644 libftx/gnl/get_next_line.h create mode 100644 libftx/gnl/get_next_line_utils.o create mode 100644 libftx/libft/Makefile create mode 100644 libftx/libft/ft_atoi.c create mode 100644 libftx/libft/ft_bzero.c create mode 100644 libftx/libft/ft_calloc.c create mode 100644 libftx/libft/ft_isalnum.c create mode 100644 libftx/libft/ft_isalpha.c create mode 100644 libftx/libft/ft_isascii.c create mode 100644 libftx/libft/ft_isdigit.c create mode 100644 libftx/libft/ft_isprint.c create mode 100644 libftx/libft/ft_itoa.c create mode 100644 libftx/libft/ft_lstadd_back.c create mode 100644 libftx/libft/ft_lstadd_front.c create mode 100644 libftx/libft/ft_lstclear.c create mode 100644 libftx/libft/ft_lstdelone.c create mode 100644 libftx/libft/ft_lstiter.c create mode 100644 libftx/libft/ft_lstlast.c create mode 100644 libftx/libft/ft_lstmap.c create mode 100644 libftx/libft/ft_lstnew.c create mode 100644 libftx/libft/ft_lstsize.c create mode 100644 libftx/libft/ft_memchr.c create mode 100644 libftx/libft/ft_memcmp.c create mode 100644 libftx/libft/ft_memcpy.c create mode 100644 libftx/libft/ft_memmove.c create mode 100644 libftx/libft/ft_memset.c create mode 100644 libftx/libft/ft_putchar_fd.c create mode 100644 libftx/libft/ft_putendl_fd.c create mode 100644 libftx/libft/ft_putnbr_fd.c create mode 100644 libftx/libft/ft_putstr_fd.c create mode 100644 libftx/libft/ft_split.c create mode 100644 libftx/libft/ft_strchr.c create mode 100644 libftx/libft/ft_strdup.c create mode 100644 libftx/libft/ft_striteri.c create mode 100644 libftx/libft/ft_strjoin.c create mode 100644 libftx/libft/ft_strlcat.c create mode 100644 libftx/libft/ft_strlcpy.c create mode 100644 libftx/libft/ft_strlen.c create mode 100644 libftx/libft/ft_strmapi.c create mode 100644 libftx/libft/ft_strncmp.c create mode 100644 libftx/libft/ft_strnstr.c create mode 100644 libftx/libft/ft_strrchr.c create mode 100644 libftx/libft/ft_strtrim.c create mode 100644 libftx/libft/ft_substr.c create mode 100644 libftx/libft/ft_tolower.c create mode 100644 libftx/libft/ft_toupper.c create mode 100644 libftx/libft/libft.h create mode 100644 libftx/libftx.h create mode 100644 libftx/printf/Makefile create mode 100644 libftx/printf/ft_dprintX.c create mode 100644 libftx/printf/ft_dprintarg.c create mode 100644 libftx/printf/ft_dprintflag.c create mode 100644 libftx/printf/ft_dprintl_base.c create mode 100644 libftx/printf/ft_dprintptr.c create mode 100644 libftx/printf/ft_dprintstrtab.c create mode 100644 libftx/printf/ft_dprintul.c create mode 100644 libftx/printf/ft_dprintul_base.c create mode 100644 libftx/printf/ft_dprintx.c create mode 100644 libftx/printf/ft_isarg.c create mode 100644 libftx/printf/ft_isdigit.c create mode 100644 libftx/printf/ft_printf.c create mode 100644 libftx/printf/ft_printf.h create mode 100644 libftx/printf/ft_putchar_fd.c create mode 100644 libftx/printf/ft_putstr_fd.c create mode 100644 libftx/printf/ft_skipflag.c create mode 100644 libftx/printf/ft_strlen.c create mode 100644 libftx/printf/ft_vdprintf.c create mode 100644 libftx/printf/libftprintf.a create mode 100644 main.c create mode 100644 minishell.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fab4bd4 --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +SRCS = main.c + +OBJS = ${SRCS:.c=.o} + +NAME = minishell + +CC = clang + +CFLAGS = -Wall -Werror -Wextra + +%.o: %.c + ${CC} ${CFLAGS} -c -o $@ $< + +all: ${NAME} + +${NAME}: ${OBJS} + ${CC} ${OBJS} -o ${NAME} + +clean: + rm -f ${OBJS} + +fclean: clean + rm -f ${NAME} + +re: fclean all + +.PHONY: all clean fclean re + diff --git a/libftx/Makefile b/libftx/Makefile new file mode 100644 index 0000000..7474655 --- /dev/null +++ b/libftx/Makefile @@ -0,0 +1,35 @@ +OBJ = ${SRC:.c=.o} + +NAME = libftx.a + +LIBS = libft/libft.a gnl/get_next_line.a printf/ft_printf.a extra/extra.a + +CC = clang + +FLAG = -Wall -Wextra -Werror + +all: ${NAME} + +${NAME}: ${OBJ} + make -C extra + make -C libft + make -C gnl + make -C printf + ar -rcT $(NAME) $(LIBS) + +clean: + make -C extra clean + make -C libft clean + make -C gnl clean + make -C printf clean + +fclean: clean + rm -f ${NAME} + make -C extra fclean + make -C libft fclean + make -C printf fclean + make -C gnl fclean + +re: fclean all + +.PHONY: all clean fclean re diff --git a/libftx/extra/Makefile b/libftx/extra/Makefile new file mode 100644 index 0000000..269a370 --- /dev/null +++ b/libftx/extra/Makefile @@ -0,0 +1,39 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: cchauvet +# include +# include +# include +# include "../libft/libft.h" + +char *ft_ultoa_base(unsigned long long n, char *base); +char *get_next_line(int fd); +size_t ft_random_generator(size_t start, size_t stop); +void ft_freer_tab_ultimate(size_t len, ...); +void ft_freer_ultimate(size_t len, ...); +char *ft_strgen(char c, size_t len); +char *ft_strfjoin(char *s1, char *s2); +char *ft_strmerger(size_t arg_len, ...); +int ft_is_in(char *str, char c); +char **ft_tabrealloc(char **tab, size_t current_size, size_t new_size); +char *ft_strndup(char *src, size_t n); +ssize_t ft_strchri(char *str, char c); +int ft_contain_only_str(char *str, char *to_find); +int ft_contain_only(char *str, char c); +int ft_strcmp(char *s1, char *s2); +#endif diff --git a/libftx/extra/ft_contain_only.c b/libftx/extra/ft_contain_only.c new file mode 100644 index 0000000..4844e79 --- /dev/null +++ b/libftx/extra/ft_contain_only.c @@ -0,0 +1,41 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_contain_only.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet 2) + { + temp = ft_strjoin(out, va_arg(va, char *)); + free(out); + if (temp == NULL) + return (NULL); + out = temp; + arg_len--; + } + return (out); +} diff --git a/libftx/extra/ft_strndup.c b/libftx/extra/ft_strndup.c new file mode 100644 index 0000000..c0fc2aa --- /dev/null +++ b/libftx/extra/ft_strndup.c @@ -0,0 +1,32 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strndup.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet M4n8bU-HLuvPNw%xGZ#l190 zs5ae7C`}AJ7>zN8M_!EaL5LU$1|qE*ZIlNSQP&5_){w9y8mf@g|DQ9nm!UqG_%~-~ z{_ns4GiT29_0Z1ks-h4<3h5>_PN0PB^3>)*HVqOVXznp5e>02Mg68CC#hfgZ&Eja8 zc;9FR74uSP9yRCwKxS&RTwcJ*WT*s6C0XfPTd87B6-wppkiul>%2en|@w{Tj=Fee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&40ls0dK3zhrMfn;Wrcsza&lY+=lNQ(g3dqalD}jTpaF*i8)NG86sX^ zMH>o%1dbOFq~-R&aCVw<{_Z*){XEY3wS2_1D4*l-2%pRN7LJR!?7ajG`-3F#k8PH) zk76DE4aehr6#CzDJ}coraehp~uX6rP3ICn*@A6UPFZSIjNq>a%rzKqEc~QczaekJM z!oS$3KTG=WabDPodPRT!mh?p*?7K&;pB1jR3KjQePgyVaNWrl|>_~>&D{B~C_1Gb)R znoK7${K|kIdLy05TgJ1`?^&PAM`HVlfuF$sNIVW#oI&|&QM)pLYj(x4FDv!_Q^~Z& z6SIc;6WPeHg>GVzR4Nn0nYbDmkYYX(B}VSmVI2P_`WpObi})JG|5kvm*hBS~FLRa0 z`wL?AXC4ZJ_ycrOI_l-K8UHuHvs9*2c<2Icum^&A=t`W4D>;s_<(yDd;&I2ho)~1^ zE)d8V>PC4}CM2Q6lE*-IvHXAF`LE=DFn`>ia{l)MhCW4|FlBU=JG~_UK8pBa#P7ml z_P_F%0l&}nB<#ev8-!wBujiE)lnZ6u4{ZAb(lQetw|}SJDa=Lv0>*Q0vHn$BY>fe~ zi2cJeP}qz0$Madv2~AG%_`gU(i6w7??qczG@%=C2V0=tTjvoa~+qsZ|VGN!s4RL#M bCZRo&9RD(4a_>;@C=cZ41~}lBlH>maDPoK7 literal 0 HcmV?d00001 diff --git a/libftx/extra/ft_ultoa_base.c b/libftx/extra/ft_ultoa_base.c new file mode 100644 index 0000000..33933e5 --- /dev/null +++ b/libftx/extra/ft_ultoa_base.c @@ -0,0 +1,89 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_ultoa_base.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet +# include +# ifndef BUFFER_SIZE +# define BUFFER_SIZE 42 +# endif +# include "../libft/libft.h" +# include "../extra/extra.h" + +char *get_next_line(int fd); + +#endif diff --git a/libftx/gnl/get_next_line_utils.o b/libftx/gnl/get_next_line_utils.o new file mode 100644 index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dYlOb<4AtT^prxt4Om{#xG(y21);>ZtXweW{rrXN28Eoxw z+Bibhet zmJ!;_C|e<+eh8SMt-t|Tkd1DPQ>xuh120ka1Z{Yj#S3Z=V{$UbA80$|-Vakv)9t{~ zCO9Br9jAMcs>cOK7&yG#LuaW5HEPxzs^L7-w0)UTY?VINWm}v=&YfrI?iAe<54?E# zDXIppl78BxU1f7cuMTv1q{z+h%Z5l!k!7x;tQ}I ze*|#G&w1E00q7XK`1+tf z93?#b*IVERdEV&n=fSZkn2Yz~hQ6pg;y6Y~JMRd*o9jD$IG*%`+{Qb?|1j6z$y-d9 zr^b-Gx4`e?xZufg-H`C_ah)AxpfCKdaePAZ{|(oR5?q+s zi*>yq;jeT3MG3EP{gQ;Qas5>Z{}b1L$6Jx7DC!%M|L3{>PYM4E*WL4CwQhgo_)fmB z#C%2EeG*>b{yiKQ`H1^(K=OZr`yZ9?zjOS!gtO06uw^8?!u?N4_!*ARNci&{|B{41 z%keKuIDRIfJR{*NE=(>+IGzMhy4bI~$Nl?!P{NnEJ}Tj29Uqr)QO}=p9K-wh8=Arz ziAmn1Hivnn!l|@YKoyGm}Ua$MPmg6-|@my;CVa zpVmLHGSemmGVnjdldvhUOG_>=y75IsBj_^-Ibyk9YY0pNS1Uj43M!9YgYFZ{U!Ek1+A zc(MLp1We8ehdj^YzbYjr`_6%Hz4-6t8&$-?__(BU{LcUuIJ#MY=5e?@8RX*yH=oWe Zx&9VLNGURoS)44$y*y!Ta7pF({{d;DXBPkf literal 0 HcmV?d00001 diff --git a/libftx/libft/Makefile b/libftx/libft/Makefile new file mode 100644 index 0000000..9a2c3b1 --- /dev/null +++ b/libftx/libft/Makefile @@ -0,0 +1,87 @@ +:# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: cchauvet = c && c >= '0') + || ('z' >= c && c >= 'a') + || ('Z' >= c && c >= 'A')) + return (1); + return (0); +} diff --git a/libftx/libft/ft_isalpha.c b/libftx/libft/ft_isalpha.c new file mode 100644 index 0000000..9573931 --- /dev/null +++ b/libftx/libft/ft_isalpha.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isalpha.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = c && c >= 'a') || ('Z' >= c && c >= 'A')) + return (1); + return (0); +} diff --git a/libftx/libft/ft_isascii.c b/libftx/libft/ft_isascii.c new file mode 100644 index 0000000..5706106 --- /dev/null +++ b/libftx/libft/ft_isascii.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isascii.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 0 && 127 >= c) + return (1); + return (0); +} diff --git a/libftx/libft/ft_isdigit.c b/libftx/libft/ft_isdigit.c new file mode 100644 index 0000000..0db99f6 --- /dev/null +++ b/libftx/libft/ft_isdigit.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = c && c >= '0') + return (1); + return (0); +} diff --git a/libftx/libft/ft_isprint.c b/libftx/libft/ft_isprint.c new file mode 100644 index 0000000..fd6d523 --- /dev/null +++ b/libftx/libft/ft_isprint.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isprint.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next = new; +} diff --git a/libftx/libft/ft_lstadd_front.c b/libftx/libft/ft_lstadd_front.c new file mode 100644 index 0000000..b17cc46 --- /dev/null +++ b/libftx/libft/ft_lstadd_front.c @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstadd_front.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next = *lst; + *lst = new; +} diff --git a/libftx/libft/ft_lstclear.c b/libftx/libft/ft_lstclear.c new file mode 100644 index 0000000..e29060a --- /dev/null +++ b/libftx/libft/ft_lstclear.c @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstclear.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next; + ft_lstdelone(*lst, del); + *lst = next; + } +} diff --git a/libftx/libft/ft_lstdelone.c b/libftx/libft/ft_lstdelone.c new file mode 100644 index 0000000..73ac454 --- /dev/null +++ b/libftx/libft/ft_lstdelone.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstdelone.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet content != NULL) + del(lst->content); + free(lst); + } +} diff --git a/libftx/libft/ft_lstiter.c b/libftx/libft/ft_lstiter.c new file mode 100644 index 0000000..1baa94d --- /dev/null +++ b/libftx/libft/ft_lstiter.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstiter.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet content); + lst = lst->next; + } +} diff --git a/libftx/libft/ft_lstlast.c b/libftx/libft/ft_lstlast.c new file mode 100644 index 0000000..ba0d9d7 --- /dev/null +++ b/libftx/libft/ft_lstlast.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstlast.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next != NULL) + lst = lst->next; + return (lst); +} diff --git a/libftx/libft/ft_lstmap.c b/libftx/libft/ft_lstmap.c new file mode 100644 index 0000000..ed99c7c --- /dev/null +++ b/libftx/libft/ft_lstmap.c @@ -0,0 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstmap.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet content)); + if (root == NULL) + return (NULL); + last = root; + lst = lst->next; + while (lst != NULL) + { + last->next = ft_lstnew(f(lst->content)); + if (last->next == NULL) + { + ft_lstclear(&root, del); + return (NULL); + } + lst = lst->next; + last = last->next; + } + return (root); +} diff --git a/libftx/libft/ft_lstnew.c b/libftx/libft/ft_lstnew.c new file mode 100644 index 0000000..705733e --- /dev/null +++ b/libftx/libft/ft_lstnew.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstnew.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next = NULL; + new->content = content; + return (new); +} diff --git a/libftx/libft/ft_lstsize.c b/libftx/libft/ft_lstsize.c new file mode 100644 index 0000000..fa39de9 --- /dev/null +++ b/libftx/libft/ft_lstsize.c @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_lstsize.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet next; + } + return (count); +} diff --git a/libftx/libft/ft_memchr.c b/libftx/libft/ft_memchr.c new file mode 100644 index 0000000..28f3775 --- /dev/null +++ b/libftx/libft/ft_memchr.c @@ -0,0 +1,31 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_memchr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet 9) + { + ft_putnbr_fd(n / 10, fd); + ft_putnbr_fd(n % 10, fd); + } + else + ft_putchar_fd(n + 48, fd); +} diff --git a/libftx/libft/ft_putstr_fd.c b/libftx/libft/ft_putstr_fd.c new file mode 100644 index 0000000..d8c87d2 --- /dev/null +++ b/libftx/libft/ft_putstr_fd.c @@ -0,0 +1,21 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putstr_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = size) + return (ft_strlen(src) + (size)); + return (len_dest + ft_strlcpy(dest + len_dest, src, size - len_dest)); +} diff --git a/libftx/libft/ft_strlcpy.c b/libftx/libft/ft_strlcpy.c new file mode 100644 index 0000000..677264b --- /dev/null +++ b/libftx/libft/ft_strlcpy.c @@ -0,0 +1,28 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strlcpy.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet 0) + if (s[i] == (char) c) + return ((char *) s + i); + return (NULL); +} diff --git a/libftx/libft/ft_strtrim.c b/libftx/libft/ft_strtrim.c new file mode 100644 index 0000000..229cb81 --- /dev/null +++ b/libftx/libft/ft_strtrim.c @@ -0,0 +1,44 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strtrim.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet len) + size = len; + ptr = malloc((size + 1) * sizeof(char)); + if (ptr == NULL) + return (NULL); + ptr[size] = '\0'; + while (size-- > 0) + ptr[size] = s[start + size]; + return (ptr); +} diff --git a/libftx/libft/ft_tolower.c b/libftx/libft/ft_tolower.c new file mode 100644 index 0000000..14d83da --- /dev/null +++ b/libftx/libft/ft_tolower.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_tolower.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 'A' && 'Z' >= c)); +} diff --git a/libftx/libft/ft_toupper.c b/libftx/libft/ft_toupper.c new file mode 100644 index 0000000..3775f6d --- /dev/null +++ b/libftx/libft/ft_toupper.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_toupper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 'a' && 'z' >= c)); +} diff --git a/libftx/libft/libft.h b/libftx/libft/libft.h new file mode 100644 index 0000000..3c98b38 --- /dev/null +++ b/libftx/libft/libft.h @@ -0,0 +1,71 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* libft.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet +# include + +void *ft_cancel(char **tab, size_t len); +int ft_atoi(const char *nptr); +void ft_bzero(void *s, size_t n); +void *ft_calloc(size_t nmemb, size_t size); +int ft_isalnum(int c); +int ft_isalpha(int c); +int ft_isascii(int c); +int ft_isdigit(int c); +int ft_isprint(int c); +void *ft_memchr(const void *s, int c, size_t n); +int ft_memcmp(const void *s1, const void *s2, size_t n); +void *ft_memcpy(void *dest, const void *src, size_t n); +void *ft_memmove(void *dest, const void *src, size_t n); +void *ft_memset(void *s, int c, size_t n); +char *ft_strchr(const char *s, int c); +char *ft_strdup(const char *s); +size_t ft_strlcat(char *dst, const char *src, size_t size); +size_t ft_strlcpy(char *dst, const char *src, size_t size); +size_t ft_strlen(const char *s); +int ft_strncmp(const char *s1, const char *s2, size_t n); +char *ft_strnstr(const char *big, const char *little, size_t len); +char *ft_strrchr(const char *s, int c); +int ft_tolower(int c); +int ft_toupper(int c); + +char *ft_substr(char const *s, unsigned int start, size_t len); +char *ft_strjoin(char const *s1, char const *s2); +char *ft_strtrim(char const *s1, char const *set); +char **ft_split(char const *s, char c); +char *ft_itoa(int n); +char *ft_strmapi(char const *s, char (*f)(unsigned int, char)); +void ft_striteri(char *s, void (*f)(unsigned int, char*)); +void ft_putchar_fd(int fd, char c); +void ft_putstr_fd(char *s, int fd); +void ft_putendl_fd(char *s, int fd); +void ft_putnbr_fd(int n, int fd); + +typedef struct s_list +{ + void *content; + struct s_list *next; +} t_list; + +t_list *ft_lstnew(void *content); +void ft_lstadd_front(t_list **lst, t_list *nouveau); +int ft_lstsize(t_list *lst); +t_list *ft_lstlast(t_list *lst); +void ft_lstadd_back(t_list **lst, t_list *nouveau); +void ft_lstdelone(t_list *lst, void (*del)(void *)); +void ft_lstclear(t_list **lst, void (*del)(void *)); +void ft_lstiter(t_list *lst, void (*f)(void *)); +t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *)); + +#endif diff --git a/libftx/libftx.h b/libftx/libftx.h new file mode 100644 index 0000000..e9d6a7a --- /dev/null +++ b/libftx/libftx.h @@ -0,0 +1,89 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* libftx.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet +# include +# include + +char *ft_ultoa_base(unsigned long long n, char *base); +int ft_printf(const char *format, ...); +char *get_next_line(int fd); +size_t ft_random_generator(size_t start, size_t stop); +void ft_freer_tab_ultimate(size_t len, ...); +void ft_freer_ultimate(size_t len, ...); +char *ft_strgen(char c, size_t len); +int ft_is_in(char *str, char c); +char **ft_tabrealloc(char **tab, size_t current_size, size_t new_size); +int ft_contain_only_str(char *str, char *to_find); +int ft_contain_only(char *str, char c); +char *ft_strfjoin(char *s1, char *s2); +char *ft_strmerger(size_t arg_len, ...); +int ft_strcmp(char *s1, char *s2); +ssize_t ft_strchri(char *str, char c); +char *ft_strndup(char *src, size_t n); + +void *ft_cancel(char **tab, size_t len); +int ft_atoi(const char *nptr); +void ft_bzero(void *s, size_t n); +void *ft_calloc(size_t nmemb, size_t size); +int ft_isalnum(int c); +int ft_isalpha(int c); +int ft_isascii(int c); +int ft_isdigit(int c); +int ft_isprint(int c); +void *ft_memchr(const void *s, int c, size_t n); +int ft_memcmp(const void *s1, const void *s2, size_t n); +void *ft_memcpy(void *dest, const void *src, size_t n); +void *ft_memmove(void *dest, const void *src, size_t n); +void *ft_memset(void *s, int c, size_t n); +char *ft_strchr(const char *s, int c); +char *ft_strdup(const char *s); +size_t ft_strlcat(char *dst, const char *src, size_t size); +size_t ft_strlcpy(char *dst, const char *src, size_t size); +size_t ft_strlen(const char *s); +int ft_strncmp(const char *s1, const char *s2, size_t n); +char *ft_strnstr(const char *big, const char *little, size_t len); +char *ft_strrchr(const char *s, int c); +int ft_tolower(int c); +int ft_toupper(int c); + +char *ft_substr(char const *s, unsigned int start, size_t len); +char *ft_strjoin(char const *s1, char const *s2); +char *ft_strtrim(char const *s1, char const *set); +char **ft_split(char const *s, char c); +char *ft_itoa(int n); +char *ft_strmapi(char const *s, char (*f)(unsigned int, char)); +void ft_striteri(char *s, void (*f)(unsigned int, char*)); +void ft_putchar_fd(int fd, char c); +void ft_putstr_fd(int fd, char *s); +void ft_putendl_fd(int fd, char *s); +void ft_putnbr_fd(int fd, int n); + +typedef struct s_list +{ + void *content; + struct s_list *next; +} t_list; + +t_list *ft_lstnew(void *content); +void ft_lstadd_front(t_list **lst, t_list *nouveau); +int ft_lstsize(t_list *lst); +t_list *ft_lstlast(t_list *lst); +void ft_lstadd_back(t_list **lst, t_list *nouveau); +void ft_lstdelone(t_list *lst, void (*del)(void *)); +void ft_lstclear(t_list **lst, void (*del)(void *)); +void ft_lstiter(t_list *lst, void (*f)(void *)); +t_list *ft_lstmap(t_list *lst, void *(*f)(void *), void (*del)(void *)); + +#endif diff --git a/libftx/printf/Makefile b/libftx/printf/Makefile new file mode 100644 index 0000000..7be75df --- /dev/null +++ b/libftx/printf/Makefile @@ -0,0 +1,39 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: cchauvet base_size - 1) + { + ft_dprintul_base(fd, n / base_size, base); + ft_putchar_fd(fd, base[n % base_size]); + } + else + ft_putchar_fd(fd, base[n]); + return (str_size - 1); +} diff --git a/libftx/printf/ft_dprintx.c b/libftx/printf/ft_dprintx.c new file mode 100644 index 0000000..6d6de6e --- /dev/null +++ b/libftx/printf/ft_dprintx.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_dprintx.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = '0') + return (1); + return (0); +} diff --git a/libftx/printf/ft_printf.c b/libftx/printf/ft_printf.c new file mode 100644 index 0000000..80cedbe --- /dev/null +++ b/libftx/printf/ft_printf.c @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_printf.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet +# include + +size_t ft_strlen(const char *s); +char *ft_strchr(const char *s, int c); +int ft_isdigit(int c); +int ft_skipflag(const char *str); +int ft_isarg(int c); + +int ft_dprintptr(int fd, void *ptr); +int ft_dprintl_base(int fd, long long n, char *base); +int ft_dprintul_base(int fd, unsigned long long n, char *base); +int ft_dprintul(int fd, unsigned long long n); +int ft_dprintx(int fd, unsigned int n); +int ft_dprint_upperx(int fd, unsigned int n); +int ft_dprintflag(int fd, const char *flag, va_list va); +int ft_dprintarg(int fd, int c, va_list va); +int ft_dprintstrtab(int fd, char **tab); + +int ft_printf(const char *format, ...); + +int ft_vdprintf(int fd, const char *format, va_list va); + +int ft_putchar_fd(int fd, char c); +int ft_putstr_fd(int fd, char *str); + +#endif diff --git a/libftx/printf/ft_putchar_fd.c b/libftx/printf/ft_putchar_fd.c new file mode 100644 index 0000000..d509e9c --- /dev/null +++ b/libftx/printf/ft_putchar_fd.c @@ -0,0 +1,19 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_putchar_fd.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet `bRY;Q4FdQ>3g|;o7)e{G=pPV4>#|i)$sf`RDd4hgfDkQO&>%mshyW9X z5cU0L-rJp<+u_|(q%FyQz~0QhnKy6#?fcE!o!xu%VE1V6;L|(y`uWsooa(sw>-){E z&77lahv#|Ko>w;Oc{{)5dAn;oujaF!_eh23J=WrRdjikf_m`e`aL)6N{Eg>5f6?>4 zM)^7@>?Qswl6~d;K&G>AWOV3ECOh2O(>>Pj5o2hqZ|LMu22n|i;^R?tV7U7v&c;p+ zjY$04T4Er|6_u-#I@Dx`Za&?anm%GA`N@c6QeeqphkR8qV&Gc)AH-?bsX2=n~CSbENjSw5SZtEsbqD zXV;E5(#M`DFDs*A(^Td??L}w8^}M?KqIgP0Q{FDG()(4_Z~b3;ko)f-cWyDrWfy|0 z=~c)Fljjz_?8CF=6kmEYm`*SL1X95VlqHv53??a?&huZCxO(D>SYnkJ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T0btiWlULR!nt;~G8lbD99uGh^BI4XAxEjc$)Bzw{~LT{Y=4h0ck)m7W z$rff*%Z*r@{S5X()@ECNTE5oe3^wHBur^bDLTydDHakKx)pXeO5;5ZVoeusf2mdt( z|GN%;bZ;I;+PF85cZQw!=CxTb`W1HLgY4O1UX{uk(_EuQmB14LMI$;WSbM(Ce0%Nr zp25ex6g#}VYFQtIpn$Q?{i={o)6-=XIh z>F{z>Pf*IV`VFRMPO9f`tE}#km@h_rJVOdUQgc#P94K zJk>eSJv7V}k^2q6ZrEeNZgb55`yhOu;-K5d=sWv8ZW%Y-+S0MPj_nC9U=Z#-;OfMs z4HBFE7{$Ri%ny>ihioINxP|(GeJFFi@`BA$PgWD^NBJg6wIqCs5+!ctll{~t4{l@;(Ck$0RN;WVx_a-p!KhTLf%*?P9RQLHJs9Pu;%c_n%}h3+j+k6|t~Y zfA=}Ja)I88no*y>{0ZtAy%sf#(`0}}0vK1=PFUyl?tR1c5n`5ptr?tHLM88J%)(qU zpSP>F6K_5H#pz*+Oe%S}B3^AgM!h;Zl>Xxj`I=9DUr_MuE0b3}f{6 zy*ZAp7jxv9gE@ZCE&7EYryHtQS-;N>PKr4-+@LRUITG0Yx0@2|^#<}@VEGa-M}0qt z-MQj>zV^#M2A2LluRK3Oy;At0U-Q2PXb<<~xn)oOUau|MC9t~mAl(^X)t{L>kY1K7 zpW|<5sU+G9@b9xI^~9Clv5~%^?083QqWjJpflatC5n@yMb9aD0RpJy04!bVRr1wY~Us$e@on5wAl#``mO$8-6xpU@dZ_BHOpm=s^*VvAs7 zAZyzwmtXS-P!>bBeiz1+DlZtr)eSX@Jh0IuTfgg`;}2P=7)BkYe0G@-y~gr(VCTj7 z#Q8-c?^^{({|ozNil9up{fnHTO)_$5%VQ}P>lek0f1FG literal 0 HcmV?d00001 diff --git a/main.c b/main.c new file mode 100644 index 0000000..a6fc1b1 --- /dev/null +++ b/main.c @@ -0,0 +1,3 @@ +#include "minishell.h" + +int diff --git a/minishell.h b/minishell.h new file mode 100644 index 0000000..dbcb823 --- /dev/null +++ b/minishell.h @@ -0,0 +1,14 @@ +typedef struct s_list +{ + void *content; + void *next; + int tag; +} t_list + +typedef struct cmd +{ + int fd_in; + int fd_out; + char *cmd; + char *args; +} cmd;