Skip to content

Commit 579c26f

Browse files
authored
Merge pull request #301 from davidrg/exclude-unused-from-kui
Exclude Console API code from K95G
2 parents 6b12cc3 + 86c87ea commit 579c26f

File tree

7 files changed

+87
-1
lines changed

7 files changed

+87
-1
lines changed

kermit/k95/ckctel.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3544,7 +3544,15 @@ tn_debug(s) char *s;
35443544
if (!scrninitialized[VTERM]) {
35453545
USHORT x,y;
35463546
checkscreenmode();
3547+
#ifndef ONETERMUPD
35473548
GetCurPos(&y, &x);
3549+
#else
3550+
{
3551+
position * ppos = VscrnGetCurPos(VCMD);
3552+
x = ppos->x;
3553+
y = ppos->y;
3554+
};
3555+
#endif
35483556
SaveCmdMode(x+1,y+1);
35493557
scrninit();
35503558
RestoreCmdMode();

kermit/k95/ckoco2.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,15 @@ extern vtattrib attrib, cmdattrib;
104104
extern bool cursoron[], cursorena[],scrollflag[], scrollstatus[], flipscrnflag[] ;
105105
extern TID tidTermScrnUpd ;
106106

107+
#ifndef KUI
107108
extern
108109
#ifdef NT
109110
HANDLE
110111
#else
111112
HVIO
112113
#endif
113114
VioHandle;
115+
#endif /* ! KUI */
114116

115117
#ifdef OS2MOUSE
116118
extern int tt_mouse ;
@@ -143,9 +145,15 @@ int pwidth, pheight; /* Physical screen width, height */
143145
int ttgcwsz(); /* ckocon.c */
144146
int os2settitle(char *, int); /* ckotio.c */
145147

148+
#ifndef KUI
146149
/*---------------------------------------------------------------------------*/
147150
/* ReadCellStr */
148151
/*---------------------------------------------------------------------------*/
152+
/* In practice this is only ever used for one thing: during startup to set the
153+
* command screen colour to the existing console screen colour. The only other
154+
* reference is reversescreen but only when ONETERMUPD is not defined, which
155+
* probably hasn't been the case since the mid 90s.
156+
*/
149157
USHORT
150158
ReadCellStr( viocell * CellStr, PUSHORT Length, USHORT Row, USHORT Column )
151159
{
@@ -277,7 +285,9 @@ ReadCellStr( viocell * CellStr, PUSHORT Length, USHORT Row, USHORT Column )
277285
return VioReadCellStr( (PCH) CellStr, Length, Row, Column, VioHandle ) ;
278286
#endif /* NT */
279287
}
288+
#endif /* KUI */
280289

290+
#ifndef KUI
281291
/*---------------------------------------------------------------------------*/
282292
/* WrtCellStr */
283293
/*---------------------------------------------------------------------------*/
@@ -514,7 +524,7 @@ WrtCellStr( viocell * CellStr, USHORT Length, USHORT Row, USHORT Column )
514524
return VioWrtCellStr( (PCH) CellStr, Length*sizeof(viocell), Row, Column, VioHandle ) ;
515525
#endif /* NT */
516526
}
517-
527+
#endif /* ! KUI */
518528

519529

520530

@@ -533,6 +543,7 @@ VscrnForceFullUpdate(void)
533543
os2settitle(NULL,1); /* Force a Title update */
534544
}
535545

546+
#ifndef KUI
536547
USHORT
537548
WrtCellStrDiff( viocell * CellStr, USHORT Length, USHORT Row, USHORT Column,
538549
USHORT Height, USHORT Width )
@@ -618,6 +629,7 @@ WrtCellStrDiff( viocell * CellStr, USHORT Length, USHORT Row, USHORT Column,
618629
return rc ;
619630

620631
}
632+
#endif /* ! KUI */
621633

622634
#ifndef KUI
623635
/*---------------------------------------------------------------------------*/
@@ -760,6 +772,7 @@ WrtNCell( viocell Cell, USHORT Times, USHORT Row, USHORT Column )
760772
}
761773
#endif /* KUI */
762774

775+
#ifndef ONETERMUPD
763776
/*---------------------------------------------------------------------------*/
764777
/* WrtCharStrAtt */
765778
/*---------------------------------------------------------------------------*/
@@ -900,6 +913,7 @@ WrtCharStrAtt( PCH CharStr, USHORT Length, USHORT Row, USHORT Column,
900913
return VioWrtCharStrAtt( CharStr, Length, Row, Column, Attr, VioHandle ) ;
901914
#endif /* NT */
902915
}
916+
#endif /* ! ONETERMUPD */
903917

904918
#ifndef KUI
905919
/*---------------------------------------------------------------------------*/
@@ -1311,6 +1325,7 @@ SetMode( PCK_VIDEOMODEINFO ModeData )
13111325
}
13121326
#endif /* KUI */
13131327

1328+
#ifndef KUI
13141329
/*---------------------------------------------------------------------------*/
13151330
/* GetCurPos */
13161331
/*---------------------------------------------------------------------------*/
@@ -1340,7 +1355,9 @@ USHORT GetCurPos( PUSHORT Row, PUSHORT Column )
13401355
return VioGetCurPos( Row, Column, VioHandle ) ;
13411356
#endif /* NT */
13421357
}
1358+
#endif /* !KUI */
13431359

1360+
#ifndef KUI
13441361
/*---------------------------------------------------------------------------*/
13451362
/* SetCurPos */
13461363
/*---------------------------------------------------------------------------*/
@@ -1367,7 +1384,9 @@ USHORT SetCurPos( USHORT Row, USHORT Column )
13671384
return VioSetCurPos( Row, Column, VioHandle ) ;
13681385
#endif /* NT */
13691386
}
1387+
#endif /* ! KUI */
13701388

1389+
#ifndef KUI
13711390
/*---------------------------------------------------------------------------*/
13721391
/* GetCurType */
13731392
/*---------------------------------------------------------------------------*/
@@ -1445,6 +1464,7 @@ USHORT SetCurType( PCK_CURSORINFO CursorData )
14451464
#endif /* NT */
14461465
return rc ;
14471466
}
1467+
#endif /* !KUI */
14481468

14491469
BOOL
14501470
IsOS2FullScreen( void )
@@ -4385,6 +4405,7 @@ IsCellPartOfURL( BYTE mode, USHORT row, USHORT col )
43854405
*/
43864406
#define URLMINCNT 4096
43874407
#define NEW_EXCLUSIVE 1
4408+
43884409
void
43894410
TermScrnUpd( void * threadinfo)
43904411
{
@@ -5245,6 +5266,9 @@ os2ResetFont( void )
52455266
/*---------------------------------------------------------------------------*/
52465267
void
52475268
killcursor( BYTE vmode ) {
5269+
#ifdef KUI
5270+
cursoron[vmode] = FALSE;
5271+
#else
52485272
CK_CURSORINFO crsr_info;
52495273
debug(F100,"killcursor","",0);
52505274
if (!cursoron[vmode]) /* It's already off */
@@ -5255,13 +5279,17 @@ killcursor( BYTE vmode ) {
52555279
{
52565280
cursoron[vmode] = FALSE;
52575281
}
5282+
#endif /* ! KUI */
52585283
}
52595284

52605285
/*---------------------------------------------------------------------------*/
52615286
/* newcursor */
52625287
/*---------------------------------------------------------------------------*/
52635288
void
52645289
newcursor( BYTE vmode ) {
5290+
#ifdef KUI
5291+
cursoron[vmode] = TRUE;
5292+
#else KUI
52655293
CK_CURSORINFO vci;
52665294

52675295
debug(F100,"newcursor","",0);
@@ -5303,6 +5331,7 @@ newcursor( BYTE vmode ) {
53035331
cursoron[vmode] = TRUE;
53045332
VscrnIsDirty(vmode);
53055333
}
5334+
#endif /* ! KUI */
53065335
}
53075336

53085337
/*---------------------------------------------------------------------------*/

kermit/k95/ckocon.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,9 @@ RestoreCmdMode() {
489489
#endif /* COMMENT */
490490
debug(F101,"x_rest wherex","",commandscreen.ox);
491491
debug(F101,"x_rest wherey","",commandscreen.oy);
492+
#ifndef KUI
492493
SetCurPos( commandscreen.oy-1, commandscreen.ox-1 ) ;
494+
#endif /* ! KUI */
493495
/* lgotoxy no longer moves */
494496
/* the physical cursor */
495497
vmode = VCMD ;
@@ -732,10 +734,15 @@ clearcmdscreen(void) {
732734
viocell cell ;
733735

734736
ttgcwsz();
737+
/* TODO: What should we do for KUI? */
738+
#ifndef KUI
739+
/* WrtNCell does nothing useful for KUI as we don't have a console window
740+
* to write to */
735741
cell.c = ' ' ;
736742
cell.video_attr = colorcmd ;
737743
WrtNCell(cell, cmd_cols * (cmd_rows+1), 0, 0);
738744
SetCurPos( 0, 0 ) ;
745+
#endif /* ! KUI */
739746
}
740747
#endif /* KUI */
741748

@@ -2400,6 +2407,7 @@ checkscreenmode() {
24002407

24012408
void
24022409
setcursormode() {
2410+
#ifndef KUI
24032411
#ifdef NT
24042412
CK_CURSORINFO vci={88,0,8,1};
24052413
#else
@@ -2449,12 +2457,15 @@ setcursormode() {
24492457
vi.fs = 1; /* 0 = blinking, 1 = hi intensity */
24502458
VioSetState((PVOID) &vi, VioHandle);
24512459
#endif /* NT */
2460+
#endif /* ! KUI */
24522461
}
24532462

24542463
void
24552464
restorecursormode() {
2465+
#ifndef KUI
24562466
debug(F100,"restorecursormode","",0);
24572467
SetCurType(&crsr_command);
2468+
#endif /* ! KUI */
24582469
}
24592470

24602471
static void
@@ -3403,7 +3414,15 @@ conect(int async) {
34033414

34043415
checkscreenmode(); /* Initialize terminal emulator */
34053416
setcursormode();
3417+
#ifndef ONETERMUPD
34063418
GetCurPos(&y, &x); /* Command screen cursor position */
3419+
#else
3420+
{
3421+
position * ppos = VscrnGetCurPos(VCMD);
3422+
x = ppos->x;
3423+
y = ppos->y;
3424+
};
3425+
#endif
34073426
SaveCmdMode(x+1,y+1); /* Remember Command screen */
34083427
RestoreTermMode(); /* Put up previous terminal screen */
34093428
#ifndef KUI

kermit/k95/ckocon.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,10 +1494,14 @@ _PROTOTYP( int vt_macro_in, (void) );
14941494
_PROTOTYP( void savescreen, (ascreen *,int,int) ) ;
14951495
_PROTOTYP( int restorescreen, (ascreen *) ) ;
14961496
_PROTOTYP( void reverserange, (SHORT, SHORT, SHORT, SHORT) ) ;
1497+
#ifndef KUI
14971498
_PROTOTYP( USHORT ReadCellStr, ( viocell *, PUSHORT, USHORT, USHORT ) );
1499+
#endif
14981500
_PROTOTYP( USHORT WrtCellStr, ( viocell *, USHORT, USHORT, USHORT ) );
14991501
_PROTOTYP( USHORT ReadCharStr, ( viocell *, PUSHORT, USHORT, USHORT ) );
1502+
#ifndef ONETERMUPD
15001503
_PROTOTYP( USHORT WrtCharStrAtt, ( PCH, USHORT, USHORT, USHORT, cell_video_attr_t* ) );
1504+
#endif /* ONETERMUPD */
15011505
#ifndef KUI
15021506
_PROTOTYP( USHORT WrtNCell, ( viocell, USHORT, USHORT, USHORT ) );
15031507
_PROTOTYP( USHORT GetMode, ( PCK_VIDEOMODEINFO ) );

kermit/k95/ckosyn.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,15 @@ UINT htimAlarm = (UINT) 0 ;
7272
UINT htimVscrn[VNUM] = {(UINT) 0, (UINT) 0, (UINT) 0} ;
7373

7474
HANDLE hevVscrnTimer[VNUM] = { (HANDLE) 0, (HANDLE) 0,(HANDLE) 0 } ;
75+
7576
HANDLE hevVscrnDirty[VNUM] = { (HANDLE) 0, (HANDLE) 0,(HANDLE) 0 } ;
7677

78+
#ifndef KUI
7779
HANDLE hevVscrnUpdate[VNUM][2] = {{(HANDLE) NULL, (HANDLE) NULL},
7880
{(HANDLE) NULL, (HANDLE) NULL},
7981
{(HANDLE) NULL, (HANDLE) NULL}};
82+
#endif /* ! KUI */
83+
8084
HANDLE hmuxCtrlC[4][2] = { { (HANDLE) NULL, (HANDLE) NULL },
8185
{ (HANDLE) NULL, (HANDLE) NULL },
8286
{ (HANDLE) NULL, (HANDLE) NULL },
@@ -1156,6 +1160,7 @@ CreateTermScrnUpdThreadSem( BOOL posted )
11561160
#endif /* NT */
11571161
}
11581162

1163+
#ifndef KUI
11591164
APIRET
11601165
PostTermScrnUpdThreadSem( void )
11611166
{
@@ -1168,6 +1173,7 @@ PostTermScrnUpdThreadSem( void )
11681173
return DosPostEventSem( hevTermScrnUpdThread ) ;
11691174
#endif /* NT */
11701175
}
1176+
#endif /* ! KUI */
11711177

11721178
APIRET
11731179
WaitTermScrnUpdThreadSem( ULONG timo )
@@ -1755,6 +1761,7 @@ TimeProc(
17551761
}
17561762
#endif /* NT */
17571763

1764+
#ifndef KUI
17581765
APIRET
17591766
StartVscrnTimer( ULONG interval )
17601767
{
@@ -1811,6 +1818,7 @@ StopVscrnTimer( void )
18111818
}
18121819
return rc;
18131820
}
1821+
#endif /* ! KUI */
18141822

18151823
APIRET
18161824
StartAlarmTimer( ULONG interval )
@@ -1856,6 +1864,7 @@ StopAlarmTimer( void )
18561864
#endif /* NT */
18571865
}
18581866

1867+
#ifndef KUI
18591868
APIRET
18601869
CreateVscrnTimerSem( BOOL posted )
18611870
{
@@ -1883,6 +1892,7 @@ CreateVscrnTimerSem( BOOL posted )
18831892
}
18841893
return 0;
18851894
}
1895+
#endif /* ! KUI */
18861896

18871897
APIRET
18881898
PostVscrnTimerSem( int vmode )
@@ -1934,6 +1944,7 @@ WaitAndResetVscrnTimerSem( int vmode, ULONG timo )
19341944
#endif /* NT */
19351945
}
19361946

1947+
#ifndef KUI
19371948
APIRET
19381949
ResetVscrnTimerSem( int vmode )
19391950
{
@@ -1950,6 +1961,7 @@ ResetVscrnTimerSem( int vmode )
19501961
return semcount ;
19511962
#endif /* NT */
19521963
}
1964+
#endif /* ! KUI */
19531965

19541966
APIRET
19551967
CloseVscrnTimerSem( void )
@@ -2096,6 +2108,7 @@ CloseVscrnDirtySem( void )
20962108
return 0;
20972109
}
20982110

2111+
#ifndef KUI
20992112
APIRET
21002113
CreateVscrnMuxWait( int vmode )
21012114
{
@@ -2156,6 +2169,7 @@ CloseVscrnMuxWait( int vmode )
21562169
return rc ;
21572170
#endif /* NT */
21582171
}
2172+
#endif /* ! KUI */
21592173

21602174
/* Process and Thread management */
21612175

kermit/k95/ckosyn.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ _PROTOTYP( APIRET ResetConKbdHandlerThreadSem, (void) ) ;
103103
_PROTOTYP( APIRET CloseConKbdHandlerThreadSem, ( void ) ) ;
104104

105105
_PROTOTYP( APIRET CreateTermScrnUpdThreadSem, (BOOL) ) ;
106+
#ifndef KUI
106107
_PROTOTYP( APIRET PostTermScrnUpdThreadSem, (void) ) ;
108+
#endif /* ! KUI */
107109
_PROTOTYP( APIRET WaitTermScrnUpdThreadSem, (unsigned long) ) ;
108110
_PROTOTYP( APIRET WaitAndResetTermScrnUpdThreadSem, (unsigned long) ) ;
109111
_PROTOTYP( APIRET ResetTermScrnUpdThreadSem, (void) ) ;
@@ -151,11 +153,15 @@ _PROTOTYP( APIRET WaitAndResetVscrnDirtySem, (int, unsigned long) ) ;
151153
_PROTOTYP( APIRET ResetVscrnDirtySem, (int) ) ;
152154
_PROTOTYP( APIRET CloseVscrnDirtySem, ( void ) ) ;
153155

156+
#ifndef KUI
154157
_PROTOTYP( APIRET CreateVscrnTimerSem, (BOOL) ) ;
158+
#endif /* ! KUI */
155159
_PROTOTYP( APIRET PostVscrnTimerSem, (int) ) ;
156160
_PROTOTYP( APIRET WaitVscrnTimerSem, (int,unsigned long) ) ;
157161
_PROTOTYP( APIRET WaitAndResetVscrnTimerSem, (int,unsigned long) ) ;
162+
#ifndef KUI
158163
_PROTOTYP( APIRET ResetVscrnTimerSem, (int) ) ;
164+
#endif /* ! KUI */
159165
_PROTOTYP( APIRET CloseVscrnTimerSem, ( void ) ) ;
160166

161167
_PROTOTYP( APIRET CreateKeyStrokeMutex, (BOOL) ) ;
@@ -206,12 +212,14 @@ _PROTOTYP( APIRET CloseDebugMutex, (void) ) ;
206212
_PROTOTYP( APIRET StartAlarmTimer, (unsigned long) ) ;
207213
_PROTOTYP( APIRET StopAlarmTimer, (void) ) ;
208214

215+
#ifndef KUI
209216
_PROTOTYP( APIRET StartVscrnTimer, (unsigned long) ) ;
210217
_PROTOTYP( APIRET StopVscrnTimer, (void) ) ;
211218

212219
_PROTOTYP( APIRET CreateVscrnMuxWait, ( int ) );
213220
_PROTOTYP( APIRET WaitVscrnMuxWait, ( int, unsigned long ) ) ;
214221
_PROTOTYP( APIRET CloseVscrnMuxWait, ( int ) ) ;
222+
#endif /* ! KUI */
215223

216224
_PROTOTYP( APIRET ResetThreadPrty, (void) ) ;
217225
_PROTOTYP( APIRET SetThreadPrty, ( int, int ) ) ;

0 commit comments

Comments
 (0)