Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 * nsWildCard.h: Defines and prototypes for shell exp. match routines
8 *
9 * See nsIZipReader.findEntries docs in nsIZipReader.idl for a description of
10 * the supported expression syntax.
11 *
12 * Note that the syntax documentation explicitly says the results of certain
13 * expressions are undefined. This is intentional to require less robustness
14 * in the code. Regular expression parsing is hard; the smaller the set of
15 * features and interactions this code must support, the easier it is to
16 * ensure it works.
17 *
18 */
20 #ifndef nsWildCard_h__
21 #define nsWildCard_h__
23 #include "nscore.h"
25 /* --------------------------- Public routines ---------------------------- */
28 /*
29 * NS_WildCardValid takes a shell expression exp as input. It returns:
30 *
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
34 */
36 #define NON_SXP -1
37 #define INVALID_SXP -2
38 #define VALID_SXP 1
40 int NS_WildCardValid(const char *expr);
42 int NS_WildCardValid(const char16_t *expr);
44 /* return values for the search routines */
45 #define MATCH 0
46 #define NOMATCH 1
47 #define ABORTED -1
49 /*
50 * NS_WildCardMatch
51 *
52 * Takes a prevalidated shell expression exp, and a string str.
53 *
54 * Returns 0 on match and 1 on non-match.
55 */
57 int NS_WildCardMatch(const char *str, const char *expr,
58 bool case_insensitive);
60 int NS_WildCardMatch(const char16_t *str, const char16_t *expr,
61 bool case_insensitive);
63 #endif /* nsWildCard_h__ */