74 lines
2.8 KiB
C
74 lines
2.8 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/04/23 14:33:45 by mcolonna #+# #+# */
|
|
/* Updated: 2024/04/25 16:54:13 by mcolonna ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "include.h"
|
|
|
|
// Clean the screen (TODO)
|
|
static void execclear(void)
|
|
{
|
|
}
|
|
|
|
// Print hi :D
|
|
static void print_hi(void)
|
|
{
|
|
printf("Welcome to____________________________________\n");
|
|
printf("|| ___ ___ ||\n");
|
|
printf("|| | \\ / | ||\n");
|
|
printf("|| | |\\ \\ / /| | __ __ __ __ ||\n");
|
|
printf("|| | | \\ \\ / / | | |__| ||\\ || |__| ||\n");
|
|
printf("|| | | \\ \\/ / | | __ || \\ || __ ||\n");
|
|
printf("|| | | \\ / | | || || \\ || || ||\n");
|
|
printf("|| | | \\/ | | || || \\ || || ||\n");
|
|
printf("|| | | | | || || \\ || || ||\n");
|
|
printf("|| |_| |_| || || \\|| || ||\n");
|
|
printf("|| _____ ||\n");
|
|
printf("|| / ___| By: Mylan COLONNA ||\n");
|
|
printf("|| \\ \\ And: Joris SCHAFT ||\n");
|
|
printf("|| \\ \\ ||\n");
|
|
printf("|| \\ \\ __ __ __ __ __ ||\n");
|
|
printf("|| \\ \\ || || ||=== || || ||\n");
|
|
printf("|| \\ \\ || || || || || ||\n");
|
|
printf("|| / / ||===|| ||=== || || ||\n");
|
|
printf("|| ___/ / || || || || || ||\n");
|
|
printf("|| |____/ || || ||=== ||=== ||=== ||\n");
|
|
printf("|_____________________________________________|\n\n");
|
|
}
|
|
|
|
int main(const int argc, const char *argv[], const char *envp[])
|
|
{
|
|
const char **path = get_path(envp);
|
|
t_memclass mc;
|
|
const char *command_str;
|
|
t_command command;
|
|
int errorstatus;
|
|
|
|
(void)argc;
|
|
(void)argv;
|
|
(void)path;
|
|
(void)command;
|
|
execclear();
|
|
print_hi();
|
|
errorstatus = 0;
|
|
while (true)
|
|
{
|
|
mc = mem_newclass(minishell_error);
|
|
command_str = ask_command(mc);
|
|
command = parse_command(mc, command_str);
|
|
if (command.error)
|
|
continue ;
|
|
/*
|
|
errorstatus = execute_command(command);
|
|
mem_freeall(mc);
|
|
*/
|
|
}
|
|
return (errorstatus);
|
|
}
|