Update: normed the shitty thing in exec
This commit is contained in:
parent
658d5bd243
commit
fa5990b00c
3 changed files with 75 additions and 38 deletions
50
exec/include/exec/_builtins.h
Normal file
50
exec/include/exec/_builtins.h
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* _builtins.h :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/08/10 18:43:56 by maiboyer #+# #+# */
|
||||||
|
/* Updated: 2024/08/30 19:12:45 by maiboyer ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#ifndef _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"
|
||||||
|
|
||||||
|
typedef struct s_builtin_spawn_info t_builtin_spawn_info;
|
||||||
|
|
||||||
|
struct s_builtin_spawn_info
|
||||||
|
{
|
||||||
|
t_vec_str args;
|
||||||
|
t_fd *stdin;
|
||||||
|
t_fd *stdout;
|
||||||
|
t_fd *stderr;
|
||||||
|
};
|
||||||
|
|
||||||
|
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 */
|
||||||
21
exec/include/exec/_builtins_func.h
Normal file
21
exec/include/exec/_builtins_func.h
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
/* ************************************************************************** */
|
||||||
|
/* */
|
||||||
|
/* ::: :::::::: */
|
||||||
|
/* _builtins_func.h :+: :+: :+: */
|
||||||
|
/* +:+ +:+ +:+ */
|
||||||
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
|
/* +#+#+#+#+#+ +#+ */
|
||||||
|
/* Created: 2024/08/30 19:05:24 by maiboyer #+# #+# */
|
||||||
|
/* Updated: 2024/08/30 19:13:17 by maiboyer ### ########.fr */
|
||||||
|
/* */
|
||||||
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
#ifndef _BUILTINS_FUNC_H
|
||||||
|
# define _BUILTINS_FUNC_H
|
||||||
|
|
||||||
|
# include "me/types.h"
|
||||||
|
|
||||||
|
typedef t_error ((*t_builtin_func)(t_state *state, \
|
||||||
|
t_builtin_spawn_info info, t_i32 *exit_code));
|
||||||
|
|
||||||
|
#endif /* _BUILTIN_FUNC_H */
|
||||||
|
|
@ -5,49 +5,15 @@
|
||||||
/* +:+ +:+ +:+ */
|
/* +:+ +:+ +:+ */
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/08/10 18:43:56 by maiboyer #+# #+# */
|
/* Created: 2024/08/30 19:12:38 by maiboyer #+# #+# */
|
||||||
/* Updated: 2024/08/30 18:22:17 by rparodi ### ########.fr */
|
/* Updated: 2024/08/30 19:13:26 by maiboyer ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#ifndef BUILTINS_H
|
#ifndef BUILTINS_H
|
||||||
# define BUILTINS_H
|
# define BUILTINS_H
|
||||||
|
|
||||||
# include "app/env.h"
|
# include "exec/_builtins.h"
|
||||||
# include "app/state.h"
|
# include "exec/_builtins_func.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;
|
|
||||||
|
|
||||||
struct s_builtin_spawn_info
|
|
||||||
{
|
|
||||||
t_vec_str args;
|
|
||||||
t_fd *stdin;
|
|
||||||
t_fd *stdout;
|
|
||||||
t_fd *stderr;
|
|
||||||
};
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
#endif /* BUILTINS_H */
|
#endif /* BUILTINS_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue