# 2.11BSD#431 - /usr/src/ucb/tn3270/screen.h

##### Variables

    AidByte           X
    BufferAddress     X
    CursorAddress     X
    FieldForward      X
    FieldReverse      X
    Highest           X
    Initialized       X
    Lowest            X
    UnLocked          X

##### Macros

    Addr3270          X
    BAIC              X
    BufferTo3270_0    X
    BufferTo3270_1    X
    CIAB              X
    DeleteAllFields   X
    DeleteField       X
    FieldAttributes   X
    FieldDec          X
    FieldInc          X
    GetHost           X
    GetTerminal       X
    HasMdt            X
    HighestScreen     X
    IsAutoSkip        X
    IsHighlighted     X
    IsHighlightedAttr X
    IsNonDisplay      X
    IsNonDisplayAttr  X
    IsOrder           X
    IsProtected       X
    IsProtectedAttr   X
    IsStartField      X
    IsUnProtected     X
    LINESIZE          X
    LowestScreen      X
    MAX               X
    MIN               X
    NUMBERLINES       X
    NeedToRedisplay   X
    NeedToRedisplayAttrX
    NeedToRedisplayFieldsX
    NeedToRedisplayFieldsAttrX
    NewField          X
    NotVisuallyCompatibleAttributesX
    SCREENSIZE        X
    ScreenDec         X
    ScreenDown        X
    ScreenInc         X
    ScreenLine        X
    ScreenLineOffset  X
    ScreenUp          X
    SetBufferAddress  X
    SetHost           X
    SetTerminal       X
    TermAttributes    X
    TermDeleteField   X
    TermIsHighlighted X
    TermIsNonDisplay  X
    TermIsStartField  X
    TermNewField      X
    TerminalCharacter X
    TerminalCharacterAttrX
    TurnOffMdt        X
    TurnOnMdt         X
    WhereAttrByte     X
    WhereHighByte     X
    WhereLowByte      X

       1: /*
       2:  *	Copyright 1984, 1985 by the Regents of the University of
       3:  *	California and by Gregory Glenn Minshall.
       4:  *
       5:  *	Permission to use, copy, modify, and distribute these
       6:  *	programs and their documentation for any purpose and
       7:  *	without fee is hereby granted, provided that this
       8:  *	copyright and permission appear on all copies and
       9:  *	supporting documentation, the name of the Regents of
      10:  *	the University of California not be used in advertising
      11:  *	or publicity pertaining to distribution of the programs
      12:  *	without specific prior permission, and notice be given in
      13:  *	supporting documentation that copying and distribution is
      14:  *	by permission of the Regents of the University of California
      15:  *	and by Gregory Glenn Minshall.  Neither the Regents of the
      16:  *	University of California nor Gregory Glenn Minshall make
      17:  *	representations about the suitability of this software
      18:  *	for any purpose.  It is provided "as is" without
      19:  *	express or implied warranty.
      20:  */
      21:
      22:
      23: /* defines and defines to describe how to deal with the screen */
      24:
      25: #define LINESIZE    80
      26: #define NUMBERLINES 24
      27: #define SCREENSIZE  (LINESIZE*NUMBERLINES)
      28: #define LowestScreen()  0
      29: #define HighestScreen() (SCREENSIZE-1)
      30:
      31: #define ScreenLineOffset(x) ((x)%LINESIZE)
      32: #define ScreenLine(x)   ((int)((x)/LINESIZE))
      33: #define ScreenInc(x)    (((x)==HighestScreen())? LowestScreen():x+1)
      34: #define ScreenDec(x)    (((x)==LowestScreen())? HighestScreen():x-1)
      35: #define ScreenUp(x) (((x)+(SCREENSIZE-LINESIZE))%SCREENSIZE)
      36: #define ScreenDown(x)   (((x)+LINESIZE)%SCREENSIZE)
      37: #define IsOrder(x)  ((x) && ((x) < 0x40) && (\
      38:                 ((x) == ORDER_SF) || \
      39:                 ((x) == ORDER_SBA) || \
      40:                 ((x) == ORDER_IC) || \
      41:                 ((x) == ORDER_PT) || \
      42:                 ((x) == ORDER_RA) || \
      43:                 ((x) == ORDER_EUA) || \
      44:                 ((x) == ORDER_YALE)))
      45: #define BAIC(x)     ((x)&0x3f)
      46: #define CIAB(x)     (CIABuffer[(x)&0x3f])
      47: #define BufferTo3270_0(x)   (CIABuffer[(int)((x)/0x40)])
      48: #define BufferTo3270_1(x)   (CIABuffer[(x)&0x3f])
      49: #define Addr3270(x,y)   (BAIC(x)*64+BAIC(y))
      50: #define SetBufferAddress(x,y)   ((x)*LINESIZE+(y))
      51:
      52: /* These know how fields are implemented... */
      53:
      54: #define FieldInc(p) FieldFind(FieldForward, p, LowestScreen())
      55: #define FieldDec(p) (HighestScreen() - \
      56:                 FieldFind(FieldReverse, \
      57:                     HighestScreen()-p, HighestScreen()))
      58: #define WhereAttrByte(p)    (IsStartField(p)? p: FieldDec(p))
      59: #define WhereHighByte(p)    ScreenDec(FieldInc(p))
      60: #define WhereLowByte(p)     ScreenInc(WhereAttrByte(p))
      61: #define FieldAttributes(x)  (IsStartField(x)? Host[x].field&0xff : \
      62:                     Host[WhereAttrByte(x)].field&0xff)
      63: #define TermAttributes(x)   (TermIsStartField(x)? Terminal[x].field&0xff : \
      64:                     Terminal[WhereTermAttrByte(x)].field&0xff)
      65: #define TurnOffMdt(x)   (Host[WhereAttrByte(x)].field &= ~ATTR_MDT)
      66: #define TurnOnMdt(x)    (Host[WhereAttrByte(x)].field |= ATTR_MDT)
      67: #define HasMdt(x)   (Host[x].field&ATTR_MDT)    /* modified tag */
      68:
      69: #define IsStartField(x) (Host[x].field&ATTR_MASK)   /* field starts here */
      70: #define TermIsStartField(x) (Terminal[x].field&ATTR_MASK)
      71: #define NewField(p,a)   (Host[p].field = (a)|ATTR_MASK, \
      72:                 FieldForward[p] = FieldReverse[SCREENSIZE-p-1] = 1)
      73: #define TermNewField(p,a)   (Terminal[p].field = (a)|ATTR_MASK)
      74: #define DeleteField(p)  (Host[p].field = 0, \
      75:                 FieldForward[p] = FieldReverse[SCREENSIZE-p-1] = 0)
      76: #define TermDeleteField(p)  (Terminal[p].field = 0)
      77: #define DeleteAllFields()   (bzero(FieldForward, sizeof FieldForward), \
      78:                     bzero(FieldReverse, sizeof FieldReverse))
      79:
      80:
      81: /* The following are independent of the implementation of fields */
      82: #define IsProtectedAttr(p,a)    (IsStartField(p) || ((a)&ATTR_PROT))
      83: #define IsProtected(p)  IsProtectedAttr(p,FieldAttributes(p))
      84:
      85: #define IsUnProtected(x)    (!IsProtected(x))
      86:
      87: #define IsAutoSkip(x)   (FieldAttributes(x)&ATTR_AUTO_SKIP)
      88:
      89: #define IsNonDisplayAttr(c) (((c)&ATTR_DSPD_MASK) == ATTR_DSPD_NONDISPLAY)
      90: #define IsNonDisplay(p) IsNonDisplayAttr(FieldAttributes(p))
      91:
      92: #define IsHighlightedAttr(c) \
      93:         (((c)&ATTR_DSPD_MASK) == ATTR_DSPD_HIGH)
      94: #define IsHighlighted(p) \
      95:         (IsHighlightedAttr(FieldAttributes(p)) && !IsStartField(p))
      96:
      97: #define TermIsNonDisplay(x) \
      98:             ((TermAttributes(x)&ATTR_DSPD_MASK) == ATTR_DSPD_NONDISPLAY)
      99: #define TermIsHighlighted(x) \
     100:         (((TermAttributes(x)&ATTR_DSPD_MASK) == ATTR_DSPD_HIGH) \
     101:                     && !TermIsStartField(x))
     102:
     103: #define TerminalCharacterAttr(c,p,a)    (IsNonDisplayAttr(a) ? ' ':c)
     104: #define TerminalCharacter(c,p)  TerminalCharacterAttr(c,p,FieldAttributes(p))
     105:
     106: #define NeedToRedisplayFields(p) ((TermIsNonDisplay(p) != IsNonDisplay(p)) || \
     107:                 (TermIsHighlighted(p) != IsHighlighted(p)))
     108: #define NeedToRedisplayFieldsAttr(p,c) ( \
     109:             (TermIsNonDisplay(p) != IsNonDisplayAttr(c)) || \
     110:             (TermIsHighlighted(p) != IsHighlightedAttr(c)))
     111:
     112: #define NotVisuallyCompatibleAttributes(p,c,d) ( \
     113:             (IsNonDisplayAttr(c) != IsNonDisplayAttr(d)) || \
     114:             (IsHighlightedAttr(c) != IsHighlightedAttr(d)))
     115:
     116: #define NeedToRedisplayAttr(c,p,a) \
     117:             ((c != GetTerminal(p)) || NeedToRedisplayFieldsAttr(p,a))
     118: #define NeedToRedisplay(c,p)    NeedToRedisplayAttr(c,p,FieldAttributes(p))
     119:
     120: #define MAX(x,y)    ((x)<(y)? (y):(x))
     121: #define MIN(x,y)    ((x)<(y)? x:(y))
     122:
     123: #define GetHost(i)  Host[i].data
     124: #define SetHost(i,c)    (Host[i].data = c)
     125:
     126: #define GetTerminal(i)      Terminal[i].data
     127: #define SetTerminal(i,c)    (Terminal[i].data = c)
     128:
     129: struct {
     130:     char    data,   /* data at this position */
     131:         field;  /* field attributes of this location if ATTR_MASK */
     132: }   Host[SCREENSIZE],       /* host view of screen */
     133:     Terminal[SCREENSIZE];
     134:
     135: char    FieldForward[SCREENSIZE],   /* non-zero for SF, 0..1919 */
     136:     FieldReverse[SCREENSIZE];   /* non-zero for SF, 1919..0 */
     137:
     138:
     139: int CursorAddress;          /* where cursor is */
     140: int BufferAddress;          /* where writes are going */
     141:
     142: int Lowest, Highest;
     143:
     144: /* the Following are globals */
     145:
     146: extern char CIABuffer[];
     147:
     148: int UnLocked;       /* is the keyboard unlocked */
     149: int AidByte;
     150:
     151: int Initialized;    /* are we initialized? */

#### Defined variables

AidByte defined in line 149; used 13 times

- in /usr/src/ucb/tn3270/datastream.c line 623, 803
- in /usr/src/ucb/tn3270/keyboard.c line 320-326(6), 356-357(2), 387, 481, 516

BufferAddress defined in line 140; used 29 times

- in /usr/src/ucb/tn3270/datastream.c line 172, 555, 656-668(11), 703, 709-712(2), 724, 731-733(4), 739-743(6), 769, 795

CursorAddress defined in line 139; used 97 times

- in /usr/src/ucb/tn3270/datastream.c line 40, 173, 554, 607-611(3), 619-620(2), 691-692(2), 709
- in /usr/src/ucb/tn3270/keyboard.c line 60-61(2), 69-71(2), 83-90(4), 105-113(4), 160, 169(2), 176, 185(2), 198, 208, 327-328(2), 361-362(2), 413, 419, 425, 431-435(6), 526-535(6), 554-563(5), 579-598(11), 621-622(2), 643-655(4), 692, 700, 749-753(2), 772-785(4), 793-796(2), 805-816(4), 825-829(2), 836-839(2), 848-852(2), 859-866(5)

FieldForward defined in line 135; used 5 times

- in line 54, 72-77(4)

FieldReverse defined in line 136; used 5 times

- in line 56, 72-78(4)

Highest defined in line 142; used 16 times

- in /usr/src/ucb/tn3270/datastream.c line 46-47(2), 175, 187, 344-345(3), 352-361(3), 488-490(2), 517-521(2), 552, 679

Initialized defined in line 151; used 4 times

- in /usr/src/ucb/tn3270/datastream.c line 516, 542, 559, 678

Lowest defined in line 142; used 15 times

- in /usr/src/ucb/tn3270/datastream.c line 43-44(2), 174, 186, 347-356(4), 487-489(3), 517-521(2), 551, 679

UnLocked defined in line 148; used 10 times

- in /usr/src/ucb/tn3270/datastream.c line 40, 556, 622, 805
- in /usr/src/ucb/tn3270/keyboard.c line 455, 464-466(2), 479, 493, 514

#### Defined macros

Addr3270 defined in line 49; used 3 times

- in /usr/src/ucb/tn3270/datastream.c line 703, 728, 740

BAIC defined in line 45; used 2 times

- in line 49(2)

BufferTo3270_0 defined in line 47; used 3 times

- in /usr/src/ucb/tn3270/keyboard.c line 292, 327, 361

BufferTo3270_1 defined in line 48; used 4 times

- in /usr/src/ucb/tn3270/keyboard.c line 293, 328, 362-367(2)

CIAB defined in line 46; never used
DeleteAllFields defined in line 77; used 2 times

- in /usr/src/ucb/tn3270/datastream.c line 171, 546

DeleteField defined in line 74; used 1 times

- in /usr/src/ucb/tn3270/datastream.c line 226

FieldAttributes defined in line 61; used 12 times

- in line 83-95(4), 104, 118
- in /usr/src/ucb/tn3270/datastream.c line 369, 657-659(2), 739
- in /usr/src/ucb/tn3270/keyboard.c line 367, 435

FieldDec defined in line 55; used 1 times

- in line 58

FieldInc defined in line 54; used 9 times

- in line 59
- in /usr/src/ucb/tn3270/datastream.c line 595
- in /usr/src/ucb/tn3270/keyboard.c line 66, 206, 338, 419, 637, 679, 863

GetHost defined in line 123; used 20 times

- in /usr/src/ucb/tn3270/datastream.c line 393, 406, 453, 471
- in /usr/src/ucb/tn3270/keyboard.c line 149, 219, 227, 265, 299, 369, 420, 427, 540, 547, 794, 803, 814, 823, 837, 846

GetTerminal defined in line 126; used 4 times

- in line 117
- in /usr/src/ucb/tn3270/datastream.c line 234, 471, 662

HasMdt defined in line 67; used 3 times

- in /usr/src/ucb/tn3270/datastream.c line 592, 615
- in /usr/src/ucb/tn3270/keyboard.c line 335

HighestScreen defined in line 29; used 18 times

- in line 33-34(2), 55-57(3)
- in /usr/src/ucb/tn3270/datastream.c line 40, 175, 186, 281, 344, 489, 551, 607-608(2), 619, 712, 719, 787

IsAutoSkip defined in line 87; never used
IsHighlighted defined in line 94; used 1 times

- in line 107

IsHighlightedAttr defined in line 92; used 5 times

- in line 95, 110-114(3)
- in /usr/src/ucb/tn3270/datastream.c line 266

IsNonDisplay defined in line 90; used 1 times

- in line 106

IsNonDisplayAttr defined in line 89; used 5 times

- in line 90, 103, 109-113(3)

IsOrder defined in line 37; used 2 times

- in /usr/src/ucb/tn3270/datastream.c line 640, 777

IsProtected defined in line 83; used 18 times

- in line 85
- in /usr/src/ucb/tn3270/datastream.c line 716
- in /usr/src/ucb/tn3270/keyboard.c line 105, 219, 226, 413, 526, 537-540(2), 547, 560, 595, 692, 700, 794, 803, 814, 837

IsProtectedAttr defined in line 82; used 2 times

- in line 83
- in /usr/src/ucb/tn3270/datastream.c line 742

IsStartField defined in line 69; used 24 times

- in line 58-61(2), 82, 95
- in /usr/src/ucb/tn3270/datastream.c line 225, 266, 371-372(2), 378, 404, 472, 656, 714
- in /usr/src/ucb/tn3270/keyboard.c line 63-68(2), 85, 146, 153, 295, 331, 365, 434, 634, 678

IsUnProtected defined in line 85; used 11 times

- in /usr/src/ucb/tn3270/datastream.c line 609
- in /usr/src/ucb/tn3270/keyboard.c line 63-68(2), 85, 113, 197, 624, 640-650(3), 661

LINESIZE defined in line 25; used 10 times

- in line 27-36(5), 50
- in /usr/src/ucb/tn3270/datastream.c line 366
- in /usr/src/ucb/tn3270/keyboard.c line 177-183(3)

LowestScreen defined in line 28; used 18 times

- in line 33-34(2), 54
- in /usr/src/ucb/tn3270/datastream.c line 174, 187, 347-348(2), 490, 552, 590, 608, 786
- in /usr/src/ucb/tn3270/keyboard.c line 208, 263, 329, 363, 659
- in /usr/src/ucb/tn3270/screen.c line 64

MAX defined in line 120; never used
MIN defined in line 121; never used
NUMBERLINES defined in line 26; used 2 times

- in line 27
- in /usr/src/ucb/tn3270/datastream.c line 128

NeedToRedisplay defined in line 118; never used
NeedToRedisplayAttr defined in line 116; used 1 times

- in line 118

NeedToRedisplayFields defined in line 106; never used
NeedToRedisplayFieldsAttr defined in line 108; used 1 times

- in line 117

NewField defined in line 71; used 1 times

- in /usr/src/ucb/tn3270/datastream.c line 665

NotVisuallyCompatibleAttributes defined in line 112; used 2 times

- in /usr/src/ucb/tn3270/datastream.c line 396, 658

SCREENSIZE defined in line 27; used 12 times

- in line 29, 35-36(3), 72-75(2), 132-136(4)
- in /usr/src/ucb/tn3270/screen.c line 76-77(2)

ScreenDec defined in line 34; used 20 times

- in line 59
- in /usr/src/ucb/tn3270/datastream.c line 345
- in /usr/src/ucb/tn3270/keyboard.c line 83-85(2), 93, 419, 425-426(3), 526-529(2), 536, 542, 549, 583, 813-815(2), 824, 852
- in /usr/src/ucb/tn3270/screen.c line 61

ScreenDown defined in line 36; used 2 times

- in /usr/src/ucb/tn3270/keyboard.c line 591, 621

ScreenInc defined in line 33; used 43 times

- in line 60
- in /usr/src/ucb/tn3270/datastream.c line 302, 402, 408, 474, 608, 668, 713-715(2), 732, 741, 776, 784
- in /usr/src/ucb/tn3270/keyboard.c line 63-69(3), 112, 150-152(2), 206, 220, 230, 275, 297, 309, 371, 433, 530, 554, 563, 587, 598, 622, 635-637(2), 659, 682, 795, 804, 829, 836-838(2), 847

ScreenLine defined in line 32; used 12 times

- in /usr/src/ucb/tn3270/datastream.c line 285-290(2), 298, 492, 691
- in /usr/src/ucb/tn3270/keyboard.c line 169, 185, 621, 645-652(3), 785

ScreenLineOffset defined in line 31; used 14 times

- in /usr/src/ucb/tn3270/datastream.c line 286-290(2), 298, 366, 493, 692
- in /usr/src/ucb/tn3270/keyboard.c line 160, 176, 643, 749-753(2), 772-781(3)

ScreenUp defined in line 35; used 1 times

- in /usr/src/ucb/tn3270/keyboard.c line 579

SetBufferAddress defined in line 50; used 14 times

- in /usr/src/ucb/tn3270/datastream.c line 172-173(2), 555, 620
- in /usr/src/ucb/tn3270/keyboard.c line 71, 90, 169, 185, 194, 621, 641-652(4)

SetHost defined in line 124; used 2 times

- in /usr/src/ucb/tn3270/datastream.c line 229, 667

SetTerminal defined in line 127; used 3 times

- in /usr/src/ucb/tn3270/datastream.c line 280, 380, 434

TermAttributes defined in line 63; used 4 times

- in line 98-100(2)
- in /usr/src/ucb/tn3270/datastream.c line 373-377(2)

TermDeleteField defined in line 76; used 1 times

- in /usr/src/ucb/tn3270/datastream.c line 382

TermIsHighlighted defined in line 99; used 2 times

- in line 107-110(2)

TermIsNonDisplay defined in line 97; used 2 times

- in line 106-109(2)

TermIsStartField defined in line 70; used 8 times

- in line 63, 101
- in /usr/src/ucb/tn3270/datastream.c line 234, 371, 405, 431, 472
- in /usr/src/ucb/tn3270/screen.c line 58

TermNewField defined in line 73; used 2 times

- in /usr/src/ucb/tn3270/datastream.c line 379, 433

TerminalCharacter defined in line 104; never used
TerminalCharacterAttr defined in line 103; used 2 times

- in line 104
- in /usr/src/ucb/tn3270/datastream.c line 282

TurnOffMdt defined in line 65; used 2 times

- in /usr/src/ucb/tn3270/datastream.c line 593, 616

TurnOnMdt defined in line 66; used 4 times

- in /usr/src/ucb/tn3270/keyboard.c line 108, 143, 432, 663

WhereAttrByte defined in line 58; used 11 times

- in line 60-66(4)
- in /usr/src/ucb/tn3270/datastream.c line 369, 590, 739
- in /usr/src/ucb/tn3270/keyboard.c line 61, 329, 622, 659

WhereHighByte defined in line 59; used 1 times

- in /usr/src/ucb/tn3270/keyboard.c line 297

WhereLowByte defined in line 60; used 2 times

- in /usr/src/ucb/tn3270/keyboard.c line 195, 289

#### Usage of this include

screen.h used 3 times

- in /usr/src/ucb/tn3270/datastream.c line 32
- in /usr/src/ucb/tn3270/keyboard.c line 28
- in /usr/src/ucb/tn3270/screen.c line 30

Last modified: 1987-02-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1546 |