]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/utrie2.h
ICU-66108.tar.gz
[apple/icu.git] / icuSources / common / utrie2.h
index 8e1caa5e90bde2a5fff8a6bcbac75dc0b1b86bba..671f44e16a65cc561b794741ddb1c6544e775bee 100644 (file)
@@ -22,7 +22,6 @@
 #include "unicode/utypes.h"
 #include "unicode/utf8.h"
 #include "putilimp.h"
-#include "udataswp.h"
 
 U_CDECL_BEGIN
 
@@ -330,40 +329,6 @@ utrie2_serialize(const UTrie2 *trie,
 
 /* Public UTrie2 API: miscellaneous functions ------------------------------- */
 
-/**
- * Get the UTrie version from 32-bit-aligned memory containing the serialized form
- * of either a UTrie (version 1) or a UTrie2 (version 2).
- *
- * @param data a pointer to 32-bit-aligned memory containing the serialized form
- *             of a UTrie, version 1 or 2
- * @param length the number of bytes available at data;
- *               can be more than necessary (see return value)
- * @param anyEndianOk If FALSE, only platform-endian serialized forms are recognized.
- *                    If TRUE, opposite-endian serialized forms are recognized as well.
- * @return the UTrie version of the serialized form, or 0 if it is not
- *         recognized as a serialized UTrie
- */
-U_CAPI int32_t U_EXPORT2
-utrie2_getVersion(const void *data, int32_t length, UBool anyEndianOk);
-
-/**
- * Swap a serialized UTrie2.
- * @internal
- */
-U_CAPI int32_t U_EXPORT2
-utrie2_swap(const UDataSwapper *ds,
-            const void *inData, int32_t length, void *outData,
-            UErrorCode *pErrorCode);
-
-/**
- * Swap a serialized UTrie or UTrie2.
- * @internal
- */
-U_CAPI int32_t U_EXPORT2
-utrie2_swapAnyVersion(const UDataSwapper *ds,
-                      const void *inData, int32_t length, void *outData,
-                      UErrorCode *pErrorCode);
-
 /**
  * Build a UTrie2 (version 2) from a UTrie (version 1).
  * Enumerates all values in the UTrie and builds a UTrie2 with the same values.
@@ -709,6 +674,10 @@ struct UTrie2 {
     UBool padding1;
     int16_t padding2;
     UNewTrie2 *newTrie;     /* builder object; NULL when frozen */
+
+#ifdef UTRIE2_DEBUG
+    const char *name;
+#endif
 };
 
 /**
@@ -902,7 +871,7 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c,
     (trie)->data[_UTRIE2_INDEX_FROM_CP(trie, asciiOffset, c)]
 
 /** Internal next-post-increment: get the next code point (c) and its data. */
-#define _UTRIE2_U16_NEXT(trie, data, src, limit, c, result) { \
+#define _UTRIE2_U16_NEXT(trie, data, src, limit, c, result) UPRV_BLOCK_MACRO_BEGIN { \
     { \
         uint16_t __c2; \
         (c)=*(src)++; \
@@ -916,10 +885,10 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c,
             (result)=_UTRIE2_GET_FROM_SUPP((trie), data, (c)); \
         } \
     } \
-}
+} UPRV_BLOCK_MACRO_END
 
 /** Internal pre-decrement-previous: get the previous code point (c) and its data */
-#define _UTRIE2_U16_PREV(trie, data, start, src, c, result) { \
+#define _UTRIE2_U16_PREV(trie, data, start, src, c, result) UPRV_BLOCK_MACRO_BEGIN { \
     { \
         uint16_t __c2; \
         (c)=*--(src); \
@@ -931,10 +900,10 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c,
             (result)=_UTRIE2_GET_FROM_SUPP((trie), data, (c)); \
         } \
     } \
-}
+} UPRV_BLOCK_MACRO_END
 
 /** Internal UTF-8 next-post-increment: get the next code point's data. */
-#define _UTRIE2_U8_NEXT(trie, ascii, data, src, limit, result) { \
+#define _UTRIE2_U8_NEXT(trie, ascii, data, src, limit, result) UPRV_BLOCK_MACRO_BEGIN { \
     uint8_t __lead=(uint8_t)*(src)++; \
     if(U8_IS_SINGLE(__lead)) { \
         (result)=(trie)->ascii[__lead]; \
@@ -966,10 +935,10 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c,
             (result)=(trie)->data[__index>>3]; \
         } \
     } \
-}
+} UPRV_BLOCK_MACRO_END
 
 /** Internal UTF-8 pre-decrement-previous: get the previous code point's data. */
-#define _UTRIE2_U8_PREV(trie, ascii, data, start, src, result) { \
+#define _UTRIE2_U8_PREV(trie, ascii, data, start, src, result) UPRV_BLOCK_MACRO_BEGIN { \
     uint8_t __b=(uint8_t)*--(src); \
     if(U8_IS_SINGLE(__b)) { \
         (result)=(trie)->ascii[__b]; \
@@ -979,7 +948,7 @@ utrie2_internalU8PrevIndex(const UTrie2 *trie, UChar32 c,
         (src)-=__index&7; \
         (result)=(trie)->data[__index>>3]; \
     } \
-}
+} UPRV_BLOCK_MACRO_END
 
 U_CDECL_END