restart: deleted all source and header files, restarting project

This commit is contained in:
2025-10-20 12:49:35 +02:00
parent 1ff8a89576
commit 56a19a23bc
25 changed files with 112 additions and 1091 deletions

0
include/.gitkeep Normal file
View File

View File

@@ -1,70 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* builtins.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/01 17:18:21 by sede-san #+# #+# */
/* Updated: 2025/08/20 22:22:40 by sede-san ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef BUILTINS_H
# define BUILTINS_H
# include <string.h>
# include <stdio.h>
// cd.c
int cd_builtin(int argc, char const *argv[]);
# define CD_HELP
// echo.c
typedef struct s_echo_flags
{
int newline; // print newline after everything has been printed
} t_echo_flags;
int echo_builtin(int argc, char const *argv[]);
# define ECHO_HELP
// // env.c
// int env_builtin(int argc, char const *argv[], char **envp);
// exit.c
int exit_builtin(int argc, char const *argv[]);
# define EXIT_HELP
// export.c
int export_builtin(int argc, char const *argv[], char **envp);
# define EXPORT_HELP
// printenv.c
int printenv_builtin(int argc, char const *argv[], char const *envp[]);
# define PRINTENV_HELP
// pwd.c
int pwd_builtin(int argc, char const *argv[]);
# define PWD_HELP
// unset.c
int unset_builtin(int argc, char const *argv[], char **envp);
# define UNSET_HELP
#endif

View File

@@ -1,20 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* history.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/20 22:07:04 by sede-san #+# #+# */
/* Updated: 2025/08/21 14:43:08 by sede-san ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef HISTORY_H
# define HISTORY_H
// history.c
#endif

View File

@@ -1,87 +0,0 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/07/31 03:42:51 by sede-san #+# #+# */
/* Updated: 2025/08/21 14:55:18 by sede-san ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MINISHELL_H
# define MINISHELL_H
# include "builtins.h"
# include "history.h"
# include "libft.h"
# include "get_next_line.h"
# include <fcntl.h>
# include <signal.h>
# include <readline/history.h>
# include <readline/readline.h>
# include <sys/wait.h>
typedef struct s_cmd
{
int argc;
char **argv;
} t_cmd;
typedef struct s_history
{
char *hist_file;
size_t hist_file_size;
t_cdlist hist;
size_t hist_size;
} t_history;
typedef struct s_minishell
{
char **envp;
t_history *history;
char *history_file;
} t_minishell;
/* ******************************** Features ******************************** */
/* History */
// history.c
void ms_add_history(const char *line);
int ms_read_history(const char *hist_file);
void ms_write_history(const char *hist_file);
/* ******************************* Commands ********************************* */
// command_utils.c
int is_absolutepath(char const *cmd);
int is_builtin(t_cmd *cmd);
int is_local(char const *cmd);
// exec.c
int exec_cmd(t_cmd *cmd, char **envp);
int exec_builtin(t_cmd *cmd, char **envp);
// parse.c
t_cmd parse_cmd(char *line, t_minishell *minishell);
// signals.c
void init_signal(void);
/* ********************************* Utils ********************************** */
// get_hostname.c
char *get_hostname(void);
/* ******************************** Builtins ******************************** */
// builtin_utils.c
int is_builtin(t_cmd *cmd);
#endif