diff --git a/42sh/includes/ft_readline.h b/42sh/includes/ft_readline.h index 5f968480..ee0dcca6 100644 --- a/42sh/includes/ft_readline.h +++ b/42sh/includes/ft_readline.h @@ -6,7 +6,7 @@ /* By: sbenning +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/08 18:02:25 by sbenning #+# #+# */ -/* Updated: 2017/01/22 11:13:43 by gwojda ### ########.fr */ +/* Updated: 2017/01/22 14:34:41 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -46,6 +46,8 @@ # define TOUCHE_OPT_V 10127586 # define TOUCHE_OPT_C 42947 # define TOUCHE_OPT_X 8948194 +# define TOUCHE_F5 892427035 +# define TOUCHE_F6 925981467 typedef struct s_line { @@ -60,6 +62,7 @@ typedef struct s_list_history struct s_list_history *next; } t_list_history; +void ft_printall(char *str, size_t *pos); void ft_get_beggin_with_curs(char *str, size_t *pos); void ft_history(char **str, int ret, t_list_history **head, size_t *pos); void ft_suppr(char **str, size_t *i); diff --git a/42sh/obj/ast_free.o b/42sh/obj/ast_free.o new file mode 100644 index 00000000..d3bbdd4d Binary files /dev/null and b/42sh/obj/ast_free.o differ diff --git a/42sh/obj/builtin_bg.o b/42sh/obj/builtin_bg.o new file mode 100644 index 00000000..92476142 Binary files /dev/null and b/42sh/obj/builtin_bg.o differ diff --git a/42sh/obj/builtin_cd.o b/42sh/obj/builtin_cd.o new file mode 100644 index 00000000..dd1af953 Binary files /dev/null and b/42sh/obj/builtin_cd.o differ diff --git a/42sh/obj/builtin_echo.o b/42sh/obj/builtin_echo.o new file mode 100644 index 00000000..3f246bed Binary files /dev/null and b/42sh/obj/builtin_echo.o differ diff --git a/42sh/obj/builtin_env.o b/42sh/obj/builtin_env.o new file mode 100644 index 00000000..4dce0ec7 Binary files /dev/null and b/42sh/obj/builtin_env.o differ diff --git a/42sh/obj/builtin_exit.o b/42sh/obj/builtin_exit.o new file mode 100644 index 00000000..f08787f4 Binary files /dev/null and b/42sh/obj/builtin_exit.o differ diff --git a/42sh/obj/builtin_fg.o b/42sh/obj/builtin_fg.o new file mode 100644 index 00000000..9da2139c Binary files /dev/null and b/42sh/obj/builtin_fg.o differ diff --git a/42sh/obj/builtin_jobs.o b/42sh/obj/builtin_jobs.o new file mode 100644 index 00000000..1260e07f Binary files /dev/null and b/42sh/obj/builtin_jobs.o differ diff --git a/42sh/obj/builtin_setenv.o b/42sh/obj/builtin_setenv.o new file mode 100644 index 00000000..9b661b54 Binary files /dev/null and b/42sh/obj/builtin_setenv.o differ diff --git a/42sh/obj/builtin_unsetenv.o b/42sh/obj/builtin_unsetenv.o new file mode 100644 index 00000000..c95cd843 Binary files /dev/null and b/42sh/obj/builtin_unsetenv.o differ diff --git a/42sh/obj/command_getoutput.o b/42sh/obj/command_getoutput.o new file mode 100644 index 00000000..41121df3 Binary files /dev/null and b/42sh/obj/command_getoutput.o differ diff --git a/42sh/obj/copy_cut_paste.o b/42sh/obj/copy_cut_paste.o new file mode 100644 index 00000000..01eb6c10 Binary files /dev/null and b/42sh/obj/copy_cut_paste.o differ diff --git a/42sh/obj/data_exit.o b/42sh/obj/data_exit.o new file mode 100644 index 00000000..b7cd5f2f Binary files /dev/null and b/42sh/obj/data_exit.o differ diff --git a/42sh/obj/data_init.o b/42sh/obj/data_init.o new file mode 100644 index 00000000..e601aa2b Binary files /dev/null and b/42sh/obj/data_init.o differ diff --git a/42sh/obj/data_singleton.o b/42sh/obj/data_singleton.o new file mode 100644 index 00000000..3ff780c6 Binary files /dev/null and b/42sh/obj/data_singleton.o differ diff --git a/42sh/obj/do_job_notification.o b/42sh/obj/do_job_notification.o new file mode 100644 index 00000000..9dd64dd4 Binary files /dev/null and b/42sh/obj/do_job_notification.o differ diff --git a/42sh/obj/exec_ampersand.o b/42sh/obj/exec_ampersand.o new file mode 100644 index 00000000..dad02cc2 Binary files /dev/null and b/42sh/obj/exec_ampersand.o differ diff --git a/42sh/obj/exec_and_if.o b/42sh/obj/exec_and_if.o new file mode 100644 index 00000000..8fa9bb18 Binary files /dev/null and b/42sh/obj/exec_and_if.o differ diff --git a/42sh/obj/exec_command.o b/42sh/obj/exec_command.o new file mode 100644 index 00000000..17669529 Binary files /dev/null and b/42sh/obj/exec_command.o differ diff --git a/42sh/obj/exec_dgreat.o b/42sh/obj/exec_dgreat.o new file mode 100644 index 00000000..4f532928 Binary files /dev/null and b/42sh/obj/exec_dgreat.o differ diff --git a/42sh/obj/exec_great.o b/42sh/obj/exec_great.o new file mode 100644 index 00000000..49a86d0f Binary files /dev/null and b/42sh/obj/exec_great.o differ diff --git a/42sh/obj/exec_less.o b/42sh/obj/exec_less.o new file mode 100644 index 00000000..14dd6f73 Binary files /dev/null and b/42sh/obj/exec_less.o differ diff --git a/42sh/obj/exec_or_if.o b/42sh/obj/exec_or_if.o new file mode 100644 index 00000000..4638ea5e Binary files /dev/null and b/42sh/obj/exec_or_if.o differ diff --git a/42sh/obj/exec_pipe.o b/42sh/obj/exec_pipe.o new file mode 100644 index 00000000..b08413ef Binary files /dev/null and b/42sh/obj/exec_pipe.o differ diff --git a/42sh/obj/exec_semi.o b/42sh/obj/exec_semi.o new file mode 100644 index 00000000..183cd9e9 Binary files /dev/null and b/42sh/obj/exec_semi.o differ diff --git a/42sh/obj/ft_exec.o b/42sh/obj/ft_exec.o new file mode 100644 index 00000000..7ebb7d95 Binary files /dev/null and b/42sh/obj/ft_exec.o differ diff --git a/42sh/obj/ft_findexec.o b/42sh/obj/ft_findexec.o new file mode 100644 index 00000000..0e9cb040 Binary files /dev/null and b/42sh/obj/ft_findexec.o differ diff --git a/42sh/obj/ft_parse.o b/42sh/obj/ft_parse.o new file mode 100644 index 00000000..58763dbd Binary files /dev/null and b/42sh/obj/ft_parse.o differ diff --git a/42sh/obj/ft_post_tokenize.o b/42sh/obj/ft_post_tokenize.o new file mode 100644 index 00000000..692079e8 Binary files /dev/null and b/42sh/obj/ft_post_tokenize.o differ diff --git a/42sh/obj/ft_putast.o b/42sh/obj/ft_putast.o new file mode 100644 index 00000000..68bc619f Binary files /dev/null and b/42sh/obj/ft_putast.o differ diff --git a/42sh/obj/ft_putast2.o b/42sh/obj/ft_putast2.o new file mode 100644 index 00000000..93e88ec6 Binary files /dev/null and b/42sh/obj/ft_putast2.o differ diff --git a/42sh/obj/ft_split_whitespaces.o b/42sh/obj/ft_split_whitespaces.o new file mode 100644 index 00000000..f8ea70a7 Binary files /dev/null and b/42sh/obj/ft_split_whitespaces.o differ diff --git a/42sh/obj/ft_tokenize.o b/42sh/obj/ft_tokenize.o new file mode 100644 index 00000000..6c708728 Binary files /dev/null and b/42sh/obj/ft_tokenize.o differ diff --git a/42sh/obj/get_lexer_state.o b/42sh/obj/get_lexer_state.o new file mode 100644 index 00000000..2a093a6d Binary files /dev/null and b/42sh/obj/get_lexer_state.o differ diff --git a/42sh/obj/get_touch.o b/42sh/obj/get_touch.o new file mode 100644 index 00000000..beb93275 Binary files /dev/null and b/42sh/obj/get_touch.o differ diff --git a/42sh/obj/get_touch_toolz.o b/42sh/obj/get_touch_toolz.o new file mode 100644 index 00000000..06853058 Binary files /dev/null and b/42sh/obj/get_touch_toolz.o differ diff --git a/42sh/obj/get_touch_toolz_2.o b/42sh/obj/get_touch_toolz_2.o new file mode 100644 index 00000000..4b5da184 Binary files /dev/null and b/42sh/obj/get_touch_toolz_2.o differ diff --git a/42sh/obj/is_builtin.o b/42sh/obj/is_builtin.o new file mode 100644 index 00000000..2161a2b4 Binary files /dev/null and b/42sh/obj/is_builtin.o differ diff --git a/42sh/obj/job_addprocess.o b/42sh/obj/job_addprocess.o new file mode 100644 index 00000000..23736aef Binary files /dev/null and b/42sh/obj/job_addprocess.o differ diff --git a/42sh/obj/job_cmp_id.o b/42sh/obj/job_cmp_id.o new file mode 100644 index 00000000..0dd4403a Binary files /dev/null and b/42sh/obj/job_cmp_id.o differ diff --git a/42sh/obj/job_format.o b/42sh/obj/job_format.o new file mode 100644 index 00000000..974c7a93 Binary files /dev/null and b/42sh/obj/job_format.o differ diff --git a/42sh/obj/job_format_head.o b/42sh/obj/job_format_head.o new file mode 100644 index 00000000..24ed7f23 Binary files /dev/null and b/42sh/obj/job_format_head.o differ diff --git a/42sh/obj/job_free.o b/42sh/obj/job_free.o new file mode 100644 index 00000000..36954c14 Binary files /dev/null and b/42sh/obj/job_free.o differ diff --git a/42sh/obj/job_getprocess.o b/42sh/obj/job_getprocess.o new file mode 100644 index 00000000..c92fdb89 Binary files /dev/null and b/42sh/obj/job_getprocess.o differ diff --git a/42sh/obj/job_getrank.o b/42sh/obj/job_getrank.o new file mode 100644 index 00000000..7dfe939a Binary files /dev/null and b/42sh/obj/job_getrank.o differ diff --git a/42sh/obj/job_is_completed.o b/42sh/obj/job_is_completed.o new file mode 100644 index 00000000..52ebf046 Binary files /dev/null and b/42sh/obj/job_is_completed.o differ diff --git a/42sh/obj/job_is_stopped.o b/42sh/obj/job_is_stopped.o new file mode 100644 index 00000000..8e64f72d Binary files /dev/null and b/42sh/obj/job_is_stopped.o differ diff --git a/42sh/obj/job_kill_all.o b/42sh/obj/job_kill_all.o new file mode 100644 index 00000000..85cac4ae Binary files /dev/null and b/42sh/obj/job_kill_all.o differ diff --git a/42sh/obj/job_notify_change.o b/42sh/obj/job_notify_change.o new file mode 100644 index 00000000..6db4d7e7 Binary files /dev/null and b/42sh/obj/job_notify_change.o differ diff --git a/42sh/obj/job_notify_new.o b/42sh/obj/job_notify_new.o new file mode 100644 index 00000000..b1f5b6a4 Binary files /dev/null and b/42sh/obj/job_notify_new.o differ diff --git a/42sh/obj/job_remove.o b/42sh/obj/job_remove.o new file mode 100644 index 00000000..5f68e0e7 Binary files /dev/null and b/42sh/obj/job_remove.o differ diff --git a/42sh/obj/job_update_id.o b/42sh/obj/job_update_id.o new file mode 100644 index 00000000..a0818cdd Binary files /dev/null and b/42sh/obj/job_update_id.o differ diff --git a/42sh/obj/job_update_status.o b/42sh/obj/job_update_status.o new file mode 100644 index 00000000..7e903dbb Binary files /dev/null and b/42sh/obj/job_update_status.o differ diff --git a/42sh/obj/job_wait.o b/42sh/obj/job_wait.o new file mode 100644 index 00000000..8eb10c59 Binary files /dev/null and b/42sh/obj/job_wait.o differ diff --git a/42sh/obj/launch_process.o b/42sh/obj/launch_process.o new file mode 100644 index 00000000..3fdab719 Binary files /dev/null and b/42sh/obj/launch_process.o differ diff --git a/42sh/obj/lexer_backslash.o b/42sh/obj/lexer_backslash.o new file mode 100644 index 00000000..0e3a6241 Binary files /dev/null and b/42sh/obj/lexer_backslash.o differ diff --git a/42sh/obj/lexer_default.o b/42sh/obj/lexer_default.o new file mode 100644 index 00000000..fce1b267 Binary files /dev/null and b/42sh/obj/lexer_default.o differ diff --git a/42sh/obj/lexer_delim.o b/42sh/obj/lexer_delim.o new file mode 100644 index 00000000..05d7ddac Binary files /dev/null and b/42sh/obj/lexer_delim.o differ diff --git a/42sh/obj/lexer_dquote.o b/42sh/obj/lexer_dquote.o new file mode 100644 index 00000000..29705224 Binary files /dev/null and b/42sh/obj/lexer_dquote.o differ diff --git a/42sh/obj/lexer_great.o b/42sh/obj/lexer_great.o new file mode 100644 index 00000000..6b6d3d0c Binary files /dev/null and b/42sh/obj/lexer_great.o differ diff --git a/42sh/obj/lexer_greatand.o b/42sh/obj/lexer_greatand.o new file mode 100644 index 00000000..842bca0c Binary files /dev/null and b/42sh/obj/lexer_greatand.o differ diff --git a/42sh/obj/lexer_less.o b/42sh/obj/lexer_less.o new file mode 100644 index 00000000..55ca67fa Binary files /dev/null and b/42sh/obj/lexer_less.o differ diff --git a/42sh/obj/lexer_lessand.o b/42sh/obj/lexer_lessand.o new file mode 100644 index 00000000..ef5abb8e Binary files /dev/null and b/42sh/obj/lexer_lessand.o differ diff --git a/42sh/obj/lexer_number.o b/42sh/obj/lexer_number.o new file mode 100644 index 00000000..001f4e8f Binary files /dev/null and b/42sh/obj/lexer_number.o differ diff --git a/42sh/obj/lexer_quote.o b/42sh/obj/lexer_quote.o new file mode 100644 index 00000000..ba0cf267 Binary files /dev/null and b/42sh/obj/lexer_quote.o differ diff --git a/42sh/obj/lexer_sep.o b/42sh/obj/lexer_sep.o new file mode 100644 index 00000000..0fc8b499 Binary files /dev/null and b/42sh/obj/lexer_sep.o differ diff --git a/42sh/obj/lexer_special.o b/42sh/obj/lexer_special.o new file mode 100644 index 00000000..497c3be6 Binary files /dev/null and b/42sh/obj/lexer_special.o differ diff --git a/42sh/obj/lexer_var.o b/42sh/obj/lexer_var.o new file mode 100644 index 00000000..0668ed3e Binary files /dev/null and b/42sh/obj/lexer_var.o differ diff --git a/42sh/obj/lexer_word.o b/42sh/obj/lexer_word.o new file mode 100644 index 00000000..1fe43cd1 Binary files /dev/null and b/42sh/obj/lexer_word.o differ diff --git a/42sh/obj/line_return_toolz.o b/42sh/obj/line_return_toolz.o new file mode 100644 index 00000000..ed542b13 Binary files /dev/null and b/42sh/obj/line_return_toolz.o differ diff --git a/42sh/obj/list_toolz.o b/42sh/obj/list_toolz.o new file mode 100644 index 00000000..ebeff716 Binary files /dev/null and b/42sh/obj/list_toolz.o differ diff --git a/42sh/obj/main.o b/42sh/obj/main.o new file mode 100644 index 00000000..90b3f8ba Binary files /dev/null and b/42sh/obj/main.o differ diff --git a/42sh/obj/mark_job_as_running.o b/42sh/obj/mark_job_as_running.o new file mode 100644 index 00000000..c4363f82 Binary files /dev/null and b/42sh/obj/mark_job_as_running.o differ diff --git a/42sh/obj/move_to_line.o b/42sh/obj/move_to_line.o new file mode 100644 index 00000000..8aa53d83 Binary files /dev/null and b/42sh/obj/move_to_line.o differ diff --git a/42sh/obj/parse_dgreat.o b/42sh/obj/parse_dgreat.o new file mode 100644 index 00000000..aa3d9954 Binary files /dev/null and b/42sh/obj/parse_dgreat.o differ diff --git a/42sh/obj/parse_dless.o b/42sh/obj/parse_dless.o new file mode 100644 index 00000000..8828a2d3 Binary files /dev/null and b/42sh/obj/parse_dless.o differ diff --git a/42sh/obj/parse_great.o b/42sh/obj/parse_great.o new file mode 100644 index 00000000..3f64649e Binary files /dev/null and b/42sh/obj/parse_great.o differ diff --git a/42sh/obj/parse_greatand.o b/42sh/obj/parse_greatand.o new file mode 100644 index 00000000..ea85f5b2 Binary files /dev/null and b/42sh/obj/parse_greatand.o differ diff --git a/42sh/obj/parse_less.o b/42sh/obj/parse_less.o new file mode 100644 index 00000000..7a14b146 Binary files /dev/null and b/42sh/obj/parse_less.o differ diff --git a/42sh/obj/parse_lessand.o b/42sh/obj/parse_lessand.o new file mode 100644 index 00000000..2d892b98 Binary files /dev/null and b/42sh/obj/parse_lessand.o differ diff --git a/42sh/obj/parse_separator.o b/42sh/obj/parse_separator.o new file mode 100644 index 00000000..0635d658 Binary files /dev/null and b/42sh/obj/parse_separator.o differ diff --git a/42sh/obj/parse_subshell.o b/42sh/obj/parse_subshell.o new file mode 100644 index 00000000..90ea1422 Binary files /dev/null and b/42sh/obj/parse_subshell.o differ diff --git a/42sh/obj/parse_word.o b/42sh/obj/parse_word.o new file mode 100644 index 00000000..22a0503c Binary files /dev/null and b/42sh/obj/parse_word.o differ diff --git a/42sh/obj/print_and_del.o b/42sh/obj/print_and_del.o new file mode 100644 index 00000000..69c97fe1 Binary files /dev/null and b/42sh/obj/print_and_del.o differ diff --git a/42sh/obj/process_cmp_pid.o b/42sh/obj/process_cmp_pid.o new file mode 100644 index 00000000..a7d27a76 Binary files /dev/null and b/42sh/obj/process_cmp_pid.o differ diff --git a/42sh/obj/process_format.o b/42sh/obj/process_format.o new file mode 100644 index 00000000..208d854e Binary files /dev/null and b/42sh/obj/process_format.o differ diff --git a/42sh/obj/process_free.o b/42sh/obj/process_free.o new file mode 100644 index 00000000..7df5f946 Binary files /dev/null and b/42sh/obj/process_free.o differ diff --git a/42sh/obj/process_mark_status.o b/42sh/obj/process_mark_status.o new file mode 100644 index 00000000..ee809bea Binary files /dev/null and b/42sh/obj/process_mark_status.o differ diff --git a/42sh/obj/process_redirect.o b/42sh/obj/process_redirect.o new file mode 100644 index 00000000..233c6b13 Binary files /dev/null and b/42sh/obj/process_redirect.o differ diff --git a/42sh/obj/process_reset.o b/42sh/obj/process_reset.o new file mode 100644 index 00000000..4bedb166 Binary files /dev/null and b/42sh/obj/process_reset.o differ diff --git a/42sh/obj/process_setexec.o b/42sh/obj/process_setexec.o new file mode 100644 index 00000000..00a361d8 Binary files /dev/null and b/42sh/obj/process_setexec.o differ diff --git a/42sh/obj/process_setgroup.o b/42sh/obj/process_setgroup.o new file mode 100644 index 00000000..a01b2e69 Binary files /dev/null and b/42sh/obj/process_setgroup.o differ diff --git a/42sh/obj/prompt.o b/42sh/obj/prompt.o new file mode 100644 index 00000000..8d0bcf53 Binary files /dev/null and b/42sh/obj/prompt.o differ diff --git a/42sh/obj/put_job_in_background.o b/42sh/obj/put_job_in_background.o new file mode 100644 index 00000000..ba69bfe9 Binary files /dev/null and b/42sh/obj/put_job_in_background.o differ diff --git a/42sh/obj/put_job_in_foreground.o b/42sh/obj/put_job_in_foreground.o new file mode 100644 index 00000000..d6b9d13d Binary files /dev/null and b/42sh/obj/put_job_in_foreground.o differ diff --git a/42sh/obj/quotes_gest.o b/42sh/obj/quotes_gest.o new file mode 100644 index 00000000..fdcbc59c Binary files /dev/null and b/42sh/obj/quotes_gest.o differ diff --git a/42sh/obj/reader.o b/42sh/obj/reader.o new file mode 100644 index 00000000..e051ee13 Binary files /dev/null and b/42sh/obj/reader.o differ diff --git a/42sh/obj/readline.o b/42sh/obj/readline.o new file mode 100644 index 00000000..f645ada8 Binary files /dev/null and b/42sh/obj/readline.o differ diff --git a/42sh/obj/reduce_bquotes.o b/42sh/obj/reduce_bquotes.o new file mode 100644 index 00000000..3aaa01ac Binary files /dev/null and b/42sh/obj/reduce_bquotes.o differ diff --git a/42sh/obj/reduce_parens.o b/42sh/obj/reduce_parens.o new file mode 100644 index 00000000..9ee29c88 Binary files /dev/null and b/42sh/obj/reduce_parens.o differ diff --git a/42sh/obj/set_exitstatus.o b/42sh/obj/set_exitstatus.o new file mode 100644 index 00000000..2d772911 Binary files /dev/null and b/42sh/obj/set_exitstatus.o differ diff --git a/42sh/obj/shell_exit.o b/42sh/obj/shell_exit.o new file mode 100644 index 00000000..6692c8c1 Binary files /dev/null and b/42sh/obj/shell_exit.o differ diff --git a/42sh/obj/shell_get_avdata.o b/42sh/obj/shell_get_avdata.o new file mode 100644 index 00000000..26ad0281 Binary files /dev/null and b/42sh/obj/shell_get_avdata.o differ diff --git a/42sh/obj/shell_get_opts.o b/42sh/obj/shell_get_opts.o new file mode 100644 index 00000000..2a597e89 Binary files /dev/null and b/42sh/obj/shell_get_opts.o differ diff --git a/42sh/obj/shell_init.o b/42sh/obj/shell_init.o new file mode 100644 index 00000000..33567b4b Binary files /dev/null and b/42sh/obj/shell_init.o differ diff --git a/42sh/obj/sigchld_handler.o b/42sh/obj/sigchld_handler.o new file mode 100644 index 00000000..79e8d16f Binary files /dev/null and b/42sh/obj/sigchld_handler.o differ diff --git a/42sh/obj/sigint_handler.o b/42sh/obj/sigint_handler.o new file mode 100644 index 00000000..859a658d Binary files /dev/null and b/42sh/obj/sigint_handler.o differ diff --git a/42sh/obj/sigtstp_handler.o b/42sh/obj/sigtstp_handler.o new file mode 100644 index 00000000..bff39d8c Binary files /dev/null and b/42sh/obj/sigtstp_handler.o differ diff --git a/42sh/obj/sigttin_handler.o b/42sh/obj/sigttin_handler.o new file mode 100644 index 00000000..f6fdc33e Binary files /dev/null and b/42sh/obj/sigttin_handler.o differ diff --git a/42sh/obj/sigttou_handler.o b/42sh/obj/sigttou_handler.o new file mode 100644 index 00000000..17056d95 Binary files /dev/null and b/42sh/obj/sigttou_handler.o differ diff --git a/42sh/obj/token_append.o b/42sh/obj/token_append.o new file mode 100644 index 00000000..8b1dede7 Binary files /dev/null and b/42sh/obj/token_append.o differ diff --git a/42sh/obj/token_cmp_type.o b/42sh/obj/token_cmp_type.o new file mode 100644 index 00000000..c5d367ac Binary files /dev/null and b/42sh/obj/token_cmp_type.o differ diff --git a/42sh/obj/token_expand_var.o b/42sh/obj/token_expand_var.o new file mode 100644 index 00000000..134684b1 Binary files /dev/null and b/42sh/obj/token_expand_var.o differ diff --git a/42sh/obj/token_free.o b/42sh/obj/token_free.o new file mode 100644 index 00000000..de97febb Binary files /dev/null and b/42sh/obj/token_free.o differ diff --git a/42sh/obj/token_init.o b/42sh/obj/token_init.o new file mode 100644 index 00000000..4bb6a561 Binary files /dev/null and b/42sh/obj/token_init.o differ diff --git a/42sh/obj/token_print.o b/42sh/obj/token_print.o new file mode 100644 index 00000000..3170b433 Binary files /dev/null and b/42sh/obj/token_print.o differ diff --git a/42sh/obj/tool_line.o b/42sh/obj/tool_line.o new file mode 100644 index 00000000..82f044ae Binary files /dev/null and b/42sh/obj/tool_line.o differ diff --git a/42sh/obj/tool_line_2.o b/42sh/obj/tool_line_2.o new file mode 100644 index 00000000..5675e7a5 Binary files /dev/null and b/42sh/obj/tool_line_2.o differ diff --git a/42sh/obj/toolz.o b/42sh/obj/toolz.o new file mode 100644 index 00000000..fc363746 Binary files /dev/null and b/42sh/obj/toolz.o differ diff --git a/42sh/obj/toolz2.o b/42sh/obj/toolz2.o new file mode 100644 index 00000000..f267b6a3 Binary files /dev/null and b/42sh/obj/toolz2.o differ diff --git a/42sh/obj/toolz_parseur.o b/42sh/obj/toolz_parseur.o new file mode 100644 index 00000000..49904a16 Binary files /dev/null and b/42sh/obj/toolz_parseur.o differ diff --git a/42sh/obj/toolz_termcaps.o b/42sh/obj/toolz_termcaps.o new file mode 100644 index 00000000..6e5ed177 Binary files /dev/null and b/42sh/obj/toolz_termcaps.o differ diff --git a/42sh/src/line-editing/copy_cut_paste.c b/42sh/src/line-editing/copy_cut_paste.c index eebce795..f74d7a6a 100644 --- a/42sh/src/line-editing/copy_cut_paste.c +++ b/42sh/src/line-editing/copy_cut_paste.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/19 12:45:06 by gwojda #+# #+# */ -/* Updated: 2017/01/19 16:42:34 by gwojda ### ########.fr */ +/* Updated: 2017/01/22 14:10:31 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,52 +14,67 @@ static void ft_v(char *tmp, size_t *pos, char **str) { - int i; - int j; - int len; + size_t tmp_pos; + int i; i = 0; - j = 0; - len = *pos; + tmp_pos = *pos; if (!tmp) return ; while (tmp[i]) { - *str = ft_realloc_imput(*str, tmp[i], *pos); - ++(*pos); + *str = ft_realloc_imput(*str, tmp[i], *pos + i); ++i; } - ft_putstr((*str) + *pos - i); - if (ft_nb_last_line(*str, *pos) == ft_size_term() - 1) + if (*pos) { - ft_putchar(' '); - ft_putchar('\b'); + --(*pos); + ft_get_beggin_with_curs(*str, pos); } - *pos = ft_strlen(*str); - ft_move_to_beggin(*str, pos); - *pos = len; - write(1, *str, *pos); + ft_current_str(*str, *pos); + ft_get_next_str(*str, pos); + ft_putnc('\b', *pos - tmp_pos); + (*pos) = tmp_pos; +} + +static char *ft_strdupi_space(char const *s) +{ + int i; + char *str; + + i = 0; + while (s[i] && s[i] != '\n') + i++; + str = (char *)malloc(sizeof(char) * (i + 1)); + if (str) + { + str[i--] = '\0'; + while (i >= 0) + { + str[i] = s[i]; + i--; + } + } + return (str); } static void ft_x(char **tmp, size_t *pos, char **str) { int i; - i = ft_strlen(*str) - 1; if (*tmp) ft_strdel(tmp); - *tmp = ft_strdup(&(*str)[(*pos)]); - while (i >= 0 && i >= (int)*pos) + *tmp = ft_strdupi_space(&(*str)[(*pos)]); + i = ft_strlen(*tmp); + while (i >= 0) { - *str = ft_remove_imput(*str, i); + *str = ft_remove_imput(*str, *pos + i); --i; } - ft_move_to_beggin(*str, pos); ft_puttermcaps("cd"); - ft_putstr(*str); - *pos = ft_strlen(*str); } + void ft_cxv(int ret, size_t *pos, char **str) { static char *tmp = NULL; @@ -72,7 +87,7 @@ void ft_cxv(int ret, size_t *pos, char **str) { if (tmp) ft_strdel(&tmp); - tmp = ft_strdup(&(*str)[(*pos)]); + tmp = ft_strdupi_space(&(*str)[(*pos)]); } else if (ret == TOUCHE_OPT_V) ft_v(tmp, pos, str); diff --git a/42sh/src/line-editing/get_touch.c b/42sh/src/line-editing/get_touch.c index cd1de32d..07281fa2 100644 --- a/42sh/src/line-editing/get_touch.c +++ b/42sh/src/line-editing/get_touch.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/19 16:28:49 by gwojda #+# #+# */ -/* Updated: 2017/01/22 11:15:54 by gwojda ### ########.fr */ +/* Updated: 2017/01/22 15:03:13 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,7 +25,9 @@ static int ft_lecture_3(int ret, char **str, size_t *i) static int ft_lecture_2(int ret, char **str, size_t *i) { - if (ret == TOUCHE_OPT_LEFT || ret == TOUCHE_OPT_RIGHT) + if (ret == TOUCHE_F5) + ft_printall(*str, i); + else if (ret == TOUCHE_OPT_LEFT || ret == TOUCHE_OPT_RIGHT) ft_move_to_word(ret, i, *str); else if (ret == TOUCHE_OPT_X || ret == TOUCHE_OPT_C || ret == TOUCHE_OPT_V) diff --git a/42sh/src/line-editing/print_and_del.c b/42sh/src/line-editing/print_and_del.c index 9d2e437c..8493e3c9 100644 --- a/42sh/src/line-editing/print_and_del.c +++ b/42sh/src/line-editing/print_and_del.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/05 16:02:43 by gwojda #+# #+# */ -/* Updated: 2017/01/21 16:57:38 by gwojda ### ########.fr */ +/* Updated: 2017/01/22 15:02:02 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/line-editing/readline.c b/42sh/src/line-editing/readline.c index 78daff55..5e783640 100644 --- a/42sh/src/line-editing/readline.c +++ b/42sh/src/line-editing/readline.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/15 14:19:48 by gwojda #+# #+# */ -/* Updated: 2017/01/20 12:07:02 by gwojda ### ########.fr */ +/* Updated: 2017/01/22 14:57:05 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -49,9 +49,9 @@ int ft_readline(void) { static t_list_history *head = NULL; - ft_prompt(); if (tcsetattr(0, TCSANOW, ft_stats_term_termcaps()) == -1) return (-1); + ft_prompt(); data_singleton()->line.input = ft_lecture(head); ft_putstr("\n"); ft_check_quotes(&data_singleton()->line.input, head); diff --git a/42sh/src/line-editing/tool_line_2.c b/42sh/src/line-editing/tool_line_2.c index f691a218..e97c1458 100644 --- a/42sh/src/line-editing/tool_line_2.c +++ b/42sh/src/line-editing/tool_line_2.c @@ -6,12 +6,64 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/01/20 19:07:52 by gwojda #+# #+# */ -/* Updated: 2017/01/21 16:52:48 by gwojda ### ########.fr */ +/* Updated: 2017/01/22 17:20:05 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" +static void ft_clear_window() +{ + pid_t soon_pid; + char *tab_str[2] = {(char *){"/usr/bin/clear"}, NULL}; + + soon_pid = fork(); + if (soon_pid != 0) + wait(NULL); + else + execve("/usr/bin/clear", tab_str, data_singleton()->env); +} + +void ft_printall(char *str, size_t *pos) +{ + size_t pos_tmp; + int ret; + + if (read(0, &ret, sizeof(int)) == -1 || ret != 126 || !str) + return ; + ft_clear_window(); + ft_prompt(); + sleep(1); + pos_tmp = *pos; + + ft_putstr("\033[31m"); + ft_puttermcaps("cd"); + ft_puttermcaps("sc"); + ft_putstr(str); + while (42) + { + ret = 0; + read(0, &ret, sizeof(int)); + if (ret == TOUCHE_F6) + { + ret = 0; + if (read(0, &ret, sizeof(int)) && ret == 126) + break ; + } + } + ft_puttermcaps("rc"); + ft_puttermcaps("cd"); + ft_putstr("\033[37m"); + --(*pos); + ft_get_beggin(str, pos); + ft_current_str(str, *pos); + ft_get_next_str(str, pos); + if (!str[*pos]) + --(*pos); + ft_putnc('\b', *pos - pos_tmp + 1); + *pos = pos_tmp; +} + void ft_get_beggin_with_curs(char *str, size_t *pos) { while ((*pos) && str[(*pos)] != '\n') diff --git a/42sh/src/line-editing/toolz_parseur.c b/42sh/src/line-editing/toolz_parseur.c index 963ad457..465063d8 100644 --- a/42sh/src/line-editing/toolz_parseur.c +++ b/42sh/src/line-editing/toolz_parseur.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/16 16:14:46 by gwojda #+# #+# */ -/* Updated: 2017/01/21 18:16:56 by gwojda ### ########.fr */ +/* Updated: 2017/01/22 11:58:06 by gwojda ### ########.fr */ /* */ /* ************************************************************************** */ @@ -59,18 +59,30 @@ void ft_found_prev_word(char *str, size_t *pos) i = 0; if (!*pos) return ; + if (!(str[*pos] == '\n' || str[*pos] == ' ')) + { + ft_puttermcaps("le"); + --(*pos); + } + while ((int)*pos - i - 1 > 0 && str[*pos - i - 1] == ' ') + { + ft_puttermcaps("le"); + ++i; + } + (*pos) = (i && str[*pos - i] == '\n') ? *pos - i + 1 : *pos - i; + i = 0; if (str[*pos - 1] == '\n') { ft_puttermcaps("cd"); + (*pos) -= 2; ft_get_beggin(str, pos); - --(*pos); ft_current_str(str, *pos); ft_get_next_str(str, pos); ++(*pos); } else { - if (!(str[*pos - i] == '\n' || str[*pos - i] == ' ')) + if (!(str[*pos] == '\n' || str[*pos] == ' ')) { ft_puttermcaps("le"); --(*pos); @@ -99,9 +111,13 @@ void ft_found_next_word(char *str, size_t *pos) int i; i = 0; + while (str[i + *pos] && str[i + *pos] == ' ') + { + ft_putchar(str[i + *pos]); + ++i; + } if (str[*pos] == '\n') { - sleep(1); if (*pos) { --(*pos); @@ -109,11 +125,11 @@ void ft_found_next_word(char *str, size_t *pos) } ft_puttermcaps("cd"); ft_get_next_str(str, pos); + (*pos) += 2; ft_current_str(str, *pos); ft_get_next_str(str, pos); - (*pos) -= 2; + --(*pos); ft_get_beggin_with_curs(str, pos); - (*pos) += 2; } else {