aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index 2fffe45..4125eba 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -6,7 +6,7 @@
/* By: cacharle <cacharle@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/28 11:56:31 by cacharle #+# #+# */
-/* Updated: 2020/10/09 12:40:51 by cacharle ### ########.fr */
+/* Updated: 2020/10/10 11:12:47 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -40,6 +40,11 @@ void print_prompt(void)
ft_putstr_fd("\033[0m$ ", STDERR_FILENO);
}
+/*
+** \brief Exit the program on condition
+** \param predicate Exit if true
+*/
+
void exit_if(bool predicate)
{
if (!predicate)
@@ -48,6 +53,12 @@ void exit_if(bool predicate)
exit(3);
}
+/*
+** \brief Check if a string only contains spaces and tabs
+** \param str String to chec
+** \return True if only contains blank, false otherwise
+*/
+
bool utils_strisblank(char *str)
{
while (*str != '\0')