maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
input_checker_helpers.c File Reference
#include "tokens.h"
Include dependency graph for input_checker_helpers.c:

Go to the source code of this file.

Functions

char * trim_input (char *str)
 
int valid_operator (const char **str)
 

Function Documentation

◆ trim_input()

char * trim_input ( char *  str)

Definition at line 15 of file input_checker_helpers.c.

16{
17 char *trimmed_str;
18
19 trimmed_str = ft_strtrim(str, " \t\n\r\v\f");
20 if (!trimmed_str)
21 return (0);
22 return (trimmed_str);
23}
char * ft_strtrim(char const *s1, char const *set)
Definition ft_strtrim.c:39

References ft_strtrim().

Referenced by main_loop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valid_operator()

int valid_operator ( const char **  str)

Definition at line 25 of file input_checker_helpers.c.

26{
27 const char *start;
28
29 start = (*str)++;
30 if (*start == **str)
31 (*str)++;
32 *str = ft_exclude_delimiters(*str, " \t\n\r\v\f");
33 if (**str == '<' || **str == '>' || **str == '|' || **str == '\0')
34 return (0);
35 return (1);
36}
const char * ft_exclude_delimiters(const char *str, char *delims)

References ft_exclude_delimiters().

Referenced by check_redirections().

Here is the call graph for this function:
Here is the caller graph for this function: