Skip to content

Commit

Permalink
add putstrdel, strlower, strcmpi
Browse files Browse the repository at this point in the history
  • Loading branch information
thifranc committed Nov 28, 2017
1 parent e5ed981 commit d99969c
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# By: thifranc <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/02/04 19:24:34 by thifranc #+# #+# #
# Updated: 2017/10/19 11:07:09 by thifranc ### ########.fr #
# Updated: 2017/11/28 19:22:00 by thifranc ### ########.fr #
# #
# **************************************************************************** #

Expand All @@ -18,17 +18,17 @@ SRC = atoi itoa ptrf\
memalloc bzero memccpy memchr memset\
memmove memcmp memcpy memdel\
putnb_base putendl putendl_fd\
putnbr putnbr_fd putstr putstr_fd\
putnbr putnbr_fd putstr putstr_fd putstrdel\
putchar putchar_fd write_fd\
strcat striter strncpy strtrim\
strchr striteri strnequ\
strlcat strclr strjoin strnew\
strcmp strlen strnstr\
strcmpi strcmp strlen strnstr\
strcpy strmap strrchr\
strdel strmapi strsplit\
strdup strncat strstr\
strequ strncmp strsub\
tolower isalnum toupper isalpha\
strlower tolower isalnum toupper isalpha\
isascii isdigit isprint\
lstadd lstnew lstdelone lstiter lstmap lstdel\
get_char\
Expand Down
20 changes: 20 additions & 0 deletions ft_putstrdel.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_putstr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/02/16 09:14:52 by thifranc #+# #+# */
/* Updated: 2017/11/28 19:38:28 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */

#include "libft.h"

void ft_putstrdel(char const *s)
{
write(1, s, ft_strlen(s));
free((void *)s);
s = NULL;
}
4 changes: 2 additions & 2 deletions ft_strcmpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/02/14 11:35:35 by thifranc #+# #+# */
/* Updated: 2017/10/30 17:18:07 by thifranc ### ########.fr */
/* Updated: 2017/10/30 17:21:11 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */

#include "libft.h"

int ft_strcmp(const char *s1, const char *s2)
int ft_strcmpi(const char *s1, const char *s2)
{
unsigned int i;

Expand Down
28 changes: 28 additions & 0 deletions ft_strlower.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/10/30 17:23:15 by thifranc #+# #+# */
/* Updated: 2017/10/30 17:38:43 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */

#include "libft.h"

char *ft_strlower(char *s)
{
int i;

i = 0;
if (!s)
return (NULL);
while (s[i])
{
s[i] = ft_tolower(s[i]);
i++;
}
return (s);
}
4 changes: 3 additions & 1 deletion libft.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: thifranc <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/02/19 10:07:41 by thifranc #+# #+# */
/* Updated: 2017/10/30 17:14:52 by thifranc ### ########.fr */
/* Updated: 2017/11/28 19:22:00 by thifranc ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -77,6 +77,7 @@ void ft_putnb_base(int n, char *base);
void ft_putnbr_fd(int n, int fd);
void ft_putstr(char const *s);
void ft_putstr_fd(char const *s, int fd);
void ft_putstrdel(char const *s);
char **ft_realloc(char **var, int add, int del);
char *ft_strcat(char *s1, const char *s2);
size_t ft_strlcat(char *dst, const char *src, size_t size);
Expand Down Expand Up @@ -109,6 +110,7 @@ char *ft_strsub(char const *s, unsigned int start, size_t len);
char *ft_strtrim(char const *s);
void ft_swap(void **a, void **b);
void ft_tabnew(int *itab, int size);
char *ft_strlower(char *s);
int ft_tolower(int c);
int ft_toupper(int c);
void ft_write_fd(char *str, int fd);
Expand Down

0 comments on commit d99969c

Please sign in to comment.