2025-02-28 18:48:30 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
|
/* */
|
|
|
|
|
/* ::: :::::::: */
|
|
|
|
|
/* subst.h :+: :+: :+: */
|
|
|
|
|
/* +:+ +:+ +:+ */
|
2025-03-08 17:32:47 +01:00
|
|
|
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
|
2025-02-28 18:48:30 +01:00
|
|
|
/* +#+#+#+#+#+ +#+ */
|
2025-03-06 17:37:08 +01:00
|
|
|
/* Created: 2025/02/23 15:01:40 by jguelen #+# #+# */
|
2025-03-21 18:54:10 +01:00
|
|
|
/* Updated: 2025/03/21 18:47:30 by jguelen ### ########.fr */
|
2025-02-28 18:48:30 +01:00
|
|
|
/* */
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
|
|
#ifndef SUBST_H
|
|
|
|
|
# define SUBST_H
|
|
|
|
|
|
|
|
|
|
# include "../parser/wordlist/wordlist.h"
|
2025-03-14 18:47:14 +01:00
|
|
|
# include "../parser/wordlist/wordlist_quicksort.h"
|
2025-02-28 18:48:30 +01:00
|
|
|
# include "../minishell.h"
|
2025-03-19 09:20:51 +01:00
|
|
|
# include "replace_substr.h"
|
2025-03-06 17:37:08 +01:00
|
|
|
# include <dirent.h>
|
|
|
|
|
# include <unistd.h>
|
2025-03-08 17:32:47 +01:00
|
|
|
# include <errno.h>
|
2025-03-19 09:20:51 +01:00
|
|
|
# include <stdlib.h>
|
|
|
|
|
# include "../../libft/libft.h"
|
2025-03-08 17:32:47 +01:00
|
|
|
|
|
|
|
|
# define PATH_SIZE_INIT 64
|
2025-02-28 18:48:30 +01:00
|
|
|
|
2025-03-06 12:45:05 +01:00
|
|
|
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);
|
2025-03-08 17:32:47 +01:00
|
|
|
|
|
|
|
|
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);
|
2025-03-06 12:45:05 +01:00
|
|
|
char *construct_repeting_char_string(char c, size_t len);
|
|
|
|
|
char *ft_get_longest_identifier(char *str);
|
2025-02-28 18:48:30 +01:00
|
|
|
|
2025-03-19 09:20:51 +01:00
|
|
|
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);
|
2025-03-21 18:54:10 +01:00
|
|
|
void clean_pattern(t_worddesc *file_pattern);
|
2025-03-19 09:20:51 +01:00
|
|
|
|
2025-02-28 18:48:30 +01:00
|
|
|
#endif
|