42_minishell/utils/utils.h
2023-03-29 19:07:57 +02:00

37 lines
1.7 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 14:46:40 by cchauvet #+# #+# */
/* Updated: 2023/03/29 18:52:32 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef UTILS_H
# define UTILS_H
# include <stdlib.h>
# include "../libftx/libftx.h"
# include "../data/data.h"
# include "../env/env.h"
size_t ft_strncpy(char *dst, const char *src, size_t n);
int ft_is_in_quote(const char *str, size_t n);
char *ft_strreplace(const char *str, const char *fill,
size_t start, size_t stop);
ssize_t ft_strnchr(const char *str, char c);
char *ft_getstr(const char *str, size_t n);
int ft_str_is_empty(const char *str);
char **ft_split_quoted(const char *s, char c);
void ft_strshift(char *str, int shift);
char *ft_quote_remover(char *str);
int ft_atoi_check(const char *nptr);
char *ft_get_executable(t_data *data, const char *name);
void ft_closer(int fds[2]);
void ft_mega_closer(int fds1[2], int fds2[2]);
void ft_add_fd(int fds[2], int fd);
#endif