minishell/src/subst/subst.h
2025-03-21 18:54:10 +01:00

47 lines
2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* subst.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/23 15:01:40 by jguelen #+# #+# */
/* Updated: 2025/03/21 18:47:30 by jguelen ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef SUBST_H
# define SUBST_H
# include "../parser/wordlist/wordlist.h"
# include "../parser/wordlist/wordlist_quicksort.h"
# include "../minishell.h"
# include "replace_substr.h"
# include <dirent.h>
# include <unistd.h>
# include <errno.h>
# include <stdlib.h>
# include "../../libft/libft.h"
# define PATH_SIZE_INIT 64
char *expand_question_mark(t_minishell *app);
t_wordlist *wordlist_var_expansion(t_wordlist *list, t_minishell *app);
t_worddesc *word_var_expansion(t_worddesc *word, t_minishell *app);
void build_pattern_checks(char *str, t_worddesc *pattern,
char **pattern_check);
char fits_pattern(char *str, t_worddesc *pattern);
t_wordlist *expand_star(t_worddesc *file_pattern);
char *construct_repeting_char_string(char c, size_t len);
char *ft_get_longest_identifier(char *str);
char *alloc_path(char *path_dir, char *name);
char *get_cmdpath(const char *name, t_minishell *app);
void destroy_pattern_check(char **pattern_check, size_t len);
void build_pattern_checks(char *str, t_worddesc *pattern,
char **checker);
void clean_pattern(t_worddesc *file_pattern);
#endif