adding ft_isspace
This commit is contained in:
1
Makefile
1
Makefile
@@ -30,6 +30,7 @@ SRCS = ft_memset.c \
|
||||
ft_isalnum.c \
|
||||
ft_isnumber.c \
|
||||
ft_isascii.c \
|
||||
ft_isspace.c \
|
||||
ft_isprint.c \
|
||||
ft_toupper.c \
|
||||
ft_tolower.c \
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef LIBFT_H
|
||||
# define LIBFT_H
|
||||
# include <unistd.h> // for write
|
||||
# include <stdlib.h> // for malloc and free
|
||||
# include "ft_gnl.h"
|
||||
# include "ft_printf.h"
|
||||
#define LIBFT_H
|
||||
#include <unistd.h> // for write
|
||||
#include <stdlib.h> // for malloc and free
|
||||
#include "ft_gnl.h"
|
||||
#include "ft_printf.h"
|
||||
|
||||
void *ft_memset(void *b, int c, size_t len);
|
||||
void ft_bzero(void *s, size_t n);
|
||||
@@ -30,6 +30,7 @@ int ft_isdigit(int c);
|
||||
int ft_isnumber(char *nb);
|
||||
int ft_isalnum(int c);
|
||||
int ft_isascii(int c);
|
||||
int ft_isspace(int c);
|
||||
int ft_isprint(int c);
|
||||
int ft_toupper(int c);
|
||||
int ft_tolower(int c);
|
||||
@@ -62,21 +63,8 @@ void ft_putstr_fd(const char *s, int fd);
|
||||
void ft_putnbr_fd(int n, int fd);
|
||||
void ft_putnbrbase_fd(int nbr, const char *base, int fd);
|
||||
|
||||
/*
|
||||
void ft_putchar(char c);
|
||||
void ft_putstr(char *s);
|
||||
void ft_putnbr(int n);
|
||||
void ft_putnbrbase(int nbr, char *base);
|
||||
void ft_putchar_fd(char c, int fd);
|
||||
void ft_putstr_fd(char *s, int fd);
|
||||
void ft_putnbr_fd(int n, int fd);
|
||||
void ft_putnbrbase_fd(int nbr, char *base, int fd);
|
||||
*/
|
||||
|
||||
/*
|
||||
void ft_putendl(char const *str);
|
||||
void ft_putendl_fd(char *s, int fd);
|
||||
*/
|
||||
// void ft_putendl(char const *str);
|
||||
// void ft_putendl_fd(char *s, int fd);
|
||||
|
||||
typedef struct s_list
|
||||
{
|
||||
@@ -85,19 +73,19 @@ typedef struct s_list
|
||||
struct s_list *next;
|
||||
} t_list;
|
||||
|
||||
/*
|
||||
t_list *ft_lstnew(void *content);
|
||||
void ft_lstadd_front(t_list **alst, t_list *n);
|
||||
void *ft_lstadd_back(t_list **alst, t_list *n);
|
||||
int ft_lstsize(t_list *lst);
|
||||
t_list *ft_lstlast(t_list *lst);
|
||||
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 *l, void *(*f)(void*), void (*d)(void*));
|
||||
*/
|
||||
//void ft_lstremove(t_list *lst, void (*del)(void *));
|
||||
//t_list *ft_lstfind(t_list *lst, void *to_find, int (*comp)(void*, void *));
|
||||
// t_list *ft_lstnew(void *content);
|
||||
// void ft_lstadd_front(t_list **alst, t_list *n);
|
||||
// void *ft_lstadd_back(t_list **alst, t_list *n);
|
||||
// int ft_lstsize(t_list *lst);
|
||||
// t_list *ft_lstlast(t_list *lst);
|
||||
// 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 *l, void *(*f)(void *), void (*d)(void *));
|
||||
|
||||
// void ft_lstremove(t_list *lst, void (*del)(void *));
|
||||
// t_list *ft_lstfind(t_list *lst, void *to_find, int (*comp)(void *, void *));
|
||||
|
||||
t_list *ft_lstcreate(void *content);
|
||||
void *ft_lstpush_back(t_list **lst, t_list *new);
|
||||
void ft_lstpush_front(t_list **alst, t_list *new);
|
||||
@@ -105,7 +93,7 @@ void ft_lstloop(t_list *lst, void (*f)(void *));
|
||||
void ft_lstloop_back(t_list *lst, void (*f)(void *));
|
||||
t_list *ft_lstbegin(t_list *lst);
|
||||
t_list *ft_lstend(t_list *lst);
|
||||
t_list *ft_lstfind(t_list *lst, void *to_find, int (*comp)(void*, void *));
|
||||
t_list *ft_lstfind(t_list *lst, void *to_find, int (*comp)(void *, void *));
|
||||
void ft_lstinsert(t_list *lst, t_list *new);
|
||||
void ft_lsterase(t_list *lst, void (*del)(void *));
|
||||
void ft_lstfree(t_list *lst, void (*del)(void *));
|
||||
@@ -133,10 +121,10 @@ int ft_atoibase(char *str, char *base);
|
||||
char *ft_convertbase(char *nbr, char *base_from, char *base_to);
|
||||
char *ft_convertbase_free(char *nbr, char *b_from, char *b_to);
|
||||
char **ft_strmultisplit(char *str, char *charset);
|
||||
int ft_any(char **tab, int (*f)(char*));
|
||||
int ft_any(char **tab, int (*f)(char *));
|
||||
void ft_foreach(int *tab, int length, void (*f)(int));
|
||||
int ft_issort(int *tab, int length, int (*f)(int, int));
|
||||
int *ft_arraymap(int *tab, int length, int(*f)(int));
|
||||
int *ft_arraymap(int *tab, int length, int (*f)(int));
|
||||
void ft_putnbrendl(int n);
|
||||
void ft_putnbrendl_fd(int n, int fd);
|
||||
char *ft_concat_free(char *str1, char *str2);
|
||||
@@ -147,6 +135,6 @@ int ft_sign(int i);
|
||||
int ft_sqrt(int i);
|
||||
void ft_free_tab(char **tab);
|
||||
|
||||
int ft_arrint(int * intarr, int comp, size_t size);
|
||||
int ft_arrint(int *intarr, int comp, size_t size);
|
||||
|
||||
#endif
|
||||
|
||||
26
srcs/ft_isspace.c
Normal file
26
srcs/ft_isspace.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_isalpha.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/11/25 13:55:15 by hulamy #+# #+# */
|
||||
/* Updated: 2019/11/25 13:55:17 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
#define SPACE ' '
|
||||
#define FORM_FEED '\f'
|
||||
#define NEWLINE '\n'
|
||||
#define CARRIAGE_RETURN '\r'
|
||||
#define HORIZONTAL_TAB '\t'
|
||||
#define VERTICAL_TAB '\v'
|
||||
|
||||
int ft_isspace(int c)
|
||||
{
|
||||
return (c == SPACE || c == FORM_FEED || c == NEWLINE ||
|
||||
c == CARRIAGE_RETURN || c == HORIZONTAL_TAB || c == VERTICAL_TAB);
|
||||
}
|
||||
Reference in New Issue
Block a user