summaryrefslogtreecommitdiffstats
path: root/libft/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-17 17:22:24 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-17 17:22:24 +0200
commitcfaf9947227065ce40661544dff9b3554ff5aca2 (patch)
treee0d5da338e8df09c71c47405f5558cb67aac1cf8 /libft/src
parentUpdated TODO list (diff)
download42-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.c6
-rw-r--r--libft/src/ft_isalpha.c20
-rw-r--r--libft/src/ft_isascii.c8
-rw-r--r--libft/src/ft_ischarset.c6
-rw-r--r--libft/src/ft_isdigit.c8
-rw-r--r--libft/src/ft_isprint.c8
-rw-r--r--libft/src/ft_isspace.c7
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);
}