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