<commit_before>/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   minishell.h                                        :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: sle-guil <<EMAIL>>          +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2015/02/21 15:32:43 by sle-guil          #+#    #+#             */
/*   Updated: 2015/03/23 16:01:24 by sle-guil         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef MINISHELL_H
# define MINISHELL_H

# include <stdlib.h>
# include <unistd.h>
# include <dirent.h>
# include <fcntl.h>
# include <sys/types.h>
# include <sys/uio.h>

# include <sys/stat.h>
# include <sys/wait.h>
# include <signal.h>

# include "libft.h"

/*!
 *	@name : User interface
 *	@brief : Print information to users
 */
void	print_prompt(char **env);
char	**env_cp(char **env);
char	**env_refresh(char **env);
void	env_free(char **env);

char	*getenv_p(char **env, char *name);
char	*getenv_cpy(char **env, char const *name);

/*!
 *	@name : Command parsing
 *	@brief : Parse a command so ft_strsplit(cmd, ' ') can be used in execve
 */
char	**script(char const *file, char **env);
int		interpreter(char **env, int fd);
char	**parse(char *cmd);
char	*parse_path(char const *path, char const *cmd);

int		testpath(char const *path);
/*!
 *	@name :		Execution
 *	@brief :	managment of the execution environment
 *				and error management
 */
int		builtins(char const *cmd, char **env);
void	runcmd(char const *cmd, char **env);

void	er_notfound(char const *cmd);

/*!
 *	@name : 	Builtins function
 *	@brief :	This function are intergrated to the minishell
 */
void	bi_exit(char const *arg);
int		bi_env(char **env, char const *arg);
int		bi_setenv(char **env, char const *var, int overwrite);
int		bi_unsetenv(char **env, char *var);
void	bi_cd(char **env, char *var);

int		bi_history_print(t_list *lst);
/*!
 *	History management
 *		Macro :
 *	- definition of the possible use of the function
 *		Use are describe in the history.c files
 *		Function :
 *	- History : general management
 */
# define H_RESET	1
# define H_SAVE		2
# define H_UP		4
# define H_DOWN		8
# define H_SEARCH	16
# define H_PRINT	32

char	*history(char const *line, int action);

#endif
<commit_msg>header update<commit_after>/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   minishell.h                                        :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: sle-guil <<EMAIL>>          +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2015/02/21 15:32:43 by sle-guil          #+#    #+#             */
/*   Updated: 2015/03/24 13:28:06 by sle-guil         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#ifndef MINISHELL_H
# define MINISHELL_H

# include <stdlib.h>
# include <unistd.h>
# include <dirent.h>
# include <fcntl.h>
# include <sys/types.h>
# include <sys/uio.h>

# include <sys/stat.h>
# include <sys/wait.h>
# include <signal.h>

# include "libft.h"

/*!
 *	@name : User interface
 *	@brief : Print information to users
 */
void	print_prompt(char **env);
char	**env_cp(char **env);
char	**env_refresh(char **env);
void	env_free(char **env);

char	*getenv_p(char **env, char *name);
char	*getenv_cpy(char **env, char const *name);

/*!
 *	@name : Command parsing
 *	@brief : Parse a command so ft_strsplit(cmd, ' ') can be used in execve
 */
char	**script(char const *file, char **env);
int		interpreter(char **env, int fd);
char	**parse(char *cmd);
char	*parse_path(char const *path, char const *cmd);

int		testpath(char const *path);
/*!
 *	@name :		Execution
 *	@brief :	managment of the execution environment
 *				and error management
 */
int		builtins(char const *cmd, char **env);
void	runcmd(char const *cmd, char **env);

void	er_notfound(char const *cmd);

/*!
 *	@name : 	Builtins function
 *	@brief :	This function are intergrated to the minishell
 */
void	bi_exit(char const *arg);
int		bi_env(char **env, char const *arg);
int		bi_setenv(char **env, char const *var, int overwrite);
int		bi_unsetenv(char **env, char *var);
int		bi_cd(char **env, char *var);

int		bi_history_print(t_list *lst);
/*!
 *	History management
 *		Macro :
 *	- definition of the possible use of the function
 *		Use are describe in the history.c files
 *		Function :
 *	- History : general management
 */
# define H_RESET	1
# define H_SAVE		2
# define H_UP		4
# define H_DOWN		8
# define H_SEARCH	16
# define H_PRINT	32

char	*history(char *line, int action);

#endif

{'fraction_non_alphanumeric': 0.20059768397459843, 'fraction_numerical': 0.013447889428464699, 'mean_word_length': 2.0220090293453725, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5407563', 'n_tokens_mistral': 1768, 'n_tokens_neox': 1689, 'n_words': 452}