1 /* @(#)match.h 1.18 16/12/12 joerg */ 2 /* 3 * 27th March 1996. Added by Jan-Piet Mens for matching regular expressions 4 * in paths. 5 * 6 * Conversions to make the code more portable May 2000 .. March 2004 7 * Copyright (c) 2000-2016 J. Schilling 8 */ 9 10 #include <schily/fnmatch.h> 11 12 #ifdef SORTING 13 #include <schily/limits.h> 14 #define NOT_SORTED INT_MIN 15 16 #ifdef MAX /* May be defined in param.h */ 17 #undef MAX 18 #endif 19 #define MAX(A, B) (A) > (B) ? (A) : (B) 20 #endif 21 22 #define EXCLUDE 0 /* Exclude file completely */ 23 #define I_HIDE 1 /* ISO9660/Rock Ridge hide */ 24 #define J_HIDE 2 /* Joliet hide */ 25 #define U_HIDE 3 /* UDF hide */ 26 #define H_HIDE 4 /* ISO9660 hidden bit set */ 27 28 #ifdef APPLE_HYB 29 #define HFS_HIDE 5 /* HFS hide */ 30 #define MAX_MAT 6 31 #else 32 #define MAX_MAT 5 33 #endif /* APPLE_HYB */ 34 35 extern int gen_add_match __PR((char *fn, int n)); 36 extern int add_match __PR((char *fn)); 37 extern int i_add_match __PR((char *fn)); 38 extern int h_add_match __PR((char *fn)); 39 extern int j_add_match __PR((char *fn)); 40 extern int u_add_match __PR((char *fn)); 41 extern int hfs_add_match __PR((char *fn)); 42 extern int gen_matches __PR((char *fn, int n)); 43 extern void gen_add_list __PR((char *fn, int n)); 44 extern int add_list __PR((char *fn)); 45 extern int i_add_list __PR((char *fn)); 46 extern int h_add_list __PR((char *fn)); 47 extern int j_add_list __PR((char *fn)); 48 extern int u_add_list __PR((char *fn)); 49 extern int hfs_add_list __PR((char *fn)); 50 extern int gen_ishidden __PR((int n)); 51 extern void gen_del_match __PR((int n)); 52 53 #ifdef SORTING 54 extern int add_sort_match __PR((char *fn, int val)); 55 extern int add_sort_list __PR((const char *fn, void *valp, 56 int *pac, char *const **pav, 57 const char *opt)); 58 extern int sort_matches __PR((char *fn, int val)); 59 extern void del_sort __PR((void)); 60 #endif /* SORTING */ 61 62 extern int match_igncase; 63 64 /* 65 * The following are for compatiblity with the separate routines - the 66 * main code should be changed to call the generic routines directly 67 */ 68 69 /* filenames to be excluded */ 70 #define matches(FN) gen_matches((FN), EXCLUDE) 71 72 /* ISO9660/Rock Ridge filenames to be hidden */ 73 #define i_matches(FN) gen_matches((FN), I_HIDE) 74 #define i_ishidden() gen_ishidden(I_HIDE) 75 76 /* Joliet filenames to be hidden */ 77 #define j_matches(FN) gen_matches((FN), J_HIDE) 78 #define j_ishidden() gen_ishidden(J_HIDE) 79 80 /* UDF filenames to be hidden */ 81 #define u_matches(FN) gen_matches((FN), U_HIDE) 82 #define u_ishidden() gen_ishidden(U_HIDE) 83 84 /* ISO9660 "hidden" files */ 85 #define h_matches(FN) gen_matches((FN), H_HIDE) 86 #define h_ishidden() gen_ishidden(H_HIDE) 87 88 #ifdef APPLE_HYB 89 /* HFS filenames to be hidden */ 90 #define hfs_matches(FN) gen_matches((FN), HFS_HIDE) 91 #define hfs_ishidden() gen_ishidden(HFS_HIDE) 92 #endif /* APPLE_HYB */ 93