Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ ifeq ($(sanitize), true)
CFLAGS += -fsanitize=address,undefined -g3
endif

### RL_FLAG ####################################################################

RL_FLAG := -lreadline

### COLORS #####################################################################

GREEN := \033[0;32m
Expand Down Expand Up @@ -70,7 +74,7 @@ all: $(NAME)

$(NAME): $(LIBFT) $(OBJS)
@echo "$(BLUE)Compiling $(NAME)...$(WHITE)"
@$(CC) $(CFLAGS) $(OBJS) -o $(NAME) $(LIBFT) -I $(PATH_INCLUDES) -I $(PATH_INCLUDES_LIBFT)
@$(CC) $(CFLAGS) $(OBJS) -o $(NAME) $(LIBFT) -I $(PATH_INCLUDES) -I $(PATH_INCLUDES_LIBFT) $(RL_FLAG)
@echo "$(GREEN)$(NAME) Compiled !$(WHITE)"

$(OBJS): $(PATH_OBJS)%.o: %.c $(HEADERS)
Expand Down
14 changes: 11 additions & 3 deletions includes/minishell.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@
/* ::: :::::::: */
/* minishell.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hucherea <hucherea@student.42.fr> +#+ +:+ +#+ */
/* By: tchobert <tchobert@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/09 16:11:56 by hucherea #+# #+# */
/* Updated: 2024/12/10 11:08:32 by hucherea ### ########.fr */
/* Updated: 2024/12/10 16:41:31 by tchobert ### ########.fr */
/* */
/* ************************************************************************** */

#ifndef MINISHELL_H
# define MINISHELL_H

// INCLUDES

# include <stdio.h>
# include <stdlib.h>
# include <readline/readline.h>
# include <readline/history.h>

// DEFINES

# define LOOP 1
# define MSH_LOOP 1
# define MSH_PROMPT "SDF$> "

#endif
11 changes: 8 additions & 3 deletions srcs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hucherea <hucherea@student.42.fr> +#+ +:+ +#+ */
/* By: tchobert <tchobert@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/09 16:11:39 by hucherea #+# #+# */
/* Updated: 2024/12/10 10:39:56 by hucherea ### ########.fr */
/* Updated: 2024/12/10 16:47:37 by tchobert ### ########.fr */
/* */
/* ************************************************************************** */

#include "minishell.h"

static int core_routine(void)
{
while (LOOP)
char *user_input_line;

user_input_line = NULL;
while (MSH_LOOP)
{
user_input_line = readline(MSH_PROMPT);
free(user_input_line);
}
return (EXIT_SUCCESS);
}
Expand Down
Loading