fix: now compiles and works for simple commands + clang format
This commit is contained in:
parent
6099bbb9e3
commit
352c122549
23 changed files with 168 additions and 150 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue