fix(ast): rename *_cmd() functions to *_command()

This commit is contained in:
Matteo Flebus 2026-01-15 17:41:15 +01:00
parent 30df2993ee
commit f0e3c2f41b
3 changed files with 21 additions and 19 deletions

View file

@ -6,30 +6,30 @@
#include "utils/lists/lists.h"
#include "utils/ast/ast_base.h"
struct ast_cmd
struct ast_command
{
struct list *cmd; // A list of words (char*)
struct list *command; // A list of words (char*)
};
/**
* Checks if the given AST node is a command.
*/
bool ast_is_cmd(struct ast *node);
bool ast_is_command(struct ast *node);
/**
* Retrieves the command data from the given AST node.
* Assumes that the node is of type AST_CMD.
*/
struct ast_cmd *ast_get_cmd(struct ast *node);
struct ast_command *ast_get_command(struct ast *node);
/**
* Creates a new AST node representing a command.
*/
struct ast *ast_create_cmd(struct list *cmd);
struct ast *ast_create_command(struct list *command);
/*
* @brief: frees the given ast_cmd and sets the pointer to NULL.
* @brief: frees the given ast_command and sets the pointer to NULL.
*/
void ast_free_cmd(struct ast_cmd **cmd_data);
void ast_free_command(struct ast_command **command_data);
#endif /* ! AST_COMMAND_H */