Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsWildCard.h File Reference
#include "prtypes.h"
#include "nscore.h"
#include <ctype.h>
#include <string.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define NON_SXP   -1
#define INVALID_SXP   -2
#define VALID_SXP   1
#define MATCH   0
#define NOMATCH   1
#define ABORTED   -1

Functions

int NS_WildCardValid (PRUnichar *expr)
int NS_WildCardMatch (const PRUnichar *str, const PRUnichar *expr, PRBool case_insensitive)
int NS_WildCardSearch (const PRUnichar *str, const PRUnichar *expr)
int NS_WildCardCaseSearch (const PRUnichar *str, const PRUnichar *expr)

Define Documentation

#define ABORTED   -1

Definition at line 93 of file nsWildCard.h.

#define INVALID_SXP   -2

Definition at line 84 of file nsWildCard.h.

#define MATCH   0

Definition at line 91 of file nsWildCard.h.

#define NOMATCH   1

Definition at line 92 of file nsWildCard.h.

#define NON_SXP   -1

Definition at line 83 of file nsWildCard.h.

#define VALID_SXP   1

Definition at line 85 of file nsWildCard.h.


Function Documentation

int NS_WildCardMatch ( const PRUnichar str,
const PRUnichar expr,
PRBool  case_insensitive 
)

Definition at line 272 of file nsWildCard.cpp.

                                          {
    register int x;
    PRUnichar *expr = nsCRT::strdup(xp);

       if(!expr)
              return 1;

    for(x=nsCRT::strlen(expr)-1;x;--x) {
        if((expr[x] == '~') && (expr[x-1] != '\\')) {
            expr[x] = '\0';
            if(_shexp_match(str,&expr[++x], case_insensitive) == MATCH)
                goto punt;
            break;
        }
    }
    if(_shexp_match(str,expr, case_insensitive) == MATCH) {
        PR_Free(expr);
        return 0;
    }

  punt:
    PR_Free(expr);
    return 1;
}

Here is the call graph for this function:

Definition at line 128 of file nsWildCard.cpp.

{
    int x;

    x = _valid_subexp(expr, '\0');
    return (x < 0 ? x : VALID_SXP);
}

Here is the call graph for this function: