diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-30 18:46:03 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-30 18:46:03 +0200 |
commit | 5eb753276ff9052d3ef93fd2b931a9bfb482590c (patch) | |
tree | e0dcc220be90eff1224b9ee1ee706253cb63ef2f /src | |
parent | Names update (diff) | |
download | 42-minishell-5eb753276ff9052d3ef93fd2b931a9bfb482590c.tar.gz 42-minishell-5eb753276ff9052d3ef93fd2b931a9bfb482590c.tar.bz2 42-minishell-5eb753276ff9052d3ef93fd2b931a9bfb482590c.tar.xz 42-minishell-5eb753276ff9052d3ef93fd2b931a9bfb482590c.tar.zst 42-minishell-5eb753276ff9052d3ef93fd2b931a9bfb482590c.zip |
Renamed quite some stuff
Diffstat (limited to 'src')
-rw-r--r-- | src/b_sqb.c | 18 | ||||
-rw-r--r-- | src/b_sqb_err.c | 8 | ||||
-rw-r--r-- | src/b_sqb_file.c | 34 | ||||
-rw-r--r-- | src/b_sqb_nbr.c | 12 | ||||
-rw-r--r-- | src/b_sqb_str.c | 8 | ||||
-rw-r--r-- | src/d_enum.h | 100 | ||||
-rw-r--r-- | src/e_builtins.c | 12 | ||||
-rw-r--r-- | src/e_externs_pipes.c | 14 | ||||
-rw-r--r-- | src/e_line.c | 2 | ||||
-rw-r--r-- | src/f_alloc.c | 2 | ||||
-rw-r--r-- | src/m_funptr.c | 22 | ||||
-rw-r--r-- | src/m_minishell.c | 2 | ||||
-rw-r--r-- | src/s_init.c | 50 | ||||
-rw-r--r-- | src/s_struct.h | 4 |
14 files changed, 144 insertions, 144 deletions
diff --git a/src/b_sqb.c b/src/b_sqb.c index 2ecf0cd..4ffb001 100644 --- a/src/b_sqb.c +++ b/src/b_sqb.c @@ -27,14 +27,14 @@ static uint8_t b_get_sqb_id(char *argv[], t_msh *msh) uint8_t i; i = 0; - while (i < FT_ID_SQB_COUNT) + while (i < B_ID_SQB_COUNT) { - if (i < FT_ID_SQB_NT && + if (i < B_ID_SQB_NT && ft_strncmp(argv[0], msh->sqb_ref[i], ft_strlen(msh->sqb_ref[i]) + 1) == 0) return (i); - if (i >= FT_ID_SQB_NT && + if (i >= B_ID_SQB_NT && ft_strncmp(argv[1], msh->sqb_ref[i], ft_strlen(msh->sqb_ref[i]) + 1) == 0) @@ -50,7 +50,7 @@ static uint8_t b_eval_sqb(char *argv[], t_msh *msh) uint8_t ret; id = b_get_sqb_id(argv, msh); - if (id == FT_ID_SQB_COUNT) + if (id == B_ID_SQB_COUNT) { ft_dprintf(STDERR_FILENO, "[: %s: unexpected operator\n", argv[0]); return (2); @@ -58,14 +58,14 @@ static uint8_t b_eval_sqb(char *argv[], t_msh *msh) if (b_sqb_err_check(id, argv) != 0) return (2); ret = 0; - if (id < FT_ID_SQB_NT && id != FT_ID_SQB_Z && id != FT_ID_SQB_N) + if (id < B_ID_SQB_NT && id != B_ID_SQB_Z && id != B_ID_SQB_N) ret = b_sqb_file_tests(id, argv); - else if (id == FT_ID_SQB_NT || id == FT_ID_SQB_OT) + else if (id == B_ID_SQB_NT || id == B_ID_SQB_OT) ret = b_sqb_double_file_tests(id, argv); - else if (id == FT_ID_SQB_N || id == FT_ID_SQB_Z || - id == FT_ID_SQB_EQUA || id == FT_ID_SQB_DIFF) + else if (id == B_ID_SQB_N || id == B_ID_SQB_Z || + id == B_ID_SQB_EQUA || id == B_ID_SQB_DIFF) ret = b_sqb_str(id, argv); - else if (id >= FT_ID_SQB_EQ) + else if (id >= B_ID_SQB_EQ) ret = b_sqb_nbr(id, argv); return (ret); } diff --git a/src/b_sqb_err.c b/src/b_sqb_err.c index d8493b5..d530de5 100644 --- a/src/b_sqb_err.c +++ b/src/b_sqb_err.c @@ -80,22 +80,22 @@ uint8_t b_sqb_err_check(uint8_t id, char *argv[]) { const uint64_t argc = u_builtins_get_argc((const char**)argv); - if (id >= FT_ID_SQB_NT) + if (id >= B_ID_SQB_NT) { if (b_expect_arg(argc, argv) != 0) return (1); } - if (id >= FT_ID_SQB_EQ) + if (id >= B_ID_SQB_EQ) { if (b_bad_nbr(argv) != 0) return (1); } - if (id < FT_ID_SQB_NT) + if (id < B_ID_SQB_NT) { if (b_single_op(argc, argv) != 0) return (1); } - else if (id >= FT_ID_SQB_NT) + else if (id >= B_ID_SQB_NT) { if (b_double_op(argc, argv) != 0) return (1); diff --git a/src/b_sqb_file.c b/src/b_sqb_file.c index 6f44ecd..5db439a 100644 --- a/src/b_sqb_file.c +++ b/src/b_sqb_file.c @@ -20,28 +20,28 @@ static t_bool b_file_tests(uint8_t id, const char path[], struct stat sb) { - if (id == FT_ID_SQB_B && S_ISBLK(sb.st_mode) == 1) + if (id == B_ID_SQB_B && S_ISBLK(sb.st_mode) == 1) return (TRUE); - else if (id == FT_ID_SQB_C && S_ISCHR(sb.st_mode) == 1) + else if (id == B_ID_SQB_C && S_ISCHR(sb.st_mode) == 1) return (TRUE); - else if (id == FT_ID_SQB_D && S_ISDIR(sb.st_mode) == 1) + else if (id == B_ID_SQB_D && S_ISDIR(sb.st_mode) == 1) return (TRUE); - else if (id == FT_ID_SQB_F && S_ISREG(sb.st_mode) == 1) + else if (id == B_ID_SQB_F && S_ISREG(sb.st_mode) == 1) return (TRUE); - else if ((id == FT_ID_SQB_H || id == FT_ID_SQB_L_MAJ) + else if ((id == B_ID_SQB_H || id == B_ID_SQB_L_MAJ) && S_ISLNK(sb.st_mode) == 1) return (TRUE); - else if (id == FT_ID_SQB_P && S_ISFIFO(sb.st_mode) == 1) + else if (id == B_ID_SQB_P && S_ISFIFO(sb.st_mode) == 1) return (TRUE); - else if (id == FT_ID_SQB_R && access(path, R_OK) == 0) + else if (id == B_ID_SQB_R && access(path, R_OK) == 0) return (TRUE); - else if (id == FT_ID_SQB_S && sb.st_size > 0) + else if (id == B_ID_SQB_S && sb.st_size > 0) return (TRUE); - else if (id == FT_ID_SQB_W && access(path, W_OK) == 0) + else if (id == B_ID_SQB_W && access(path, W_OK) == 0) return (TRUE); - else if (id == FT_ID_SQB_X && access(path, X_OK) == 0) + else if (id == B_ID_SQB_X && access(path, X_OK) == 0) return (TRUE); - else if (id == FT_ID_SQB_S_MAJ && S_ISSOCK(sb.st_mode) == 0) + else if (id == B_ID_SQB_S_MAJ && S_ISSOCK(sb.st_mode) == 0) return (TRUE); return (FALSE); } @@ -52,9 +52,9 @@ uint8_t b_sqb_file_tests(uint8_t id, char *argv[]) if (access(argv[1], 0) == -1) return (1); - if (id == FT_ID_SQB_E) + if (id == B_ID_SQB_E) return (0); - if (id == FT_ID_SQB_H || id == FT_ID_SQB_L_MAJ) + if (id == B_ID_SQB_H || id == B_ID_SQB_L_MAJ) lstat(argv[1], &sb); else stat(argv[1], &sb); @@ -67,11 +67,11 @@ static t_bool b_sqb_file_comp_tests(uint8_t id, struct stat sb1, struct stat sb2) { - if (id == FT_ID_SQB_NT && - sb1.st_mtim.tv_sec > sb2.st_mtim.tv_sec) + if (id == B_ID_SQB_NT + && sb1.st_mtim.tv_sec > sb2.st_mtim.tv_sec) return (TRUE); - else if (id == FT_ID_SQB_OT && - sb1.st_mtim.tv_sec < sb2.st_mtim.tv_sec) + else if (id == B_ID_SQB_OT + && sb1.st_mtim.tv_sec < sb2.st_mtim.tv_sec) return (TRUE); return (FALSE); } diff --git a/src/b_sqb_nbr.c b/src/b_sqb_nbr.c index e8220cb..0f96e82 100644 --- a/src/b_sqb_nbr.c +++ b/src/b_sqb_nbr.c @@ -17,17 +17,17 @@ static t_bool b_sqb_nbr_tests(uint8_t id, int32_t n1, int32_t n2) { - if (id == FT_ID_SQB_EQ && n1 == n2) + if (id == B_ID_SQB_EQ && n1 == n2) return (TRUE); - else if (id == FT_ID_SQB_NE && n1 != n2) + else if (id == B_ID_SQB_NE && n1 != n2) return (TRUE); - else if (id == FT_ID_SQB_GT && n1 > n2) + else if (id == B_ID_SQB_GT && n1 > n2) return (TRUE); - else if (id == FT_ID_SQB_GE && n1 >= n2) + else if (id == B_ID_SQB_GE && n1 >= n2) return (TRUE); - else if (id == FT_ID_SQB_LT && n1 < n2) + else if (id == B_ID_SQB_LT && n1 < n2) return (TRUE); - else if (id == FT_ID_SQB_LE && n1 <= n2) + else if (id == B_ID_SQB_LE && n1 <= n2) return (TRUE); return (FALSE); } diff --git a/src/b_sqb_str.c b/src/b_sqb_str.c index 0b2693c..fa4381a 100644 --- a/src/b_sqb_str.c +++ b/src/b_sqb_str.c @@ -17,10 +17,10 @@ static t_bool b_sqb_str_comp(uint8_t id, const char s1[], const char s2[]) { - if (id == FT_ID_SQB_EQUA && + if (id == B_ID_SQB_EQUA && ft_strncmp(s1, s2, ft_strlen(s1) + 1) == 0) return (TRUE); - else if (id == FT_ID_SQB_EQUA && + else if (id == B_ID_SQB_EQUA && ft_strncmp(s1, s2, ft_strlen(s1) + 1) != 0) return (TRUE); return (FALSE); @@ -28,14 +28,14 @@ static t_bool b_sqb_str_comp(uint8_t id, const char s1[], const char s2[]) uint8_t b_sqb_str(uint8_t id, char *argv[]) { - if (id == FT_ID_SQB_N) + if (id == B_ID_SQB_N) { if (argv[1][0] != '\0') return (0); else return (1); } - else if (id == FT_ID_SQB_Z) + else if (id == B_ID_SQB_Z) { if (argv[1][0] == '\0') return (0); diff --git a/src/d_enum.h b/src/d_enum.h index 636598d..b05d526 100644 --- a/src/d_enum.h +++ b/src/d_enum.h @@ -10,8 +10,8 @@ /* */ /* ************************************************************************** */ -#ifndef D_ENUM_H -#define D_ENUM_H +#ifndef FT_D_ENUM_H +# define FT_D_ENUM_H /* ** ret vals: @@ -20,69 +20,69 @@ ** 1: alloc err */ -enum +enum e_ret { - FT_RET_FINE, - FT_RET_ALLOC + M_RET_FINE, + M_RET_ALLOC }; -enum +enum e_pipe_ends { - FT_WRITE_END, - FT_READ_END + E_WRITE_END, + E_READ_END }; -typedef enum +typedef enum e_quote_mode { Q_NONE, Q_SINGLE, Q_DOUBLE -} t_quote_mode; +} t_quote_mode; -enum +enum e_builtins_id { - FT_ID_ECHO, - FT_ID_CD, - FT_ID_PWD, - FT_ID_EXPORT, - FT_ID_UNSET, - FT_ID_ENV, - FT_ID_EXIT, - FT_ID_TYPE, - FT_ID_SQB, - FT_ID_ALIAS, - FT_ID_H, - FT_BUILTINS_COUNT + B_ID_ECHO, + B_ID_CD, + B_ID_PWD, + B_ID_EXPORT, + B_ID_UNSET, + B_ID_ENV, + B_ID_EXIT, + B_ID_TYPE, + B_ID_SQB, + B_ID_ALIAS, + B_ID_H, + B_BUILTINS_COUNT }; -enum +enum e_sqb_id { - FT_ID_SQB_B, - FT_ID_SQB_C, - FT_ID_SQB_D, - FT_ID_SQB_E, - FT_ID_SQB_F, - FT_ID_SQB_H, - FT_ID_SQB_N, - FT_ID_SQB_P, - FT_ID_SQB_R, - FT_ID_SQB_S, - FT_ID_SQB_W, - FT_ID_SQB_X, - FT_ID_SQB_Z, - FT_ID_SQB_L_MAJ, - FT_ID_SQB_S_MAJ, - FT_ID_SQB_NT, - FT_ID_SQB_OT, - FT_ID_SQB_EQUA, - FT_ID_SQB_DIFF, - FT_ID_SQB_EQ, - FT_ID_SQB_NE, - FT_ID_SQB_GT, - FT_ID_SQB_GE, - FT_ID_SQB_LT, - FT_ID_SQB_LE, - FT_ID_SQB_COUNT + B_ID_SQB_B, + B_ID_SQB_C, + B_ID_SQB_D, + B_ID_SQB_E, + B_ID_SQB_F, + B_ID_SQB_H, + B_ID_SQB_N, + B_ID_SQB_P, + B_ID_SQB_R, + B_ID_SQB_S, + B_ID_SQB_W, + B_ID_SQB_X, + B_ID_SQB_Z, + B_ID_SQB_L_MAJ, + B_ID_SQB_S_MAJ, + B_ID_SQB_NT, + B_ID_SQB_OT, + B_ID_SQB_EQUA, + B_ID_SQB_DIFF, + B_ID_SQB_EQ, + B_ID_SQB_NE, + B_ID_SQB_GT, + B_ID_SQB_GE, + B_ID_SQB_LT, + B_ID_SQB_LE, + B_ID_SQB_COUNT }; #endif diff --git a/src/e_builtins.c b/src/e_builtins.c index 90f3775..2f6d33f 100644 --- a/src/e_builtins.c +++ b/src/e_builtins.c @@ -52,7 +52,7 @@ static void e_export_env_fork(ptr, msh); e_dup_redirs(ptr, msh); ret = 0; - if (bu_id == FT_ID_H && msh->fd == STDIN_FILENO) + if (bu_id == B_ID_H && msh->fd == STDIN_FILENO) ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); else ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); @@ -76,15 +76,15 @@ static void ; ret = WEXITSTATUS(status); msh->ret = ret; - if (bu_id == FT_ID_CD && ret == 0) + if (bu_id == B_ID_CD && ret == 0) msh->bu_ptr[bu_id](ptr->argv + 1, msh); - else if (bu_id == FT_ID_EXPORT) + else if (bu_id == B_ID_EXPORT) b_export_mute(ptr->argv + 1, msh); - else if (bu_id == FT_ID_UNSET) + else if (bu_id == B_ID_UNSET) msh->bu_ptr[bu_id](ptr->argv + 1, msh); - else if (bu_id == FT_ID_ALIAS) + else if (bu_id == B_ID_ALIAS) b_alias_mute(ptr->argv + 1, msh); - else if (bu_id == FT_ID_EXIT) + else if (bu_id == B_ID_EXIT) { if (msh->fd == STDIN_FILENO) m_dump_hist(msh); diff --git a/src/e_externs_pipes.c b/src/e_externs_pipes.c index 64581e4..86c4f0d 100644 --- a/src/e_externs_pipes.c +++ b/src/e_externs_pipes.c @@ -97,14 +97,14 @@ static void if ((pid = fork()) == 0) { if (i != 0) - dup2(fd[i - 1][FT_WRITE_END], STDIN_FILENO); + dup2(fd[i - 1][E_WRITE_END], STDIN_FILENO); if (i != pipes) - dup2(fd[i][FT_READ_END], STDOUT_FILENO); + dup2(fd[i][E_READ_END], STDOUT_FILENO); j = 0; while (j < pipes) { - close(fd[j][FT_WRITE_END]); - close(fd[j][FT_READ_END]); + close(fd[j][E_WRITE_END]); + close(fd[j][E_READ_END]); j++; } e_pipe_child(fullpath, i, head->com, msh); @@ -115,8 +115,8 @@ static void i = 0; while (i < pipes) { - close(fd[i][FT_WRITE_END]); - close(fd[i][FT_READ_END]); + close(fd[i][E_WRITE_END]); + close(fd[i][E_READ_END]); i++; } waitpid(pid, &status, 0); @@ -152,7 +152,7 @@ void else { if ((bu_id = u_get_builtin_id(rptr->com->bin)) - < FT_BUILTINS_COUNT) + < B_BUILTINS_COUNT) { if ((fullpath[i] = ft_strdup("builtin")) == NULL) f_alloc_and_destroy_msh(msh); diff --git a/src/e_line.c b/src/e_line.c index caf3d75..de1eae2 100644 --- a/src/e_line.c +++ b/src/e_line.c @@ -33,7 +33,7 @@ void { if (msh->com->bin != NULL && (bu_id = u_get_builtin_id(msh->com->bin)) - < FT_BUILTINS_COUNT) + < B_BUILTINS_COUNT) e_builtin(msh->com, bu_id, msh); else if (msh->com->bin != NULL) e_extern(msh->com, msh); diff --git a/src/f_alloc.c b/src/f_alloc.c index c1e0c76..721cf34 100644 --- a/src/f_alloc.c +++ b/src/f_alloc.c @@ -29,7 +29,7 @@ void ft_strlcpy(tmp, msh->argv[0], 255); s_destroy(msh); ft_dprintf(STDERR_FILENO, "%s: %s\n", tmp, strerror(errno)); - exit(FT_RET_ALLOC); + exit(M_RET_ALLOC); } void diff --git a/src/m_funptr.c b/src/m_funptr.c index 4f17827..0bf0d20 100644 --- a/src/m_funptr.c +++ b/src/m_funptr.c @@ -22,15 +22,15 @@ void init_buptr(t_msh *msh) { - msh->bu_ptr[FT_ID_ECHO] = b_echo; - msh->bu_ptr[FT_ID_CD] = b_cd; - msh->bu_ptr[FT_ID_PWD] = b_pwd; - msh->bu_ptr[FT_ID_EXPORT] = b_export; - msh->bu_ptr[FT_ID_UNSET] = b_unset; - msh->bu_ptr[FT_ID_ENV] = b_env; - msh->bu_ptr[FT_ID_EXIT] = b_exit; - msh->bu_ptr[FT_ID_TYPE] = b_type; - msh->bu_ptr[FT_ID_SQB] = b_sqb; - msh->bu_ptr[FT_ID_ALIAS] = b_alias; - msh->bu_ptr[FT_ID_H] = b_h; + msh->bu_ptr[B_ID_ECHO] = b_echo; + msh->bu_ptr[B_ID_CD] = b_cd; + msh->bu_ptr[B_ID_PWD] = b_pwd; + msh->bu_ptr[B_ID_EXPORT] = b_export; + msh->bu_ptr[B_ID_UNSET] = b_unset; + msh->bu_ptr[B_ID_ENV] = b_env; + msh->bu_ptr[B_ID_EXIT] = b_exit; + msh->bu_ptr[B_ID_TYPE] = b_type; + msh->bu_ptr[B_ID_SQB] = b_sqb; + msh->bu_ptr[B_ID_ALIAS] = b_alias; + msh->bu_ptr[B_ID_H] = b_h; } diff --git a/src/m_minishell.c b/src/m_minishell.c index aac3af7..938779c 100644 --- a/src/m_minishell.c +++ b/src/m_minishell.c @@ -31,7 +31,7 @@ int main(int argc, char *const argv[], char *const envp[]) if ((msh = init_msh(argc, argv, envp)) == NULL) { ft_dprintf(STDERR_FILENO, "%s\n", strerror(errno)); - return (FT_RET_ALLOC); + return (M_RET_ALLOC); } ret = m_argv(argc, argv, msh); s_destroy(msh); diff --git a/src/s_init.c b/src/s_init.c index aff245f..1ce73dd 100644 --- a/src/s_init.c +++ b/src/s_init.c @@ -29,40 +29,40 @@ static void s_init_sqb_ref_one(t_msh *msh) { - ft_memcpy(msh->sqb_ref[FT_ID_SQB_B], B_SQB_B, ft_strlen(B_SQB_B) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_C], B_SQB_C, ft_strlen(B_SQB_C) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_D], B_SQB_D, ft_strlen(B_SQB_D) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_E], B_SQB_E, ft_strlen(B_SQB_E) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_F], B_SQB_F, ft_strlen(B_SQB_F) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_H], B_SQB_H, ft_strlen(B_SQB_H) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_N], B_SQB_N, ft_strlen(B_SQB_N) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_P], B_SQB_P, ft_strlen(B_SQB_P) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_R], B_SQB_R, ft_strlen(B_SQB_R) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_S], B_SQB_S, ft_strlen(B_SQB_S) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_W], B_SQB_W, ft_strlen(B_SQB_W) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_X], B_SQB_X, ft_strlen(B_SQB_X) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_Z], B_SQB_Z, ft_strlen(B_SQB_Z) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_L_MAJ], + ft_memcpy(msh->sqb_ref[B_ID_SQB_B], B_SQB_B, ft_strlen(B_SQB_B) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_C], B_SQB_C, ft_strlen(B_SQB_C) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_D], B_SQB_D, ft_strlen(B_SQB_D) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_E], B_SQB_E, ft_strlen(B_SQB_E) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_F], B_SQB_F, ft_strlen(B_SQB_F) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_H], B_SQB_H, ft_strlen(B_SQB_H) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_N], B_SQB_N, ft_strlen(B_SQB_N) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_P], B_SQB_P, ft_strlen(B_SQB_P) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_R], B_SQB_R, ft_strlen(B_SQB_R) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_S], B_SQB_S, ft_strlen(B_SQB_S) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_W], B_SQB_W, ft_strlen(B_SQB_W) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_X], B_SQB_X, ft_strlen(B_SQB_X) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_Z], B_SQB_Z, ft_strlen(B_SQB_Z) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_L_MAJ], B_SQB_L_MAJ, ft_strlen(B_SQB_L_MAJ) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_S_MAJ], + ft_memcpy(msh->sqb_ref[B_ID_SQB_S_MAJ], B_SQB_S_MAJ, ft_strlen(B_SQB_S_MAJ) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_NT], B_SQB_NT, ft_strlen(B_SQB_NT) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_OT], B_SQB_OT, ft_strlen(B_SQB_OT) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_EQUA], + ft_memcpy(msh->sqb_ref[B_ID_SQB_NT], B_SQB_NT, ft_strlen(B_SQB_NT) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_OT], B_SQB_OT, ft_strlen(B_SQB_OT) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_EQUA], B_SQB_EQUA, ft_strlen(B_SQB_EQUA) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_DIFF], + ft_memcpy(msh->sqb_ref[B_ID_SQB_DIFF], B_SQB_DIFF, ft_strlen(B_SQB_DIFF) + 1); } static void s_init_sqb_ref_two(t_msh *msh) { - ft_memcpy(msh->sqb_ref[FT_ID_SQB_EQ], B_SQB_EQ, ft_strlen(B_SQB_EQ) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_NE], B_SQB_NE, ft_strlen(B_SQB_NE) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_GT], B_SQB_GT, ft_strlen(B_SQB_GT) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_GE], B_SQB_GE, ft_strlen(B_SQB_GE) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_LT], B_SQB_LT, ft_strlen(B_SQB_LT) + 1); - ft_memcpy(msh->sqb_ref[FT_ID_SQB_LE], B_SQB_LE, ft_strlen(B_SQB_LE) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_EQ], B_SQB_EQ, ft_strlen(B_SQB_EQ) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_NE], B_SQB_NE, ft_strlen(B_SQB_NE) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_GT], B_SQB_GT, ft_strlen(B_SQB_GT) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_GE], B_SQB_GE, ft_strlen(B_SQB_GE) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_LT], B_SQB_LT, ft_strlen(B_SQB_LT) + 1); + ft_memcpy(msh->sqb_ref[B_ID_SQB_LE], B_SQB_LE, ft_strlen(B_SQB_LE) + 1); } static char diff --git a/src/s_struct.h b/src/s_struct.h index 37d6726..41b3360 100644 --- a/src/s_struct.h +++ b/src/s_struct.h @@ -96,10 +96,10 @@ typedef struct s_msh char *curr_hist; char ps[4][255]; char env_fork_tmp[128][4096]; - char sqb_ref[FT_ID_SQB_COUNT][4]; + char sqb_ref[B_ID_SQB_COUNT][4]; char *cwd; int32_t fd; - uint8_t (*bu_ptr[FT_BUILTINS_COUNT])(char **, struct s_msh*); + uint8_t (*bu_ptr[B_BUILTINS_COUNT])(char **, struct s_msh*); uint8_t ret; } t_msh; |