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.
michael@0 | 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | /* |
michael@0 | 7 | * nsWildCard.h: Defines and prototypes for shell exp. match routines |
michael@0 | 8 | * |
michael@0 | 9 | * See nsIZipReader.findEntries docs in nsIZipReader.idl for a description of |
michael@0 | 10 | * the supported expression syntax. |
michael@0 | 11 | * |
michael@0 | 12 | * Note that the syntax documentation explicitly says the results of certain |
michael@0 | 13 | * expressions are undefined. This is intentional to require less robustness |
michael@0 | 14 | * in the code. Regular expression parsing is hard; the smaller the set of |
michael@0 | 15 | * features and interactions this code must support, the easier it is to |
michael@0 | 16 | * ensure it works. |
michael@0 | 17 | * |
michael@0 | 18 | */ |
michael@0 | 19 | |
michael@0 | 20 | #ifndef nsWildCard_h__ |
michael@0 | 21 | #define nsWildCard_h__ |
michael@0 | 22 | |
michael@0 | 23 | #include "nscore.h" |
michael@0 | 24 | |
michael@0 | 25 | /* --------------------------- Public routines ---------------------------- */ |
michael@0 | 26 | |
michael@0 | 27 | |
michael@0 | 28 | /* |
michael@0 | 29 | * NS_WildCardValid takes a shell expression exp as input. It returns: |
michael@0 | 30 | * |
michael@0 | 31 | * NON_SXP if exp is a standard string |
michael@0 | 32 | * INVALID_SXP if exp is a shell expression, but invalid |
michael@0 | 33 | * VALID_SXP if exp is a valid shell expression |
michael@0 | 34 | */ |
michael@0 | 35 | |
michael@0 | 36 | #define NON_SXP -1 |
michael@0 | 37 | #define INVALID_SXP -2 |
michael@0 | 38 | #define VALID_SXP 1 |
michael@0 | 39 | |
michael@0 | 40 | int NS_WildCardValid(const char *expr); |
michael@0 | 41 | |
michael@0 | 42 | int NS_WildCardValid(const char16_t *expr); |
michael@0 | 43 | |
michael@0 | 44 | /* return values for the search routines */ |
michael@0 | 45 | #define MATCH 0 |
michael@0 | 46 | #define NOMATCH 1 |
michael@0 | 47 | #define ABORTED -1 |
michael@0 | 48 | |
michael@0 | 49 | /* |
michael@0 | 50 | * NS_WildCardMatch |
michael@0 | 51 | * |
michael@0 | 52 | * Takes a prevalidated shell expression exp, and a string str. |
michael@0 | 53 | * |
michael@0 | 54 | * Returns 0 on match and 1 on non-match. |
michael@0 | 55 | */ |
michael@0 | 56 | |
michael@0 | 57 | int NS_WildCardMatch(const char *str, const char *expr, |
michael@0 | 58 | bool case_insensitive); |
michael@0 | 59 | |
michael@0 | 60 | int NS_WildCardMatch(const char16_t *str, const char16_t *expr, |
michael@0 | 61 | bool case_insensitive); |
michael@0 | 62 | |
michael@0 | 63 | #endif /* nsWildCard_h__ */ |