2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <proto/exec.h>
10 #include <dos/dosasl.h>
11 #include <dos/dosextens.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
17 #include <proto/dos.h>
19 AROS_LH3(LONG
, ParsePattern
,
22 AROS_LHA(STRPTR
, Source
, D1
),
23 AROS_LHA(STRPTR
, Dest
, D2
),
24 AROS_LHA(LONG
, DestLength
, D3
),
27 struct DosLibrary
*, DOSBase
, 140, Dos
)
30 Takes a pattern containing wildcards and transforms it into some
31 intermediate representation for use with the MatchPattern() function.
32 The intermediate representation is longer but generally a buffer
33 size of 2*(strlen(Source)+1) is enough. Nevertheless you should check
34 the returncode to be sure that everything went fine.
37 Source - Pattern describing the kind of strings that match.
39 #x - The following character or item is repeaded 0 or
41 ? - Item matching a single non-NUL character.
42 a|b|c - Matches one of multiple strings.
43 ~x - This item matches if the item x doesn't match.
45 [a-z] - Matches a single character out of the set.
46 [~a-z] - Matches a single non-NUL character not in the set.
47 'c - Escapes the following character.
48 * - Same as #?, but optional.
49 Dest - Buffer for the destination.
50 DestLength - Size of the buffer.
53 1 - There are wildcards in the pattern (it might match more than
55 0 - No wildcards in it, all went fine.
56 -1 - An error happened. IoErr() gives additional information in
69 *****************************************************************************/
72 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
74 return patternParse(Source
, Dest
, DestLength
, TRUE
, DOSBase
);