banner work

This commit is contained in:
Quinten Mennen 2025-02-06 13:37:12 +01:00
parent 473135b33d
commit 75cbe896ce
5 changed files with 24 additions and 32 deletions

View File

@ -18,7 +18,6 @@ void free_minishell(t_minishell *minishell);
t_minishell *init_minishell(void);
void print_banner(void);
void print_list(void *content);
int cmp_value(t_list *list, char *str);
void simple_builtins(t_minishell *minishell);
#endif // UTILS_H

View File

@ -12,7 +12,7 @@
#include "minishell.h"
static char *ft_parse_quotes(t_lexer *lexer)
static char *parse_quotes(t_lexer *lexer)
{
int start;
int len;
@ -47,7 +47,7 @@ char *ft_lexer_readword(t_lexer *lexer)
start = lexer->pos;
if (lexer->current_char == '"' || lexer->current_char == '\'')
{
return (ft_parse_quotes(lexer));
return (parse_quotes(lexer));
}
while (ft_isprint(lexer->current_char) && lexer->current_char != '<'
&& lexer->current_char != '>' && lexer->current_char != '|'

View File

@ -1,24 +0,0 @@
/* ************************************************************************** */
/* */
/* :::::::: */
/* cmp_value.c :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/02/05 16:13:19 by whaffman #+# #+# */
/* Updated: 2025/02/05 16:14:51 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include "minishell.h"
int cmp_value(t_list *list, char *str)
{
if (list != NULL
&& ft_strncmp(
((t_token *)list->content)->value,
str,
ft_strlen(str) + 1) == 0)
return (TRUE);
return (FALSE);
}

View File

@ -14,9 +14,15 @@
void print_banner(void)
{
printf("%s\n", GREEN"• ▌ ▄ ·. ▪ ▐ ▄ ▪ .▄▄ · ▄ .▄▄▄▄ .▄▄▌ ▄▄▌ "RESET);
printf("%s\n", GREEN"·██ ▐███▪██ •█▌▐███ ▐█ ▀. ██▪▐█▀▄.▀·██• ██• "RESET);
printf("%s\n", GREEN"▐█ ▌▐▌▐█·▐█·▐█▐▐▌▐█·▄▀▀▀█▄██▀▐█▐▀▀▪▄██▪ ██▪ "RESET);
printf("%s\n", GREEN"██ ██▌▐█▌▐█▌██▐█▌▐█▌▐█▄▪▐███▌▐▀▐█▄▄▌▐█▌▐▌▐█▌▐▌"RESET);
printf("%s\n", GREEN"▀▀ █▪▀▀▀▀▀▀▀▀ █▪▀▀▀ ▀▀▀▀ ▀▀▀ · ▀▀▀ .▀▀▀ .▀▀▀ "RESET);
printf("%s\n", RED "\n"
"██████████████████████████████████████████████████\n\n"
GREEN
" • ▌ ▄ ·. ▪ ▐ ▄ ▪ .▄▄ · ▄ .▄▄▄▄ .▄▄▌ ▄▄▌ \n"
" ·██ ▐███▪██ •█▌▐███ ▐█ ▀. ██▪▐█▀▄.▀·██• ██• \n"
" ▐█ ▌▐▌▐█·▐█·▐█▐▐▌▐█·▄▀▀▀█▄██▀▐█▐▀▀▪▄██▪ ██▪ \n"
" ██ ██▌▐█▌▐█▌██▐█▌▐█▌▐█▄▪▐███▌▐▀▐█▄▄▌▐█▌▐▌▐█▌▐▌\n"
" ▀▀ █▪▀▀▀▀▀▀▀▀ █▪▀▀▀ ▀▀▀▀ ▀▀▀ · ▀▀▀ .▀▀▀ .▀▀▀ \n\n"
RED
"██████████████████████████████████████████████████\n"
RESET);
}

View File

@ -12,6 +12,17 @@
#include "minishell.h"
static int cmp_value(t_list *list, char *str)
{
if (list != NULL
&& ft_strncmp(
((t_token *)list->content)->value,
str,
ft_strlen(str) + 1) == 0)
return (TRUE);
return (FALSE);
}
void simple_builtins(t_minishell *minishell)
{
if (cmp_value(minishell->tokens, "clear"))