• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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) 1997-2016, International Business Machines Corporation and
6  * others. All Rights Reserved.
7  ********************************************************************/
8 /*   file name:  cbiditst.h
9 *   encoding:   UTF-8
10 *   tab size:   8 (not used)
11 *   indentation:4
12 *
13 *   created on: 1999sep22
14 *   created by: Markus W. Scherer
15 */
16 
17 #ifndef CBIDITST_H
18 #define CBIDITST_H
19 
20 #include "unicode/utypes.h"
21 #include "unicode/uchar.h"
22 #include "unicode/ubidi.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 #define MAX_STRING_LENGTH 200
29 
30 /*  Comparing the description of the BiDi algorithm with this implementation
31     is easier with the same names for the BiDi types in the code as there.
32     See UCharDirection in uchar.h .
33 */
34 #define L   U_LEFT_TO_RIGHT
35 #define R   U_RIGHT_TO_LEFT
36 #define EN  U_EUROPEAN_NUMBER
37 #define ES  U_EUROPEAN_NUMBER_SEPARATOR
38 #define ET  U_EUROPEAN_NUMBER_TERMINATOR
39 #define AN  U_ARABIC_NUMBER
40 #define CS  U_COMMON_NUMBER_SEPARATOR
41 #define B   U_BLOCK_SEPARATOR
42 #define S   U_SEGMENT_SEPARATOR
43 #define WS  U_WHITE_SPACE_NEUTRAL
44 #define ON  U_OTHER_NEUTRAL
45 #define LRE U_LEFT_TO_RIGHT_EMBEDDING
46 #define LRO U_LEFT_TO_RIGHT_OVERRIDE
47 #define AL  U_RIGHT_TO_LEFT_ARABIC
48 #define RLE U_RIGHT_TO_LEFT_EMBEDDING
49 #define RLO U_RIGHT_TO_LEFT_OVERRIDE
50 #define PDF U_POP_DIRECTIONAL_FORMAT
51 #define NSM U_DIR_NON_SPACING_MARK
52 #define BN  U_BOUNDARY_NEUTRAL
53 #define FSI U_FIRST_STRONG_ISOLATE
54 #define LRI U_LEFT_TO_RIGHT_ISOLATE
55 #define RLI U_RIGHT_TO_LEFT_ISOLATE
56 #define PDI U_POP_DIRECTIONAL_ISOLATE
57 
58 extern const char * const
59 dirPropNames[U_CHAR_DIRECTION_COUNT];
60 
61 extern UChar
62 charFromDirProp[U_CHAR_DIRECTION_COUNT];
63 
64 typedef struct {
65     const uint8_t *text;
66     int32_t length;
67     UBiDiLevel paraLevel;
68     int32_t lineStart, lineLimit;
69     UBiDiDirection direction;
70     UBiDiLevel resultLevel;
71     const UBiDiLevel *levels;
72     const uint8_t *visualMap;
73 } BiDiTestData;
74 
75 extern const BiDiTestData
76 tests[];
77 
78 extern const int
79 bidiTestCount;
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif
86