fix: now compiles and works for simple commands + clang format

This commit is contained in:
matteo 2026-01-17 19:11:55 +01:00 committed by william.valenduc
parent e9b6d39760
commit c299882586
23 changed files with 168 additions and 150 deletions

View file

@ -2,28 +2,33 @@
#define AST_REDIR_H
#include <stdbool.h>
#include "utils/ast/ast_base.h"
enum ast_redir_type {
AST_REDIR_TYPE_LESS, // <
AST_REDIR_TYPE_GREAT, // >
AST_REDIR_TYPE_DLESS, // <<
AST_REDIR_TYPE_DGREAT, // >>
AST_REDIR_TYPE_LESSAND, // <&
AST_REDIR_TYPE_GREATAND, // >&
AST_REDIR_TYPE_CLOBBER // >|
enum ast_redir_type
{
AST_REDIR_TYPE_LESS, // <
AST_REDIR_TYPE_GREAT, // >
AST_REDIR_TYPE_DLESS, // <<
AST_REDIR_TYPE_DGREAT, // >>
AST_REDIR_TYPE_LESSAND, // <&
AST_REDIR_TYPE_GREATAND, // >&
AST_REDIR_TYPE_CLOBBER // >|
};
struct ast_redir {
struct ast_redir
{
struct ast *child;
char *filename;
int io_number; // The FD being redirected (default -1 if not specified, implies 0 or 1 based on type)
int io_number; // The FD being redirected (default -1 if not specified,
// implies 0 or 1 based on type)
enum ast_redir_type type;
};
bool ast_is_redir(struct ast *node);
struct ast_redir *ast_get_redir(struct ast *node);
struct ast *ast_create_redir(struct ast *child, char *filename, int io_number, enum ast_redir_type type);
struct ast *ast_create_redir(struct ast *child, char *filename, int io_number,
enum ast_redir_type type);
void ast_free_redir(struct ast_redir *redir);
#endif /* ! AST_REDIR_H */