[MKISOFS]
[reactos.git] / reactos / sdk / tools / mkisofs / schilytools / mkisofs / match.h
1 /* @(#)match.h 1.15 09/07/10 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-2009 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((char *fn));
56 extern int sort_matches __PR((char *fn, int val));
57 extern void del_sort __PR((void));
58 #endif /* SORTING */
59
60 /*
61 * The following are for compatiblity with the separate routines - the
62 * main code should be changed to call the generic routines directly
63 */
64
65 /* filenames to be excluded */
66 #define matches(FN) gen_matches((FN), EXCLUDE)
67
68 /* ISO9660/Rock Ridge filenames to be hidden */
69 #define i_matches(FN) gen_matches((FN), I_HIDE)
70 #define i_ishidden() gen_ishidden(I_HIDE)
71
72 /* Joliet filenames to be hidden */
73 #define j_matches(FN) gen_matches((FN), J_HIDE)
74 #define j_ishidden() gen_ishidden(J_HIDE)
75
76 /* UDF filenames to be hidden */
77 #define u_matches(FN) gen_matches((FN), U_HIDE)
78 #define u_ishidden() gen_ishidden(U_HIDE)
79
80 /* ISO9660 "hidden" files */
81 #define h_matches(FN) gen_matches((FN), H_HIDE)
82 #define h_ishidden() gen_ishidden(H_HIDE)
83
84 #ifdef APPLE_HYB
85 /* HFS filenames to be hidden */
86 #define hfs_matches(FN) gen_matches((FN), HFS_HIDE)
87 #define hfs_ishidden() gen_ishidden(HFS_HIDE)
88 #endif /* APPLE_HYB */