read script init

This commit is contained in:
ariard@student.42.fr 2017-01-22 00:38:27 +01:00
parent 4b22633cab
commit 133f4bf052
220 changed files with 183 additions and 84 deletions

View file

@ -72,6 +72,11 @@ $(D_OBJ)/%.o: $(D_SRC)/job-control/%.c includes/job_control.h
@$(CC) $(O_INC) $(W_FLAGS) -c $< -o $@ $(D_FLAGS)
@echo "Compiling "$<"..."
$(D_OBJ)/%.o: $(D_SRC)/read-script/%.c includes/readscript.h
@$(MKDIR) $(D_OBJ)
@$(CC) $(O_INC) $(W_FLAGS) -c $< -o $@ $(D_FLAGS)
@echo "Compiling "$<"..."
libft/libft.a: libft/src/*/*.c
@echo "libft/libft.a"
@$(MAKE) -C libft 2>/dev/null

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/13 17:21:56 by jhalford #+# #+# */
/* Updated: 2017/01/09 16:57:22 by jhalford ### ########.fr */
/* Updated: 2017/01/19 20:54:43 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/27 20:29:56 by jhalford #+# #+# */
/* Updated: 2017/01/12 13:18:27 by jhalford ### ########.fr */
/* Updated: 2017/01/19 21:03:13 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: sbenning <sbenning@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/08 16:34:51 by sbenning #+# #+# */
/* Updated: 2016/12/09 17:08:52 by sbenning ### ########.fr */
/* Updated: 2017/01/19 21:53:40 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: sbenning <sbenning@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/09 02:05:22 by sbenning #+# #+# */
/* Updated: 2017/01/10 11:45:38 by jhalford ### ########.fr */
/* Updated: 2017/01/21 21:49:00 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: sbenning <sbenning@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/08 18:02:25 by sbenning #+# #+# */
/* Updated: 2017/01/11 17:31:09 by jhalford ### ########.fr */
/* Updated: 2017/01/21 23:42:07 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/10 16:55:09 by jhalford #+# #+# */
/* Updated: 2017/01/09 16:56:18 by jhalford ### ########.fr */
/* Updated: 2017/01/19 21:51:10 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/01 12:15:50 by jhalford #+# #+# */
/* Updated: 2017/01/12 14:57:41 by jhalford ### ########.fr */
/* Updated: 2017/01/22 00:37:19 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/10 13:07:44 by jhalford #+# #+# */
/* Updated: 2017/01/11 17:17:16 by jhalford ### ########.fr */
/* Updated: 2017/01/22 00:37:20 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -16,6 +16,7 @@
# include "libft.h"
# include "readscript.h"
# include "types.h"
# include "lexer.h"
# include "parser.h"
@ -46,6 +47,7 @@ struct s_comp
# define SHELL_MSG_NOJOBC "no job-control"
struct s_data
{
char **env;
@ -56,6 +58,7 @@ struct s_data
t_comp comp;
t_exec exec;
t_jobc jobc;
t_script script;
};
extern t_stof g_builtins[];

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/01 12:15:54 by jhalford #+# #+# */
/* Updated: 2017/01/11 17:06:17 by jhalford ### ########.fr */
/* Updated: 2017/01/20 18:26:51 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -0,0 +1,43 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* read_script.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ariard <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/21 22:50:22 by ariard #+# #+# */
/* Updated: 2017/01/22 00:37:21 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef READSCRIPT_H
# define READSCRIPT_H
/*
* input : destination buffer
* b_size : allocated size of the destination buffer
* used : acutal used size in the destination buffer
* q_size : number of elements in the queue
* queue : list of queued lines, FIFO
*/
struct s_script
{
char *buffer;
int b_size;
int used;
int q_size;
t_list *queue;
};
typedef struct s_script t_script;
/*
* Read_script setup/cleanup
*/
int rs_setup(t_script *script);
int ft_read_script();
#endif

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/13 17:11:48 by jhalford #+# #+# */
/* Updated: 2017/01/10 12:45:35 by jhalford ### ########.fr */
/* Updated: 2017/01/19 21:52:47 by ariard ### ########.fr */
/* */
/* ************************************************************************** */

BIN
42sh/obj/ast_free.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_bg.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_cd.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_echo.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_env.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_exit.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_fg.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_jobs.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_setenv.o Normal file

Binary file not shown.

BIN
42sh/obj/builtin_unsetenv.o Normal file

Binary file not shown.

Binary file not shown.

BIN
42sh/obj/curs_ask.o Normal file

Binary file not shown.

BIN
42sh/obj/curs_clear.o Normal file

Binary file not shown.

BIN
42sh/obj/curs_goto.o Normal file

Binary file not shown.

BIN
42sh/obj/curs_move.o Normal file

Binary file not shown.

BIN
42sh/obj/curs_setup.o Normal file

Binary file not shown.

BIN
42sh/obj/curs_single.o Normal file

Binary file not shown.

BIN
42sh/obj/curs_term_setup.o Normal file

Binary file not shown.

BIN
42sh/obj/curs_write.o Normal file

Binary file not shown.

BIN
42sh/obj/data_exit.o Normal file

Binary file not shown.

BIN
42sh/obj/data_init.o Normal file

Binary file not shown.

BIN
42sh/obj/data_singleton.o Normal file

Binary file not shown.

Binary file not shown.

BIN
42sh/obj/exec_ampersand.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_and_if.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_command.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_dgreat.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_great.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_less.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_or_if.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_pipe.o Normal file

Binary file not shown.

BIN
42sh/obj/exec_semi.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_exec.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_findexec.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_parse.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_post_tokenize.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_putast.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_putast2.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_read_script.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_readline.o Normal file

Binary file not shown.

BIN
42sh/obj/ft_tokenize.o Normal file

Binary file not shown.

BIN
42sh/obj/get_lexer_state.o Normal file

Binary file not shown.

BIN
42sh/obj/is_builtin.o Normal file

Binary file not shown.

BIN
42sh/obj/job_addprocess.o Normal file

Binary file not shown.

BIN
42sh/obj/job_cmp_id.o Normal file

Binary file not shown.

BIN
42sh/obj/job_format.o Normal file

Binary file not shown.

BIN
42sh/obj/job_format_head.o Normal file

Binary file not shown.

BIN
42sh/obj/job_free.o Normal file

Binary file not shown.

BIN
42sh/obj/job_getprocess.o Normal file

Binary file not shown.

BIN
42sh/obj/job_getrank.o Normal file

Binary file not shown.

BIN
42sh/obj/job_is_completed.o Normal file

Binary file not shown.

BIN
42sh/obj/job_is_stopped.o Normal file

Binary file not shown.

BIN
42sh/obj/job_kill_all.o Normal file

Binary file not shown.

Binary file not shown.

BIN
42sh/obj/job_notify_new.o Normal file

Binary file not shown.

BIN
42sh/obj/job_remove.o Normal file

Binary file not shown.

BIN
42sh/obj/job_update_id.o Normal file

Binary file not shown.

Binary file not shown.

BIN
42sh/obj/job_wait.o Normal file

Binary file not shown.

BIN
42sh/obj/launch_process.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_backslash.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_default.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_delim.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_dquote.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_great.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_greatand.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_less.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_lessand.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_number.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_quote.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_sep.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_special.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_var.o Normal file

Binary file not shown.

BIN
42sh/obj/lexer_word.o Normal file

Binary file not shown.

BIN
42sh/obj/main.o Normal file

Binary file not shown.

Binary file not shown.

BIN
42sh/obj/parse_dgreat.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_dless.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_great.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_greatand.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_less.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_lessand.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_separator.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_subshell.o Normal file

Binary file not shown.

BIN
42sh/obj/parse_word.o Normal file

Binary file not shown.

BIN
42sh/obj/process_cmp_pid.o Normal file

Binary file not shown.

BIN
42sh/obj/process_format.o Normal file

Binary file not shown.

BIN
42sh/obj/process_free.o Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more