maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
exit_status_utils.c
Go to the documentation of this file.
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* exit_status_utils.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: dmdemirk <dmdemirk@student.42london.c +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2024/09/06 11:33:18 by dmdemirk #+# #+# */
9
/* Updated: 2024/09/06 11:34:28 by dmdemirk ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "
exit_status.h
"
14
#include <stdio.h>
15
#include <stdlib.h>
16
#include "
libft.h
"
17
18
int
ft_perror
(
char
*str)
19
{
20
perror (str);
21
exit(
EXIT_FAILURE
);
22
}
23
24
int
ft_isnumber
(
char
*str)
25
{
26
int
i;
27
28
i = 0;
29
while
(str[i])
30
{
31
if
(!
ft_isdigit
(str[i]))
32
return
(0);
33
i++;
34
}
35
return
(1);
36
}
exit_status.h
EXIT_FAILURE
#define EXIT_FAILURE
Definition
exit_status.h:17
ft_isnumber
int ft_isnumber(char *str)
Definition
exit_status_utils.c:24
ft_perror
int ft_perror(char *str)
Definition
exit_status_utils.c:18
libft.h
ft_isdigit
int ft_isdigit(int c)
Definition
ft_isdigit.c:13
src
exit_status
exit_status_utils.c
Generated by
1.9.8