1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
|
{
This file is part of the Free Pascal run time library
for Netware.
Copyright (c) 1999-2005 by the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
unit nwsnut;
interface
{$mode objfpc}
{$if defined (netware_clib)}
uses nwserv;
{$else}
uses libc;
{$endif}
{$PACKRECORDS C}
const
External_library='nwsnut';
{ constants
the constant CURRENT_NUT_VERSION is incremented when increased
functionality is added. An NLM can check this value which is placed
in the NUTInfo structure, version field, to determine if the NWSNUT
NLM contains sufficient functionality to support its requirements }
CURRENT_NUT_VERSION = 405;
{ the constant NUT_REVISION_LEVEL is incremented when a major change
in the behavior of NWSNUT is made. This value is not used by the calling
NLM, but rather by NWSNUT itself to determine what is expected of it
by the calling NLM }
NUT_REVISION_LEVEL = 1;
SAVE = 1;
NO_SAVE = 0;
NOHEADER = 0;
NOBORDER = 0;
NO_HELP_CONTEXT = $ffff;
SINGLE = 1;
DOUBLE = 2;
CURSOR_OFF = 0;
CURSOR_ON = 1;
VIRTUAL = 0;
DIRECT = 1;
SEVERITY_INFORM = 1;
SEVERITY_WARNING = 2;
SEVERITY_FATAL = 3;
{ text size minimization styles }
SNORMAL = 0;
SMINWIDTH = 1;
SMINHEIGHT = 2;
{ palettes to set screen colors.
background and foreground can be reversed with VREVERSE }
BW_PALETTE = 0; // white and black
NORMAL_PALETTE = 1; // white and dark blue
INIT_PALETTE = 2; // light blue and dark blue
HELP_PALETTE = 3; // green and black
ERROR_PALETTE = 4; // red and black
WARNING_PALETTE = 5; // pink and white
OTHER_PALETTE = 6; // green and red
{ text and portal justification styles }
JRIGHT = 0;
JLEFT = 1;
JTOP = 2;
JBOTTOM = 3;
JCENTER = 4;
JTOPRIGHT = 5;
JTOPLEFT = 6;
JBOTTOMLEFT = 7;
JBOTTOMRIGHT = 8;
{ video constants }
V_UP = 6;
V_DOWN = 7;
LINE_OFFSET = 160;
EXPLODE_RATE = 45;
SCREEN_SPEED = 0;
{ video attributes }
VNORMAL = 0;
VINTENSE = 1;
VREVERSE = 2;
VBLINK = 3;
VIBLINK = 4;
VRBLINK = 5;
{ header types }
NO_HEADER = 0;
SMALL_HEADER = 1;
NORMAL_HEADER = 2;
LARGE_HEADER = 3;
{ keyboard constants }
KS_OFF = 0;
KS_ON = 1;
KS_INT = 2;
K_NORMAL = 0;
K_F1 = 1;
K_F2 = 2;
K_F3 = 3;
K_F4 = 4;
K_F5 = 5;
K_F6 = 6;
K_F7 = 7;
K_F8 = 8;
K_F9 = 9;
K_F10 = 10;
K_SF1 = 11;
K_SF2 = 12;
K_SF3 = 13;
K_SF4 = 14;
K_SF5 = 15;
K_SF6 = 16;
K_SF7 = 17;
K_SF8 = 18;
K_SF9 = 19;
K_SF10 = 20;
K_CF1 = 21;
K_CF2 = 22;
K_CF3 = 23;
K_CF4 = 24;
K_CF5 = 25;
K_CF6 = 26;
K_CF7 = 27;
K_CF8 = 28;
K_CF9 = 29;
K_CF10 = 30;
K_AF1 = 31;
K_AF2 = 32;
K_AF3 = 33;
K_AF4 = 34;
K_AF5 = 35;
K_AF6 = 36;
K_AF7 = 37;
K_AF8 = 38;
K_AF9 = 39;
K_AF10 = 40;
K_HELP = 1;
K_MODIFY = 3;
K_MARK = 5;
K_CANCEL = 7;
K_MODE = 9;
K_EXIT = 40;
K_ESCAPE = 41;
K_BACK = 42;
K_INSERT = 43;
K_DELETE = 44;
K_SELECT = 45;
K_CYCLE = 46;
K_UP = 47;
K_DOWN = 48;
K_LEFT = 49;
K_RIGHT = 50;
K_SUP = 51;
K_SDOWN = 52;
K_SLEFT = 53;
K_SRIGHT = 54;
K_PUP = 55;
K_PDOWN = 56;
K_FRIGHT = 57;
K_FLEFT = 58;
K_DELETE_END = 59;
{
For NWSUngetKey of function keys, use UGK_FUNCTION_KEY for the "type"
parameter and "K_F1" etc. for the "value" parameter
}
UGK_NORMAL_KEY = $00;
UGK_FUNCTION_KEY = $01;
{
For other special keys listed below, use UGK_NORMAL_KEY for the "value"
parameter, and the UGK_xxx for the "type" parameter.
}
UGK_ENTER_KEY = $02;
UGK_ESCAPE_KEY = $03;
UGK_BACKSPACE_KEY = $04;
UGK_DELETE_KEY = $05;
UGK_INSERT_KEY = $06;
UGK_CURSOR_UP_KEY = $07;
UGK_CURSOR_DOWN_KEY = $08;
UGK_CURSOR_RIGHT_KEY = $09;
UGK_CURSOR_LEFT_KEY = $0a;
UGK_CURSOR_HOME_KEY = $0b;
UGK_CURSOR_END_KEY = $0c;
UGK_CURSOR_PUP_KEY = $0d;
UGK_CURSOR_PDOWN_KEY = $0e;
{
Added in version 403
A special key type to cause LISTs to refresh. K_REFRESH_KEY may be returned
from an action procedure passed to NWSList, or another thread that wishes
to cause a list to refresh may call NWSUngetKey with the UGK version of this,
and it too will cause the list to be redrawn.
Use "type" = UGK_SPECIAL_KEY, and "value" = UGK_REFRESH_KEY
}
UGK_SPECIAL_KEY = 3;
UGK_REFRESH_KEY = $22222222;
K_REFRESH_KEY = UGK_REFRESH_KEY;
OLD_REFRESH_KEY = 222;
{ available action keys for list }
M_ESCAPE = $0001;
M_INSERT = $0002;
M_DELETE = $0004;
M_MODIFY = $0008;
M_SELECT = $0010;
{ marked delete }
M_MDELETE = $0020;
M_CYCLE = $0040;
{ marked modify }
M_MMODIFY = $0080;
{ marked select }
M_MSELECT = $0100;
{ don't sort list }
M_NO_SORT = $0200;
{ allow the list to be refreshed }
M_REFRESH = $0400;
{ return values for EditString }
E_ESCAPE = 1;
E_SELECT = 2;
E_EMPTY = 4;
E_CHANGE = 8;
{ type values for EditString }
EF_ANY = $0001;
EF_DECIMAL = $0002;
EF_HEX = $0004;
EF_NOSPACES = $0008;
EF_UPPER = $0010;
EF_DATE = $0020;
EF_TIME = $0040;
EF_FLOAT = $0080;
EF_SET = $0100;
EF_NOECHO = $0200;
EF_FILENAME = $0400;
{ added in version 404 }
EF_MASK = $0800;
{ and in version 405 }
EF_NOCONFIRM_EXIT = $1000;
{ scroll bar stuff for NWSEditTextWithScrollBars, and NWSViewTextWithScrollBars }
{ which scroll bars to show }
SHOW_VERTICAL_SCROLL_BAR = 2;
SHOW_HORIZONTAL_SCROLL_BAR = 4;
{ when to show the scroll bars. Use ONLY one of these }
CONSTANT_SCROLL_BARS = $0200;
TEXT_SENSITIVE_SCROLL_BARS = $0400;
CONSIDER_LOCKED_FIELDS = $0800;
{ character and key constants }
function F_H1 : longint;
{ Í } function F_H2 : longint;
{ ³ } function F_V1 : longint;
{ º } function F_V2 : longint;
{ Ú } function F_UL1 : longint;
{ ¿ } function F_UR1 : longint;
{ À } function F_LL1 : longint;
{ Ù } function F_LR1 : longint;
{ É } function F_UL2 : longint;
{ » } function F_UR2 : longint;
{ È } function F_LL2 : longint;
{ ¼ } function F_LR2 : longint;
{ Á } function F_UT1 : longint;
{ Â } function F_DT1 : longint;
{ ´ } function F_LT1 : longint;
{ Ã } function F_RT1 : longint;
{ Ê } function F_UT2 : longint;
{ Ë } function F_DT2 : longint;
{ ¹ } function F_LT2 : longint;
{ Ì } function F_RT2 : longint;
{ Å } function F_X1 : longint;
{ Î } function F_X2 : longint;
{ } function F_UP : longint;
{ } function F_DOWN : longint;
{ } function F_LEFT : longint;
{ } function F_RIGHT : longint;
{ ° } function F_BG1 : longint;
{ ± } function F_BG2 : longint;
{ ² } function F_BG3 : longint;
{ Û } function F_BG4 : longint;
{ form constants (control flags) }
const
F_NOVERIFY = $00;
F_VERIFY = $10;
F_FORCE = $20;
{ a flag to pass if no help is desired in the form }
F_NO_HELP = $ffffffff;
{ fieldFlags Type masks }
{ normal editable field }
NORMAL_FIELD = $00;
{ non accessable }
LOCKED_FIELD = $01;
{ non editable }
SECURE_FIELD = $02;
{ verify field on form exit }
REQUIRED_FIELD = $04;
{ hidden fields are also locked }
HIDDEN_FIELD = $09;
{ prompt fields are also locked }
PROMPT_FIELD = $11;
{ field locked by user, not by NUT }
ULOCKED_FIELD = $0100;
{ MASKED_FIELD added in version 402 }
{ display ' ' for text }
MASKED_FIELD = $200;
{ flag to cause form deselection
before action & verify routines
are called }
FORM_DESELECT = $20;
{ In case old flag was used }
NO_FORM_DESELECT = $00;
{ normal field controlled justify }
DEFAULT_FORMAT = $00;
{ right justification format }
RIGHT_FORMAT = $40;
{ left justification format }
LEFT_FORMAT = $80;
{ centering format }
CENTER_FORMAT = $C0;
MAXPORTALS = 50;
MAXLISTS = 20;
SAVELISTS = 20;
MAXACTIONS = 60;
MAXFUNCTIONS = MAXACTIONS;
MAXHELP = 30;
NO_MESSAGE = $ffff;
DYNAMIC_MESSAGE_ONE = $fffe;
DYNAMIC_MESSAGE_TWO = $fffd;
DYNAMIC_MESSAGE_THREE = $fffc;
DYNAMIC_MESSAGE_FOUR = $fffb;
DYNAMIC_MESSAGE_FIVE = $fffa;
DYNAMIC_MESSAGE_SIX = $fff9;
DYNAMIC_MESSAGE_SEVEN = $fff8;
DYNAMIC_MESSAGE_EIGHT = $fff7;
DYNAMIC_MESSAGE_NINE = $fff6;
DYNAMIC_MESSAGE_TEN = $fff5;
DYNAMIC_MESSAGE_ELEVEN = $fff4;
DYNAMIC_MESSAGE_TWELVE = $fff3;
DYNAMIC_MESSAGE_THIRTEEN = $fff2;
DYNAMIC_MESSAGE_FOURTEEN = $fff1;
SYSTEM_MESSAGE = $8000;
function IS_DYNAMIC_MESSAGE(a : longint) : boolean;
type
PNUTInfo_ = ^TNUTInfo_;
PPCB_ = ^TPCB_;
TPCB_ = record
frameLine : longint;
frameColumn : longint;
frameHeight : longint;
frameWidth : longint;
virtualHeight : longint;
virtualWidth : longint;
cursorState : longint;
borderType : longint;
borderAttribute : longint;
saveFlag : word;
secondarySaveFlag : word;
directFlag : longint;
headerAttribute : longint;
portalLine : longint;
portalColumn : longint;
portalHeight : longint;
portalWidth : longint;
virtualLine : longint;
virtualColumn : longint;
cursorLine : longint;
cursorColumn : longint;
firstUpdateFlag : longint;
headerText : pchar;
headerText2 : pchar;
virtualScreen : pointer;
saveScreen : pointer;
screenID : TScr;
nutInfo : PNUTInfo_;
sequenceNumber : longint;
reserved1 : longint;
mtflags : longint;
borderPalette : longint;
showScrollBars : longint;
lastLine : longint;
longestLineLen : longint;
verticalScroll : longint;
horizontalScroll : longint;
oldVertical : longint;
oldHorizontal : longint;
deHighlightFunction : procedure (para1:PNUTInfo_; para2:PPCB_);cdecl;
reHighlightFunction : procedure (para1:PNUTInfo_; para2:PPCB_); cdecl;
reportPortalUpdate : procedure (para1:PPCB_; para2:PNUTInfo_; updateType:longint); cdecl;
end;
TPCB = TPCB_;
PPCB = ^TPCB;
PHS_ = ^THS_;
THS_ = record
nextScreen : longint;
previousScreen : longint;
frameLine : longint;
frameColumn : longint;
frameHeight : longint;
frameWidth : longint;
virtualHeight : longint;
virtualWidth : longint;
cursorState : longint;
borderType : longint;
borderAttribute : longint;
saveFlag : longint;
directFlag : longint;
headerAttribute : longint;
headerText : pchar;
text : pchar;
end;
THELP_SCREEN = THS_;
PHELP_SCREEN = ^THELP_SCREEN;
PLIST_STRUCT = ^TLIST_STRUCT;
TLIST_STRUCT = record
prev : PLIST_STRUCT;
next : PLIST_STRUCT;
otherInfo : pointer;
marked : longint;
flags : word;
maxSkew : word;
entryProcedure : procedure (listElement:PLIST_STRUCT; displayLine:longint; NUTInfoStructure:pointer);cdecl;
extra : longint;
text : array[0..0] of char;
end;
TLIST = TLIST_STRUCT;
PLIST = ^TLIST;
PPLIST= ^PLIST;
PLP_ = ^TLP_;
TLP_ = record
head : pointer;
tail : pointer;
sortProc : function :longint;cdecl;
freeProcedure : procedure (memoryPointer:pointer);
end;
TLISTPTR = TLP_;
PLISTPTR = ^TLISTPTR;
PMI_ = ^TMI_;
TMI_ = record
dynamicMessageOne : pchar;
dynamicMessageTwo : pchar;
dynamicMessageThree : pchar;
dynamicMessageFour : pchar;
dynamicMessageFive : pchar;
dynamicMessageSix : pchar;
dynamicMessageSeven : pchar;
dynamicMessageEight : pchar;
dynamicMessageNine : pchar;
dynamicMessageTen : pchar;
dynamicMessageEleven : pchar;
dynamicMessageTwelve : pchar;
dynamicMessageThirteen : pchar;
dynamicMessageFourteen : pchar;
messageCount : longint;
programMesgTable : ppchar;
end;
TMessageInfo = TMI_;
PMessageInfo = ^TMessageInfo;
PINT_ = ^TINT_;
TINT_ = record
interruptProc : procedure (handle:pointer);cdecl;
key : longint;
end;
TINTERRUPT = TINT_;
PINTERRUPT = ^TINTERRUPT;
PMP_ = ^TMP_;
TMP_ = record
listAction : function (option:longint; parameter:pointer):longint;cdecl;
parameter : pointer;
end;
TMENU_PARAMETER = TMP_;
PMENU_PARAMETER = ^TMENU_PARAMETER;
{ environment structure }
{ always leave the following fields at the end of the struct. They
should never be referenced directly by an application }
TNUTInfo_ = record
portal : array[0..(MAXPORTALS)-1] of PPCB;
currentPortal : longint;
headerHeight : longint;
waitFlag : longint;
listStack : array[0..(MAXLISTS)-1] of TLISTPTR;
saveStack : array[0..(SAVELISTS)-1] of TLISTPTR;
nextAvailList : longint;
head : PLIST;
tail : PLIST;
defaultCompareFunction : function (el1:PLIST; el2:PLIST):longint;cdecl;
freeProcedure : procedure (memoryPointer:pointer);
interruptTable : array[0..(MAXFUNCTIONS)-1] of procedure ;
functionKeyStatus : array[0..(MAXACTIONS)-1] of longint;
messages : TMessageInfo;
helpContextStack : array[0..(MAXHELP)-1] of longint;
currentPreHelpMessage : longint;
freeHelpSlot : longint;
redisplayFormFlag : longint;
preHelpPortal : longint;
helpActive : smallint;
errorDisplayActive : smallint;
helpPortal : longint;
waitPortal : longint;
errorPortal : longint;
resourceTag : pointer;
screenID : pointer;
helpScreens : pointer;
helpOffset : longint;
helpHelp : longint;
allocChain : pointer;
version : longint;
reserved : array[0..9] of longint;
moduleHandle : longint;
customData : pointer;
customDataRelease : procedure (theData:pointer; thisStructure:PNUTInfo_); cdecl;
displayErrorLabel : longint;
markBuffer : pchar;
markBufferLength : longint;
editBuffer : pchar;
editBufferLength : longint;
staticFlag : longint;
processID : longint;
mtflags : longint;
saveCurrentPortal : longint;
palette : longint;
nutDataHandle : pointer;
next : PNUTInfo_;
prev : PNUTInfo_;
listSortFunction : procedure (head:PLIST; tail:PLIST; thisStructure:PNUTInfo_); cdecl;
compatibilityLevel : longint;
end;
TNUTInfo = TNUTInfo_;
PNUTInfo = ^TNUTInfo;
PPNUTInfo= ^PNUTInfo;
{ menu header message number }
{ menu center line }
{ menu center column }
{ len of longest menu option }
{ menu action routine }
{ list head for menu list }
PMFC_ = ^TMFC_;
TMFC_ = record
headernum : longint;
centerLine : longint;
centerColumn : longint;
maxoptlen : longint;
action : function (option:longint; parameter:pointer):longint;cdecl;
arg1 : longint;
arg2 : longint;
arg3 : longint;
arg4 : longint;
arg5 : longint;
arg6 : longint;
menuhead : TLISTPTR;
nutInfo : PNUTInfo;
end;
TMFCONTROL = TMFC_;
PMFCONTROL = ^TMFCONTROL;
{ list element that owns the field }
{ Control flags }
{ Line where field is located }
{ Column where field is located }
{ Maximum width of field }
{ Display attribute for field }
{ Keys that will activate the field }
{ Routine called when field selected }
{ Routine to verify Input }
{ Data & Xtra field release routine }
{ Pointer to data }
{ Additional control info }
{ help context for this field }
{ Pointer to field above }
{ Pointer to field below }
{ Pointer to field to left }
{ Pointer to field to right }
{ Pointer to previous field }
{ Pointer to next field }
{ if this value is set, this routine will be called upon
entry to each field }
{ this allows the user to have any sort of custom data that
he wants attached to the field. }
{ and this lets him release it. Note that these parameters
match NWSFree which allows the use of NWSAlloc for
this data (a further guarantee that the memory will be freed }
{ handle to keep track of who owns the field }
Pfielddef = ^Tfielddef;
Tfielddef = record
element : PLIST;
fieldFlags : longint;
fieldLine : longint;
fieldColumn : longint;
fieldWidth : longint;
fieldAttribute : longint;
fieldActivateKeys : longint;
fieldFormat : procedure (field:Pfielddef; text:pchar; buffLen:longint);cdecl;
fieldControl : function (field:Pfielddef; selectKey:longint; fieldChanged:Plongint; handle:PNUTInfo):longint;
fieldVerify : function (field:Pfielddef; data:pchar; handle:PNUTInfo):longint;
fieldRelease : procedure (para1:Pfielddef);
fieldData : pchar;
fieldXtra : pchar;
fieldHelp : longint;
fieldAbove : Pfielddef;
fieldBelow : Pfielddef;
fieldLeft : Pfielddef;
fieldRight : Pfielddef;
fieldPrev : Pfielddef;
fieldNext : Pfielddef;
fieldEntry : procedure (intoField:Pfielddef; fieldData:pointer; handle:PNUTInfo);
customData : pointer;
customDataRelease : procedure (fieldCustomData:pointer; handle:PNUTInfo);
nutInfo : PNUTInfo;
end;
TFIELD = Tfielddef;
PFIELD = ^TFIELD;
{ Structures used for DisplayErrorCondition }
PPCERR_ = ^TPCERR_;
TPCERR_ = record
ccodeReturned : longint;
errorMessageNumber : longint;
end;
TPROCERROR = TPCERR_;
PPROCERROR = ^TPROCERROR;
PNA_ = ^TNA_;
TNA_ = record
address : pointer;
next : pointer;
end;
TNUT_ALLOC = TNA_;
PNUT_ALLOC = ^TNUT_ALLOC;
function NWSInitializeNut
(utility,
version,
headerType,
compatibilityLevel : longint;
messageTable : PPchar;
helpScreens : pchar;
screenID : TScr; // Clib/OS Screen Id
resourceTag : TRtag; // OS ResourceTagStructure
var handle : PNUTInfo) : longint;cdecl;external External_library name 'NWSInitializeNut';
procedure NWSScreenSize(maxLines,maxColumns:plongint);cdecl;external External_library name 'NWSScreenSize';
procedure NWSScreenSize(var maxLines,maxColumns:longint);cdecl;external External_library name 'NWSScreenSize';
procedure NWSShowPortalLine(line,column:longint; text:pchar; length:longint; portal:PPCB);cdecl;external External_library name 'NWSShowPortalLine';
procedure NWSShowPortalLineAttribute(line,column:longint; text:pchar; attribute,length:longint;
portal:PPCB);cdecl;external External_library name 'NWSShowPortalLineAttribute';
procedure NWSScrollPortalZone(line,column,height,width,attribute,
count,direction:longint; portal:PPCB);cdecl;external External_library name 'NWSScrollPortalZone';
procedure NWSFillPortalZone(line,column,height,width,fillCharacter,
fillAttribute:longint; portal:PPCB);cdecl;external External_library name 'NWSFillPortalZone';
procedure NWSFillPortalZoneAttribute(line,column,height,width,attribute:longint;
portal:PPCB);cdecl;external External_library name 'NWSFillPortalZoneAttribute';
function NWSGetMessage(message:longint; messages:PMessageInfo):pchar;cdecl;external External_library name 'NWSGetMessage';
procedure NWSSetDynamicMessage(message:longint; text:pchar; messages:PMessageInfo);cdecl;external External_library name 'NWSSetDynamicMessage';
procedure NWSSetDynamicMessage(message:longint; text:pchar; var messages:TMessageInfo);cdecl;external External_library name 'NWSSetDynamicMessage';
function NWSCreatePortal
(line,
column,
frameHeight,
frameWidth,
virtualHeight,
virtualWidth,
saveFlag:longint;
headerText:pchar;
headerAttribute,
borderType,
borderAttribute,
cursorFlag,
directFlag : longint;
handle : PNUTInfo) : longint;cdecl;external External_library name 'NWSCreatePortal';
procedure NWSDestroyPortal(portalNumber:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSDestroyPortal';
procedure NWSPositionPortalCursor(line:longint; column:longint; portal:PPCB);cdecl;external External_library name 'NWSPositionPortalCursor';
procedure NWSEnablePortalCursor(portal:PPCB);cdecl;external External_library name 'NWSEnablePortalCursor';
procedure NWSDisablePortalCursor(portal:PPCB);cdecl;external External_library name 'NWSDisablePortalCursor';
procedure NWSDeselectPortal(handle:PNUTInfo);cdecl;external External_library name 'NWSDeselectPortal';
procedure NWSSelectPortal(portalNumber:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSSelectPortal';
function NWSComputePortalPosition(centerLine:longint; centerColumn:longint; height:longint; width:longint; line:plongint;
column:plongint; handle:PNUTInfo):longint;cdecl;external External_library name 'NWSComputePortalPosition';
procedure NWSClearPortal(portal:PPCB);cdecl;external External_library name 'NWSClearPortal';
type TFreeRoutine = procedure (memoryPointer:pointer); cdecl;
procedure NWSInitList(handle:PNUTInfo; freeRoutine:TFreeRoutine);cdecl;external External_library name 'NWSInitList';
function NWSPushList(handle:PNUTInfo):longint;cdecl;external External_library name 'NWSPushList';
function NWSPopList(handleNWS:PNUTInfo):longint;cdecl;external External_library name 'NWSPopList';
function NWSSaveList(listIndex:longint; handle:PNUTInfo):longint;cdecl;external External_library name 'NWSSaveList';
function NWSRestoreList(listIndex:longint; handle:PNUTInfo):longint;cdecl;external External_library name 'NWSRestoreList';
procedure NWSDestroyList(handle:PNUTInfo);cdecl;external External_library name 'NWSDestroyList';
procedure NWSDestroyMenu(handle:PNUTInfo);cdecl;external External_library name 'NWSDestroyMenu';
procedure NWSDestroyForm(handle:PNUTInfo);cdecl;external External_library name 'NWSDestroyForm';
function NWSAppendToList(text:pchar; otherInfo:pointer; handle:PNUTInfo):PLIST;cdecl;external External_library name 'NWSAppendToList';
function NWSDeleteFromList(el:PLIST; handle:PNUTInfo):PLIST;cdecl;external External_library name 'NWSDeleteFromList';
function NWSInsertInList(text:pchar; otherInfo:pointer; atElement:PLIST; handle:PNUTInfo):PLIST;cdecl;external External_library name 'NWSInsertInList';
function NWSGetListElementText(element:PLIST):pchar;cdecl;external External_library name 'NWSGetListElementText';
function NWSGetListHead(handle:PNUTInfo):PLIST;cdecl;external External_library name 'NWSGetListHead';
function NWSGetListTail(handle:PNUTInfo):PLIST;cdecl;external External_library name 'NWSGetListTail';
procedure NWSUnmarkList(handle:PNUTInfo);cdecl;external External_library name 'NWSUnmarkList';
procedure NWSSetList(listPtr:PLISTPTR; handle:PNUTInfo);cdecl;external External_library name 'NWSSetList';
procedure NWSGetList(listPtr:PLISTPTR; handle:PNUTInfo);cdecl;external External_library name 'NWSGetList';
function NWSIsAnyMarked(handle:PNUTInfo):longint;cdecl;external External_library name 'NWSIsAnyMarked';
procedure NWSPushMarks(handle:PNUTInfo);cdecl;external External_library name 'NWSPushMarks';
procedure NWSPopMarks(handle:PNUTInfo);cdecl;external External_library name 'NWSPopMarks';
procedure NWSSortList(handle:PNUTInfo);cdecl;external External_library name 'NWSSortList';
procedure NWSInitMenu(handle:PNUTInfo);cdecl;external External_library name 'NWSInitMenu';
procedure NWSInitForm(handle:PNUTInfo);cdecl;external External_library name 'NWSInitForm';
function NWSGetSortCharacter(charIndex:longint):longint;cdecl;external External_library name 'NWSGetSortCharacter';
function NWSGetLineDrawCharacter(charIndex:longint):longint;cdecl;external External_library name 'NWSGetLineDrawCharacter';
function NWSStrcat(_string, newStuff:pchar):longint;cdecl;external External_library name 'NWSStrcat';
procedure NWSMemmove(dest:pointer; source:pointer; len:longint);cdecl;external External_library name 'NWSMemmove';
function NWSToupper(ch:char):char;cdecl;external External_library name 'NWSToupper';
function NWSIsdigit(ch:char):longbool;cdecl;external External_library name 'NWSIsdigit';
function NWSIsxdigit(ch:char):longbool;cdecl;external External_library name 'NWSIsxdigit';
function NWSAsciiToInt(data:pchar):longint;cdecl;external External_library name 'NWSAsciiToInt';
function NWSAsciiToLONG(data:pchar):longint;cdecl;external External_library name 'NWSAsciiToLONG';
function NWSAsciiHexToInt(data:pchar):longint;cdecl;external External_library name 'NWSAsciiHexToInt';
procedure NWSWaitForEscape(handle:PNUTInfo);cdecl;external External_library name 'NWSWaitForEscape';
function NWSWaitForEscapeOrCancel(handle:PNUTInfo):longint;cdecl;external External_library name 'NWSWaitForEscapeOrCancel';
procedure NWSGetKey(_type:plongint; value:pchar; handle:PNUTInfo);cdecl;external External_library name 'NWSGetKey';
procedure NWSGetKey(var _type:longint; value:pchar; handle:PNUTInfo);cdecl;external External_library name 'NWSGetKey';
function NWSKeyStatus(handle:PNUTInfo):longint;cdecl;external External_library name 'NWSKeyStatus';
function NWSUngetKey(_type:longint; value:longint; handle:PNUTInfo):longint;cdecl;external External_library name 'NWSUngetKey';
procedure NWSEnableFunctionKey(key:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSEnableFunctionKey';
procedure NWSDisableFunctionKey(key:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSDisableFunctionKey';
procedure NWSDisableInterruptKey(key:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSDisableInterruptKey';
type TInterruptProc = procedure (handle:pointer); cdecl;
procedure NWSEnableInterruptKey(key:longint; interruptProc:TInterruptProc; handle:PNUTInfo);cdecl;external External_library name 'NWSEnableInterruptKey';
procedure NWSSaveFunctionKeyList(keyList:pchar; handle:PNUTInfo);cdecl;external External_library name 'NWSSaveFunctionKeyList';
procedure NWSEnableFunctionKeyList(keyList:pchar; handle:PNUTInfo);cdecl;external External_library name 'NWSEnableFunctionKeyList';
procedure NWSSaveInterruptList(interruptList:PINTERRUPT; handle:PNUTInfo);cdecl;external External_library name 'NWSSaveInterruptList';
procedure NWSEnableInterruptList(interruptList:PINTERRUPT; handle:PNUTInfo);cdecl;external External_library name 'NWSEnableInterruptList';
procedure NWSDisableAllInterruptKeys(handle:PNUTInfo);cdecl;external External_library name 'NWSDisableAllInterruptKeys';
procedure NWSDisableAllFunctionKeys(handle:PNUTInfo);cdecl;external External_library name 'NWSDisableAllFunctionKeys';
procedure NWSEnableAllFunctionKeys(handle:PNUTInfo);cdecl;external External_library name 'NWSEnableAllFunctionKeys';
function NWSDisplayTextInPortal(line,indentLevel:longint; text:pchar; attribute:longint; portal:PPCB):longint;cdecl;external External_library name 'NWSDisplayTextInPortal';
function NWSDisplayInformation(header,pauseFlag,centerLine,centerColumn,palette,
attribute:longint; displayText:pchar; handle:PNUTInfo):longint;cdecl;external External_library name 'NWSDisplayInformation';
procedure NWSStartWait(centerLine,centerColumn:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSStartWait';
procedure NWSEndWait(handle:PNUTInfo);cdecl;external External_library name 'NWSEndWait';
function NWSAlert(centerLine,centerColumn:longint; handle:PNUTInfo; message:longint; args:array of const):longint;cdecl;external External_library name 'NWSAlert';
function NWSAlert(centerLine,centerColumn:longint; handle:PNUTInfo; message:longint):longint;cdecl;external External_library name 'NWSAlert';
function NWSAlertWithHelp(centerLine,centerColumn:longint; handle:PNUTInfo; message,helpContext:longint;
args:array of const):longint;cdecl;external External_library name 'NWSAlertWithHelp';
function NWSAlertWithHelp(centerLine,centerColumn:longint; handle:PNUTInfo; message:longint; helpContext:longint):longint;cdecl;external External_library name 'NWSAlertWithHelp';
function NWSTrace(handle:PNUTInfo; message:pchar; args:array of const):longint;cdecl;external External_library name 'NWSTrace';
function NWSTrace(handle:PNUTInfo; message:pchar):longint;cdecl;external External_library name 'NWSTrace';
procedure NWSDisplayErrorText(message:longint; severity:longint; handle:PNUTInfo; args:array of const);cdecl;external External_library name 'NWSDisplayErrorText';
procedure NWSDisplayErrorText(message:longint; severity:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSDisplayErrorText';
procedure NWSDisplayErrorCondition(procedureName:pchar; errorCode:longint; severity:longint; errorList:PPROCERROR; handle:PNUTInfo;
args:array of const);cdecl;external External_library name 'NWSDisplayErrorCondition';
procedure NWSDisplayErrorCondition(procedureName:pchar; errorCode:longint; severity:longint; errorList:PPROCERROR; handle:PNUTInfo);cdecl;external External_library name 'NWSDisplayErrorCondition';
function NWSAppendToMenu(message:longint; option:longint; handle:PNUTInfo):PLIST;cdecl;external External_library name 'NWSAppendToMenu';
type TActionFunc = function (option:longint; parameter:pointer) : longint; cdecl;
function NWSMenu(header,
centerLine,
centerColumn:longint;
defaultElement:PLIST;
action:TActionFunc;
handle:PNUTInfo;
actionParameter:pointer):longint;cdecl;external External_library name 'NWSMenu';
function NWSConfirm(header,centerLine,centerColumn,defaultChoice:longint;
action:TActionFunc;
handle:PNUTInfo;
actionParameter:pointer):longint;cdecl;external External_library name 'NWSConfirm';
function NWSPushHelpContext(helpContext:longint; handle:PNUTInfo):longint;cdecl;external External_library name 'NWSPushHelpContext';
function NWSPopHelpContext(handle:PNUTInfo):longint;cdecl;external External_library name 'NWSPopHelpContext';
type TFormatFunc=function (element:PLIST; skew:longint; displayLine:pchar; width:longint):longint; cdecl;
TNWSListActionFunc=function (keyPressed:longint; elementSelected:PPLIST; itemLineNumber:plongint; actionParameter:pointer):longint; cdecl;
function NWSList(header:longint; centerLine:longint; centerColumn:longint; height:longint; width:longint;
validKeyFlags:longint; element:PPLIST; handle:PNUTInfo; format:TFormatFunc; action:TNWSListActionFunc;
actionParameter:pointer):longint;cdecl;external External_library name 'NWSList';
type TInsertFunc = function (text:pchar; otherInfo:Ppointer; parameters:pointer):longint; cdecl;
TFreeProcedure=function (otherInfo:pointer):longint; cdecl;
function NWSInsertInPortalList(currentElement:PPLIST; currentLine:plongint; InsertProcedure:TInsertFunc; FreeProcedure:TFreeProcedure; handle:PNUTInfo;
parameters:pointer):longint;cdecl;external External_library name 'NWSInsertInPortalList';
type TModifyProcedure=function (text:pchar; parameters:pointer):longint; cdecl;
function NWSModifyInPortalList(currentElement:PPLIST; currentLine:plongint; ModifyProcedure:TModifyProcedure; handle:PNUTInfo; parameters:pointer):longint;cdecl;external External_library name 'NWSModifyInPortalList';
type TDeleteFunc = function (el:PLIST; handle:PNUTInfo; parameters:pointer):PLIST; cdecl;
function NWSDeleteFromPortalList(currentElement:PPLIST; currentLine:plongint; DeleteProcedure:TDeleteFunc; deleteCurrentHeader:longint; deleteMarkedHeader:longint;
handle:PNUTInfo; parameters:pointer):longint;cdecl;external External_library name 'NWSDeleteFromPortalList';
type TNWSEditInsertFunc=function (buffer:pchar; maxLen:longint; parameters:pointer):longint; cdecl;
TNWSEditActionFunc=function (action:longint; buffer:pchar; parameters:pointer):longint; cdecl;
function NWSEditString(
centerLine, centerColumn, editHeight, editWidth, header,
prompt :longint;
buf:pchar;
maxLen, _type:longint; handle:PNUTInfo;
insertProc:TNWSEditInsertFunc;
actionProc:TNWSEditActionFunc;
parameters:pointer):longint;cdecl;external External_library name 'NWSEditString';
function NWSAppendIntegerField
(line, column, fflag:longint; data:Plongint;
minimum, maximum, help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendIntegerField';
function NWSAppendIntegerField
(line, column, fflag:longint; var data:longint;
minimum, maximum, help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendIntegerField';
function NWSAppendUnsignedIntegerField
(line,
column,
fflag:longint;
data:plongint;
minimum, maximum, help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendUnsignedIntegerField';
function NWSAppendUnsignedIntegerField
(line,
column,
fflag:longint;
var data:cardinal;
minimum, maximum, help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendUnsignedIntegerField';
function NWSAppendHexField
(line,column,fflag:longint;
data:Plongint;
minimum, maximum, help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendHexField';
procedure NWSDisplayPreHelp
(line, column, message:longint;
handle:PNUTInfo);cdecl;external External_library name 'NWSDisplayPreHelp';
procedure NWSRemovePreHelp
(handle:PNUTInfo);cdecl;external External_library name 'NWSRemovePreHelp';
function NWSGetADisk
(volName,prompt:pchar;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSGetADisk';
procedure NWSInitListPtr(listPtr:PLISTPTR);cdecl;external External_library name 'NWSInitListPtr';
function NWSEditForm
(headernum,
line,
col,
portalHeight,
portalWidth,
virtualHeight,
virtualWidth,
ESCverify,
forceverify,
confirmMessage : longint;
handle : PNUTInfo):longint;cdecl;external External_library name 'NWSEditForm';
function NWSEditPortalFormField
(header,
cline,
ccol,
formHeight,
formWidth,
controlFlags:longint;
formHelp:CARDINAL;
confirmMessage:longint;
startField:PFIELD;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSEditPortalFormField';
function NWSEditPortalForm
(header,
centerLine,
centerColumn,
formHeight,
formWidth,
controlFlags:longint;
formHelp:CARDINAL;
confirmMessage:longint;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSEditPortalForm';
type TfFormat = procedure (field:Pfielddef; text:pchar; buffLen:longint); cdecl;
TfControl = function (field:Pfielddef; selectKey:longint; var fieldChanged:longint; handle:PNUTInfo):longint; cdecl;
TfVerify = function (field:Pfielddef; data:pointer; handle:PNUTInfo):longint; cdecl;
TfRelease = procedure (field:Pfielddef); cdecl;
{ Data & Xtra field release routine }
function NWSAppendToForm(
fline,
fcol,
fwidth,
fattr:longint;
fFormat:TfFormat;
fControl:TfControl;
fVerify:TfVerify;
fRelease:TfRelease;
fData:pointer;
fXtra:pointer;
fflags:longint;
fActivateKeys:longint;
fhelp:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendToForm';
function NWSAppendPromptField(line,column,promptnum:longint; handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendPromptField';
function NWSAppendCommentField(line,column:longint; prompt:pchar; handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendCommentField';
function NWSAppendStringField
(line,
column,
width,
fflag:longint;
data,cset:pchar;
help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendStringField';
function NWSAppendBoolField
(line,
column,
fflag:longint;
data:pointer;
help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendBoolField';
function NWSAppendBoolField
(line,
column,
fflag:longint;
var data:longbool;
help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendBoolField';
function NWSAppendGenericBoolField
(line,
column,
fflag:longint;
data:pointer;
help:longint;
yesString, noString:pchar;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendGenericBoolField';
function NWSAppendGenericBoolField
(line,
column,
fflag:longint;
var data:longbool;
help:longint;
yesString, noString:pchar;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendGenericBoolField';
type TSpotActionFunc = function (fp:PFIELD; selectKey:longint; var changedField:longint; handle:PNUTInfo):longint; cdecl;
function NWSAppendHotSpotField
(line,
column,
fflag:longint;
displayString:pchar;
SpotAction:TSpotActionFunc;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendHotSpotField';
function NWSInitMenuField
(headermsg,
cLine,
cCol:longint;
action:TActionFunc;
nutInfo:PNUTInfo;
args:array of const):PMFCONTROL;cdecl;external External_library name 'NWSInitMenuField';
function NWSInitMenuField
(headermsg,
cLine,
cCol:longint;
action:TActionFunc;
nutInfo:PNUTInfo):PMFCONTROL;cdecl;external External_library name 'NWSInitMenuField';
function NWSAppendToMenuField
(m:PMFCONTROL;
optiontext:longint;
option:longint;
nutInfo:PNUTInfo):longint;cdecl;external External_library name 'NWSAppendToMenuField';
function NWSAppendMenuField
(line,
column,
fflag:longint;
data:Plongint;
m:PMFCONTROL;
help:longint;
nutInfo:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendMenuField';
function NWSAppendMenuField
(line,
column,
fflag:longint;
var data:longint;
m:PMFCONTROL;
help:longint;
nutInfo:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendMenuField';
function NWSEditText
(centerLine,
centerColumn,
height,
width,
headerNumber:longint;
textBuffer:pchar;
maxBufferLength,
confirmMessage,
forceConfirm:longint;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSEditText';
function NWSViewText
(centerLine,
centerColumn,
height,
width,
headerNumber:longint;
textBuffer:pchar;
maxBufferLength:longint;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSViewText';
procedure NWSDisplayHelpScreen
(offset:longint;
handle:PNUTInfo);cdecl;external External_library name 'NWSDisplayHelpScreen';
// Allocates memory for NWSNUT purposes
function NWSAlloc
(numberOfBytes:longint;
handle:PNUTInfo):pointer;cdecl;external External_library name 'NWSAlloc';
procedure NWSFree
(address:pointer;
handle:PNUTInfo);cdecl;external External_library name 'NWSFree';
// Displays justified text in an existing portal
function NWSDisplayTextJustifiedInPortal
(justify,
line:longint; column:longint; textWidth:longint; text:pchar;
attribute:longint; portal:PPCB):longint;cdecl;external External_library name 'NWSDisplayTextJustifiedInPortal';
function NWSDisplayInformationInPortal
(header,
portalJustifyLine,
portalJustifyColumn,
portalJustifyType,
portalPalette,
portalBorderType,
portalMaxWidth,
portalMaxHeight,
portalMinWidth,
portalMinHeight,
textLRJustifyType,
textLRIndent,
textTBJustifyType,
textTBIndent,
textAttribute,
textMinimizeStyle:longint;
text:pchar;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSDisplayInformationInPortal';
procedure NWSRestoreNut(handle:PNUTInfo);cdecl;external External_library name 'NWSRestoreNut';
procedure NWSDrawPortalBorder(portal:PPCB);cdecl;external External_library name 'NWSDrawPortalBorder';
procedure NWSUpdatePortal(portal:PPCB);cdecl;external External_library name 'NWSUpdatePortal';
type TSSFEntryProc = procedure (para1:PFIELD; para2:pointer; para3:PNUTInfo); cdecl;
TSSFCustomDataReleaseProc = procedure (para1:pointer; para2:PNUTInfo); cdecl;
TSSFFormat=procedure (para1:PFIELD; text:pchar; para3:longint); cdecl;
TSSFControlFunc = function (para1:PFIELD; para2:longint; para3:Plongint; para4:PNUTInfo):longint; cdecl;
TSSFVerifyFunc = function (para1:PFIELD; para2:pointer; para3:PNUTInfo):longint; cdecl;
TSSFReleaseProc = procedure (para1:PFIELD); cdecl;
procedure NWSSetFieldFunctionPtr(fp:PFIELD;
Format : TSSFFormat;
Control: TSSFControlFunc;
Verify : TSSFVerifyFunc;
Release: TSSFReleaseProc;
Entry : TSSFEntryProc;
customDataRelease
: TSSFCustomDataReleaseProc);cdecl;external External_library name 'NWSSetFieldFunctionPtr';
type TCompareFunc = function (el1:PLIST; el2:PLIST):longint; cdecl;
procedure NWSSetDefaultCompare(handle:PNUTInfo;
defaultCompareFunction:TCompareFunc);cdecl;external External_library name 'NWSSetDefaultCompare';
procedure NWSGetDefaultCompare(handle:PNUTInfo; var defaultCompareFunction:TCompareFunc);cdecl;external External_library name 'NWSGetDefaultCompare';
type TlistSortFunction = procedure (head:PLIST; tail:PLIST; handle:PNUTInfo); cdecl;
{ added in version 402 }
procedure NWSSetListSortFunction(handle:PNUTInfo;
listSortFunction:TlistSortFunction);cdecl;external External_library name 'NWSSetListSortFunction';
{ added in version 402 }
procedure NWSGetListSortFunction(handle:PNUTInfo;
var listSortFunction:TlistSortFunction);cdecl;external External_library name 'NWSGetListSortFunction';
procedure NWSSetScreenPalette(newPalette:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSSetScreenPalette';
function NWSGetScreenPalette(handle:PNUTInfo):longint;cdecl;external External_library name 'NWSGetScreenPalette';
procedure NWSGetPCB(var _pPcb:PPCB; portalNumber:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSGetPCB';
type TentryProcedure = procedure (element:PLIST; displayLine:longint; handle:PNUTInfo); cdecl;
procedure NWSSetListNotifyProcedure(el:PLIST;
entryProcedure:TentryProcedure);cdecl;external External_library name 'NWSSetListNotifyProcedure';
procedure NWSGetListNotifyProcedure(el:PLIST;
var entryProcedure:TentryProcedure);cdecl;external External_library name 'NWSGetListNotifyProcedure';
type TcdReleaseProc = procedure (theData:pointer; handle:PNUTInfo); cdecl;
procedure NWSSetHandleCustomData(handle:PNUTInfo;
customData:pointer;
customDataRelease:TcdReleaseProc);cdecl;external External_library name 'NWSSetHandleCustomData';
procedure NWSGetHandleCustomData(handle:PNUTInfo;
customData:Ppointer;
customDataRelease:TcdReleaseProc);cdecl;external External_library name 'NWSGetHandleCustomData';
procedure NWSSetErrorLabelDisplayFlag(flag:longint;
handle:PNUTInfo);cdecl;external External_library name 'NWSSetErrorLabelDisplayFlag';
procedure NWSSetHelpHelp(helpIndex:longint;
handle:PNUTInfo);cdecl;external External_library name 'NWSSetHelpHelp';
{ max length of passwordString, including NULL }
function NWSPromptForPassword
(passwordHeader,
line,
column,
maxPasswordLen : longint;
passwordString:pchar;
verifyEntry:longint;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSPromptForPassword';
function NWSAppendPasswordField
(line,
column,
width,
fflag:longint; // field flags
data:pchar; // ptr to field text
maxDataLen, // including null
help, // help for field
verifyEntry, // force password verification
passwordPortalHeader,
maskCharacter:longint; // fill character for field
nhandle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendPasswordField';
function NWSAppendScrollableStringField
(line,
column,
width,
fflag:longint;
data:pchar;
maxLen:longint; // max len of data, allowing for null terminator
cset:pointer; // valid characters, if using EF_SET
editFlags, // NWSEditString flags (EF_UPPER etc.)
help:longint;
handle:PNUTInfo):PFIELD;cdecl;external External_library name 'NWSAppendScrollableStringField';
type TSSFInsertFunc = function (_string:pchar; maxLen:longint; parameters:pointer):longint; cdecl;
procedure NWSSetScrollableFieldInsertProc(fp:PFIELD; insertProc:TSSFInsertFunc);cdecl;external External_library name 'NWSSetScrollableFieldInsertProc';
{ Returns 0 for success, -1 if none selected }
{ if not NULL, returns portal number }
function NWSGetCurrentPortal(nutInfo:PNUTInfo; portalNumber:plongint; var portal:PPCB):longint;cdecl;external External_library name 'NWSGetCurrentPortal';
{ if not NULL, returns PCB pointer }
function NWSWaitForKeyAndValue(handle:PNUTInfo;
nKeys:longint;
keyType:array of longint;
keyValue:array of longint):longint;cdecl;external External_library name 'NWSWaitForKeyAndValue';
procedure NWSShowLineAttribute(line,
column:longint;
text:pchar;
attribute,
length:longint;
screenID:TScr);cdecl;external External_library name 'NWSShowLineAttribute';
procedure NWSShowLine(line,column:longint; text:pchar; length:longint; screenID:TScr);cdecl;external External_library name 'NWSShowLine';
procedure NWSScrollZone
(line,
column,
height,
width,
attribute,
count,
direction:longint;
screenID:TScr);cdecl;external External_library name 'NWSScrollZone';
procedure NWSSaveZone
(line,
column,
height,
width:longint;
buffer:pointer;
screenID:TScr);cdecl;external External_library name 'NWSSaveZone';
procedure NWSSaveZone
(line,
column,
height,
width:longint;
var buffer;
screenID:TScr);cdecl;external External_library name 'NWSSaveZone';
procedure NWSRestoreZone
(line,
column,
height,
width:longint;
buffer:pointer;
screenID:TScr);cdecl;external External_library name 'NWSRestoreZone';
procedure NWSRestoreZone
(line,
column,
height,
width:longint;
var buffer;
screenID:TScr);cdecl;external External_library name 'NWSRestoreZone';
procedure NWSRestoreDisplay(screenID:TScr);cdecl;external External_library name 'NWSRestoreDisplay';
procedure NWSPositionCursor(line, column:longint; screenID:TScr);cdecl;external External_library name 'NWSPositionCursor';
procedure NWSGetNUTVersion(majorVersion, minorVersion, revision:plongint);cdecl;external External_library name 'NWSGetNUTVersion';
procedure NWSGetNUTVersion(var majorVersion, minorVersion, revision:longint);cdecl;external External_library name 'NWSGetNUTVersion';
procedure NWSSetFormRepaintFlag(value:longint; handle:PNUTInfo);cdecl;external External_library name 'NWSSetFormRepaintFlag';
procedure NWSSetFormNoWrap(handle:PNUTInfo);cdecl;external External_library name 'NWSSetFormNoWrap';
function NWSViewTextWithScrollBars
(centerLine,
centerColumn,
height,
width,
headerNumber:longint;
textBuffer:pchar;
maxBufferLength,
scrollBarFlag:longint;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSViewTextWithScrollBars';
{ length of document }
function NWSEditTextWithScrollBars
(centerLine,
centerColumn,
height,
width,
headerNumber:longint;
textBuffer:pchar;
maxBufferLength,
confirmMessage,
forceConfirm,
scrollBarFlag:longint;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSEditTextWithScrollBars';
function NWSEditTextWithScrollBars
(centerLine,
centerColumn,
height,
width,
headerNumber:longint;
textBuffer:pchar;
maxBufferLength,
confirmMessage : longint;
forceConfirm : longbool;
scrollBarFlag : longint;
handle:PNUTInfo):longint;cdecl;external External_library name 'NWSEditTextWithScrollBars';
implementation
function F_H1 : longint;
begin
F_H1:=NWSGetLineDrawCharacter(0);
end;
function F_H2 : longint;
begin
F_H2:=NWSGetLineDrawCharacter(1);
end;
function F_V1 : longint;
begin
F_V1:=NWSGetLineDrawCharacter(2);
end;
function F_V2 : longint;
begin
F_V2:=NWSGetLineDrawCharacter(3);
end;
function F_UL1 : longint;
begin
F_UL1:=NWSGetLineDrawCharacter(4);
end;
function F_UR1 : longint;
begin
F_UR1:=NWSGetLineDrawCharacter(5);
end;
function F_LL1 : longint;
begin
F_LL1:=NWSGetLineDrawCharacter(6);
end;
function F_LR1 : longint;
begin
F_LR1:=NWSGetLineDrawCharacter(7);
end;
function F_UL2 : longint;
begin
F_UL2:=NWSGetLineDrawCharacter(8);
end;
function F_UR2 : longint;
begin
F_UR2:=NWSGetLineDrawCharacter(9);
end;
function F_LL2 : longint;
begin
F_LL2:=NWSGetLineDrawCharacter(10);
end;
function F_LR2 : longint;
begin
F_LR2:=NWSGetLineDrawCharacter(11);
end;
function F_UT1 : longint;
begin
F_UT1:=NWSGetLineDrawCharacter(12);
end;
function F_DT1 : longint;
begin
F_DT1:=NWSGetLineDrawCharacter(13);
end;
function F_LT1 : longint;
begin
F_LT1:=NWSGetLineDrawCharacter(14);
end;
function F_RT1 : longint;
begin
F_RT1:=NWSGetLineDrawCharacter(15);
end;
function F_UT2 : longint;
begin
F_UT2:=NWSGetLineDrawCharacter(24);
end;
function F_DT2 : longint;
begin
F_DT2:=NWSGetLineDrawCharacter(25);
end;
function F_LT2 : longint;
begin
F_LT2:=NWSGetLineDrawCharacter(26);
end;
function F_RT2 : longint;
begin
F_RT2:=NWSGetLineDrawCharacter(27);
end;
function F_X1 : longint;
begin
F_X1:=NWSGetLineDrawCharacter(36);
end;
function F_X2 : longint;
begin
F_X2:=NWSGetLineDrawCharacter(39);
end;
function F_UP : longint;
begin
F_UP:=NWSGetLineDrawCharacter(40);
end;
function F_DOWN : longint;
begin
F_DOWN:=NWSGetLineDrawCharacter(41);
end;
function F_LEFT : longint;
begin
F_LEFT:=NWSGetLineDrawCharacter(42);
end;
function F_RIGHT : longint;
begin
F_RIGHT:=NWSGetLineDrawCharacter(43);
end;
function F_BG1 : longint;
begin
F_BG1:=NWSGetLineDrawCharacter(44);
end;
function F_BG2 : longint;
begin
F_BG2:=NWSGetLineDrawCharacter(45);
end;
function F_BG3 : longint;
begin
F_BG3:=NWSGetLineDrawCharacter(46);
end;
function F_BG4 : longint;
begin
F_BG4:=NWSGetLineDrawCharacter(47);
end;
function IS_DYNAMIC_MESSAGE(a : longint) : boolean;
begin
IS_DYNAMIC_MESSAGE:=(a > $fff0) and (a < $ffff);
end;
end.
|