diff options
Diffstat (limited to 'src/b_sqb_file.c')
-rw-r--r-- | src/b_sqb_file.c | 34 |
1 files changed, 17 insertions, 17 deletions
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); } |