summaryrefslogtreecommitdiffstats
path: root/libft
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libft/Makefile1
-rw-r--r--libft/include/libft.h1
-rw-r--r--libft/src/ft_isfulldigit.c23
3 files changed, 25 insertions, 0 deletions
diff --git a/libft/Makefile b/libft/Makefile
index 4024b3e..66b8081 100644
--- a/libft/Makefile
+++ b/libft/Makefile
@@ -28,6 +28,7 @@ SRCS_NAME += ft_strclen.c
SRCS_NAME += ft_strnlen.c
SRCS_NAME += ft_isalpha.c
SRCS_NAME += ft_isdigit.c
+SRCS_NAME += ft_isfulldigit.c
SRCS_NAME += ft_isalnum.c
SRCS_NAME += ft_isascii.c
SRCS_NAME += ft_isprint.c
diff --git a/libft/include/libft.h b/libft/include/libft.h
index 47992c0..265d87c 100644
--- a/libft/include/libft.h
+++ b/libft/include/libft.h
@@ -145,6 +145,7 @@ int ft_memcmp(const void *s1, const void *s2, size_t n);
t_bool ft_isspace(int c);
t_bool ft_iswhitespace(int c);
t_bool ft_ischarset(const char *charset, int c);
+t_bool ft_isfulldigit(char *str);
t_bool ft_isupper(int c);
t_bool ft_islower(int c);
t_bool ft_isalpha(int c);
diff --git a/libft/src/ft_isfulldigit.c b/libft/src/ft_isfulldigit.c
new file mode 100644
index 0000000..d7b7d1e
--- /dev/null
+++ b/libft/src/ft_isfulldigit.c
@@ -0,0 +1,23 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_isdigit.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:06:39 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:06:39 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <libft.h>
+
+t_bool ft_isfulldigit(char *str)
+{
+ unsigned int i;
+
+ i = 0;
+ while (ft_isdigit(str[i]))
+ i++;
+ return (i == ft_strlen(str));
+}