w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ubidiimp.h File Reference
#include "unicode/utypes.h"
#include "unicode/ubidi.h"
#include "unicode/uchar.h"
#include "ubidi_props.h"
Include dependency graph for ubidiimp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Para
 
struct  Opening
 
struct  IsoRun
 
struct  BracketData
 
struct  Isolate
 
struct  Run
 
class  Point
 
struct  InsertPoints
 
struct  UBiDi
 
union  BidiMemoryForAllocation
 

Macros

#define DIRPROP_FLAG(dir)   (1UL<<(dir))
 
#define PURE_DIRPROP(prop)   ((prop)&~0xE0) ?????????????????????????
 
#define DIRPROP_FLAG_MULTI_RUNS   (1UL<<31)
 
#define MASK_LTR   (DIRPROP_FLAG(L)|DIRPROP_FLAG(EN)|DIRPROP_FLAG(ENL)|DIRPROP_FLAG(ENR)|DIRPROP_FLAG(AN)|DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO)|DIRPROP_FLAG(LRI))
 
#define MASK_RTL   (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)|DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO)|DIRPROP_FLAG(RLI))
 
#define MASK_R_AL   (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL))
 
#define MASK_STRONG_EN_AN   (DIRPROP_FLAG(L)|DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)|DIRPROP_FLAG(EN)|DIRPROP_FLAG(AN))
 
#define MASK_EXPLICIT   (DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO)|DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO)|DIRPROP_FLAG(PDF))
 
#define MASK_ISO   (DIRPROP_FLAG(LRI)|DIRPROP_FLAG(RLI)|DIRPROP_FLAG(FSI)|DIRPROP_FLAG(PDI))
 
#define MASK_BN_EXPLICIT   (DIRPROP_FLAG(BN)|MASK_EXPLICIT)
 
#define MASK_B_S   (DIRPROP_FLAG(B)|DIRPROP_FLAG(S))
 
#define MASK_WS   (MASK_B_S|DIRPROP_FLAG(WS)|MASK_BN_EXPLICIT|MASK_ISO)
 
#define MASK_POSSIBLE_N   (DIRPROP_FLAG(ON)|DIRPROP_FLAG(CS)|DIRPROP_FLAG(ES)|DIRPROP_FLAG(ET)|MASK_WS)
 
#define MASK_EMBEDDING   (DIRPROP_FLAG(NSM)|MASK_POSSIBLE_N)
 
#define GET_LR_FROM_LEVEL(level)   ((DirProp)((level)&1))
 
#define IS_DEFAULT_LEVEL(level)   ((level)>=0xfe)
 
#define ISOLATE   0x0100
 
#define GET_PARALEVEL(ubidi, index)
 
#define SIMPLE_PARAS_COUNT   10
 
#define SIMPLE_ISOLATES_COUNT   5
 
#define SIMPLE_OPENINGS_COUNT   20
 
#define CR   0x000D
 
#define LF   0x000A
 
#define INDEX_ODD_BIT   (1UL<<31)
 
#define MAKE_INDEX_ODD_PAIR(index, level)   ((index)|((int32_t)((level)&1)<<31))
 
#define ADD_ODD_BIT_FROM_LEVEL(x, level)   ((x)|=((int32_t)((level)&1)<<31))
 
#define REMOVE_ODD_BIT(x)   ((x)&=~INDEX_ODD_BIT)
 
#define GET_INDEX(x)   ((x)&~INDEX_ODD_BIT)
 
#define GET_ODD_BIT(x)   ((uint32_t)(x)>>31)
 
#define IS_ODD_RUN(x)   ((UBool)(((x)&INDEX_ODD_BIT)!=0))
 
#define IS_EVEN_RUN(x)   ((UBool)(((x)&INDEX_ODD_BIT)==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)
 
#define UBIDI_REORDER_LAST_LOGICAL_TO_VISUAL   UBIDI_REORDER_NUMBERS_SPECIAL
 
#define IS_VALID_PARA(x)   ((x) && ((x)->pParaBiDi==(x)))
 
#define IS_VALID_PARA_OR_LINE(x)   ((x) && ((x)->pParaBiDi==(x) || (((x)->pParaBiDi) && (x)->pParaBiDi->pParaBiDi==(x)->pParaBiDi)))
 
#define RETURN_IF_NULL_OR_FAILING_ERRCODE(pErrcode, retvalue)
 
#define RETURN_IF_NOT_VALID_PARA(bidi, errcode, retvalue)
 
#define RETURN_IF_NOT_VALID_PARA_OR_LINE(bidi, errcode, retvalue)
 
#define RETURN_IF_BAD_RANGE(arg, start, limit, errcode, retvalue)
 
#define RETURN_VOID_IF_NULL_OR_FAILING_ERRCODE(pErrcode)
 
#define RETURN_VOID_IF_NOT_VALID_PARA(bidi, errcode)
 
#define RETURN_VOID_IF_NOT_VALID_PARA_OR_LINE(bidi, errcode)
 
#define RETURN_VOID_IF_BAD_RANGE(arg, start, limit, errcode)
 
#define getDirPropsMemory(pBiDi, length)
 
#define getLevelsMemory(pBiDi, length)
 
#define getRunsMemory(pBiDi, length)
 
#define getInitialDirPropsMemory(pBiDi, length)
 
#define getInitialLevelsMemory(pBiDi, length)
 
#define getInitialOpeningsMemory(pBiDi, length)
 
#define getInitialParasMemory(pBiDi, length)
 
#define getInitialRunsMemory(pBiDi, length)
 
#define getInitialIsolatesMemory(pBiDi, length)
 

Typedefs

typedef uint8_t DirProp
 
typedef uint32_t Flags
 
typedef struct Para Para
 
typedef struct Opening Opening
 
typedef struct IsoRun IsoRun
 
typedef struct BracketData BracketData
 
typedef struct Isolate Isolate
 
typedef struct Run Run
 
typedef struct Point Point
 
typedef struct InsertPoints InsertPoints
 

Enumerations

enum  {
  L = U_LEFT_TO_RIGHT , R = U_RIGHT_TO_LEFT , EN = U_EUROPEAN_NUMBER , ES = U_EUROPEAN_NUMBER_SEPARATOR ,
  ET = U_EUROPEAN_NUMBER_TERMINATOR , AN = U_ARABIC_NUMBER , CS = U_COMMON_NUMBER_SEPARATOR , B = U_BLOCK_SEPARATOR ,
  S = U_SEGMENT_SEPARATOR , WS = U_WHITE_SPACE_NEUTRAL , ON = U_OTHER_NEUTRAL , LRE =U_LEFT_TO_RIGHT_EMBEDDING ,
  LRO =U_LEFT_TO_RIGHT_OVERRIDE , AL = U_RIGHT_TO_LEFT_ARABIC , RLE =U_RIGHT_TO_LEFT_EMBEDDING , RLO =U_RIGHT_TO_LEFT_OVERRIDE ,
  PDF =U_POP_DIRECTIONAL_FORMAT , NSM =U_DIR_NON_SPACING_MARK , BN = U_BOUNDARY_NEUTRAL , FSI =U_FIRST_STRONG_ISOLATE ,
  LRI =U_LEFT_TO_RIGHT_ISOLATE , RLI =U_RIGHT_TO_LEFT_ISOLATE , PDI =U_POP_DIRECTIONAL_ISOLATE , ENL ,
  ENR , dirPropCount
}
 
enum  { LRM_BEFORE =1 , LRM_AFTER =2 , RLM_BEFORE =4 , RLM_AFTER =8 }
 
enum  { FOUND_L =(1UL<<( L )) , FOUND_R =(1UL<<( R )) }
 
enum  {
  ZWNJ_CHAR =0x200c , ZWJ_CHAR , LRM_CHAR , RLM_CHAR ,
  LRE_CHAR =0x202a , RLE_CHAR , PDF_CHAR , LRO_CHAR ,
  RLO_CHAR , LRI_CHAR =0x2066 , RLI_CHAR , FSI_CHAR ,
  PDI_CHAR
}
 

Functions

UBiDiLevel ubidi_getParaLevelAtIndex_68 (const UBiDi *pBiDi, int32_t index)
 
UBool ubidi_getRuns_68 (UBiDi *pBiDi, UErrorCode *pErrorCode)
 
UBool ubidi_getMemory_68 (BidiMemoryForAllocation *pMemory, int32_t *pSize, UBool mayAllocate, int32_t sizeNeeded)
 

Macro Definition Documentation

◆ ADD_ODD_BIT_FROM_LEVEL

#define ADD_ODD_BIT_FROM_LEVEL (   x,
  level 
)    ((x)|=((int32_t)((level)&1)<<31))

Definition at line 210 of file ubidiimp.h.

◆ CR

#define CR   0x000D

Definition at line 139 of file ubidiimp.h.

◆ DIRPROP_FLAG

#define DIRPROP_FLAG (   dir)    (1UL<<(dir))

Definition at line 78 of file ubidiimp.h.

◆ DIRPROP_FLAG_MULTI_RUNS

#define DIRPROP_FLAG_MULTI_RUNS   (1UL<<31)

Definition at line 82 of file ubidiimp.h.

◆ GET_INDEX

#define GET_INDEX (   x)    ((x)&~INDEX_ODD_BIT)

Definition at line 213 of file ubidiimp.h.

◆ GET_LR_FROM_LEVEL

#define GET_LR_FROM_LEVEL (   level)    ((DirProp)((level)&1))

Definition at line 115 of file ubidiimp.h.

◆ GET_ODD_BIT

#define GET_ODD_BIT (   x)    ((uint32_t)(x)>>31)

Definition at line 214 of file ubidiimp.h.

◆ GET_PARALEVEL

#define GET_PARALEVEL (   ubidi,
  index 
)
Value:
((UBiDiLevel)(!(ubidi)->defaultParaLevel || (index)<(ubidi)->paras[0].limit ? \
(ubidi)->paraLevel : ubidi_getParaLevelAtIndex((ubidi), (index))))
#define index(s, c)
Definition: plain2.h:351
uint8_t UBiDiLevel
Definition: ubidi.h:339
#define ubidi_getParaLevelAtIndex
Definition: urename.h:449

Definition at line 128 of file ubidiimp.h.

◆ getDirPropsMemory

#define getDirPropsMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \
(pBiDi)->mayAllocateText, (length))
#define length(c)
Definition: ctangleboot.c:65
#define ubidi_getMemory
Definition: urename.h:444

Definition at line 447 of file ubidiimp.h.

◆ getInitialDirPropsMemory

#define getInitialDirPropsMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \
true, (length))

Definition at line 460 of file ubidiimp.h.

◆ getInitialIsolatesMemory

#define getInitialIsolatesMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->isolatesMemory, &(pBiDi)->isolatesSize, \
true, (length)*sizeof(Isolate))

Definition at line 480 of file ubidiimp.h.

◆ getInitialLevelsMemory

#define getInitialLevelsMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \
true, (length))

Definition at line 464 of file ubidiimp.h.

◆ getInitialOpeningsMemory

#define getInitialOpeningsMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->openingsMemory, &(pBiDi)->openingsSize, \
true, (length)*sizeof(Opening))

Definition at line 468 of file ubidiimp.h.

◆ getInitialParasMemory

#define getInitialParasMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->parasMemory, &(pBiDi)->parasSize, \
true, (length)*sizeof(Para))
Definition: ubidiimp.h:150

Definition at line 472 of file ubidiimp.h.

◆ getInitialRunsMemory

#define getInitialRunsMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \
true, (length)*sizeof(Run))
Definition: ubidiimp.h:199

Definition at line 476 of file ubidiimp.h.

◆ getLevelsMemory

#define getLevelsMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \
(pBiDi)->mayAllocateText, (length))

Definition at line 451 of file ubidiimp.h.

◆ getRunsMemory

#define getRunsMemory (   pBiDi,
  length 
)
Value:
ubidi_getMemory((BidiMemoryForAllocation *)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \
(pBiDi)->mayAllocateRuns, (length)*sizeof(Run))

Definition at line 455 of file ubidiimp.h.

◆ INDEX_ODD_BIT

#define INDEX_ODD_BIT   (1UL<<31)

Definition at line 207 of file ubidiimp.h.

◆ IS_BIDI_CONTROL_CHAR

#define IS_BIDI_CONTROL_CHAR (   c)    (((uint32_t)(c)&0xfffffffc)==ZWNJ_CHAR || (uint32_t)((c)-LRE_CHAR)<5 || (uint32_t)((c)-LRI_CHAR)<4)

Definition at line 238 of file ubidiimp.h.

◆ IS_DEFAULT_LEVEL

#define IS_DEFAULT_LEVEL (   level)    ((level)>=0xfe)

Definition at line 117 of file ubidiimp.h.

◆ IS_EVEN_RUN

#define IS_EVEN_RUN (   x)    ((UBool)(((x)&INDEX_ODD_BIT)==0))

Definition at line 216 of file ubidiimp.h.

◆ IS_ODD_RUN

#define IS_ODD_RUN (   x)    ((UBool)(((x)&INDEX_ODD_BIT)!=0))

Definition at line 215 of file ubidiimp.h.

◆ IS_VALID_PARA

#define IS_VALID_PARA (   x)    ((x) && ((x)->pParaBiDi==(x)))

Definition at line 385 of file ubidiimp.h.

◆ IS_VALID_PARA_OR_LINE

#define IS_VALID_PARA_OR_LINE (   x)    ((x) && ((x)->pParaBiDi==(x) || (((x)->pParaBiDi) && (x)->pParaBiDi->pParaBiDi==(x)->pParaBiDi)))

Definition at line 386 of file ubidiimp.h.

◆ ISOLATE

#define ISOLATE   0x0100

Definition at line 123 of file ubidiimp.h.

◆ LF

#define LF   0x000A

Definition at line 140 of file ubidiimp.h.

◆ MAKE_INDEX_ODD_PAIR

#define MAKE_INDEX_ODD_PAIR (   index,
  level 
)    ((index)|((int32_t)((level)&1)<<31))

Definition at line 209 of file ubidiimp.h.

◆ MASK_B_S

#define MASK_B_S   (DIRPROP_FLAG(B)|DIRPROP_FLAG(S))

Definition at line 99 of file ubidiimp.h.

◆ MASK_BN_EXPLICIT

#define MASK_BN_EXPLICIT   (DIRPROP_FLAG(BN)|MASK_EXPLICIT)

Definition at line 96 of file ubidiimp.h.

◆ MASK_EMBEDDING

#define MASK_EMBEDDING   (DIRPROP_FLAG(NSM)|MASK_POSSIBLE_N)

Definition at line 112 of file ubidiimp.h.

◆ MASK_EXPLICIT

Definition at line 91 of file ubidiimp.h.

◆ MASK_ISO

Definition at line 94 of file ubidiimp.h.

◆ MASK_LTR

◆ MASK_POSSIBLE_N

Definition at line 105 of file ubidiimp.h.

◆ MASK_R_AL

#define MASK_R_AL   (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL))

Definition at line 87 of file ubidiimp.h.

◆ MASK_RTL

Definition at line 86 of file ubidiimp.h.

◆ MASK_STRONG_EN_AN

Definition at line 88 of file ubidiimp.h.

◆ MASK_WS

Definition at line 102 of file ubidiimp.h.

◆ PURE_DIRPROP

#define PURE_DIRPROP (   prop)    ((prop)&~0xE0) ?????????????????????????

Definition at line 79 of file ubidiimp.h.

◆ REMOVE_ODD_BIT

#define REMOVE_ODD_BIT (   x)    ((x)&=~INDEX_ODD_BIT)

Definition at line 211 of file ubidiimp.h.

◆ RETURN_IF_BAD_RANGE

#define RETURN_IF_BAD_RANGE (   arg,
  start,
  limit,
  errcode,
  retvalue 
)
Value:
if((arg)<(start) || (arg)>=(limit)) { \
return retvalue; \
} \
#define UPRV_BLOCK_MACRO_END
Definition: umachine.h:178
#define UPRV_BLOCK_MACRO_BEGIN
Definition: umachine.h:169
@ start
Definition: preamble.c:52
@ U_ILLEGAL_ARGUMENT_ERROR
Definition: utypes.h:467
#define limit(x)
Definition: yuvsplittoppm.c:26

Definition at line 413 of file ubidiimp.h.

◆ RETURN_IF_NOT_VALID_PARA

#define RETURN_IF_NOT_VALID_PARA (   bidi,
  errcode,
  retvalue 
)
Value:
if(!IS_VALID_PARA(bidi)) { \
return retvalue; \
} \
#define IS_VALID_PARA(x)
Definition: ubidiimp.h:385
@ U_INVALID_STATE_ERROR
Definition: utypes.h:494

Definition at line 401 of file ubidiimp.h.

◆ RETURN_IF_NOT_VALID_PARA_OR_LINE

#define RETURN_IF_NOT_VALID_PARA_OR_LINE (   bidi,
  errcode,
  retvalue 
)
Value:
if(!IS_VALID_PARA_OR_LINE(bidi)) { \
return retvalue; \
} \
#define IS_VALID_PARA_OR_LINE(x)
Definition: ubidiimp.h:386

Definition at line 407 of file ubidiimp.h.

◆ RETURN_IF_NULL_OR_FAILING_ERRCODE

#define RETURN_IF_NULL_OR_FAILING_ERRCODE (   pErrcode,
  retvalue 
)
Value:
if((pErrcode)==NULL || U_FAILURE(*pErrcode)) return retvalue; \
#define NULL
Definition: ftobjs.h:61
#define U_FAILURE(x)
Definition: utypes.h:735

Definition at line 398 of file ubidiimp.h.

◆ RETURN_VOID_IF_BAD_RANGE

#define RETURN_VOID_IF_BAD_RANGE (   arg,
  start,
  limit,
  errcode 
)
Value:
if((arg)<(start) || (arg)>=(limit)) { \
return; \
} \

Definition at line 435 of file ubidiimp.h.

◆ RETURN_VOID_IF_NOT_VALID_PARA

#define RETURN_VOID_IF_NOT_VALID_PARA (   bidi,
  errcode 
)
Value:
if(!IS_VALID_PARA(bidi)) { \
return; \
} \

Definition at line 423 of file ubidiimp.h.

◆ RETURN_VOID_IF_NOT_VALID_PARA_OR_LINE

#define RETURN_VOID_IF_NOT_VALID_PARA_OR_LINE (   bidi,
  errcode 
)
Value:

Definition at line 429 of file ubidiimp.h.

◆ RETURN_VOID_IF_NULL_OR_FAILING_ERRCODE

#define RETURN_VOID_IF_NULL_OR_FAILING_ERRCODE (   pErrcode)
Value:
if((pErrcode)==NULL || U_FAILURE(*pErrcode)) return; \

Definition at line 420 of file ubidiimp.h.

◆ SIMPLE_ISOLATES_COUNT

#define SIMPLE_ISOLATES_COUNT   5

Definition at line 135 of file ubidiimp.h.

◆ SIMPLE_OPENINGS_COUNT

#define SIMPLE_OPENINGS_COUNT   20

Definition at line 137 of file ubidiimp.h.

◆ SIMPLE_PARAS_COUNT

#define SIMPLE_PARAS_COUNT   10

Definition at line 133 of file ubidiimp.h.

◆ UBIDI_REORDER_LAST_LOGICAL_TO_VISUAL

#define UBIDI_REORDER_LAST_LOGICAL_TO_VISUAL   UBIDI_REORDER_NUMBERS_SPECIAL

Definition at line 312 of file ubidiimp.h.

Typedef Documentation

◆ BracketData

typedef struct BracketData BracketData

◆ DirProp

typedef uint8_t DirProp

Definition at line 37 of file ubidiimp.h.

◆ Flags

typedef uint32_t Flags

Definition at line 38 of file ubidiimp.h.

◆ InsertPoints

typedef struct InsertPoints InsertPoints

◆ Isolate

typedef struct Isolate Isolate

◆ IsoRun

typedef struct IsoRun IsoRun

◆ Opening

typedef struct Opening Opening

◆ Para

typedef struct Para Para

◆ Point

typedef struct Point Point

◆ Run

typedef struct Run Run

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EN 
ES 
ET 
AN 
CS 
WS 
ON 
LRE 
LRO 
AL 
RLE 
RLO 
PDF 
NSM 
BN 
FSI 
LRI 
RLI 
PDI 
ENL 
ENR 
dirPropCount 

Definition at line 44 of file ubidiimp.h.

◆ anonymous enum

anonymous enum
Enumerator
LRM_BEFORE 
LRM_AFTER 
RLM_BEFORE 
RLM_AFTER 

Definition at line 143 of file ubidiimp.h.

◆ anonymous enum

anonymous enum
Enumerator
FOUND_L 
FOUND_R 

Definition at line 155 of file ubidiimp.h.

◆ anonymous enum

anonymous enum

BiDi control code points

Enumerator
ZWNJ_CHAR 
ZWJ_CHAR 
LRM_CHAR 
RLM_CHAR 
LRE_CHAR 
RLE_CHAR 
PDF_CHAR 
LRO_CHAR 
RLO_CHAR 
LRI_CHAR 
RLI_CHAR 
FSI_CHAR 
PDI_CHAR 

Definition at line 222 of file ubidiimp.h.

Function Documentation

◆ ubidi_getMemory_68()

UBool ubidi_getMemory_68 ( BidiMemoryForAllocation pMemory,
int32_t pSize,
UBool  mayAllocate,
int32_t  sizeNeeded 
)

Definition at line 199 of file ubidi.cpp.

References FALSE, NULL, TRUE, uprv_malloc, and uprv_realloc.

◆ ubidi_getParaLevelAtIndex_68()

UBiDiLevel ubidi_getParaLevelAtIndex_68 ( const UBiDi pBiDi,
int32_t  index 
)

Definition at line 644 of file ubidi.cpp.

References i, Para::level, limit, UBiDi::paraCount, and UBiDi::paras.

◆ ubidi_getRuns_68()