Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* |
michael@0 | 2 | ******************************************************************************* |
michael@0 | 3 | * Copyright (C) 2003-2006, International Business Machines |
michael@0 | 4 | * Corporation and others. All Rights Reserved. |
michael@0 | 5 | ******************************************************************************* |
michael@0 | 6 | * file name: regexc.cpp |
michael@0 | 7 | * description: The purpose of this function is to separate the codepage |
michael@0 | 8 | * conversion from the rest of the uregex_ API. This can removes any |
michael@0 | 9 | * dependency on codepage conversion, which reduces the overhead of |
michael@0 | 10 | */ |
michael@0 | 11 | |
michael@0 | 12 | #include "unicode/uregex.h" |
michael@0 | 13 | #include "unicode/unistr.h" |
michael@0 | 14 | |
michael@0 | 15 | U_NAMESPACE_USE |
michael@0 | 16 | |
michael@0 | 17 | //---------------------------------------------------------------------------------------- |
michael@0 | 18 | // |
michael@0 | 19 | // uregex_openC |
michael@0 | 20 | // |
michael@0 | 21 | //---------------------------------------------------------------------------------------- |
michael@0 | 22 | #if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_REGULAR_EXPRESSIONS |
michael@0 | 23 | |
michael@0 | 24 | U_CAPI URegularExpression * U_EXPORT2 |
michael@0 | 25 | uregex_openC( const char *pattern, |
michael@0 | 26 | uint32_t flags, |
michael@0 | 27 | UParseError *pe, |
michael@0 | 28 | UErrorCode *status) { |
michael@0 | 29 | if (U_FAILURE(*status)) { |
michael@0 | 30 | return NULL; |
michael@0 | 31 | } |
michael@0 | 32 | if (pattern == NULL) { |
michael@0 | 33 | *status = U_ILLEGAL_ARGUMENT_ERROR; |
michael@0 | 34 | return NULL; |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | UnicodeString patString(pattern); |
michael@0 | 38 | return uregex_open(patString.getBuffer(), patString.length(), flags, pe, status); |
michael@0 | 39 | } |
michael@0 | 40 | #endif |