xref: /aosp_15_r20/external/icu/libicu/cts_headers/regextxt.h (revision 0e209d3975ff4a8c132096b14b0e9364a753506e)
1*0e209d39SAndroid Build Coastguard Worker // © 2016 and later: Unicode, Inc. and others.
2*0e209d39SAndroid Build Coastguard Worker // License & terms of use: http://www.unicode.org/copyright.html
3*0e209d39SAndroid Build Coastguard Worker /********************************************************************
4*0e209d39SAndroid Build Coastguard Worker  * COPYRIGHT:
5*0e209d39SAndroid Build Coastguard Worker  * Copyright (c) 2008-2010, International Business Machines Corporation and
6*0e209d39SAndroid Build Coastguard Worker  * others. All Rights Reserved.
7*0e209d39SAndroid Build Coastguard Worker  ********************************************************************/
8*0e209d39SAndroid Build Coastguard Worker //
9*0e209d39SAndroid Build Coastguard Worker //  file:  regextxt.h
10*0e209d39SAndroid Build Coastguard Worker //
11*0e209d39SAndroid Build Coastguard Worker //  This file contains utility code for supporting UText in the regular expression engine.
12*0e209d39SAndroid Build Coastguard Worker //
13*0e209d39SAndroid Build Coastguard Worker //  This class is internal to the regular expression implementation.
14*0e209d39SAndroid Build Coastguard Worker //  For the public Regular Expression API, see the file "unicode/regex.h"
15*0e209d39SAndroid Build Coastguard Worker //
16*0e209d39SAndroid Build Coastguard Worker 
17*0e209d39SAndroid Build Coastguard Worker #ifndef _REGEXTXT_H
18*0e209d39SAndroid Build Coastguard Worker #define _REGEXTXT_H
19*0e209d39SAndroid Build Coastguard Worker 
20*0e209d39SAndroid Build Coastguard Worker #include "unicode/utypes.h"
21*0e209d39SAndroid Build Coastguard Worker #include "unicode/utext.h"
22*0e209d39SAndroid Build Coastguard Worker 
23*0e209d39SAndroid Build Coastguard Worker U_NAMESPACE_BEGIN
24*0e209d39SAndroid Build Coastguard Worker 
25*0e209d39SAndroid Build Coastguard Worker #define UTEXT_USES_U16(ut) (NULL==((ut)->pFuncs->mapNativeIndexToUTF16))
26*0e209d39SAndroid Build Coastguard Worker 
27*0e209d39SAndroid Build Coastguard Worker #if 0
28*0e209d39SAndroid Build Coastguard Worker #define REGEX_DISABLE_CHUNK_MODE 1
29*0e209d39SAndroid Build Coastguard Worker #endif
30*0e209d39SAndroid Build Coastguard Worker 
31*0e209d39SAndroid Build Coastguard Worker #ifdef REGEX_DISABLE_CHUNK_MODE
32*0e209d39SAndroid Build Coastguard Worker #  define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) (false)
33*0e209d39SAndroid Build Coastguard Worker #else
34*0e209d39SAndroid Build Coastguard Worker #  define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) ((0==((ut)->chunkNativeStart))&&((len)==((ut)->chunkNativeLimit))&&((len)==((ut)->nativeIndexingLimit)))
35*0e209d39SAndroid Build Coastguard Worker #endif
36*0e209d39SAndroid Build Coastguard Worker 
37*0e209d39SAndroid Build Coastguard Worker struct URegexUTextUnescapeCharContext {
38*0e209d39SAndroid Build Coastguard Worker     UText *text;
39*0e209d39SAndroid Build Coastguard Worker     int32_t lastOffset;
40*0e209d39SAndroid Build Coastguard Worker };
41*0e209d39SAndroid Build Coastguard Worker #define U_REGEX_UTEXT_UNESCAPE_CONTEXT(text) { (text), -1 }
42*0e209d39SAndroid Build Coastguard Worker 
43*0e209d39SAndroid Build Coastguard Worker U_CFUNC UChar U_CALLCONV
44*0e209d39SAndroid Build Coastguard Worker uregex_utext_unescape_charAt(int32_t offset, void * /* struct URegexUTextUnescapeCharContext* */ context);
45*0e209d39SAndroid Build Coastguard Worker U_CFUNC UChar U_CALLCONV
46*0e209d39SAndroid Build Coastguard Worker uregex_ucstr_unescape_charAt(int32_t offset, void * /* UChar* */ context);
47*0e209d39SAndroid Build Coastguard Worker 
48*0e209d39SAndroid Build Coastguard Worker U_NAMESPACE_END
49*0e209d39SAndroid Build Coastguard Worker 
50*0e209d39SAndroid Build Coastguard Worker #endif
51