xpcom/io/nsWildCard.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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__ */

mercurial