feat: redirection rules

This commit is contained in:
Gu://em_ 2026-01-24 15:34:10 +01:00
parent 18c1da6bdf
commit 32f56beb6b
8 changed files with 218 additions and 25 deletions

35
src/utils/ast/ast_word.h Normal file
View file

@ -0,0 +1,35 @@
#ifndef AST_WORD_H
#define AST_WORD_H
#include <stdbool.h>
#include "ast_base.h"
struct ast_word
{
enum ast_type type;
char *word;
};
/**
* Checks if the given AST node is a command.
*/
bool ast_is_word(struct ast *node);
/**
* Retrieves the command data from the given AST node.
* Assumes that the node is of type AST_CMD.
*/
struct ast_word *ast_get_word(struct ast *node);
/**
* Creates a new AST node representing a command.
*/
struct ast *ast_create_word(char* word);
/*
* @brief: frees the given ast_command and sets the pointer to NULL.
*/
void ast_free_word(struct ast_word *ast_node);
#endif /* ! AST_WORD_H */