update stuff
This commit is contained in:
parent
5973022688
commit
544ed8b045
194 changed files with 2060 additions and 1464 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/09 15:00:53 by rparodi #+# #+# */
|
||||
/* Updated: 2024/05/18 18:31:34 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/05/19 14:56:22 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#include "me/vec/vec_str.h"
|
||||
// #include "app/node/handle_program.h"
|
||||
#include "app/node/handle_command.h"
|
||||
#include "me/string/str_clone.h"
|
||||
#include "me/str/str.h"
|
||||
#include "minishell.h"
|
||||
#include <time.h>
|
||||
|
||||
|
|
@ -48,8 +48,6 @@ t_error handle_command(t_node *self, t_utils *shcat, t_i32 *out_exit_code)
|
|||
printf("PAS ENCORE HANDLE FDP asignement!\n");
|
||||
else
|
||||
{
|
||||
printf("arg %s %s\n", self->childs[i].kind_str,
|
||||
node_getstr(&self->childs[i]));
|
||||
if (handle_node_getstr(&self->childs[i], shcat, &tmp))
|
||||
return (vec_str_free(spawn_info.arguments), ERROR);
|
||||
if (vec_str_push(&spawn_info.arguments, str_clone(tmp)))
|
||||
|
|
@ -57,15 +55,11 @@ t_error handle_command(t_node *self, t_utils *shcat, t_i32 *out_exit_code)
|
|||
}
|
||||
i++;
|
||||
}
|
||||
// printf("%zu\n", spawn_info.arguments.len);
|
||||
vec_str_push(&spawn_info.arguments, NULL);
|
||||
// for (i = 0; i < spawn_info.arguments.len; i++)
|
||||
// printf("[%zu]\t%s\n", i, spawn_info.arguments.buffer[i]);
|
||||
// vec_str_push(&spawn_info.arguments, NULL);
|
||||
spawn_info.stdin = inherited();
|
||||
spawn_info.stdout = inherited();
|
||||
spawn_info.stderr = inherited();
|
||||
spawn_info.forked_free = NULL;
|
||||
printf("building envp\n");
|
||||
if (build_envp(shcat->env, &spawn_info.environement))
|
||||
return (vec_str_free(spawn_info.arguments), ERROR);
|
||||
if (spawn_process(spawn_info, &shcat->ret))
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include "app/node/handle_word.h"
|
||||
#include "app/state.h"
|
||||
#include "gmr/symbols.h"
|
||||
#include "me/buffered_str/buf_str.h"
|
||||
#include "me/string/string.h"
|
||||
#include "me/types.h"
|
||||
|
||||
t_error node_get_string(t_node *self, t_utils *shcat, t_str *ret)
|
||||
|
|
@ -30,20 +30,20 @@ t_error node_get_string(t_node *self, t_utils *shcat, t_str *ret)
|
|||
|
||||
t_error handle_concat(t_node *self, t_utils *shcat, t_str *ret)
|
||||
{
|
||||
t_buffer_str out;
|
||||
t_string out;
|
||||
t_usize i;
|
||||
t_str tmp;
|
||||
|
||||
(void)(shcat);
|
||||
if (self == NULL || ret == NULL || self->kind != sym_concatenation)
|
||||
return (ERROR);
|
||||
out = alloc_new_buffer(16);
|
||||
out = string_new(16);
|
||||
i = 0;
|
||||
while (i < self->childs_count)
|
||||
{
|
||||
if (node_get_string(&self->childs[i], shcat, &tmp))
|
||||
return (str_free(out), ERROR);
|
||||
push_str_buffer(&out, tmp);
|
||||
return (string_free(out), ERROR);
|
||||
string_push(&out, tmp);
|
||||
mem_free(tmp);
|
||||
i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@
|
|||
#include "app/node.h"
|
||||
#include "app/state.h"
|
||||
#include "gmr/symbols.h"
|
||||
#include "me/string/str_len.h"
|
||||
#include "me/string/str_substring.h"
|
||||
#include "me/str/str.h"
|
||||
#include "me/str/str.h"
|
||||
#include "me/types.h"
|
||||
|
||||
t_error handle_raw_string(t_node *self, t_utils *shcat, t_str *ret)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#include "app/node/handle_word.h"
|
||||
#include "app/state.h"
|
||||
#include "gmr/symbols.h"
|
||||
#include "me/string/str_clone.h"
|
||||
#include "me/str/str.h"
|
||||
#include "me/types.h"
|
||||
|
||||
t_error handle_word(t_node *self, t_utils *shcat, t_str *ret)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include "me/vec/vec_str.h"
|
||||
#include "app/node/handle_command.h"
|
||||
#include "minishell.h"
|
||||
#include "me/string/str_clone.h"
|
||||
#include "me/str/str.h"
|
||||
|
||||
t_error ft_command_exec(t_node *self, t_i32 *ret);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue