cmdlist debug: tree debug printing (STUB)

This commit is contained in:
Khaïs COLIN 2025-03-18 12:36:19 +01:00
parent 131ba36d93
commit 47a61699ab
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
2 changed files with 21 additions and 4 deletions

View file

@ -6,7 +6,7 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */ /* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/03/11 15:18:02 by khais #+# #+# */ /* Created: 2025/03/11 15:18:02 by khais #+# #+# */
/* Updated: 2025/03/18 12:32:12 by khais ### ########.fr */ /* Updated: 2025/03/18 12:37:51 by khais ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -46,7 +46,6 @@ void cmdgroup_debug(t_cmdgroup *cmd, t_buffer **indent, bool is_last)
*indent = ft_buffer_push_buf(*indent, VERTICAL, TREEDRAW_LENGTH); *indent = ft_buffer_push_buf(*indent, VERTICAL, TREEDRAW_LENGTH);
} }
ft_printf("%s\n", "t_cmdgroup"); ft_printf("%s\n", "t_cmdgroup");
(void)cmd; cmdlist_debug(&cmd->item, indent, false);
/* cmdlist_debug(cmd->item, indent, false); */
/* redirection_list_debug(cmd->redirections, indent, true); */ /* redirection_list_debug(cmd->redirections, indent, true); */
} }

View file

@ -6,11 +6,12 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */ /* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/24 17:49:46 by khais #+# #+# */ /* Created: 2025/02/24 17:49:46 by khais #+# #+# */
/* Updated: 2025/03/18 15:02:38 by khais ### ########.fr */ /* Updated: 2025/03/18 15:08:30 by khais ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "cmdlist.h" #include "cmdlist.h"
#include "../../treedrawing.h"
#include "cmdlist_item.h" #include "cmdlist_item.h"
#include "cmdlist_builder.h" #include "cmdlist_builder.h"
#include "cmdlist_item_type.h" #include "cmdlist_item_type.h"
@ -116,3 +117,20 @@ void cmdlist_destroy(t_cmdlist *cmd)
free(cmd->operators); free(cmd->operators);
free(cmd); free(cmd);
} }
void cmdlist_debug(t_cmdlist *cmd, t_buffer **indent, bool is_last)
{
ft_printf("%s", (*indent)->buffer);
if (is_last)
{
ft_printf("%s", CORNER);
*indent = ft_buffer_push_buf(*indent, SPACE, TREEDRAW_LENGTH);
}
else
{
ft_printf("%s", CROSS);
*indent = ft_buffer_push_buf(*indent, VERTICAL, TREEDRAW_LENGTH);
}
ft_printf("%s\n", "t_cmdlist");
(void)cmd; // TODO
}