diff --git a/env_2env_8c.html b/env_2env_8c.html index 96aa8f0f..9db5de62 100644 --- a/env_2env_8c.html +++ b/env_2env_8c.html @@ -302,7 +302,7 @@

References ft_strcmp(), s_env::key, s_env::next, and s_env::value.

-

Referenced by add_env(), builtin_cd(), ft_find_path(), generate_prompt_string(), test_get_env(), test_set_env(), and test_unset_env().

+

Referenced by add_env(), builtin_cd(), ft_find_path(), generate_prompt_string(), test_get_env(), test_set_env(), and test_unset_env().

Here is the call graph for this function:
diff --git a/env_8h.html b/env_8h.html index bcdeb4bc..ab3f9eb6 100644 --- a/env_8h.html +++ b/env_8h.html @@ -719,7 +719,7 @@

References ft_strcmp(), s_env::key, s_env::next, and s_env::value.

-

Referenced by add_env(), builtin_cd(), ft_find_path(), generate_prompt_string(), test_get_env(), test_set_env(), and test_unset_env().

+

Referenced by add_env(), builtin_cd(), ft_find_path(), generate_prompt_string(), test_get_env(), test_set_env(), and test_unset_env().

Here is the call graph for this function:
diff --git a/ft__printf_8c.html b/ft__printf_8c.html index ade08075..ca971944 100644 --- a/ft__printf_8c.html +++ b/ft__printf_8c.html @@ -335,7 +335,7 @@

References ft_formatssssss(), and ft_print_char().

-

Referenced by append_phrase_if_valid(), input_error_checks(), print_maxishell(), and print_stack().

+

Referenced by append_phrase_if_valid(), input_error_checks(), print_maxishell(), and print_stack().

Here is the call graph for this function:
diff --git a/ft__strcat_8c.html b/ft__strcat_8c.html index 4b57b5da..90305654 100644 --- a/ft__strcat_8c.html +++ b/ft__strcat_8c.html @@ -177,6 +177,22 @@

41 return (dest);

42}

+

Referenced by generate_prompt().

+
+Here is the caller graph for this function:
+
+
+ + + + + + + + + +
+

diff --git a/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.map b/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.map new file mode 100644 index 00000000..15e00dd1 --- /dev/null +++ b/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.md5 b/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.md5 new file mode 100644 index 00000000..6e6abad0 --- /dev/null +++ b/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.md5 @@ -0,0 +1 @@ +ff726f91f972e26f16406b32cff5e2d5 \ No newline at end of file diff --git a/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.png b/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.png new file mode 100644 index 00000000..2aeeea31 Binary files /dev/null and b/ft__strcat_8c_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.png differ diff --git a/ft__strcpy_8c.html b/ft__strcpy_8c.html index 80a9b8f3..5f991eed 100644 --- a/ft__strcpy_8c.html +++ b/ft__strcpy_8c.html @@ -173,7 +173,7 @@

36 return (dest);
37}
-

Referenced by generate_prompt().

+

Referenced by generate_prompt().

Here is the caller graph for this function:
diff --git a/ft__strjoin_8c.html b/ft__strjoin_8c.html index 82810679..2ac590b4 100644 --- a/ft__strjoin_8c.html +++ b/ft__strjoin_8c.html @@ -185,7 +185,7 @@

References ft_strlen().

-

Referenced by env_to_array(), generate_prompt_string(), heredoc(), and relative_path_handle().

+

Referenced by env_to_array(), generate_prompt_string(), heredoc(), and relative_path_handle().

Here is the call graph for this function:
diff --git a/ft__strlen_8c.html b/ft__strlen_8c.html index 87613d5d..4acaa7cc 100644 --- a/ft__strlen_8c.html +++ b/ft__strlen_8c.html @@ -141,135 +141,135 @@

22 return (i);

23}

-

Referenced by builtin_echo(), builtin_exit(), ft_putstr_fd(), ft_strdup(), ft_strjoin(), ft_strlcat(), ft_strndup(), ft_strnstr(), ft_strstr(), ft_strtrim(), ft_substr(), generate_prompt(), generate_prompt_string(), and redirect_here_doc().

+

Referenced by builtin_echo(), builtin_exit(), ft_putstr_fd(), ft_strdup(), ft_strjoin(), ft_strlcat(), ft_strndup(), ft_strnstr(), ft_strstr(), ft_strtrim(), ft_substr(), generate_prompt_string(), and redirect_here_doc().

Here is the caller graph for this function:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map b/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map index 834f0aa6..3151e163 100644 --- a/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map +++ b/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map @@ -1,125 +1,125 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 b/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 index 419ec6f7..530c86e3 100644 --- a/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 +++ b/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 @@ -1 +1 @@ -c1d54364997c53013e8dd5bdc19c0c67 \ No newline at end of file +bfa0e6083f2921b8c5dbf133b09c4510 \ No newline at end of file diff --git a/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png b/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png index d14174be..9713ac7b 100644 Binary files a/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png and b/ft__strlen_8c_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png differ diff --git a/ft__strncmp_8c.html b/ft__strncmp_8c.html index c106239a..cb7dd511 100644 --- a/ft__strncmp_8c.html +++ b/ft__strncmp_8c.html @@ -178,7 +178,7 @@

34 return (0);
35}
-

Referenced by builtin_export(), ft_find_path(), ft_strnstr(), ft_strstr(), generate_prompt_string(), and list_repeat_check_str().

+

Referenced by builtin_export(), ft_find_path(), ft_strnstr(), ft_strstr(), generate_prompt_string(), and list_repeat_check_str().

Here is the caller graph for this function:
diff --git a/libft_8h.html b/libft_8h.html index e1732d09..580567f4 100644 --- a/libft_8h.html +++ b/libft_8h.html @@ -2404,7 +2404,7 @@

References ft_formatssssss(), and ft_print_char().

-

Referenced by append_phrase_if_valid(), input_error_checks(), print_maxishell(), and print_stack().

+

Referenced by append_phrase_if_valid(), input_error_checks(), print_maxishell(), and print_stack().

Here is the call graph for this function:
@@ -3239,6 +3239,22 @@

41 return (dest);

42}

+

Referenced by generate_prompt().

+
+Here is the caller graph for this function:
+
+
+ + + + + + + + + +
+ @@ -3552,7 +3568,7 @@

36 return (dest);
37}
-

Referenced by generate_prompt().

+

Referenced by generate_prompt().

Here is the caller graph for this function:
@@ -3844,7 +3860,7 @@

References ft_strlen().

-

Referenced by env_to_array(), generate_prompt_string(), heredoc(), and relative_path_handle().

+

Referenced by env_to_array(), generate_prompt_string(), heredoc(), and relative_path_handle().

Here is the call graph for this function:
@@ -4202,135 +4218,135 @@

22 return (i);

23}

-

Referenced by builtin_echo(), builtin_exit(), ft_putstr_fd(), ft_strdup(), ft_strjoin(), ft_strlcat(), ft_strndup(), ft_strnstr(), ft_strstr(), ft_strtrim(), ft_substr(), generate_prompt(), generate_prompt_string(), and redirect_here_doc().

+

Referenced by builtin_echo(), builtin_exit(), ft_putstr_fd(), ft_strdup(), ft_strjoin(), ft_strlcat(), ft_strndup(), ft_strnstr(), ft_strstr(), ft_strtrim(), ft_substr(), generate_prompt_string(), and redirect_here_doc().

Here is the caller graph for this function:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -4433,7 +4449,7 @@

34 return (0);
35}
-

Referenced by builtin_export(), ft_find_path(), ft_strnstr(), ft_strstr(), generate_prompt_string(), and list_repeat_check_str().

+

Referenced by builtin_export(), ft_find_path(), ft_strnstr(), ft_strstr(), generate_prompt_string(), and list_repeat_check_str().

Here is the caller graph for this function:
diff --git a/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map b/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map index 834f0aa6..3151e163 100644 --- a/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map +++ b/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.map @@ -1,125 +1,125 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 b/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 index 419ec6f7..530c86e3 100644 --- a/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 +++ b/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.md5 @@ -1 +1 @@ -c1d54364997c53013e8dd5bdc19c0c67 \ No newline at end of file +bfa0e6083f2921b8c5dbf133b09c4510 \ No newline at end of file diff --git a/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png b/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png index d14174be..9713ac7b 100644 Binary files a/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png and b/libft_8h_abbb8c6c4ed85d892e7f1509f65f5768a_icgraph.png differ diff --git a/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.map b/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.map new file mode 100644 index 00000000..15e00dd1 --- /dev/null +++ b/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.md5 b/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.md5 new file mode 100644 index 00000000..6e6abad0 --- /dev/null +++ b/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.md5 @@ -0,0 +1 @@ +ff726f91f972e26f16406b32cff5e2d5 \ No newline at end of file diff --git a/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.png b/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.png new file mode 100644 index 00000000..2aeeea31 Binary files /dev/null and b/libft_8h_ac7bb7d543c62b46aae49fdc97c9ae837_icgraph.png differ diff --git a/main_8c.html b/main_8c.html index 3f55127e..4d904a1d 100644 --- a/main_8c.html +++ b/main_8c.html @@ -226,131 +226,128 @@

Definition shell.h:21

void free_minishell_data(t_minishell_data *data)
void initialise(int argc, char **argv)
Definition initialise.c:30
-
void print_maxishell(void)
Definition prompt.c:69
+
void print_maxishell(void)
Definition prompt.c:72
void init_minishell_data(t_minishell_data *data, char **envp)
Definition initialise.c:17
-

References free_minishell_data(), init_minishell_data(), initialise(), main_loop(), and print_maxishell().

+

References free_minishell_data(), init_minishell_data(), initialise(), main_loop(), and print_maxishell().

Here is the call graph for this function:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -426,13 +423,13 @@

void print_ast_root(t_ast *root)
Definition visualiser.c:103
t_ast * parse_tokens(t_token **tokens)
void loop_cleanup(char *line, t_token *tokens, char *prompt, t_ast *tree)
-
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:31
+
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:32
t_token * tokenise(char *str)
Definition tokeniser.c:106
int input_error_checks(const char *str)
void make_history(char *line)
Definition aux.c:15
char * trim_input(char *str)
-

References execute_ast(), generate_prompt(), handle_io_fd(), s_loop_data::input, input_error_checks(), loop_cleanup(), make_history(), parse_tokens(), print_ast_root(), s_loop_data::prompt, set_signals_interactive(), set_signals_noninteractive(), status_handler(), tokenise(), s_loop_data::tokens, s_loop_data::tree, trim_input(), and s_loop_data::trimmed_input.

+

References execute_ast(), generate_prompt(), handle_io_fd(), s_loop_data::input, input_error_checks(), loop_cleanup(), make_history(), parse_tokens(), print_ast_root(), s_loop_data::prompt, set_signals_interactive(), set_signals_noninteractive(), status_handler(), tokenise(), s_loop_data::tokens, s_loop_data::tree, trim_input(), and s_loop_data::trimmed_input.

Referenced by main().

diff --git a/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.map b/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.map index f6ed83d1..eb4f11ef 100644 --- a/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.map +++ b/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.map @@ -1,118 +1,115 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.md5 b/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.md5 index 12739033..3668917b 100644 --- a/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.md5 +++ b/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.md5 @@ -1 +1 @@ -287df98be652576e309cd609c5e9b132 \ No newline at end of file +44b4af76f4803b3f48bfd1be25174605 \ No newline at end of file diff --git a/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.png b/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.png index 56a77028..c718a61e 100644 Binary files a/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.png and b/main_8c_a647f21a28344e1d9c643f4115516d7c9_cgraph.png differ diff --git a/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.map b/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.map index f50704de..5d8eda14 100644 --- a/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.map +++ b/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.map @@ -1,127 +1,123 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.md5 b/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.md5 index 582a683c..e12c79e9 100644 --- a/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.md5 +++ b/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.md5 @@ -1 +1 @@ -003c9c1949564a734b2220764b3aee22 \ No newline at end of file +def4396a0c3b7cdb996b1d6f995acbb6 \ No newline at end of file diff --git a/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.png b/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.png index a8027807..d91087c8 100644 Binary files a/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.png and b/main_8c_abaf800210325f066cb9289aaae9e2c86_cgraph.png differ diff --git a/main_8c_source.html b/main_8c_source.html index a8042c3a..62a77242 100644 --- a/main_8c_source.html +++ b/main_8c_source.html @@ -202,8 +202,8 @@
t_ast * parse_tokens(t_token **tokens)
void loop_cleanup(char *line, t_token *tokens, char *prompt, t_ast *tree)
void initialise(int argc, char **argv)
Definition initialise.c:30
-
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:31
-
void print_maxishell(void)
Definition prompt.c:69
+
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:32
+
void print_maxishell(void)
Definition prompt.c:72
t_token * tokenise(char *str)
Definition tokeniser.c:106
int input_error_checks(const char *str)
void make_history(char *line)
Definition aux.c:15
diff --git a/prompt_8c.html b/prompt_8c.html index 96a61c0c..1ac57360 100644 --- a/prompt_8c.html +++ b/prompt_8c.html @@ -175,29 +175,30 @@

-

Definition at line 31 of file prompt.c.

-
32{
-
33 char *prompt;
-
34 size_t prompt_len;
-
35
-
36 if (data->std_in == -1)
-
37 prompt_len = ft_strlen("minishell:~> ") + 1;
-
38 else
-
39 prompt_len = ft_strlen("> ") + 1;
-
40 prompt = (char *)malloc(prompt_len);
-
41 if (!prompt)
-
42 exit(EXIT_FAILURE);
-
43 if (data->std_in == -1)
-
44 ft_strcpy(prompt, "minishell:~> ");
-
45 else
-
46 ft_strcpy(prompt, "> ");
-
47 return (prompt);
-
48}
+

Definition at line 32 of file prompt.c.

+
33{
+
34 char *prompt;
+
35 size_t prompt_len;
+
36
+
37 prompt_len = strlen("🌴\e[1m @maxishell:~> \e[m") + \
+
38 strlen(getenv("LOGNAME")) + \
+
39 ft_strlen(getenv("PWD")) + \
+
40 1;
+
41 prompt = (char *)malloc(prompt_len);
+
42 if (!prompt)
+
43 exit(EXIT_FAILURE);
+
44 ft_strcpy(prompt, "🌴\e[1m ");
+
45 ft_strcat(prompt, getenv("LOGNAME"));
+
46 ft_strcat(prompt, "@maxishell:~");
+
47 ft_strcat(prompt, getenv("PWD"));
+
48 ft_strcat(prompt, "> \e[m");
+
49 (void)data;
+
50 return (prompt);
+
51}
char * ft_strcpy(char *dest, const char *src)
Definition ft_strcpy.c:25
-
size_t ft_strlen(const char *s)
Definition ft_strlen.c:15
- +
char * ft_strcat(char *dest, char *src)
Definition ft_strcat.c:26
-

References ft_strcpy(), ft_strlen(), and s_minishell_data::std_in.

+

References ft_strcat(), and ft_strcpy().

Referenced by main_loop().

@@ -206,10 +207,10 @@

- - - - + + + +
@@ -259,26 +260,27 @@

-

Definition at line 50 of file prompt.c.

-
52{
-
53 char *temp_pwd;
-
54
-
55 pwd = get_env(data->envp, "PWD");
-
56 if (pwd)
-
57 {
-
58 home_dir = get_env(data->envp, "HOME");
-
59 if (home_dir && ft_strncmp(pwd, home_dir, ft_strlen(home_dir)) == 0)
-
60 {
-
61 temp_pwd = ft_strjoin("~", pwd + ft_strlen(home_dir));
-
62 free(pwd);
-
63 pwd = temp_pwd;
-
64 }
-
65 }
-
66 return (pwd);
-
67}
+

Definition at line 53 of file prompt.c.

+
55{
+
56 char *temp_pwd;
+
57
+
58 pwd = get_env(data->envp, "PWD");
+
59 if (pwd)
+
60 {
+
61 home_dir = get_env(data->envp, "HOME");
+
62 if (home_dir && ft_strncmp(pwd, home_dir, ft_strlen(home_dir)) == 0)
+
63 {
+
64 temp_pwd = ft_strjoin("~", pwd + ft_strlen(home_dir));
+
65 free(pwd);
+
66 pwd = temp_pwd;
+
67 }
+
68 }
+
69 return (pwd);
+
70}
char * get_env(t_env *envp, const char *key)
Definition env.c:60
char * ft_strjoin(char const *s1, char const *s2)
Definition ft_strjoin.c:23
int ft_strncmp(const char *s1, const char *s2, size_t n)
Definition ft_strncmp.c:24
+
size_t ft_strlen(const char *s)
Definition ft_strlen.c:15
t_env * envp
Definition shell.h:24

References s_minishell_data::envp, ft_strjoin(), ft_strlen(), ft_strncmp(), and get_env().

@@ -320,28 +322,28 @@

-

Definition at line 69 of file prompt.c.

-
70{
-
71 ft_printf("\033[1;33m\n\n\n\n\n");
-
72 ft_printf("███╗░░░███╗░█████╗░██╗░░██╗██╗░██████╗██╗░"
-
73 "░██╗███████╗██╗░░░░░██╗░░░░░\n");
-
74 ft_printf("████╗░████║██╔══██╗╚██╗██╔╝██║██╔════╝██║░"
-
75 "░██║██╔════╝██║░░░░░██║░░░░░\n");
-
76 ft_printf("██╔████╔██║███████║░╚███╔╝░██║╚█████╗░█████"
-
77 "██║█████╗░░██║░░░░░██║░░░░░\n");
-
78 ft_printf("██║╚██╔╝██║██╔══██║░██╔██╗░██║░╚═══██╗██╔══"
-
79 "██║██╔══╝░░██║░░░░░██║░░░░░\n");
-
80 ft_printf("██║░╚═╝░██║██║░░██║██╔╝╚██╗██║██████╔╝██║░░"
-
81 "██║███████╗███████╗███████╗\n");
-
82 ft_printf("╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═════╝░╚═╝░░"
-
83 "╚═╝╚══════╝╚══════╝╚══════╝\n");
-
84 ft_printf("\n");
-
85 ft_printf(" \033[1;34m"
-
86 "Version 0.0.0\033[0m\n");
-
87 ft_printf(" \033[1;36m"
-
88 "By Димас и Ромас\033[0m\n");
-
89 ft_printf("\n");
-
90}
+

Definition at line 72 of file prompt.c.

+
73{
+
74 ft_printf("\033[1;33m\n\n\n\n\n");
+
75 ft_printf("███╗░░░███╗░█████╗░██╗░░██╗██╗░██████╗██╗░"
+
76 "░██╗███████╗██╗░░░░░██╗░░░░░\n");
+
77 ft_printf("████╗░████║██╔══██╗╚██╗██╔╝██║██╔════╝██║░"
+
78 "░██║██╔════╝██║░░░░░██║░░░░░\n");
+
79 ft_printf("██╔████╔██║███████║░╚███╔╝░██║╚█████╗░█████"
+
80 "██║█████╗░░██║░░░░░██║░░░░░\n");
+
81 ft_printf("██║╚██╔╝██║██╔══██║░██╔██╗░██║░╚═══██╗██╔══"
+
82 "██║██╔══╝░░██║░░░░░██║░░░░░\n");
+
83 ft_printf("██║░╚═╝░██║██║░░██║██╔╝╚██╗██║██████╔╝██║░░"
+
84 "██║███████╗███████╗███████╗\n");
+
85 ft_printf("╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═════╝░╚═╝░░"
+
86 "╚═╝╚══════╝╚══════╝╚══════╝\n");
+
87 ft_printf("\n");
+
88 ft_printf(" \033[1;34m"
+
89 "Version 0.0.0\033[0m\n");
+
90 ft_printf(" \033[1;36m"
+
91 "By Димас и Ромас\033[0m\n");
+
92 ft_printf("\n");
+
93}
int ft_printf(const char *format,...)
Definition ft_printf.c:37

References ft_printf().

diff --git a/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.map b/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.map index 13fd8bde..60a4c18d 100644 --- a/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.map +++ b/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.map @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 b/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 index 644c1f8a..574a24af 100644 --- a/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 +++ b/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 @@ -1 +1 @@ -32542fff44d2894b07e4be4463453d9b \ No newline at end of file +5fccfb142e2f7461fe9ab423f9899808 \ No newline at end of file diff --git a/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.png b/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.png index 79f773c0..55680395 100644 Binary files a/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.png and b/prompt_8c_a4c523064ece03ba20eb609b52253b88e_cgraph.png differ diff --git a/prompt_8c_source.html b/prompt_8c_source.html index 890dbaf7..d17c096b 100644 --- a/prompt_8c_source.html +++ b/prompt_8c_source.html @@ -128,71 +128,74 @@
28char *generate_prompt_string(t_minishell_data *data, char *pwd, \
29 char *home_dir);
30
-
- -
32{
-
33 char *prompt;
-
34 size_t prompt_len;
-
35
-
36 if (data->std_in == -1)
-
37 prompt_len = ft_strlen("minishell:~> ") + 1;
-
38 else
-
39 prompt_len = ft_strlen("> ") + 1;
-
40 prompt = (char *)malloc(prompt_len);
-
41 if (!prompt)
-
42 exit(EXIT_FAILURE);
-
43 if (data->std_in == -1)
-
44 ft_strcpy(prompt, "minishell:~> ");
-
45 else
-
46 ft_strcpy(prompt, "> ");
-
47 return (prompt);
-
48}
+
31
+
+ +
33{
+
34 char *prompt;
+
35 size_t prompt_len;
+
36
+
37 prompt_len = strlen("🌴\e[1m @maxishell:~> \e[m") + \
+
38 strlen(getenv("LOGNAME")) + \
+
39 ft_strlen(getenv("PWD")) + \
+
40 1;
+
41 prompt = (char *)malloc(prompt_len);
+
42 if (!prompt)
+
43 exit(EXIT_FAILURE);
+
44 ft_strcpy(prompt, "🌴\e[1m ");
+
45 ft_strcat(prompt, getenv("LOGNAME"));
+
46 ft_strcat(prompt, "@maxishell:~");
+
47 ft_strcat(prompt, getenv("PWD"));
+
48 ft_strcat(prompt, "> \e[m");
+
49 (void)data;
+
50 return (prompt);
+
51}
-
49
-
- -
51 char *home_dir)
-
52{
-
53 char *temp_pwd;
-
54
-
55 pwd = get_env(data->envp, "PWD");
-
56 if (pwd)
-
57 {
-
58 home_dir = get_env(data->envp, "HOME");
-
59 if (home_dir && ft_strncmp(pwd, home_dir, ft_strlen(home_dir)) == 0)
-
60 {
-
61 temp_pwd = ft_strjoin("~", pwd + ft_strlen(home_dir));
-
62 free(pwd);
-
63 pwd = temp_pwd;
-
64 }
-
65 }
-
66 return (pwd);
-
67}
+
52
+
+ +
54 char *home_dir)
+
55{
+
56 char *temp_pwd;
+
57
+
58 pwd = get_env(data->envp, "PWD");
+
59 if (pwd)
+
60 {
+
61 home_dir = get_env(data->envp, "HOME");
+
62 if (home_dir && ft_strncmp(pwd, home_dir, ft_strlen(home_dir)) == 0)
+
63 {
+
64 temp_pwd = ft_strjoin("~", pwd + ft_strlen(home_dir));
+
65 free(pwd);
+
66 pwd = temp_pwd;
+
67 }
+
68 }
+
69 return (pwd);
+
70}
-
68
-
- -
70{
-
71 ft_printf("\033[1;33m\n\n\n\n\n");
-
72 ft_printf("███╗░░░███╗░█████╗░██╗░░██╗██╗░██████╗██╗░"
-
73 "░██╗███████╗██╗░░░░░██╗░░░░░\n");
-
74 ft_printf("████╗░████║██╔══██╗╚██╗██╔╝██║██╔════╝██║░"
-
75 "░██║██╔════╝██║░░░░░██║░░░░░\n");
-
76 ft_printf("██╔████╔██║███████║░╚███╔╝░██║╚█████╗░█████"
-
77 "██║█████╗░░██║░░░░░██║░░░░░\n");
-
78 ft_printf("██║╚██╔╝██║██╔══██║░██╔██╗░██║░╚═══██╗██╔══"
-
79 "██║██╔══╝░░██║░░░░░██║░░░░░\n");
-
80 ft_printf("██║░╚═╝░██║██║░░██║██╔╝╚██╗██║██████╔╝██║░░"
-
81 "██║███████╗███████╗███████╗\n");
-
82 ft_printf("╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═════╝░╚═╝░░"
-
83 "╚═╝╚══════╝╚══════╝╚══════╝\n");
-
84 ft_printf("\n");
-
85 ft_printf(" \033[1;34m"
-
86 "Version 0.0.0\033[0m\n");
-
87 ft_printf(" \033[1;36m"
-
88 "By Димас и Ромас\033[0m\n");
-
89 ft_printf("\n");
-
90}
+
71
+
+ +
73{
+
74 ft_printf("\033[1;33m\n\n\n\n\n");
+
75 ft_printf("███╗░░░███╗░█████╗░██╗░░██╗██╗░██████╗██╗░"
+
76 "░██╗███████╗██╗░░░░░██╗░░░░░\n");
+
77 ft_printf("████╗░████║██╔══██╗╚██╗██╔╝██║██╔════╝██║░"
+
78 "░██║██╔════╝██║░░░░░██║░░░░░\n");
+
79 ft_printf("██╔████╔██║███████║░╚███╔╝░██║╚█████╗░█████"
+
80 "██║█████╗░░██║░░░░░██║░░░░░\n");
+
81 ft_printf("██║╚██╔╝██║██╔══██║░██╔██╗░██║░╚═══██╗██╔══"
+
82 "██║██╔══╝░░██║░░░░░██║░░░░░\n");
+
83 ft_printf("██║░╚═╝░██║██║░░██║██╔╝╚██╗██║██████╔╝██║░░"
+
84 "██║███████╗███████╗███████╗\n");
+
85 ft_printf("╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═════╝░╚═╝░░"
+
86 "╚═╝╚══════╝╚══════╝╚══════╝\n");
+
87 ft_printf("\n");
+
88 ft_printf(" \033[1;34m"
+
89 "Version 0.0.0\033[0m\n");
+
90 ft_printf(" \033[1;36m"
+
91 "By Димас и Ромас\033[0m\n");
+
92 ft_printf("\n");
+
93}
char * get_env(t_env *envp, const char *key)
Definition env.c:60
@@ -201,12 +204,12 @@
char * ft_strjoin(char const *s1, char const *s2)
Definition ft_strjoin.c:23
int ft_strncmp(const char *s1, const char *s2, size_t n)
Definition ft_strncmp.c:24
size_t ft_strlen(const char *s)
Definition ft_strlen.c:15
-
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:31
-
void print_maxishell(void)
Definition prompt.c:69
-
char * generate_prompt_string(t_minishell_data *data, char *pwd, char *home_dir)
Definition prompt.c:50
+
char * ft_strcat(char *dest, char *src)
Definition ft_strcat.c:26
+
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:32
+
void print_maxishell(void)
Definition prompt.c:72
+
char * generate_prompt_string(t_minishell_data *data, char *pwd, char *home_dir)
Definition prompt.c:53
t_env * envp
Definition shell.h:24
-
diff --git a/structs__minishell__data.html b/structs__minishell__data.html index 27a68576..13aa251d 100644 --- a/structs__minishell__data.html +++ b/structs__minishell__data.html @@ -185,7 +185,7 @@

Definition at line 24 of file shell.h.

-

Referenced by add_env(), builtin_cd(), builtin_env(), builtin_export(), builtin_unset(), env_tests(), free_minishell_data(), generate_prompt_string(), init_minishell_data(), new_process(), test_get_env(), test_init_env(), test_set_env(), and test_unset_env().

+

Referenced by add_env(), builtin_cd(), builtin_env(), builtin_export(), builtin_unset(), env_tests(), free_minishell_data(), generate_prompt_string(), init_minishell_data(), new_process(), test_get_env(), test_init_env(), test_set_env(), and test_unset_env().

@@ -257,7 +257,7 @@

Definition at line 26 of file shell.h.

-

Referenced by builtin_pipe(), execute_child(), free_minishell_data(), generate_prompt(), handle_io_fd(), init_minishell_data(), new_process(), and redirect_in().

+

Referenced by builtin_pipe(), execute_child(), free_minishell_data(), handle_io_fd(), init_minishell_data(), new_process(), and redirect_in().

diff --git a/tokens_8h.html b/tokens_8h.html index 6bd8abc8..05105acb 100644 --- a/tokens_8h.html +++ b/tokens_8h.html @@ -1328,28 +1328,30 @@

-

Definition at line 31 of file prompt.c.

-
32{
-
33 char *prompt;
-
34 size_t prompt_len;
-
35
-
36 if (data->std_in == -1)
-
37 prompt_len = ft_strlen("minishell:~> ") + 1;
-
38 else
-
39 prompt_len = ft_strlen("> ") + 1;
-
40 prompt = (char *)malloc(prompt_len);
-
41 if (!prompt)
-
42 exit(EXIT_FAILURE);
-
43 if (data->std_in == -1)
-
44 ft_strcpy(prompt, "minishell:~> ");
-
45 else
-
46 ft_strcpy(prompt, "> ");
-
47 return (prompt);
-
48}
+

Definition at line 32 of file prompt.c.

+
33{
+
34 char *prompt;
+
35 size_t prompt_len;
+
36
+
37 prompt_len = strlen("🌴\e[1m @maxishell:~> \e[m") + \
+
38 strlen(getenv("LOGNAME")) + \
+
39 ft_strlen(getenv("PWD")) + \
+
40 1;
+
41 prompt = (char *)malloc(prompt_len);
+
42 if (!prompt)
+
43 exit(EXIT_FAILURE);
+
44 ft_strcpy(prompt, "🌴\e[1m ");
+
45 ft_strcat(prompt, getenv("LOGNAME"));
+
46 ft_strcat(prompt, "@maxishell:~");
+
47 ft_strcat(prompt, getenv("PWD"));
+
48 ft_strcat(prompt, "> \e[m");
+
49 (void)data;
+
50 return (prompt);
+
51}
char * ft_strcpy(char *dest, const char *src)
Definition ft_strcpy.c:25
-
size_t ft_strlen(const char *s)
Definition ft_strlen.c:15
+
char * ft_strcat(char *dest, char *src)
Definition ft_strcat.c:26
-

References ft_strcpy(), ft_strlen(), and s_minishell_data::std_in.

+

References ft_strcat(), and ft_strcpy().

Referenced by main_loop().

@@ -1358,10 +1360,10 @@

- - - - + + + +
@@ -2778,28 +2780,28 @@

-

Definition at line 69 of file prompt.c.

-
70{
-
71 ft_printf("\033[1;33m\n\n\n\n\n");
-
72 ft_printf("███╗░░░███╗░█████╗░██╗░░██╗██╗░██████╗██╗░"
-
73 "░██╗███████╗██╗░░░░░██╗░░░░░\n");
-
74 ft_printf("████╗░████║██╔══██╗╚██╗██╔╝██║██╔════╝██║░"
-
75 "░██║██╔════╝██║░░░░░██║░░░░░\n");
-
76 ft_printf("██╔████╔██║███████║░╚███╔╝░██║╚█████╗░█████"
-
77 "██║█████╗░░██║░░░░░██║░░░░░\n");
-
78 ft_printf("██║╚██╔╝██║██╔══██║░██╔██╗░██║░╚═══██╗██╔══"
-
79 "██║██╔══╝░░██║░░░░░██║░░░░░\n");
-
80 ft_printf("██║░╚═╝░██║██║░░██║██╔╝╚██╗██║██████╔╝██║░░"
-
81 "██║███████╗███████╗███████╗\n");
-
82 ft_printf("╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═════╝░╚═╝░░"
-
83 "╚═╝╚══════╝╚══════╝╚══════╝\n");
-
84 ft_printf("\n");
-
85 ft_printf(" \033[1;34m"
-
86 "Version 0.0.0\033[0m\n");
-
87 ft_printf(" \033[1;36m"
-
88 "By Димас и Ромас\033[0m\n");
-
89 ft_printf("\n");
-
90}
+

Definition at line 72 of file prompt.c.

+
73{
+
74 ft_printf("\033[1;33m\n\n\n\n\n");
+
75 ft_printf("███╗░░░███╗░█████╗░██╗░░██╗██╗░██████╗██╗░"
+
76 "░██╗███████╗██╗░░░░░██╗░░░░░\n");
+
77 ft_printf("████╗░████║██╔══██╗╚██╗██╔╝██║██╔════╝██║░"
+
78 "░██║██╔════╝██║░░░░░██║░░░░░\n");
+
79 ft_printf("██╔████╔██║███████║░╚███╔╝░██║╚█████╗░█████"
+
80 "██║█████╗░░██║░░░░░██║░░░░░\n");
+
81 ft_printf("██║╚██╔╝██║██╔══██║░██╔██╗░██║░╚═══██╗██╔══"
+
82 "██║██╔══╝░░██║░░░░░██║░░░░░\n");
+
83 ft_printf("██║░╚═╝░██║██║░░██║██╔╝╚██╗██║██████╔╝██║░░"
+
84 "██║███████╗███████╗███████╗\n");
+
85 ft_printf("╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝╚═════╝░╚═╝░░"
+
86 "╚═╝╚══════╝╚══════╝╚══════╝\n");
+
87 ft_printf("\n");
+
88 ft_printf(" \033[1;34m"
+
89 "Version 0.0.0\033[0m\n");
+
90 ft_printf(" \033[1;36m"
+
91 "By Димас и Ромас\033[0m\n");
+
92 ft_printf("\n");
+
93}

References ft_printf().

diff --git a/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.map b/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.map index 13fd8bde..60a4c18d 100644 --- a/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.map +++ b/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.map @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 b/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 index 644c1f8a..574a24af 100644 --- a/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 +++ b/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.md5 @@ -1 +1 @@ -32542fff44d2894b07e4be4463453d9b \ No newline at end of file +5fccfb142e2f7461fe9ab423f9899808 \ No newline at end of file diff --git a/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.png b/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.png index 79f773c0..55680395 100644 Binary files a/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.png and b/tokens_8h_a4c523064ece03ba20eb609b52253b88e_cgraph.png differ diff --git a/tokens_8h_source.html b/tokens_8h_source.html index 8caf853b..5753c2f1 100644 --- a/tokens_8h_source.html +++ b/tokens_8h_source.html @@ -255,9 +255,9 @@
void initialise(int argc, char **argv)
Definition initialise.c:30
t_ast * manage_pipe(t_token **tokens)
Definition parser.c:87
void execute_command(char **parsed_text, t_token **tokens)
-
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:31
+
char * generate_prompt(t_minishell_data *data)
Definition prompt.c:32
char * check_heredoc(char *line)
Definition heredoc.c:15
-
void print_maxishell(void)
Definition prompt.c:69
+
void print_maxishell(void)
Definition prompt.c:72
int arg_len(t_token *current)
t_token * tokenise(char *str)
Definition tokeniser.c:106
t_ast * new_ast_node(t_token_type type)