From 1d0f0b1901ab4556e229ee4fcda06724189c711d Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Tue, 27 Sep 2022 16:29:23 +0200 Subject: [PATCH] m --- Makefile | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ a.out | Bin 0 -> 15152 bytes ft_atoi.c | 36 +++++++++++++++++++++++++++++ ft_bzero.c | 18 +++++++++++++++ ft_calloc.c | 24 +++++++++++++++++++ ft_isalnum.c | 22 ++++++++++++++++++ ft_isalpha.c | 20 ++++++++++++++++ ft_isascii.c | 18 +++++++++++++++ ft_isdigit.c | 20 ++++++++++++++++ ft_isprint.c | 18 +++++++++++++++ ft_memchr.c | 31 +++++++++++++++++++++++++ ft_memcmp.c | 29 +++++++++++++++++++++++ ft_memcpy.c | 32 ++++++++++++++++++++++++++ ft_memmove.c | 35 ++++++++++++++++++++++++++++ ft_memset.c | 28 ++++++++++++++++++++++ ft_strchr.c | 24 +++++++++++++++++++ ft_strdup.c | 31 +++++++++++++++++++++++++ ft_strlcpy.c | 29 +++++++++++++++++++++++ ft_strlen.c | 22 ++++++++++++++++++ ft_strncmp.c | 23 ++++++++++++++++++ ft_strrchr.c | 27 ++++++++++++++++++++++ ft_strstr.c | 31 +++++++++++++++++++++++++ ft_tolower.c | 20 ++++++++++++++++ ft_toupper.c | 20 ++++++++++++++++ libft.h | 41 +++++++++++++++++++++++++++++++++ 25 files changed, 663 insertions(+) create mode 100644 Makefile create mode 100755 a.out create mode 100644 ft_atoi.c create mode 100644 ft_bzero.c create mode 100644 ft_calloc.c create mode 100644 ft_isalnum.c create mode 100644 ft_isalpha.c create mode 100644 ft_isascii.c create mode 100644 ft_isdigit.c create mode 100644 ft_isprint.c create mode 100644 ft_memchr.c create mode 100644 ft_memcmp.c create mode 100644 ft_memcpy.c create mode 100644 ft_memmove.c create mode 100644 ft_memset.c create mode 100644 ft_strchr.c create mode 100644 ft_strdup.c create mode 100644 ft_strlcpy.c create mode 100644 ft_strlen.c create mode 100644 ft_strncmp.c create mode 100644 ft_strrchr.c create mode 100644 ft_strstr.c create mode 100644 ft_tolower.c create mode 100644 ft_toupper.c create mode 100644 libft.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2f03087 --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: cchauvet G>q_`gHG{KD)EflI55>lL3`z_~FD0m$d*GfS=cH?DE zs!-YOdSMDi3(I#KOT0dX&N$L0+-LcRzut&ftf5e-;warGiBo#g^yxLo>vv-qHfmw{ zE`&R7KgYRo6Z4-M*n}PNxMkD2d8 zPL#E8p$G4uxPq9aX)G+PIgKwKS<^``%$M~GT9sB%Y1Q*uHJ}&A%6d_&>VZ=C8S$fY z=HF>lUmk@N%(wNz*fI=dy#Ut>+KSAu0l`(UD+n%*y?rc%j4Q|p;vQ`|`!@=3WXiuA zLbj@2Fjo+WmsUMXdGx}C@-wws?fCCqq8>cbC6($ZYODEjeppvKNV{&f(Xg_C1&|i3{4cJZRZCZb^&+Z_Bv|TT$?Tw!lq0W|Y0+dt zmdlj8K1)i16?L@uI7;T<9fl_Lvb0EN1?%)wbDu}bC8S1r^0-K+ zWEW0JWdOtyLdun}o=;JwHD)qj7UrKRL;Y+~^@91jT(ecYTGU=Yrd_qq^=3{<=bH9H zyJ~hisLHL*bH0@Q5a_!jUuaO67Tfz;@Kr_=(6_lm%5DA0Rzdk58^=K<)YU#-;!$U*B0 z9c>xuY)im_ZTA8nfqk>nexPnY0RFqM-{-U&b^DXxf3QaU^RPd)hW!=Te+>JVo%z34 z&;JJaQ?Nhew72Y(4jaL(;&mSOyPWpPdi+Mx7WPd}`=fRHy|Djj4f_GuFTw7)e%P^(RGKX=+&PTKQ-1@@o9o@=mM0?_*2fV~X+4;$=rcKj;r58>>@8tnUR z`$n9RBJ9sK*q^l~NSxn%1$+g31$+g31$+g31$+g31$+g31wMrW|M+ihhQglW2Ycyx zUuugyR?j5Az~h@NvwWtPy6bq{!?=M_!EM}8&tw0)X4S)=K#EeXp9wxNGV;~%maz#l zZJ6Pq$o5G8)&WzF299j&kMwVk4BTPyA6-6(Rrja|pdIc(JRLpQln)B^yt%_2&rsiB z>)pt=3Z-)+-)8SeBi~+s-rr#elC)t5!QG&^QJiYZ-z3!Y`_8DKy}NZ5`-a)SU#l}# zugin)_29R7@L%!Zzv02}@!-cj__zn3_23sg_@W1Y%7Z`c!T;KWrza?y>HL}p54x%U zCGY|9;r;z91vEJ)AAnsi+Qq?Jq=S(6Fwp%E^Cv=aKh)igapsS@>OSp}=a>io4Ci^1 z^UHg0$p0MkZ}EP`cv`<;{vy{^^Z6z7A?D>hI*K`DM3cGLbS4ptOj?7foFf)1&wA-ML$f>bv&R8sSF? zca}lRnE*&Pp*stXzr*#k;_GMMl5Ss5mHa;vLGTF zpNbhVKzfR31VT#cQOZP?G7(q=locY9n@bt7380a+Frj+bk$5&EBIy|;9(gQnMl#tM zsBX+Ts0lNPU;iYhgmg&6atRTcnoA?8g+^9HjQFe}BJo7@P&Sr|M-x-v)JS^8QprgX znVdW$_81Dzu;1PKJpl{l zRPpM1Md6?_a0a!0mGEhFXzsjh`?^N`KJE%Ts`aUO^&RjN*r|R$``N(6oi<^0$d{TE zT~n0yevYs5f;+*6@ly5G{@n;p%^h94ZJ`SzwBM*g*3hoYL-~KMX7QKlV56O|z= c && c >= '0') + || ('z' >= c && c >= 'a') + || ('Z' >= c && c >= 'A'))) + return (1); + return (0); +} diff --git a/ft_isalpha.c b/ft_isalpha.c new file mode 100644 index 0000000..9573931 --- /dev/null +++ b/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/ft_isascii.c b/ft_isascii.c new file mode 100644 index 0000000..5706106 --- /dev/null +++ b/ft_isascii.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isascii.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 0 && 127 >= c) + return (1); + return (0); +} diff --git a/ft_isdigit.c b/ft_isdigit.c new file mode 100644 index 0000000..0db99f6 --- /dev/null +++ b/ft_isdigit.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isdigit.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = c && c >= '0') + return (1); + return (0); +} diff --git a/ft_isprint.c b/ft_isprint.c new file mode 100644 index 0000000..d16a74e --- /dev/null +++ b/ft_isprint.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_isprint.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet + +size_t ft_strlen(const char *s) +{ + size_t length; + + length = 0; + while (s[length]) + length++; + return (length); +} diff --git a/ft_strncmp.c b/ft_strncmp.c new file mode 100644 index 0000000..dc02068 --- /dev/null +++ b/ft_strncmp.c @@ -0,0 +1,23 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_strncmp.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 'A' && 'Z' >= c) + return (c - 48); + return (c); +} diff --git a/ft_toupper.c b/ft_toupper.c new file mode 100644 index 0000000..6fda229 --- /dev/null +++ b/ft_toupper.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_toupper.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet = 'a' && 'z' >= c) + return (c - 48); + return (c); +} diff --git a/libft.h b/libft.h new file mode 100644 index 0000000..9ae182c --- /dev/null +++ b/libft.h @@ -0,0 +1,41 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* libft.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cchauvet +# include + +int ft_isalpha(int c); +int ft_isdigit(int c); +int ft_isalnum(int c); +int ft_isascii(int c); +int ft_isprint(int c); +size_t ft_strlen(const char *s); +/* todo */ +void *ft_memset(void *s, int c, size_t n); +void ft_bzero(void *s, 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); +size_t ft_strlcpy(char *dst, const char *src, size_t size); +size_t ft_strlcat(char *dst, const char *src, size_t size); +int ft_toupper(int c); +int ft_tolower(int c); +char *ft_strchr(const char *s, int c); +char *ft_strrchr(const char *s, int c); +int ft_strncmp(const char *s1, const char *s2, size_t n); +void *ft_memchr(const void *s, int c, size_t n); +void *ft_memrchr(const void *s, int c, size_t n); +char *ft_strnstr(const char *big, const char *little, size_t len); +int ft_atoi(const char *nptr); + +#endif