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