No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes ct-logs...
[gecko.git] / xpcom / io / nsWildCard.h
blobe3205fa7a1342530e59457d795c8e3d07546f8a7
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /*
8 * nsWildCard.h: Defines and prototypes for shell exp. match routines
10 * See nsIZipReader.findEntries docs in nsIZipReader.idl for a description of
11 * the supported expression syntax.
13 * Note that the syntax documentation explicitly says the results of certain
14 * expressions are undefined. This is intentional to require less robustness
15 * in the code. Regular expression parsing is hard; the smaller the set of
16 * features and interactions this code must support, the easier it is to
17 * ensure it works.
21 #ifndef nsWildCard_h__
22 #define nsWildCard_h__
24 #include "nscore.h"
26 /* --------------------------- Public routines ---------------------------- */
29 * NS_WildCardValid takes a shell expression exp as input. It returns:
31 * NON_SXP if exp is a standard string
32 * INVALID_SXP if exp is a shell expression, but invalid
33 * VALID_SXP if exp is a valid shell expression
36 #define NON_SXP -1
37 #define INVALID_SXP -2
38 #define VALID_SXP 1
40 int NS_WildCardValid(const char* aExpr);
42 int NS_WildCardValid(const char16_t* aExpr);
44 /* return values for the search routines */
45 #define MATCH 0
46 #define NOMATCH 1
47 #define ABORTED -1
50 * NS_WildCardMatch
52 * Takes a prevalidated shell expression exp, and a string str.
54 * Returns 0 on match and 1 on non-match.
57 int NS_WildCardMatch(const char* aStr, const char* aExpr,
58 bool aCaseInsensitive);
60 int NS_WildCardMatch(const char16_t* aStr, const char16_t* aExpr,
61 bool aCaseInsensitive);
63 #endif /* nsWildCard_h__ */