1/********************************************************************
2 * COPYRIGHT:
3 * Copyright (c) 1997-2007, 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 XP_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
55extern const char * const
56dirPropNames[U_CHAR_DIRECTION_COUNT];
57
58extern UChar
59charFromDirProp[U_CHAR_DIRECTION_COUNT];
60
61typedef struct {
62    const uint8_t *text;
63    int32_t length;
64    UBiDiLevel paraLevel;
65    int32_t lineStart, lineLimit;
66    UBiDiDirection direction;
67    UBiDiLevel resultLevel;
68    const UBiDiLevel *levels;
69    const uint8_t *visualMap;
70} BiDiTestData;
71
72extern const BiDiTestData
73tests[];
74
75extern const int
76bidiTestCount;
77
78#ifdef XP_CPLUSPLUS
79}
80#endif
81
82#endif
83