5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
12 #ifndef EXEC_LIBRARIES_H
13 # include <exec/libraries.h>
16 # include <exec/lists.h>
22 /**********************************************************************
23 ************************** Pattern Matching **************************
24 **********************************************************************/
26 /* PRIVATE structure, which describes an anchor for matching functions. */
29 struct AChain
* an_Child
; /* The next anchor */
30 struct AChain
* an_Parent
; /* The last anchor */
32 BPTR an_Lock
; /* Lock of this anchor */
33 struct FileInfoBlock an_Info
; /* The fib, describing this anchor */
34 BYTE an_Flags
; /* see below */
39 #define DDB_PatternBit 0
40 #define DDB_ExaminedBit 1
41 #define DDB_Completed 2
44 #define DDF_PatternBit (1<<DDB_PatternBit)
45 #define DDF_ExaminedBit (1<<DDB_ExaminedBit)
46 #define DDF_Completed (1<<DDB_Completed)
47 #define DDF_AllBit (1<<DDB_AllBit)
48 #define DDF_Single (1<<DDB_Single)
51 /* Structure as used with MatchFirst() and MatchNext(). */
54 struct AChain
* ap_Base
; /* First anchor. */
55 struct AChain
* ap_Last
; /* Last anchor. */
57 /* Signal bits at which the function using this structure should return
58 to the caller. See <dos/dos.h> and <exec/tasks.h> for bit definitions.
61 /* Signal bits that caused the function to break. */
63 BYTE ap_Flags
; /* see below */
64 BYTE ap_Reserved
; /* PRIVATE */
65 /* Size of ap_Buf (see below). This may be zero. */
67 /* Embedded FileInfoBlock structure as defined in <dos/dos.h>. This
68 describes any files found by matching-functions. */
69 struct FileInfoBlock ap_Info
;
70 /* Buffer for the fully qualified pathname of files found by
71 matching-functions. This may be as large as you want (including
72 zero bytes). Put its size into ap_StrLen. */
75 #define ap_First ap_Base
76 #define ap_Current ap_Last
77 #define ap_Length ap_Flags
79 /* ap_Flags. Some of the flags are set by the matching-functions and some
81 #define APB_DOWILD 0 /* Please check for wildcards in supplied string. */
82 #define APB_ITSWILD 1 /* There is actually a wildcard in the supplied
84 #define APB_DODIR 2 /* Set, if a directory is to be entered.
85 Applications may clear this bit to prohibit the
86 matching-functions from entering a directory. */
87 #define APB_DIDDIR 3 /* Set, if directory was already searched.
89 #define APB_NOMEMERR 4 /* Set, if function was out of memory. READ-ONLY */
90 #define APB_DODOT 5 /* '.' may refer to the current directory
92 #define APB_DirChanged 6 /* Directory changed since last call. */
93 #define APB_FollowHLinks 7 /* Follow hardlinks, too. */
95 #define APF_DOWILD (1<<APB_DOWILD)
96 #define APF_ITSWILD (1<<APB_ITSWILD)
97 #define APF_DODIR (1<<APB_DODIR)
98 #define APF_DIDDIR (1<<APB_DIDDIR)
99 #define APF_NOMEMERR (1<<APB_NOMEMERR)
100 #define APF_DODOT (1<<APB_DODOT)
101 #define APF_DirChanged (1<<APB_DirChanged)
102 #define APF_FollowHLinks (1<<APB_FollowHLinks)
104 /* Predefined tokens for wildcards. The characters are replaced by these
105 tokens in the tokenized string returned by the ParsePattern() function
107 #define P_ANY 0x80 /* Matches everything ("#?" and "*") */
108 #define P_SINGLE 0x81 /* Any character ("?") */
109 #define P_ORSTART 0x82 /* Opening parenthesis for OR'ing ("(") */
110 #define P_ORNEXT 0x83 /* Field delimiter for OR'ing ("|") */
111 #define P_OREND 0x84 /* Closing parenthesis for OR'ing (")") */
112 #define P_NOT 0x85 /* Inversion ("~") */
113 #define P_NOTEND 0x86 /* Inversion end */
114 #define P_NOTCLASS 0x87 /* Inversion class ("^") */
115 #define P_CLASS 0x88 /* Class ("[" and "]") */
116 #define P_REPBEG 0x89 /* Beginning of repetition ("[") */
117 #define P_REPEND 0x8a /* End of repetition ("]") */
120 #define COMPLEX_BIT 1
121 #define EXAMINE_BIT 2
123 /* Additional error-numbers. Main chunk of error-numbers is defined in
125 #define ERROR_BUFFER_OVERFLOW 303 /* Supplied or internal buffer too small. */
126 #define ERROR_BREAK 304 /* One of the break signals was received. */
127 #define ERROR_NOT_EXECUTABLE 305 /* A file is not an executable. */
129 #endif /* DOS_DOSASL_H */