Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / genisoimage / match.h
1 /*
2  * This file has been modified for the cdrkit suite.
3  *
4  * The behaviour and appearence of the program code below can differ to a major
5  * extent from the version distributed by the original author(s).
6  *
7  * For details, see Changelog file distributed with the cdrkit package. If you
8  * received this file from another source then ask the distributing person for
9  * a log of modifications.
10  *
11  */
12
13 /* @(#)match.h  1.9 04/05/23 joerg */
14 /*
15  * 27th March 1996. Added by Jan-Piet Mens for matching regular expressions
16  *                  in paths.
17  *
18  */
19
20 #include "fnmatch.h"
21
22 #ifdef  SORTING
23 #include <limits.h>
24 #define NOT_SORTED INT_MIN
25
26 #ifdef  MAX                             /* May be defined in param.h */
27 #undef  MAX
28 #endif
29 #define MAX(A, B)       (A) > (B) ? (A) : (B)
30 #endif
31
32 #define EXCLUDE         0               /* Exclude file completely */
33 #define I_HIDE          1               /* ISO9660/Rock Ridge hide */
34 #define J_HIDE          2               /* Joliet hide */
35 #define H_HIDE          3               /* ISO9660 hidden bit set */
36
37 #ifdef  APPLE_HYB
38 #define HFS_HIDE        4               /* HFS hide */
39 #define MAX_MAT         5
40 #else
41 #define MAX_MAT         4
42 #endif /* APPLE_HYB */
43
44 extern int      gen_add_match(char *fn, int n);
45 extern int      gen_matches(char *fn, int n);
46 extern void     gen_add_list(char *fn, int n);
47 extern int      gen_ishidden(int n);
48 extern void     gen_del_match(int n);
49
50 #ifdef SORTING
51 extern int      add_sort_match(char *fn, int val);
52 extern void     add_sort_list(char *fn);
53 extern int      sort_matches(char *fn, int val);
54 extern void     del_sort(void);
55 #endif /* SORTING */
56
57 /*
58  * The following are for compatiblity with the separate routines - the
59  * main code should be changed to call the generic routines directly
60  */
61
62 /* filenames to be excluded */
63 #define add_match(FN)   gen_add_match((FN), EXCLUDE)
64 #define add_list(FN)    gen_add_list((FN), EXCLUDE)
65 #define matches(FN)     gen_matches((FN), EXCLUDE)
66
67 /* ISO9660/Rock Ridge filenames to be hidden */
68 #define i_add_match(FN) gen_add_match((FN), I_HIDE)
69 #define i_add_list(FN)  gen_add_list((FN), I_HIDE)
70 #define i_matches(FN)   gen_matches((FN), I_HIDE)
71 #define i_ishidden()    gen_ishidden(I_HIDE)
72
73 /* Joliet filenames to be hidden */
74 #define j_add_match(FN) gen_add_match((FN), J_HIDE)
75 #define j_add_list(FN)  gen_add_list((FN), J_HIDE)
76 #define j_matches(FN)   gen_matches((FN), J_HIDE)
77 #define j_ishidden()    gen_ishidden(J_HIDE)
78
79 /* ISO9660 "hidden" files */
80 #define h_add_match(FN) gen_add_match((FN), H_HIDE)
81 #define h_add_list(FN)  gen_add_list((FN), H_HIDE)
82 #define h_matches(FN)   gen_matches((FN), H_HIDE)
83 #define h_ishidden()    gen_ishidden(H_HIDE)
84
85 #ifdef APPLE_HYB
86 /* HFS filenames to be hidden */
87 #define hfs_add_match(FN) gen_add_match((FN), HFS_HIDE)
88 #define hfs_add_list(FN)  gen_add_list((FN), HFS_HIDE)
89 #define hfs_matches(FN)   gen_matches((FN), HFS_HIDE)
90 #define hfs_ishidden()    gen_ishidden(HFS_HIDE)
91 #endif /* APPLE_HYB */