michael@0: /* michael@0: ****************************************************************************** michael@0: * michael@0: * Copyright (C) 1999-2013, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: * michael@0: ****************************************************************************** michael@0: * file name: ubidiimp.h michael@0: * encoding: US-ASCII michael@0: * tab size: 8 (not used) michael@0: * indentation:4 michael@0: * michael@0: * created on: 1999aug06 michael@0: * created by: Markus W. Scherer, updated by Matitiahu Allouche michael@0: */ michael@0: michael@0: #ifndef UBIDIIMP_H michael@0: #define UBIDIIMP_H michael@0: michael@0: /* set import/export definitions */ michael@0: #ifdef U_COMMON_IMPLEMENTATION michael@0: michael@0: #include "unicode/utypes.h" michael@0: #include "unicode/uchar.h" michael@0: #include "ubidi_props.h" michael@0: michael@0: /* miscellaneous definitions ---------------------------------------------- */ michael@0: michael@0: typedef uint8_t DirProp; michael@0: typedef uint32_t Flags; michael@0: michael@0: /* Comparing the description of the BiDi algorithm with this implementation michael@0: is easier with the same names for the BiDi types in the code as there. michael@0: See UCharDirection in uchar.h . michael@0: */ michael@0: enum { michael@0: L= U_LEFT_TO_RIGHT, /* 0 */ michael@0: R= U_RIGHT_TO_LEFT, /* 1 */ michael@0: EN= U_EUROPEAN_NUMBER, /* 2 */ michael@0: ES= U_EUROPEAN_NUMBER_SEPARATOR, /* 3 */ michael@0: ET= U_EUROPEAN_NUMBER_TERMINATOR, /* 4 */ michael@0: AN= U_ARABIC_NUMBER, /* 5 */ michael@0: CS= U_COMMON_NUMBER_SEPARATOR, /* 6 */ michael@0: B= U_BLOCK_SEPARATOR, /* 7 */ michael@0: S= U_SEGMENT_SEPARATOR, /* 8 */ michael@0: WS= U_WHITE_SPACE_NEUTRAL, /* 9 */ michael@0: ON= U_OTHER_NEUTRAL, /* 10 */ michael@0: LRE=U_LEFT_TO_RIGHT_EMBEDDING, /* 11 */ michael@0: LRO=U_LEFT_TO_RIGHT_OVERRIDE, /* 12 */ michael@0: AL= U_RIGHT_TO_LEFT_ARABIC, /* 13 */ michael@0: RLE=U_RIGHT_TO_LEFT_EMBEDDING, /* 14 */ michael@0: RLO=U_RIGHT_TO_LEFT_OVERRIDE, /* 15 */ michael@0: PDF=U_POP_DIRECTIONAL_FORMAT, /* 16 */ michael@0: NSM=U_DIR_NON_SPACING_MARK, /* 17 */ michael@0: BN= U_BOUNDARY_NEUTRAL, /* 18 */ michael@0: FSI=U_FIRST_STRONG_ISOLATE, /* 19 */ michael@0: LRI=U_LEFT_TO_RIGHT_ISOLATE, /* 20 */ michael@0: RLI=U_RIGHT_TO_LEFT_ISOLATE, /* 21 */ michael@0: PDI=U_POP_DIRECTIONAL_ISOLATE, /* 22 */ michael@0: ENL, /* 23 */ michael@0: ENR, /* 24 */ michael@0: dirPropCount michael@0: }; michael@0: michael@0: /* michael@0: * Sometimes, bit values are more appropriate michael@0: * to deal with directionality properties. michael@0: * Abbreviations in these macro names refer to names michael@0: * used in the BiDi algorithm. michael@0: */ michael@0: #define DIRPROP_FLAG(dir) (1UL<<(dir)) michael@0: michael@0: /* special flag for multiple runs from explicit embedding codes */ michael@0: #define DIRPROP_FLAG_MULTI_RUNS (1UL<<31) michael@0: michael@0: /* are there any characters that are LTR or RTL? */ michael@0: #define MASK_LTR (DIRPROP_FLAG(L)|DIRPROP_FLAG(EN)|DIRPROP_FLAG(AN)|DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO)|DIRPROP_FLAG(LRI)) michael@0: #define MASK_RTL (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)|DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO)|DIRPROP_FLAG(RLI)) michael@0: #define MASK_R_AL (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)) michael@0: #define MASK_STRONG_EN_AN (DIRPROP_FLAG(L)|DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)|DIRPROP_FLAG(EN)|DIRPROP_FLAG(AN)) michael@0: michael@0: /* explicit embedding codes */ michael@0: #define MASK_EXPLICIT (DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO)|DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO)|DIRPROP_FLAG(PDF)) michael@0: michael@0: /* explicit isolate codes */ michael@0: #define MASK_ISO (DIRPROP_FLAG(LRI)|DIRPROP_FLAG(RLI)|DIRPROP_FLAG(FSI)|DIRPROP_FLAG(PDI)) michael@0: michael@0: #define MASK_BN_EXPLICIT (DIRPROP_FLAG(BN)|MASK_EXPLICIT) michael@0: michael@0: /* paragraph and segment separators */ michael@0: #define MASK_B_S (DIRPROP_FLAG(B)|DIRPROP_FLAG(S)) michael@0: michael@0: /* all types that are counted as White Space or Neutral in some steps */ michael@0: #define MASK_WS (MASK_B_S|DIRPROP_FLAG(WS)|MASK_BN_EXPLICIT|MASK_ISO) michael@0: michael@0: /* types that are neutrals or could becomes neutrals in (Wn) */ michael@0: #define MASK_POSSIBLE_N (DIRPROP_FLAG(ON)|DIRPROP_FLAG(CS)|DIRPROP_FLAG(ES)|DIRPROP_FLAG(ET)|MASK_WS) michael@0: michael@0: /* michael@0: * These types may be changed to "e", michael@0: * the embedding type (L or R) of the run, michael@0: * in the BiDi algorithm (N2) michael@0: */ michael@0: #define MASK_EMBEDDING (DIRPROP_FLAG(NSM)|MASK_POSSIBLE_N) michael@0: michael@0: /* the dirProp's L and R are defined to 0 and 1 values in UCharDirection */ michael@0: #define GET_LR_FROM_LEVEL(level) ((DirProp)((level)&1)) michael@0: michael@0: #define IS_DEFAULT_LEVEL(level) ((level)>=0xfe) michael@0: michael@0: /* michael@0: * The following bit is ORed to the property of directional control michael@0: * characters which are ignored: unmatched PDF or PDI; LRx, RLx or FSI michael@0: * which would exceed the maximum explicit bidi level. michael@0: */ michael@0: #define IGNORE_CC 0x40 michael@0: michael@0: #define PURE_DIRPROP(prop) ((prop)&~IGNORE_CC) michael@0: michael@0: /* michael@0: * The following bit is used for the directional isolate status. michael@0: * Stack entries corresponding to isolate sequences are greater than ISOLATE. michael@0: */ michael@0: #define ISOLATE 0x0100 michael@0: michael@0: U_CFUNC UBiDiLevel michael@0: ubidi_getParaLevelAtIndex(const UBiDi *pBiDi, int32_t index); michael@0: michael@0: #define GET_PARALEVEL(ubidi, index) \ michael@0: ((UBiDiLevel)(!(ubidi)->defaultParaLevel || (index)<(ubidi)->paras[0].limit ? \ michael@0: (ubidi)->paraLevel : ubidi_getParaLevelAtIndex((ubidi), (index)))) michael@0: michael@0: /* number of paras entries allocated initially without malloc */ michael@0: #define SIMPLE_PARAS_SIZE 10 michael@0: /* number of isolate entries allocated initially without malloc */ michael@0: #define SIMPLE_ISOLATES_SIZE 5 michael@0: /* number of isolate run entries for paired brackets allocated initially without malloc */ michael@0: #define SIMPLE_OPENINGS_SIZE 20 michael@0: michael@0: #define CR 0x000D michael@0: #define LF 0x000A michael@0: michael@0: /* Run structure for reordering --------------------------------------------- */ michael@0: enum { michael@0: LRM_BEFORE=1, michael@0: LRM_AFTER=2, michael@0: RLM_BEFORE=4, michael@0: RLM_AFTER=8 michael@0: }; michael@0: michael@0: typedef struct Para { michael@0: int32_t limit; michael@0: int32_t level; michael@0: } Para; michael@0: michael@0: enum { /* flags for Opening.flags */ michael@0: FOUND_L=DIRPROP_FLAG(L), michael@0: FOUND_R=DIRPROP_FLAG(R) michael@0: }; michael@0: michael@0: typedef struct Opening { michael@0: int32_t position; /* position of opening bracket */ michael@0: int32_t match; /* matching char or -position of closing bracket */ michael@0: int32_t contextPos; /* position of last strong char found before opening */ michael@0: uint16_t flags; /* bits for L or R/AL found within the pair */ michael@0: UBiDiDirection contextDir; /* L or R according to last strong char before opening */ michael@0: uint8_t filler; /* to complete a nice multiple of 4 chars */ michael@0: } Opening; michael@0: michael@0: typedef struct IsoRun { michael@0: int32_t lastStrongPos; /* position of last strong char found in this run */ michael@0: int32_t contextPos; /* position of last char defining context */ michael@0: uint16_t start; /* index of first opening entry for this run */ michael@0: uint16_t limit; /* index after last opening entry for this run */ michael@0: UBiDiLevel level; /* level of this run */ michael@0: DirProp lastStrong; /* bidi class of last strong char found in this run */ michael@0: UBiDiDirection contextDir; /* L or R to use as context for following openings */ michael@0: uint8_t filler; /* to complete a nice multiple of 4 chars */ michael@0: } IsoRun; michael@0: michael@0: typedef struct BracketData { michael@0: UBiDi *pBiDi; michael@0: /* array of opening entries which should be enough in most cases; no malloc() */ michael@0: Opening simpleOpenings[SIMPLE_OPENINGS_SIZE]; michael@0: Opening *openings; /* pointer to current array of entries */ michael@0: int32_t openingsSize; /* number of allocated entries */ michael@0: int32_t isoRunLast; /* index of last used entry */ michael@0: /* array of nested isolated sequence entries; can never excess UBIDI_MAX_EXPLICIT_LEVEL michael@0: + 1 for index 0, + 1 for before the first isolated sequence */ michael@0: IsoRun isoRuns[UBIDI_MAX_EXPLICIT_LEVEL+2]; michael@0: UBool isNumbersSpecial; /* reordering mode for NUMBERS_SPECIAL */ michael@0: } BracketData; michael@0: michael@0: typedef struct Isolate { michael@0: int32_t start1; michael@0: int16_t stateImp; michael@0: int16_t state; michael@0: } Isolate; michael@0: michael@0: typedef struct Run { michael@0: int32_t logicalStart, /* first character of the run; b31 indicates even/odd level */ michael@0: visualLimit, /* last visual position of the run +1 */ michael@0: insertRemove; /* if >0, flags for inserting LRM/RLM before/after run, michael@0: if <0, count of bidi controls within run */ michael@0: } Run; michael@0: michael@0: /* in a Run, logicalStart will get this bit set if the run level is odd */ michael@0: #define INDEX_ODD_BIT (1UL<<31) michael@0: michael@0: #define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31)) michael@0: #define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31)) michael@0: #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT) michael@0: michael@0: #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT) michael@0: #define GET_ODD_BIT(x) ((uint32_t)(x)>>31) michael@0: #define IS_ODD_RUN(x) ((UBool)(((x)&INDEX_ODD_BIT)!=0)) michael@0: #define IS_EVEN_RUN(x) ((UBool)(((x)&INDEX_ODD_BIT)==0)) michael@0: michael@0: U_CFUNC UBool michael@0: ubidi_getRuns(UBiDi *pBiDi, UErrorCode *pErrorCode); michael@0: michael@0: /** BiDi control code points */ michael@0: enum { michael@0: ZWNJ_CHAR=0x200c, michael@0: ZWJ_CHAR, michael@0: LRM_CHAR, michael@0: RLM_CHAR, michael@0: LRE_CHAR=0x202a, michael@0: RLE_CHAR, michael@0: PDF_CHAR, michael@0: LRO_CHAR, michael@0: RLO_CHAR, michael@0: LRI_CHAR=0x2066, michael@0: RLI_CHAR, michael@0: FSI_CHAR, michael@0: PDI_CHAR michael@0: }; michael@0: michael@0: #define IS_BIDI_CONTROL_CHAR(c) (((uint32_t)(c)&0xfffffffc)==ZWNJ_CHAR || (uint32_t)((c)-LRE_CHAR)<5 || (uint32_t)((c)-LRI_CHAR)<4) michael@0: michael@0: /* InsertPoints structure for noting where to put BiDi marks ---------------- */ michael@0: michael@0: typedef struct Point { michael@0: int32_t pos; /* position in text */ michael@0: int32_t flag; /* flag for LRM/RLM, before/after */ michael@0: } Point; michael@0: michael@0: typedef struct InsertPoints { michael@0: int32_t capacity; /* number of points allocated */ michael@0: int32_t size; /* number of points used */ michael@0: int32_t confirmed; /* number of points confirmed */ michael@0: UErrorCode errorCode; /* for eventual memory shortage */ michael@0: Point *points; /* pointer to array of points */ michael@0: } InsertPoints; michael@0: michael@0: michael@0: /* UBiDi structure ----------------------------------------------------------- */ michael@0: michael@0: struct UBiDi { michael@0: /* pointer to parent paragraph object (pointer to self if this object is michael@0: * a paragraph object); set to NULL in a newly opened object; set to a michael@0: * real value after a successful execution of ubidi_setPara or ubidi_setLine michael@0: */ michael@0: const UBiDi * pParaBiDi; michael@0: michael@0: const UBiDiProps *bdp; michael@0: michael@0: /* alias pointer to the current text */ michael@0: const UChar *text; michael@0: michael@0: /* length of the current text */ michael@0: int32_t originalLength; michael@0: michael@0: /* if the UBIDI_OPTION_STREAMING option is set, this is the length michael@0: * of text actually processed by ubidi_setPara, which may be shorter than michael@0: * the original length. michael@0: * Otherwise, it is identical to the original length. michael@0: */ michael@0: int32_t length; michael@0: michael@0: /* if the UBIDI_OPTION_REMOVE_CONTROLS option is set, and/or michael@0: * marks are allowed to be inserted in one of the reordering mode, the michael@0: * length of the result string may be different from the processed length. michael@0: */ michael@0: int32_t resultLength; michael@0: michael@0: /* memory sizes in bytes */ michael@0: int32_t dirPropsSize, levelsSize, openingsSize, parasSize, runsSize, isolatesSize; michael@0: michael@0: /* allocated memory */ michael@0: DirProp *dirPropsMemory; michael@0: UBiDiLevel *levelsMemory; michael@0: Opening *openingsMemory; michael@0: Para *parasMemory; michael@0: Run *runsMemory; michael@0: Isolate *isolatesMemory; michael@0: michael@0: /* indicators for whether memory may be allocated after ubidi_open() */ michael@0: UBool mayAllocateText, mayAllocateRuns; michael@0: michael@0: /* arrays with one value per text-character */ michael@0: DirProp *dirProps; michael@0: UBiDiLevel *levels; michael@0: michael@0: /* are we performing an approximation of the "inverse BiDi" algorithm? */ michael@0: UBool isInverse; michael@0: michael@0: /* are we using the basic algorithm or its variation? */ michael@0: UBiDiReorderingMode reorderingMode; michael@0: michael@0: /* UBIDI_REORDER_xxx values must be ordered so that all the regular michael@0: * logical to visual modes come first, and all inverse BiDi modes michael@0: * come last. michael@0: */ michael@0: #define UBIDI_REORDER_LAST_LOGICAL_TO_VISUAL UBIDI_REORDER_NUMBERS_SPECIAL michael@0: michael@0: /* bitmask for reordering options */ michael@0: uint32_t reorderingOptions; michael@0: michael@0: /* must block separators receive level 0? */ michael@0: UBool orderParagraphsLTR; michael@0: michael@0: /* the paragraph level */ michael@0: UBiDiLevel paraLevel; michael@0: /* original paraLevel when contextual */ michael@0: /* must be one of UBIDI_DEFAULT_xxx or 0 if not contextual */ michael@0: UBiDiLevel defaultParaLevel; michael@0: michael@0: /* context data */ michael@0: const UChar *prologue; michael@0: int32_t proLength; michael@0: const UChar *epilogue; michael@0: int32_t epiLength; michael@0: michael@0: /* the following is set in ubidi_setPara, used in processPropertySeq */ michael@0: const struct ImpTabPair * pImpTabPair; /* pointer to levels state table pair */ michael@0: michael@0: /* the overall paragraph or line directionality - see UBiDiDirection */ michael@0: UBiDiDirection direction; michael@0: michael@0: /* flags is a bit set for which directional properties are in the text */ michael@0: Flags flags; michael@0: michael@0: /* lastArabicPos is index to the last AL in the text, -1 if none */ michael@0: int32_t lastArabicPos; michael@0: michael@0: /* characters after trailingWSStart are WS and are */ michael@0: /* implicitly at the paraLevel (rule (L1)) - levels may not reflect that */ michael@0: int32_t trailingWSStart; michael@0: michael@0: /* fields for paragraph handling */ michael@0: int32_t paraCount; /* set in getDirProps() */ michael@0: /* filled in getDirProps() */ michael@0: Para *paras; michael@0: michael@0: /* for relatively short text, we only need a tiny array of paras (no malloc()) */ michael@0: Para simpleParas[SIMPLE_PARAS_SIZE]; michael@0: michael@0: /* fields for line reordering */ michael@0: int32_t runCount; /* ==-1: runs not set up yet */ michael@0: Run *runs; michael@0: michael@0: /* for non-mixed text, we only need a tiny array of runs (no malloc()) */ michael@0: Run simpleRuns[1]; michael@0: michael@0: /* maximum or current nesting depth of isolate sequences */ michael@0: /* Within resolveExplicitLevels() and checkExplicitLevels(), this is the maximal michael@0: nesting encountered. michael@0: Within resolveImplicitLevels(), this is the index of the current isolates michael@0: stack entry. */ michael@0: int32_t isolateCount; michael@0: Isolate *isolates; michael@0: michael@0: /* for simple text, have a small stack (no malloc()) */ michael@0: Isolate simpleIsolates[SIMPLE_ISOLATES_SIZE]; michael@0: michael@0: /* for inverse Bidi with insertion of directional marks */ michael@0: InsertPoints insertPoints; michael@0: michael@0: /* for option UBIDI_OPTION_REMOVE_CONTROLS */ michael@0: int32_t controlCount; michael@0: michael@0: /* for Bidi class callback */ michael@0: UBiDiClassCallback *fnClassCallback; /* action pointer */ michael@0: const void *coClassCallback; /* context pointer */ michael@0: }; michael@0: michael@0: #define IS_VALID_PARA(x) ((x) && ((x)->pParaBiDi==(x))) michael@0: #define IS_VALID_PARA_OR_LINE(x) ((x) && ((x)->pParaBiDi==(x) || (((x)->pParaBiDi) && (x)->pParaBiDi->pParaBiDi==(x)->pParaBiDi))) michael@0: michael@0: typedef union { michael@0: DirProp *dirPropsMemory; michael@0: UBiDiLevel *levelsMemory; michael@0: Opening *openingsMemory; michael@0: Para *parasMemory; michael@0: Run *runsMemory; michael@0: Isolate *isolatesMemory; michael@0: } BidiMemoryForAllocation; michael@0: michael@0: /* Macros for initial checks at function entry */ michael@0: #define RETURN_IF_NULL_OR_FAILING_ERRCODE(pErrcode, retvalue) \ michael@0: if((pErrcode)==NULL || U_FAILURE(*pErrcode)) return retvalue michael@0: #define RETURN_IF_NOT_VALID_PARA(bidi, errcode, retvalue) \ michael@0: if(!IS_VALID_PARA(bidi)) { \ michael@0: errcode=U_INVALID_STATE_ERROR; \ michael@0: return retvalue; \ michael@0: } michael@0: #define RETURN_IF_NOT_VALID_PARA_OR_LINE(bidi, errcode, retvalue) \ michael@0: if(!IS_VALID_PARA_OR_LINE(bidi)) { \ michael@0: errcode=U_INVALID_STATE_ERROR; \ michael@0: return retvalue; \ michael@0: } michael@0: #define RETURN_IF_BAD_RANGE(arg, start, limit, errcode, retvalue) \ michael@0: if((arg)<(start) || (arg)>=(limit)) { \ michael@0: (errcode)=U_ILLEGAL_ARGUMENT_ERROR; \ michael@0: return retvalue; \ michael@0: } michael@0: michael@0: #define RETURN_VOID_IF_NULL_OR_FAILING_ERRCODE(pErrcode) \ michael@0: if((pErrcode)==NULL || U_FAILURE(*pErrcode)) return michael@0: #define RETURN_VOID_IF_NOT_VALID_PARA(bidi, errcode) \ michael@0: if(!IS_VALID_PARA(bidi)) { \ michael@0: errcode=U_INVALID_STATE_ERROR; \ michael@0: return; \ michael@0: } michael@0: #define RETURN_VOID_IF_NOT_VALID_PARA_OR_LINE(bidi, errcode) \ michael@0: if(!IS_VALID_PARA_OR_LINE(bidi)) { \ michael@0: errcode=U_INVALID_STATE_ERROR; \ michael@0: return; \ michael@0: } michael@0: #define RETURN_VOID_IF_BAD_RANGE(arg, start, limit, errcode) \ michael@0: if((arg)<(start) || (arg)>=(limit)) { \ michael@0: (errcode)=U_ILLEGAL_ARGUMENT_ERROR; \ michael@0: return; \ michael@0: } michael@0: michael@0: /* helper function to (re)allocate memory if allowed */ michael@0: U_CFUNC UBool michael@0: ubidi_getMemory(BidiMemoryForAllocation *pMemory, int32_t *pSize, UBool mayAllocate, int32_t sizeNeeded); michael@0: michael@0: /* helper macros for each allocated array in UBiDi */ michael@0: #define getDirPropsMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \ michael@0: (pBiDi)->mayAllocateText, (length)) michael@0: michael@0: #define getLevelsMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \ michael@0: (pBiDi)->mayAllocateText, (length)) michael@0: michael@0: #define getRunsMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \ michael@0: (pBiDi)->mayAllocateRuns, (length)*sizeof(Run)) michael@0: michael@0: /* additional macros used by ubidi_open() - always allow allocation */ michael@0: #define getInitialDirPropsMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \ michael@0: TRUE, (length)) michael@0: michael@0: #define getInitialLevelsMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \ michael@0: TRUE, (length)) michael@0: michael@0: #define getInitialOpeningsMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->openingsMemory, &(pBiDi)->openingsSize, \ michael@0: TRUE, (length)*sizeof(Opening)) michael@0: michael@0: #define getInitialParasMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->parasMemory, &(pBiDi)->parasSize, \ michael@0: TRUE, (length)*sizeof(Para)) michael@0: michael@0: #define getInitialRunsMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \ michael@0: TRUE, (length)*sizeof(Run)) michael@0: michael@0: #define getInitialIsolatesMemory(pBiDi, length) \ michael@0: ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->isolatesMemory, &(pBiDi)->isolatesSize, \ michael@0: TRUE, (length)*sizeof(Isolate)) michael@0: michael@0: #endif michael@0: michael@0: #endif