]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/ubidiimp.h
ICU-62135.0.1.tar.gz
[apple/icu.git] / icuSources / common / ubidiimp.h
index 14d7b99a6aabd2a75257a8ab7cd4e4e27861a3b1..a50fbbc46d355f2fff97efb3307a3de477452c3d 100644 (file)
@@ -1,12 +1,14 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1999-2015, International Business Machines
+*   Copyright (C) 1999-2016, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
 *   file name:  ubidiimp.h
-*   encoding:   US-ASCII
+*   encoding:   UTF-8
 *   tab size:   8 (not used)
 *   indentation:4
 *
 #ifndef UBIDIIMP_H
 #define UBIDIIMP_H
 
-/*  set import/export definitions */
-#ifdef U_COMMON_IMPLEMENTATION
-
 #include "unicode/utypes.h"
+#include "unicode/ubidi.h"
 #include "unicode/uchar.h"
 #include "ubidi_props.h"
 
@@ -254,8 +254,6 @@ struct UBiDi {
      */
     const UBiDi * pParaBiDi;
 
-    const UBiDiProps *bdp;
-
     /* alias pointer to the current text */
     const UChar *text;
 
@@ -276,9 +274,10 @@ struct UBiDi {
     int32_t resultLength;
 
     /* memory sizes in bytes */
-    int32_t dirPropsSize, levelsSize, openingsSize, parasSize, runsSize, isolatesSize;
+    int32_t dirInsertSize, dirPropsSize, levelsSize, openingsSize, parasSize, runsSize, isolatesSize;
 
     /* allocated memory */
+    uint16_t *dirInsertMemory;
     DirProp *dirPropsMemory;
     UBiDiLevel *levelsMemory;
     Opening *openingsMemory;
@@ -290,6 +289,7 @@ struct UBiDi {
     UBool mayAllocateText, mayAllocateRuns;
 
     /* arrays with one value per text-character */
+    uint16_t *dirInsert;
     DirProp *dirProps;
     UBiDiLevel *levels;
 
@@ -380,6 +380,7 @@ struct UBiDi {
 #define IS_VALID_PARA_OR_LINE(x) ((x) && ((x)->pParaBiDi==(x) || (((x)->pParaBiDi) && (x)->pParaBiDi->pParaBiDi==(x)->pParaBiDi)))
 
 typedef union {
+    uint16_t *dirInsertMemory;
     DirProp *dirPropsMemory;
     UBiDiLevel *levelsMemory;
     Opening *openingsMemory;
@@ -430,6 +431,10 @@ U_CFUNC UBool
 ubidi_getMemory(BidiMemoryForAllocation *pMemory, int32_t *pSize, UBool mayAllocate, int32_t sizeNeeded);
 
 /* helper macros for each allocated array in UBiDi */
+#define getDirInsertMemory(pBiDi, length) \
+        ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirInsertMemory, &(pBiDi)->dirInsertSize, \
+                        (pBiDi)->mayAllocateText, (length)*sizeof(uint16_t))
+
 #define getDirPropsMemory(pBiDi, length) \
         ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \
                         (pBiDi)->mayAllocateText, (length))
@@ -443,6 +448,10 @@ ubidi_getMemory(BidiMemoryForAllocation *pMemory, int32_t *pSize, UBool mayAlloc
                         (pBiDi)->mayAllocateRuns, (length)*sizeof(Run))
 
 /* additional macros used by ubidi_open() - always allow allocation */
+#define getInitialDirInsertMemory(pBiDi, length) \
+        ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirInsertMemory, &(pBiDi)->dirInsertSize, \
+                        TRUE, (length))
+
 #define getInitialDirPropsMemory(pBiDi, length) \
         ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \
                         TRUE, (length))
@@ -468,5 +477,3 @@ ubidi_getMemory(BidiMemoryForAllocation *pMemory, int32_t *pSize, UBool mayAlloc
                         TRUE, (length)*sizeof(Isolate))
 
 #endif
-
-#endif