diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-17 17:22:24 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-17 17:22:24 +0200 |
commit | cfaf9947227065ce40661544dff9b3554ff5aca2 (patch) | |
tree | e0d5da338e8df09c71c47405f5558cb67aac1cf8 /libft/src | |
parent | Updated TODO list (diff) | |
download | 42-minishell-cfaf9947227065ce40661544dff9b3554ff5aca2.tar.gz 42-minishell-cfaf9947227065ce40661544dff9b3554ff5aca2.tar.bz2 42-minishell-cfaf9947227065ce40661544dff9b3554ff5aca2.tar.xz 42-minishell-cfaf9947227065ce40661544dff9b3554ff5aca2.tar.zst 42-minishell-cfaf9947227065ce40661544dff9b3554ff5aca2.zip |
Set libft/ft_is* to type t_bool
Diffstat (limited to '')
-rw-r--r-- | libft/src/ft_isalnum.c | 6 | ||||
-rw-r--r-- | libft/src/ft_isalpha.c | 20 | ||||
-rw-r--r-- | libft/src/ft_isascii.c | 8 | ||||
-rw-r--r-- | libft/src/ft_ischarset.c | 6 | ||||
-rw-r--r-- | libft/src/ft_isdigit.c | 8 | ||||
-rw-r--r-- | libft/src/ft_isprint.c | 8 | ||||
-rw-r--r-- | libft/src/ft_isspace.c | 7 |
7 files changed, 36 insertions, 27 deletions
diff --git a/libft/src/ft_isalnum.c b/libft/src/ft_isalnum.c index e764ac6..fca042d 100644 --- a/libft/src/ft_isalnum.c +++ b/libft/src/ft_isalnum.c @@ -12,10 +12,10 @@ #include <libft.h> -int +t_bool ft_isalnum(int c) { if (ft_isalpha(c) || ft_isdigit(c)) - return (1); - return (0); + return (TRUE); + return (FALSE); } diff --git a/libft/src/ft_isalpha.c b/libft/src/ft_isalpha.c index 562825d..3b7a88f 100644 --- a/libft/src/ft_isalpha.c +++ b/libft/src/ft_isalpha.c @@ -10,26 +10,28 @@ /* */ /* ************************************************************************** */ -static int +#include <libft.h> + +t_bool ft_isupper(int c) { if (c >= 65 && c <= 90) - return (1); - return (0); + return (TRUE); + return (FALSE); } -static int +t_bool ft_islower(int c) { if (c >= 97 && c <= 122) - return (1); - return (0); + return (TRUE); + return (FALSE); } -int +t_bool ft_isalpha(int c) { if (ft_isupper(c) || ft_islower(c)) - return (1); - return (0); + return (TRUE); + return (FALSE); } diff --git a/libft/src/ft_isascii.c b/libft/src/ft_isascii.c index 8d2f3f2..04e63c3 100644 --- a/libft/src/ft_isascii.c +++ b/libft/src/ft_isascii.c @@ -10,10 +10,12 @@ /* */ /* ************************************************************************** */ -int +#include <libft.h> + +t_bool ft_isascii(int c) { if (c >= 0 && c <= 127) - return (1); - return (0); + return (TRUE); + return (FALSE); } diff --git a/libft/src/ft_ischarset.c b/libft/src/ft_ischarset.c index 95b9172..eb57d87 100644 --- a/libft/src/ft_ischarset.c +++ b/libft/src/ft_ischarset.c @@ -14,7 +14,7 @@ #include <stddef.h> #include <inttypes.h> -uint8_t +t_bool ft_ischarset(const char *charset, int c) { size_t i; @@ -23,8 +23,8 @@ uint8_t while (charset[i]) { if (charset[i] == c) - return (1); + return (TRUE); i++; } - return (0); + return (FALSE); } diff --git a/libft/src/ft_isdigit.c b/libft/src/ft_isdigit.c index ebe1f40..3c73f92 100644 --- a/libft/src/ft_isdigit.c +++ b/libft/src/ft_isdigit.c @@ -10,10 +10,12 @@ /* */ /* ************************************************************************** */ -int +#include <libft.h> + +t_bool ft_isdigit(int c) { if (c >= 48 && c <= 57) - return (1); - return (0); + return (TRUE); + return (FALSE); } diff --git a/libft/src/ft_isprint.c b/libft/src/ft_isprint.c index 12fdb7a..f4d1b73 100644 --- a/libft/src/ft_isprint.c +++ b/libft/src/ft_isprint.c @@ -10,10 +10,12 @@ /* */ /* ************************************************************************** */ -int +#include <libft.h> + +t_bool ft_isprint(int c) { if (c >= 32 && c <= 126) - return (1); - return (0); + return (TRUE); + return (FALSE); } diff --git a/libft/src/ft_isspace.c b/libft/src/ft_isspace.c index 188e94a..b9b653f 100644 --- a/libft/src/ft_isspace.c +++ b/libft/src/ft_isspace.c @@ -10,9 +10,10 @@ /* */ /* ************************************************************************** */ +#include <libft.h> #include <inttypes.h> -uint8_t +t_bool ft_isspace(int c) { if (c == '\t' || @@ -21,6 +22,6 @@ uint8_t c == '\f' || c == '\r' || c == ' ') - return (1); - return (0); + return (TRUE); + return (FALSE); } |