mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Reformat minibidi.[ch] in line with my coding conventions. It was
just getting to be too much hassle trying to work with the existing indentation. [originally from svn r4952]
This commit is contained in:
parent
52eb87aed2
commit
73231eeb54
1684
minibidi.c
1684
minibidi.c
File diff suppressed because it is too large
Load Diff
170
minibidi.h
170
minibidi.h
@ -38,12 +38,12 @@
|
|||||||
#define OISR 0x40 /* Override is R */
|
#define OISR 0x40 /* Override is R */
|
||||||
|
|
||||||
/* Shaping Helpers */
|
/* Shaping Helpers */
|
||||||
#define STYPE(xh) (((xh >= SHAPE_FIRST) && (xh <= SHAPE_LAST)) ? \
|
#define STYPE(xh) ((((xh) >= SHAPE_FIRST) && ((xh) <= SHAPE_LAST)) ? \
|
||||||
shapetypes[xh-SHAPE_FIRST].type : SU) /*))*/
|
shapetypes[(xh)-SHAPE_FIRST].type : SU) /*))*/
|
||||||
#define SISOLATED(xh) (shapetypes[xh-SHAPE_FIRST].form_b)
|
#define SISOLATED(xh) (shapetypes[(xh)-SHAPE_FIRST].form_b)
|
||||||
#define SFINAL(xh) xh+1
|
#define SFINAL(xh) ((xh)+1)
|
||||||
#define SINITIAL(xh) xh+2
|
#define SINITIAL(xh) ((xh)+2)
|
||||||
#define SMEDIAL(ch) ch+3
|
#define SMEDIAL(ch) ((ch)+3)
|
||||||
|
|
||||||
typedef struct bidi_char {
|
typedef struct bidi_char {
|
||||||
wchar_t origwc, wc;
|
wchar_t origwc, wc;
|
||||||
@ -64,42 +64,40 @@ int do_bidi(bidi_char *line, int count);
|
|||||||
void doMirror(wchar_t* ch);
|
void doMirror(wchar_t* ch);
|
||||||
|
|
||||||
/* character types */
|
/* character types */
|
||||||
enum
|
enum {
|
||||||
{
|
L,
|
||||||
L,
|
LRE,
|
||||||
LRE,
|
LRO,
|
||||||
LRO,
|
R,
|
||||||
R,
|
AL,
|
||||||
AL,
|
RLE,
|
||||||
RLE,
|
RLO,
|
||||||
RLO,
|
PDF,
|
||||||
PDF,
|
EN,
|
||||||
EN,
|
ES,
|
||||||
ES,
|
ET,
|
||||||
ET,
|
AN,
|
||||||
AN,
|
CS,
|
||||||
CS,
|
NSM,
|
||||||
NSM,
|
BN,
|
||||||
BN,
|
B,
|
||||||
B,
|
S,
|
||||||
S,
|
WS,
|
||||||
WS,
|
ON,
|
||||||
ON,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Shaping Types */
|
/* Shaping Types */
|
||||||
enum
|
enum {
|
||||||
{
|
SL, /* Left-Joining, doesnt exist in U+0600 - U+06FF */
|
||||||
SL, /* Left-Joining, doesnt exist in U+0600 - U+06FF */
|
SR, /* Right-Joining, ie has Isolated, Final */
|
||||||
SR, /* Right-Joining, ie has Isolated, Final */
|
SD, /* Dual-Joining, ie has Isolated, Final, Initial, Medial */
|
||||||
SD, /* Dual-Joining, ie has Isolated, Final, Initial, Medial */
|
SU, /* Non-Joining */
|
||||||
SU, /* Non-Joining */
|
SC /* Join-Causing, like U+0640 (TATWEEL) */
|
||||||
SC /* Join-Causing, like U+0640 (TATWEEL) */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct{
|
typedef struct {
|
||||||
char type;
|
char type;
|
||||||
wchar_t form_b;
|
wchar_t form_b;
|
||||||
} shape_node;
|
} shape_node;
|
||||||
|
|
||||||
/* Kept near the actual table, for verification. */
|
/* Kept near the actual table, for verification. */
|
||||||
@ -107,66 +105,64 @@ typedef struct{
|
|||||||
#define SHAPE_LAST 0x64A
|
#define SHAPE_LAST 0x64A
|
||||||
|
|
||||||
const shape_node shapetypes[] = {
|
const shape_node shapetypes[] = {
|
||||||
/* index, Typ, Iso, Ligature Index*/
|
/* index, Typ, Iso, Ligature Index*/
|
||||||
/* 621 */ {SU, 0xFE80},
|
/* 621 */ {SU, 0xFE80},
|
||||||
/* 622 */ {SR, 0xFE81},
|
/* 622 */ {SR, 0xFE81},
|
||||||
/* 623 */ {SR, 0xFE83},
|
/* 623 */ {SR, 0xFE83},
|
||||||
/* 624 */ {SR, 0xFE85},
|
/* 624 */ {SR, 0xFE85},
|
||||||
/* 625 */ {SR, 0xFE87},
|
/* 625 */ {SR, 0xFE87},
|
||||||
/* 626 */ {SD, 0xFE89},
|
/* 626 */ {SD, 0xFE89},
|
||||||
/* 627 */ {SR, 0xFE8D},
|
/* 627 */ {SR, 0xFE8D},
|
||||||
/* 628 */ {SD, 0xFE8F},
|
/* 628 */ {SD, 0xFE8F},
|
||||||
/* 629 */ {SR, 0xFE93},
|
/* 629 */ {SR, 0xFE93},
|
||||||
/* 62A */ {SD, 0xFE95},
|
/* 62A */ {SD, 0xFE95},
|
||||||
/* 62B */ {SD, 0xFE99},
|
/* 62B */ {SD, 0xFE99},
|
||||||
/* 62C */ {SD, 0xFE9D},
|
/* 62C */ {SD, 0xFE9D},
|
||||||
/* 62D */ {SD, 0xFEA1},
|
/* 62D */ {SD, 0xFEA1},
|
||||||
/* 62E */ {SD, 0xFEA5},
|
/* 62E */ {SD, 0xFEA5},
|
||||||
/* 62F */ {SR, 0xFEA9},
|
/* 62F */ {SR, 0xFEA9},
|
||||||
/* 630 */ {SR, 0xFEAB},
|
/* 630 */ {SR, 0xFEAB},
|
||||||
/* 631 */ {SR, 0xFEAD},
|
/* 631 */ {SR, 0xFEAD},
|
||||||
/* 632 */ {SR, 0xFEAF},
|
/* 632 */ {SR, 0xFEAF},
|
||||||
/* 633 */ {SD, 0xFEB1},
|
/* 633 */ {SD, 0xFEB1},
|
||||||
/* 634 */ {SD, 0xFEB5},
|
/* 634 */ {SD, 0xFEB5},
|
||||||
/* 635 */ {SD, 0xFEB9},
|
/* 635 */ {SD, 0xFEB9},
|
||||||
/* 636 */ {SD, 0xFEBD},
|
/* 636 */ {SD, 0xFEBD},
|
||||||
/* 637 */ {SD, 0xFEC1},
|
/* 637 */ {SD, 0xFEC1},
|
||||||
/* 638 */ {SD, 0xFEC5},
|
/* 638 */ {SD, 0xFEC5},
|
||||||
/* 639 */ {SD, 0xFEC9},
|
/* 639 */ {SD, 0xFEC9},
|
||||||
/* 63A */ {SD, 0xFECD},
|
/* 63A */ {SD, 0xFECD},
|
||||||
/* 63B */ {SU, 0x0},
|
/* 63B */ {SU, 0x0},
|
||||||
/* 63C */ {SU, 0x0},
|
/* 63C */ {SU, 0x0},
|
||||||
/* 63D */ {SU, 0x0},
|
/* 63D */ {SU, 0x0},
|
||||||
/* 63E */ {SU, 0x0},
|
/* 63E */ {SU, 0x0},
|
||||||
/* 63F */ {SU, 0x0},
|
/* 63F */ {SU, 0x0},
|
||||||
/* 640 */ {SC, 0x0},
|
/* 640 */ {SC, 0x0},
|
||||||
/* 641 */ {SD, 0xFED1},
|
/* 641 */ {SD, 0xFED1},
|
||||||
/* 642 */ {SD, 0xFED5},
|
/* 642 */ {SD, 0xFED5},
|
||||||
/* 643 */ {SD, 0xFED9},
|
/* 643 */ {SD, 0xFED9},
|
||||||
/* 644 */ {SD, 0xFEDD},
|
/* 644 */ {SD, 0xFEDD},
|
||||||
/* 645 */ {SD, 0xFEE1},
|
/* 645 */ {SD, 0xFEE1},
|
||||||
/* 646 */ {SD, 0xFEE5},
|
/* 646 */ {SD, 0xFEE5},
|
||||||
/* 647 */ {SD, 0xFEE9},
|
/* 647 */ {SD, 0xFEE9},
|
||||||
/* 648 */ {SR, 0xFEED},
|
/* 648 */ {SR, 0xFEED},
|
||||||
/* 649 */ {SR, 0xFEEF}, /* SD */
|
/* 649 */ {SR, 0xFEEF}, /* SD */
|
||||||
/* 64A */ {SD, 0xFEF1},
|
/* 64A */ {SD, 0xFEF1},
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This describes the data byte and its frequency
|
* This describes the data byte and its frequency
|
||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
unsigned char d;
|
||||||
unsigned char d;
|
unsigned char f;
|
||||||
unsigned char f;
|
} RLENode;
|
||||||
}RLENode;
|
|
||||||
|
|
||||||
|
|
||||||
/* This is an array of RLENodes, which is the
|
/* This is an array of RLENodes, which is the
|
||||||
* Compressed unicode types table
|
* Compressed unicode types table
|
||||||
*/
|
*/
|
||||||
const RLENode RLE_table[] =
|
const RLENode RLE_table[] = {
|
||||||
{
|
|
||||||
{ BN, 9}, { S, 1}, { B, 1}, { S, 1}, { WS, 1},
|
{ BN, 9}, { S, 1}, { B, 1}, { S, 1}, { WS, 1},
|
||||||
{ B, 1}, { BN, 14}, { B, 3}, { S, 1}, { WS, 1},
|
{ B, 1}, { BN, 14}, { B, 3}, { S, 1}, { WS, 1},
|
||||||
{ ON, 2}, { ET, 3}, { ON, 5}, { ET, 1}, { CS, 1},
|
{ ON, 2}, { ET, 3}, { ON, 5}, { ET, 1}, { CS, 1},
|
||||||
|
Loading…
Reference in New Issue
Block a user