michael@0: /******************************************************************** michael@0: * COPYRIGHT: michael@0: * Copyright (c) 2008-2010, International Business Machines Corporation and michael@0: * others. All Rights Reserved. michael@0: ********************************************************************/ michael@0: // michael@0: // file: regextxt.h michael@0: // michael@0: // This file contains utility code for supporting UText in the regular expression engine. michael@0: // michael@0: // This class is internal to the regular expression implementation. michael@0: // For the public Regular Expression API, see the file "unicode/regex.h" michael@0: // michael@0: michael@0: #ifndef _REGEXTXT_H michael@0: #define _REGEXTXT_H michael@0: michael@0: #include "unicode/utypes.h" michael@0: #include "unicode/utext.h" michael@0: michael@0: U_NAMESPACE_BEGIN michael@0: michael@0: #define UTEXT_USES_U16(ut) (NULL==((ut)->pFuncs->mapNativeIndexToUTF16)) michael@0: michael@0: #if 0 michael@0: #define REGEX_DISABLE_CHUNK_MODE 1 michael@0: #endif michael@0: michael@0: #ifdef REGEX_DISABLE_CHUNK_MODE michael@0: # define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) (FALSE) michael@0: #else michael@0: # define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) ((0==((ut)->chunkNativeStart))&&((len)==((ut)->chunkNativeLimit))&&((len)==((ut)->nativeIndexingLimit))) michael@0: #endif michael@0: michael@0: struct URegexUTextUnescapeCharContext { michael@0: UText *text; michael@0: int32_t lastOffset; michael@0: }; michael@0: #define U_REGEX_UTEXT_UNESCAPE_CONTEXT(text) { (text), -1 } michael@0: michael@0: U_CFUNC UChar U_CALLCONV michael@0: uregex_utext_unescape_charAt(int32_t offset, void * /* struct URegexUTextUnescapeCharContext* */ context); michael@0: U_CFUNC UChar U_CALLCONV michael@0: uregex_ucstr_unescape_charAt(int32_t offset, void * /* UChar* */ context); michael@0: michael@0: U_NAMESPACE_END michael@0: michael@0: #endif