Normed the includes of exec
This commit is contained in:
parent
4e56302770
commit
241a382c43
4 changed files with 136 additions and 101 deletions
|
|
@ -1,17 +1,17 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* arith.h :+: :+: :+: */
|
||||
/* _run_arith.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/27 21:13:15 by rparodi #+# #+# */
|
||||
/* Updated: 2024/08/01 06:21:37 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/08/14 16:38:32 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef ARITH_H
|
||||
# define ARITH_H
|
||||
#ifndef _RUN_ARITH_H
|
||||
# define _RUN_ARITH_H
|
||||
|
||||
# include "app/state.h"
|
||||
# include "ast/ast.h"
|
||||
|
|
|
|||
|
|
@ -5,34 +5,34 @@
|
|||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/02 14:41:48 by rparodi #+# #+# */
|
||||
/* Updated: 2024/08/13 16:52:12 by maiboyer ### ########.fr */
|
||||
/* Created: 2024/08/14 17:57:57 by rparodi #+# #+# */
|
||||
/* Updated: 2024/08/14 18:04:01 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef _RUN_AST_H
|
||||
#define _RUN_AST_H
|
||||
# define _RUN_AST_H
|
||||
|
||||
#include "app/state.h"
|
||||
#include "ast/ast.h"
|
||||
#include "me/fs/fs.h"
|
||||
#include "me/os/os.h"
|
||||
#include "me/types.h"
|
||||
#include "me/vec/vec_estr.h"
|
||||
# include "app/state.h"
|
||||
# include "ast/ast.h"
|
||||
# include "me/fs/fs.h"
|
||||
# include "me/os/os.h"
|
||||
# include "me/types.h"
|
||||
# include "me/vec/vec_estr.h"
|
||||
|
||||
#define NOT_DONE \
|
||||
{ \
|
||||
printf("function `%s` isn't done !\n", __func__); \
|
||||
return (ERROR); \
|
||||
}
|
||||
/*# define NOT_DONE \*/
|
||||
/* { \*/
|
||||
/* printf("function `%s` isn't done !\n", __func__); \*/
|
||||
/* return (ERROR); \*/
|
||||
/* }*/
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma GCC diagnostic ignored "-Wempty-body"
|
||||
#pragma clang diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||
/*# pragma GCC diagnostic ignored "-Wunused-parameter"*/
|
||||
/*# pragma GCC diagnostic ignored "-Wunused-variable"*/
|
||||
/*# pragma GCC diagnostic ignored "-Wunknown-pragmas"*/
|
||||
/*# pragma GCC diagnostic ignored "-Wempty-body"*/
|
||||
/*# pragma clang diagnostic ignored "-Wunknown-pragmas"*/
|
||||
/*# pragma clang diagnostic ignored "-Wunused-parameter"*/
|
||||
/*# pragma clang diagnostic ignored "-Wunused-variable"*/
|
||||
|
||||
typedef struct s_expansion_result t_expansion_result;
|
||||
|
||||
|
|
@ -96,33 +96,61 @@ struct s_subshell_result
|
|||
int exit;
|
||||
};
|
||||
|
||||
t_error run_arithmetic_expansion(t_ast_arithmetic_expansion *arithmetic_expansion, t_state *state, t_i64 *out);
|
||||
t_error run_command(t_ast_command *command, t_state *state, t_cmd_pipe cmd_pipe, t_command_result *out);
|
||||
t_error run_expansion(t_ast_expansion *self, t_state *state, t_expansion_result *out);
|
||||
t_error run_word(t_ast_word *word, t_state *state, t_word_result *out);
|
||||
t_error run_program(t_ast_program *program, t_state *state, t_program_result *out);
|
||||
t_error run_pipeline(t_ast_pipeline *pipeline, t_state *state, t_pipeline_result *out);
|
||||
t_error run_list(t_ast_list *list, t_state *state, t_list_result *out);
|
||||
t_error run_subshell(t_ast_subshell *subshell, t_state *state, t_subshell_result *out);
|
||||
t_error run_arithmetic_expansion(\
|
||||
t_ast_arithmetic_expansion *arithmetic_expansion, t_state *state, t_i64 *out);
|
||||
t_error run_command(\
|
||||
t_ast_command *command, t_state *state, t_cmd_pipe cmd_pipe, \
|
||||
t_command_result *out);
|
||||
t_error run_expansion(\
|
||||
t_ast_expansion *self, t_state *state, t_expansion_result *out);
|
||||
t_error run_word(\
|
||||
t_ast_word *word, t_state *state, t_word_result *out);
|
||||
t_error run_program(\
|
||||
t_ast_program *program, t_state *state, t_program_result *out);
|
||||
t_error run_pipeline(\
|
||||
t_ast_pipeline *pipeline, t_state *state, t_pipeline_result *out);
|
||||
t_error run_list(\
|
||||
t_ast_list *list, t_state *state, t_list_result *out);
|
||||
t_error run_subshell(\
|
||||
t_ast_subshell *subshell, t_state *state, t_subshell_result *out);
|
||||
|
||||
t_error run_case_(t_ast_case *case_, t_state *state, void *out);
|
||||
t_error run_case_item(t_ast_case_item *case_item, t_state *state, void *out);
|
||||
t_error run_command_substitution(t_ast_command_substitution *command_substitution, t_state *state, void *out);
|
||||
t_error run_compound_statement(t_ast_compound_statement *compound_statement, t_state *state, void *out);
|
||||
t_error run_elif(t_ast_elif *elif, t_state *state, void *out);
|
||||
t_error run_else_(t_ast_else *else_, t_state *state, void *out);
|
||||
t_error run_extglob(t_ast_extglob *extglob, t_state *state, void *out);
|
||||
t_error run_for_(t_ast_for *for_, t_state *state, void *out);
|
||||
t_error run_function_definition(t_ast_function_definition *function_definition, t_state *state, void *out);
|
||||
t_error run_if_(t_ast_if *if_, t_state *state, void *out);
|
||||
t_error run_regex(t_ast_regex *regex, t_state *state, void *out);
|
||||
t_error run_until(t_ast_until *until, t_state *state, void *out);
|
||||
t_error run_variable_assignment(t_ast_variable_assignment *variable_assignment, t_state *state, bool is_temporary, void *out);
|
||||
t_error run_while_(t_ast_while *while_, t_state *state, void *out);
|
||||
t_error run_case_(\
|
||||
t_ast_case *case_, t_state *state, void *out);
|
||||
t_error run_case_item(\
|
||||
t_ast_case_item *case_item, t_state *state, void *out);
|
||||
t_error run_command_substitution(\
|
||||
t_ast_command_substitution *command_substitution, t_state *state, void *out);
|
||||
t_error run_compound_statement(\
|
||||
t_ast_compound_statement *compound_statement, t_state *state, void *out);
|
||||
t_error run_elif(\
|
||||
t_ast_elif *elif, t_state *state, void *out);
|
||||
t_error run_else_(\
|
||||
t_ast_else *else_, t_state *state, void *out);
|
||||
t_error run_extglob(\
|
||||
t_ast_extglob *extglob, t_state *state, void *out);
|
||||
t_error run_for_(\
|
||||
t_ast_for *for_, t_state *state, void *out);
|
||||
t_error run_function_definition(\
|
||||
t_ast_function_definition *function_definition, t_state *state, void *out);
|
||||
t_error run_if_(\
|
||||
t_ast_if *if_, t_state *state, void *out);
|
||||
t_error run_regex(\
|
||||
t_ast_regex *regex, t_state *state, void *out);
|
||||
t_error run_until(\
|
||||
t_ast_until *until, t_state *state, void *out);
|
||||
t_error run_variable_assignment(\
|
||||
t_ast_variable_assignment *variable_assignment, t_state *state, \
|
||||
bool is_temporary, void *out);
|
||||
t_error run_while_(\
|
||||
t_ast_while *while_, t_state *state, void *out);
|
||||
|
||||
t_error run_heredoc_redirection(t_ast_heredoc_redirection *heredoc_redirection, t_state *state, void *out);
|
||||
t_error run_file_redirection(t_ast_file_redirection *file_redirection, t_state *state, void *out);
|
||||
t_error run_empty(t_ast_empty *empty, t_state *state, void *out);
|
||||
t_error run_raw_string(t_ast_raw_string *raw_string, t_state *state, void *out);
|
||||
t_error run_heredoc_redirection(\
|
||||
t_ast_heredoc_redirection *heredoc_redirection, t_state *state, void *out);
|
||||
t_error run_file_redirection(\
|
||||
t_ast_file_redirection *file_redirection, t_state *state, void *out);
|
||||
t_error run_empty(\
|
||||
t_ast_empty *empty, t_state *state, void *out);
|
||||
t_error run_raw_string(\
|
||||
t_ast_raw_string *raw_string, t_state *state, void *out);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,19 +6,19 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/10 18:43:56 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/08/11 12:01:18 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/08/14 16:42:10 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef BUILTINS_H
|
||||
#define BUILTINS_H
|
||||
# define BUILTINS_H
|
||||
|
||||
#include "app/env.h"
|
||||
#include "app/state.h"
|
||||
#include "exec/_run_ast.h"
|
||||
#include "me/os/os.h"
|
||||
#include "me/types.h"
|
||||
#include "me/vec/vec_str.h"
|
||||
# include "app/env.h"
|
||||
# include "app/state.h"
|
||||
# include "exec/_run_ast.h"
|
||||
# include "me/os/os.h"
|
||||
# include "me/types.h"
|
||||
# include "me/vec/vec_str.h"
|
||||
|
||||
typedef struct s_builtin_spawn_info t_builtin_spawn_info;
|
||||
|
||||
|
|
@ -30,15 +30,24 @@ struct s_builtin_spawn_info
|
|||
t_fd *stderr;
|
||||
};
|
||||
|
||||
typedef t_error (*t_builtin_func)(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
typedef t_error (*t_builtin_func)(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
|
||||
t_error builtin_cd____(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_echo__(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_env___(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_exit__(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_export(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_pwd___(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_unset_(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_debug_(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_cd____(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_echo__(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_env___(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_exit__(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_export(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_pwd___(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_unset_(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
t_error builtin_debug_(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code);
|
||||
|
||||
#endif /* BUILTINS_H */
|
||||
|
|
|
|||
|
|
@ -6,15 +6,13 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/07/11 17:23:24 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/07/11 17:38:05 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/08/14 16:36:15 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef RUN_H
|
||||
#define RUN_H
|
||||
|
||||
#include "me/types.h"
|
||||
|
||||
# define RUN_H
|
||||
|
||||
# include "me/types.h"
|
||||
|
||||
#endif /* RUN_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue