regextxt.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // © 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. #ifndef _REGEXTXT_H
  17. #define _REGEXTXT_H
  18. #include "unicode/utypes.h"
  19. #include "unicode/utext.h"
  20. U_NAMESPACE_BEGIN
  21. #define UTEXT_USES_U16(ut) (NULL==((ut)->pFuncs->mapNativeIndexToUTF16))
  22. #if 0
  23. #define REGEX_DISABLE_CHUNK_MODE 1
  24. #endif
  25. #ifdef REGEX_DISABLE_CHUNK_MODE
  26. # define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) (FALSE)
  27. #else
  28. # define UTEXT_FULL_TEXT_IN_CHUNK(ut,len) ((0==((ut)->chunkNativeStart))&&((len)==((ut)->chunkNativeLimit))&&((len)==((ut)->nativeIndexingLimit)))
  29. #endif
  30. struct URegexUTextUnescapeCharContext {
  31. UText *text;
  32. int32_t lastOffset;
  33. };
  34. #define U_REGEX_UTEXT_UNESCAPE_CONTEXT(text) { (text), -1 }
  35. U_CFUNC UChar U_CALLCONV
  36. uregex_utext_unescape_charAt(int32_t offset, void * /* struct URegexUTextUnescapeCharContext* */ context);
  37. U_CFUNC UChar U_CALLCONV
  38. uregex_ucstr_unescape_charAt(int32_t offset, void * /* UChar* */ context);
  39. U_NAMESPACE_END
  40. #endif