Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

   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
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
.\" Copyright (c) 1992, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)fns.doc	8.2 (Berkeley) 6/1/94
.\"
.Ds
.Fn addbytes "char *str" "int len"
.De
This function is the low level character output function.
.Vn Len
characters of the string
.Vn str
are output to the current \*y position of the window.
.Ds
.Fn addch "chtype ch" \(dg
.De
Add the character
.Vn ch
on the window
at the current \*y.
If the character is a newline
(\'\en\')
the line will be cleared to the end,
and the current \*y will be changed to the
beginning off the next line
if newline mapping is on,
or to the next line at the same x co-ordinate
if it is off.
A return
(\'\er\')
will move to the beginning of the line on the window.
Tabs
(\'\et\')
will be expanded into spaces
in the normal tabstop positions of
every eight characters.
\*(Es
.Ds
.Fn addchstr "chtype *str" \(dg
.De
Add the characters and attributes in the string pointed to by
.Vn str
on the window at the current \*y.
\*(Es
In this case, it will put on as much as it can.
.Ds
.Fn addchnstr "chtype *str" "int len" \(dg
.De
Add no more than
.Vn len
characters and attributes of the string pointed to by
.Vn str
on the window at the current \*y.
\*(Es
In this case, it will put on as much as it can.
.Ds
.Fn addstr "char *str" \(dg
.De
Add the string pointed to by
.Vn str
on the window at the current \*y.
\*(Es
In this case, it will put on as much as it can.
.Ds
.Fn addnstr "char *str" "int len" \(dg
.De
Add no more than
.Vn len
characters of the string pointed to by
.Vn str
on the window at the current \*y.
\*(Es
In this case, it will put on as much as it can.
.Ds
.Fn assume_default_colors "short fore" "short back"
.De
Set the curses default foreground and background colors to
.Vn fore
and
.Vn back .
.Ds
.Fn attr_get "attr_t *attr" "short *pair" "void *opt" \(dg
.De
Get the attributes and colour pair for the window.
Either
.Vn attr
or
.Vn pair
may be NULL.
The
.Vn opt
argument is not used.
.Ds
.Fn attr_off "attr_t attr" "void *opt" \(dg
.De
Remove character attributes set by
.Fn attr_on
or
.Fn attr_set .
.Ds
.Fn attr_on "attr_t attr" "void *opt" \(dg
.De
Add character attributes for any characters
added to the window (if it has that capability).
The attributes that can be set are \fBA_UNDERLINE\fR,
\fBA_REVERSE\fR, \fBA_BLINK\fR, \fBA_DIM\fR,
\fBA_BOLD\fR, \fBA_BLANK\fR, \fBA_PROTECT\fB,
\fBA_ALTCHARSET\fR and \fBCOLOR_PAIR(n)\fR.
.Ds
.Fn attr_set "attr_t attr" "short pair" "void *opt" \(dg
.De
Set character attributes and color pair for any characters
added to the window (if it has that capability).
.Ds
.Fn attroff "int attribute" \(dg
.De
Remove character attributes set by
.Fn attron
or
.Fn attrset .
To clear all character attributes, use
.Fn attroff "A_ATTRIBUTES" .
.Fn attroff "A_STANDOUT"
is equivalent to
.Fn standend .
.Fn attroff "A_UNDERLINE"
is equivalent to
.Fn underend .
.Ds
.Fn attron "int attribute" \(dg
.De
Add character attributes for any characters
added to the window (if it has that capability).
.Fn attron "A_STANDOUT"
is equivalent to
.Fn standout .
.Fn attron "A_UNDERLINE"
is equivalent to
.Fn underscore .
.Ds
.Fn attrset "int attribute" \(dg
.De
Set character attributes for any characters
added to the window (if it has that capability).
.Ds
.Fn baudrate "" \(dg
.De
Returns the output baud rate of the terminal.
This is a system dependent constant
(defined in
.b <sys/tty.h>
on BSD systems,
which is included by
.b <curses.h> ).
.Ds
.Fn beep ""
.De
Sound the terminal bell.  If the terminal has no bell capability,
but has the ability to flash the screen, do that instead.  See also
.Fn flash
.Ds
.Fn bkgd "chtype ch"
.De
Sets the background rendition to
.Vn ch .
.Ds
.Fn bkgdset "chtype ch"
.De
Sets the background rendition to
.Vn ch 
and applies this rendition to the window.
.Ds
.Fn border "chtype left" "chtype right" "chtype top" "chtype bottom" "chtype topleft" "chtype topright" "chtype botleft" "chtype botright"
.De
.Pp
Draws a border around the window using the characters:
.Vn left
for drawing the left side, 
.Vn right
for drawing the left side, 
.Vn top
for drawing the top edge, 
.Vn bottom
for drawing the top edge, 
.Vn topleft
for drawing the top-left corner, 
.Vn topright
for drawing the top-right corner, 
.Vn botleft
for drawing the bottom-left corner, and 
.Vn botright
for drawing the bottom-right corner.  If scrolling is not allowed,
and the window encompasses the lower right-hand corner of the terminal,
the corners are left blank to avoid a scroll.
.Ds
.Fn box "WINDOW win" "chtype vert" "chtype hor"
.De
.Pp
Draws a box around the window using
.Vn vert
as the character for drawing the vertical sides, and
.Vn hor
for drawing the horizontal lines.
If scrolling is not allowed,
and the window encompasses the lower right-hand corner of the terminal,
the corners are left blank to avoid a scroll.
.Ds
.Fn can_change_color ""
.De
Check if terminal can change colors.
.Ds
.Fn cbreak ""
.De
Set the terminal to cbreak mode.
.Ds
.Fn clear "" \(dg
.De
Resets the entire window to blanks.
If
.Vn win
is a screen,
this sets the clear flag,
which will cause a clear-screen sequence to be sent
on the next
.Fn refresh
call.
This also moves the current \*y
to (0\*,0).
.Ds
.Fn clearok "WINDOW *scr" "int boolf" \(dg
.De
Sets the clear flag for the screen
.Vn scr .
If
.Vn boolf
is non-zero,
this will force a clear-screen to be printed on the next
.Fn refresh ,
or stop it from doing so if
.Vn boolf
is 0.
This only works on screens,
and,
unlike
.Fn clear ,
does not alter the contents of the screen.
If
.Vn scr
is
.Vn curscr ,
the next
.Fn refresh
call will cause a clear-screen,
even if the window passed to
.Fn refresh
is not a screen.
.Ds
.Fn clrtobot "" \(dg
.De
Wipes the window clear from the current \*y to the bottom.
This does not force a clear-screen sequence on the next refresh
under any circumstances.
\*(Nm
.Ds
.Fn clrtoeol "" \(dg
.De
Wipes the window clear from the current \*y to the end of the line.
\*(Nm
.Ds
.Fn color_content "short color" "short *red" "short *green" "short *blue"
.De
Get the red, green and blue values of color
.Vn color .
.Ds
.Fn color_set "short pair" "void *opt" \(dg
.De
Set color pair for any characters added to the window (if it has
that capability).
.Ds
.Fn copywin "const WINDOW *src" "WINDOW *dst" "int sminrow" "int smincol" "int dminrow" "int dmincol" "int dmaxrow" "int dmaxcol" "int overlay"
.De
Copies the contents of the window
.Vn src
starting at (
.Vn sminrow ,
.Vn smincol )
to the destination window
.Vn dst
starting at (
.Vn dminrow ,
.Vn dmincol )
and ending at either the end of the source window or (
.Vn dmaxrow ,
.Vn dmaxcol )
whichever is the lesser.  The parameter
.Vn overlay
determines the nature of the copy.  If 
.Vn overlay
is TRUE then only the non-space characters from
.Vn src
are copied to
.Vn dst .
If 
.Vn overlay
is FALSE then all characters are copied from
.Vn src
to
.Vn dst.
.Ds
.Fn curs_set "int visibility"
.De
Sets the visibility of the screen cursor.  The parameter
.Vn visibility
can be one of three values, 0 means make the cursor invisible, 1 means
set the cursor to normal visibility and 2 sets the cursor to high
visibility.  In all cases the old mode of the cursor is returned if
the call was successful and
.b ERR
is returned if the terminal cannot support the requested visibility
mode.
.Ds
.Fn crmode "" \(dg
.De
Identical to
.Fn cbreak .
The misnamed macro
.Fn crmode
and
.Fn nocrmode
is retained for backwards compatibility
with ealier versions of the library.
.Ds
.Fn delay_output "int ms"
.De
Pause output for
.Vn ms
milliseconds using the terminal pad character.
.Ds
.Fn def_prog_mode ""
.De
Save the current terminal modes as the \'in curses\' state for use with
.Fn reset_prog_mode .
.Ds
.Fn def_shell_mode ""
.De
Save the current terminal modes as the \'not in curses\' state for use with
.Fn reset_shell_mode .
.Ds
.Fn define_key "char *sequence" "int key_symbol" 
.De
Assigns the character sequence given in
.Vn sequence
to the key symbol
.Vn key_symbol .
If 
.Fn keypad
has set been set TRUE and the character sequence is found in the input
stream then the key symbol defined will be returned.  Normally the
sequences are found in the
.b termcap
database but this function allows extensions to be added by the
application.  If 
.Vn sequence
is a NULL pointer then all the sequences associated with
.Vn key_symbol
will be removed, including any definitions inserted by
.b termcap .
.Ds
.Fn delch ""
.De
Delete the character at the current \*y.
Each character after it on the line shifts to the left,
and the last character becomes blank.
.Ds
.Fn deleteln ""
.De
Delete the current line.
Every line below the current one will move up,
and the bottom line will become blank.
The current \*y will remain unchanged.
.Ds
.Fn delscreen "SCREEN *screen"
.De
Delete the screen and frees all associated resources.
.Ds
.Fn delwin "WINDOW *win"
.De
Deletes the window from existence.
All resources are freed for future use by
.b calloc (3).
If a window has a
.Fn subwin
allocated window inside of it,
deleting the outer window
the subwindow is not affected,
even though this does invalidate it.
Therefore,
subwindows should be deleted before their
outer windows are.
.Ds
.Fn derwin "WINDOW *orig" "int nlines" "int ncols" "int by" "int bx"
.De
Performs a function very similar to that of
.Fn subwin .
The difference being that with
.Fn derwin
the origin of the child window given by (
.Vn by ,
.Vn bx )
is relative to the origin of the parent window
.Vn orig
instead of being absolute screen coordinates as they are in
.Fn subwin .
.Ds
.Fn doupdate ""
.De
Synchronize the terminal screen with the virtual screen that
has had window contents added to it by calls to
.Fn wnoutrefresh .
.Ds
.Fn dupwin "WINDOW *win"
.De
Creates an exact copy of the window
.Vn win .
.Ds
.Fn echo "" \(dg
.De
Sets the terminal to echo characters.
.Ds
.Fn echochar "const chtype ch" \(dg
.De
Add the character
.Vn ch
on the window
at the current \*y and immediately refresh the window.
.Ds
.Fn endwin ""
.De
Finish up window routines before exit.
This restores the terminal to the state it was before
.Fn initscr
(or
.Fn gettmode
and
.Fn setterm )
was called.
It should always be called before exiting and before the final calls to
.Fn delwin .
It does not exit.
This is especially useful for resetting tty stats
when trapping rubouts via
.b signal (2).
.Ds
.Fn erase "" \(dg
.De
Erases the window to blanks without setting the clear flag.
This is analagous to
.Fn clear ,
except that it never causes a clear-screen sequence to be generated
on a
.Fn refresh .
\*(Nm
.Ds
.Fn erasechar "" \(dg
.De
Returns the erase character
for the terminal,
.i i.e. ,
the character used by the user to erase a single character from the input.
.Ds
.Fn flash ""
.De
Flash the terminal screen.  If the terminal has no flash capability,
but has the ability to sound the bell, do that instead.  See also
.Fn bell
.Ds
.Fn flushinp ""
.De
Throw away any input that has been typed by the user but has not yet
been read by the program.
.Ds
.Fn flushok "WINDOW *win" "int boolf"
.De
Normally,
.Fn refresh
.Fn fflush 's
.Vn stdout
when it is finished.
.Fn flushok
allows you to control this.
if
.Vn boolf
is non-zero
(\c
.i i.e. ,
non-zero)
it will do the
.Fn fflush ,
otherwise it will not.
.Ds
.Fn getattrs "WINDOW *win"
.De
Gets the attributes for
.Vn win .
.Ds
.Fn getbkgd "WINDOW *win"
.De
Gets the background rendition for
.Vn win .
.Ds
.Fn getcap "char *name"
.De
Get the terminal capability
.Vn name .
.Ds
.Fn getch "" \(dg
.De
Gets a character from the terminal and (if necessary)
echos it on the window.
\*(Es
Otherwise, the character gotten is returned.
If
.i noecho
has been set, then the window is left unaltered.
In order to retain control of the terminal,
it is necessary to have one of
.i noecho ,
.i cbreak ,
or
.i rawmode
set.
If you do not set one,
whatever routine you call to read characters will set
.i cbreak
for you,
and then reset to the original mode when finished.
.Ds
.Fn getcury "WINDOW *win"
.De
Get current y position on
.Vn win .
.Ds
.Fn getcurx "WINDOW *win"
.De
Get current x position on
.Vn win .
.Ds
.Fn getbegy "WINDOW *win"
.De
Get start y position on
.Vn win .
.Ds
.Fn getbegx "WINDOW *win"
.De
Get start x position on
.Vn win .
.Ds
.Fn getmaxy "WINDOW *win"
.De
Get maximum y position on
.Vn win .
.Ds
.Fn getmaxx "WINDOW *win"
.De
Get maximum x position on
.Vn win .
.Ds
.Fn getnstr "char *str" \(dg
.De
Get a string through the window
and put it in the location pointed to by
.Vn str .
A maximum of
.Vn n
characters is returned (including the trailing null).
It sets tty modes if necessary,
and then calls
.Fn getch
(or
.Fn wgetch )
to get the characters needed to fill in the string
until a newline or EOF is encountered.
The newline stripped off the string.
\*(Es
.Ds
.Fn getstr "char *str" \(dg
.De
Get a string through the window
and put it in the location pointed to by
.Vn str ,
which is assumed to be large enough to handle it.
It sets tty modes if necessary,
and then calls
.Fn getch
(or
.Fn wgetch )
to get the characters needed to fill in the string
until a newline or EOF is encountered.
The newline stripped off the string.
\*(Es
.Ds
.Fn getparx "WINDOW *win"
.De
Returns the x location of the given subwindow relative to the parent
window.  If the window is not a subwindow then -1 is returned.
.Ds
.Fn getpary "WINDOW *win"
.De
Returns the y location of the given subwindow relative to the parent
window.  If the window is not a subwindow then -1 is returned.
.Ds
.Fn getpary "WINDOW *win" "int y" "int x"
.De
Is a macro that sets the 
.Vn y
and
.Vn x
parameters to the respective coordinates of the top left hand corner
of the subwindow relative to the parent window.  If the given window
.Vn win
is not a subwindow then both
.Vn y
and 
.Vn x
will be set to -1.
.Ds
.Fn gettmode ""
.De
Get the tty stats.
This is normally called by
.Fn initscr .
.Ds 
.Fn getwin "FILE *fp"
.De
Creates a window from a file written by
.Fn putwin .
.Ds
.Fn getyx "WINDOW *win" "int y" "int x"
.De
Puts the current \*y of
.Vn win
in the variables
.Vn y
and
.Vn x .
Since it is a macro,
not a function,
you do not pass the address
of
.Vn y
and
.Vn x .
.Ds
.Fn halfdelay "int timeout"
.De
Sets the terminal into a mode similar to that done by
.Fn cbreak
with the exception that the input routines will wait for
.Vn timeout
number of tenths of a second, if at this time there is no input then
ERR will be returned.
.Ds
.Fn has_colors ""
.De
Check if terminal has colors.
.Ds
.Fn hline "chtype ch" "int count"
.De
Draw a horizontal line of the character ch starting at the current
cursor position and moving towards the rightmost column.  At most
.Vn count
characters will be written, less if the edge of the screen is reached
before 
.Vn count
is reached.
.Ds
.Fn idcok "WINDOW *win" "int boolf"
.De
Reserved for future use.
This will eventually signal to
.Fn refresh
that it is all right to use the insert and delete char sequences
when updating the window.
.Ds
.Fn idlok "WINDOW *win" "int boolf"
.De
Reserved for future use.
This will eventually signal to
.Fn refresh
that it is all right to use the insert and delete line sequences
when updating the window.
.ne 1i
.Ds
.Fn inch "" \(dg
.De
Returns the character at the current position on the given window.
This does not make any changes to the window.
.Ds
.Fn inchnstr "chtype *chstr" "int n"
.De
Get an array of at most
.Vn n
characters and renditions starting at the current cursor position and
ending at the end of the line and put it in the location pointed to by
.Vn chstr .
.Ds
.Fn inchstr "chtype *chstr"
.De
Get an array of characters and renditions starting at the current cursor
position and ending at the end of the line and put it in the location
pointed to by
.Vn chstr ,
which is assumed to be large enough to handle it.
.Ds
.Fn innstr "char *str" "int n"
.De
Get a string of at most
.Vn n
characters starting at the current cursor position and ending at the end
of the line and put it in the location pointed to by
.Vn str .
.Ds
.Fn init_color "short color" "short red" "short green" "short blue"
.De
Set the red, green and blue values of color
.Vn color .
.Ds
.Fn init_pair "short pair" "short fore" "short back"
.De
Set the foreground and background colors of pair
.Vn pair .
.Ds
.Fn initscr ""
.De
Initialize the screen routines.
This must be called before any of the screen routines are used.
It initializes the terminal-type data and such,
and without it none of the routines can operate.
If standard input is not a tty,
it sets the specifications to the terminal
whose name is pointed to by
.Vn Def\*_term
(initially "dumb").
If the boolean
.Vn My\*_term
is non-zero,
.Vn Def\*_term
is always used.
If the system supports the
.b TIOCGWINSZ
.i ioctl(2)
call,
it is used to get the number of lines and columns for the terminal,
otherwise it is taken from the
.b termcap
description.
.Ds
.Fn insch "char c"
.De
Insert
.Vn c
at the current \*y
Each character after it shifts to the right,
and the last character disappears.
\*(Es
.Ds
.Fn insdelln "int n"
.De
If
.Vn n
is positive insert
.Vn n
lines above the current one.
Every line below the current line
will be shifted down,
and the last
.Vn n
lines will disappear.
If
.Vn n
is negative, delete
.Vn n
lines starting from the current one.
The last
.Vn n
lines are cleared.
The current \*y will remain unchanged.
.Ds
.Fn insertln ""
.De
Insert a line above the current one.
Every line below the current line
will be shifted down,
and the bottom line will disappear.
The current line will become blank,
and the current \*y will remain unchanged.
.Ds
.Fn instr "char *str"
.De
Get an string starting at the current cursor position and ending at the
end of the line and put it in the location pointed to by
.Vn str ,
which is assumed to be large enough to handle it.
.Ds
.Fn is_linetouched "WINDOW *win" "int line"
.De
Returns TRUE if 
.Vn line
in the window
.Vn win
has been modified since the last call to
.Fn wrefresh .
.Ds
.Fn is_wintouched "WINDOW *win" "int line"
.De
Returns TRUE if the window
.Vn win
has been modified since the last call to
.Fn wrefresh .
.Ds
.Fn isendwin ""
.De
Returns TRUE if
.Fn endwin
has been called without a subsequent call to
.Fn wrefresh ,
and FALSE otherwise.
.Ds
.Fn intrflush "WINDOW *win" "int boolf"
.De
Sets the terminal flush on interrupt mode.  If
.Vn boolf
is non-zero, flushing of the output buffer will occur when an
interrupt key is pressed.  The default is inherited from the
terminal settings.
.Ds
.Fn keyok "int key_symbol" "bool flag"
.De
Controls the recognition of the key symbol
.Vn key_symbol .
By setting
.Vn flag
to FALSE the recognition of any sequence of characters
that have been associated with the key symbol will be disabled.
By default, this flag is TRUE so sequences will be recognised.
.Ds
.Fn keyname "int key"
.De
Returns a description of the key
.Vn key .
.Ds
.Fn keypad "WINDOW *win" "int boolf"
.De
Sets the boolean flag for interpretation of escape sequences.  If
.Vn boolf
is non-zero, escape sequences from terminal keypad and function
keys will be interpreted by the library.  Escape sequences are not
interpreted by default.  The include file
.b <curses.h>
contains the list of recognised keypad and function keys.  See also
.Fn notimeout .
.Ds
.Fn killchar "" \(dg
.De
Returns the line kill character
for the terminal,
.i i.e. ,
the character used by the user to erase an entire line from the input.
.Ds
.Fn leaveok "WINDOW *win" "int boolf" \(dg
.De
Sets the boolean flag for leaving the cursor after the last change.
If
.Vn boolf
is non-zero,
the cursor will be left after the last update on the terminal,
and the current \*y for
.Vn win
will be changed accordingly.
If
.Vn boolf
 is 0 the cursor will be moved to the current \*y.
This flag
(initially 0)
retains its value until changed by the user.
.Ds
.Fn longname "" \(dg
.De
Returns a string containing the verbose description of the terminal.
.Ds
.Fn meta "WINDOW *win" "bool bf"
.De
Manipulates the meta mode on terminals that support this capability.
Note that 
.Vn win
is always ignored.
.Ds
.Fn move "int y" "int x"
.De
Change the current \*y of the window to
.Vn y\*,x ). (
\*(Es
.Ds
.Fn mvaddch "int y" "int x" "chtype ch"
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
and then adds a character in the same manner as
.Fn addch .
.Ds
.Fn mvaddchstr "int y" "int x" "chtype *str" \(dg
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
and then adds characters and attributes in the same manner as
.Fn addchstr .
.Ds
.Fn mvaddchnstr "int y" "int x" "chtype *str" \(dg
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
and then adds characters and attributes in the same manner as
.Fn addchnstr .
.Ds
.Fn mvaddstr "int y" "int x" "char *str" \(dg
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
and then adds a string in the same manner as
.Fn addstr .
.Ds
.Fn mvaddnstr "int y" "int x" "char *str" \(dg
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
and then adds a string in the same manner as
.Fn addnstr .
.Ds
.Fn mvcur "int lasty" "int lastx" "int newy" "int newx"
.De
Moves the terminal's cursor from
.Vn lasty\*,lastx ) (
to
.Vn newy\*,newx ) (
in an approximation of optimal fashion.
This routine uses the functions borrowed from
.i ex
version 2.6.
It is possible to use this optimization
without the benefit of the screen routines.
With the screen routines, this should not be called by the user.
.Fn move
and
.Fn refresh
should be used to move the cursor position,
so that the routines know what's going on.
.Ds
.Fn mvderwin "WINDOW *win" "int y" "int x"
.De
Moves the subwindow
.Vn win
to the location
.Vn y\*,x ) (
where the location is relative to the top left hand corner of the
parent window.  This call will return ERR if 
.Vn win
is not a subwindow or if the relocated window would lie outside the
parent window.
.Ds
.Fn mvhline "int y" "int x" "chtype ch" "int count"
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
and then draws a horizontal line in the same manner as
.Fn hline .
.Ds
.Fn mvprintw "int y" "int x" "const char *fmt" "..."
.De
Equivalent to:
.(l
move(y, x);
printw(fmt, ...);
.)l
.Ds
.Fn mvscanw "int y" "int x" "const char *fmt" "..."
.De
Equivalent to:
.(l
move(y, x);
scanw(fmt, ...);
.)l
.Ds
.Fn mvvline "int y" "int x" "chtype ch" "int count"
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
and then draws a vertical line in the same manner as
.Fn vline .
.Ds
.Fn mvwhline "WINDOW *win" "int y" "int x" "chtype ch" "int count"
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
on window 
.Vn win
and then draws a horizontal line in the same manner as
.Fn whline .
.Ds
.Fn mvwvline "WINDOW *win" "int y" "int x" "chtype ch" "int count"
.De
Moves the cursor to the position
.Vn (y ,
.Vn x )
on window 
.Vn win
and then draws a horizontal line in the same manner as
.Fn wvline .
.Ds
.Fn mvwin "WINDOW *win" "int y" "int x"
.De
Move the home position of the window
.Vn win
from its current starting coordinates
to
.Vn y\*,x ). (
If that would put part or all of the window
off the edge of the terminal screen,
.Fn mvwin
returns ERR and does not change anything.
For subwindows,
.Fn mvwin
also returns ERR if you attempt to move it off its main window.
If you move a main window,
all subwindows are moved along with it.
.Ds
.Fn mvwprintw "WINDOW *win" "int y" "int x" "const char *fmt" "..."
.De
Equivalent to:
.(l
wmove(win, y, x);
printw(fmt, ...);
.)l
.Ds
.Fn mvwscanw "WINDOW *win" "int y" "int x" "const char *fmt" "..."
.De
Equivalent to:
.(l
wmove(win, y, x);
scanw(fmt, ...);
.)l
.Ds
.Fn napms "int ms"
.De
Sleep for
.Vn ms
milliseconds.
.Ds
.Ft "WINDOW *"
.Fn newpad "int lines" "int cols"
.De
Create a new pad with
.Vn lines
lines and
.Vn cols
columns.
.Ds
.Ft "SCREEN *"
.Fn newterm "char *type" "FILE *outfd" "FILE *infd"
.De
Iinitialise the curses subsystem to use the terminal of type
.Vn type
connected via the input and output streams
.Vn infd,outfd. 
The 
.Fn newterm
is used in multi-terminal applications and returns a pointer to a
.Ft "SCREEN"
structure that holds the state for that particular terminal.  The
application may swap between the terminals by calling the
.Fn set_term
function.  If the 
.Vn type
parameter is NULL then the $TERM variable is used as the terminal type.
.Ds
.Ft "WINDOW *"
.Fn newwin "int lines" "int cols" "int begin_y" "int begin_x"
.De
Create a new window with
.Vn lines
lines and
.Vn cols
columns starting at position
.Vn begin\*_y\*,begin\*_x ). (
If either
.Vn lines
or
.Vn cols
is 0 (zero),
that dimension will be set to
.Vn "LINES \- begin\*_y" ) (
or
.Vn "COLS \- begin\*_x" ) (
respectively.
Thus, to get a new window of dimensions
.Vn LINES
\(mu
.Vn COLS ,
use
.Fn newwin 0 0 0 0 .
.Ds
.Fn nl ""
.De
Set the terminal to nl mode,
.i i.e. ,
start/stop the system from mapping
.b <RETURN>
to
.b <LINE-FEED> .
If the mapping is not done,
.Fn refresh
can do more optimization,
so it is recommended, but not required, to turn it off.
.Ds
.Fn no_color_video ""
.De
Return attributes that cannot be combined with color.
.Ds
.Fn nocbreak ""
.De
Unset the terminal from cbreak mode.
.Ds
.Fn nocrmode "" \(dg
.De
Identical to
.Fn nocbreak .
The misnamed macro
.Fn nocrmode
is retained for backwards compatibility
with ealier versions of the library.
.Ds
.Fn nodelay "WINDOW *win1" "int boolf"
.De
Sets the boolean flag for non-blocking
.Fn getch .
If
.Vn boolf
is non-zero,
.Fn getch
will return ERR is no input is waiting.  The default
is to for
.Fn getch
to block indefinitely.  See also
.Fn timeout .
.Ds
.Fn noecho "" \(dg
.De
Turn echoing of characters off.
.Ds
.Fn nonl ""
.De
Unset the terminal to from nl mode.  See
.Fn nl .
.ne 1i
.Ds
.Fn noqiflush \(dg
.De
Unset the terminal flush on interrupt mode.
This is equivalent to
.Fn intrflush stdscr FALSE .
.Ds
.Fn noraw ""
.De
Unset the terminal from raw mode.  See
.Fn raw .
.Ds
.Fn notimeout "WINDOW *win1" "int boolf"
.De
Sets the boolean flag for inter-key timeouts
for escape sequences interpreted when
.Fn keypad
is set.
By default,
.Fn keypad
sets a timer while waiting for the next character of
an escape sequence.
If
.Vn boolf
is non-zero,
.Fn getch
will wait indefinitely between escape sequence characters,
or until a delay set by
.Fn timeout
expires.
.Ds
.Fn overlay "WINDOW *win1" "WINDOW *win2"
.De
Overlay
.Vn win1
on
.Vn win2 .
The contents of
.Vn win1 ,
insofar as they fit,
are placed on
.Vn win2
at their starting \*y.
This is done non-destructively,
i.e., blanks on
.Vn win1
leave the contents of the space on
.Vn win2
untouched.  Note that all non-blank characters are overwritten
destructively in the overlay.
.Ds
.Fn overwrite "WINDOW *win1" "WINDOW *win2"
.De
Overwrite
.Vn win1
on
.Vn win2 .
The contents of
.Vn win1 ,
insofar as they fit,
are placed on
.Vn win2
at their starting \*y.
This is done destructively,
.i i.e. ,
blanks on
.Vn win1
become blank on
.Vn win2 .
.Ds
.Fn pair_content "short pair" "short *fore" "short *back"
.De
Get the foreground and background colors of pair
.Vn pair .
.Ds
.Fn pechochar "const chtype ch" \(dg
.De
Add the character
.Vn ch
on the pad
at the current \*y and immediately refresh the pad.
.Ds 
.Fn pnoutrefresh "WINDOW *pad" "int pbeg_y" "int pbeg_x" "int sbeg_y" "int sbeg_x" "int smax_y" "int smax_x"
.De    
Add the pad contents to a virtual screen.  Several pads can be added
before a call to
.Fn doupdate ,
thus allowing the screen to updated in an efficient manner.
.Ds
.Fn prefresh "WINDOW *pad" "int pbeg_y" "int pbeg_x" "int sbeg_y" "int sbeg_x" "int smax_y" "int smax_x"
.De 
Synchronize the terminal screen with the desired pad.
.Ds
.Fn printw "char *fmt" "..."
.De
Performs a
.Fn printf
on the window starting at the current \*y.
It uses
.Fn addstr
to add the string on the window.
It is often advisable to use the field width options of
.Fn printf
to avoid leaving things on the window from earlier calls.
\*(Es
.Ds 
.Fn putwin "WINDOW *win" "FILE *fp"
.De
Writes the window data to a file.
.Ds
.Fn qiflush \(dg
.De
Set the terminal flush on interrupt mode.
This is equivalent to
.Fn intrflush stdscr TRUE .
.Ds
.Fn raw ""
.De
Set the terminal to raw mode.
On version 7
.Un \**
.(f
\**
.Un
is a trademark of Unix System Laboratories.
.)f
this also turns off newline mapping
(see
.Fn nl ).
.Ds
.Fn redrawwin "WINDOW *win" \(dg
.De
Mark the entire window as having been corrupted.
This is equivalent to the
.Fn touchwin
function.
.Ds
.Fn refresh "" \(dg
.De
Synchronize the terminal screen with the desired window.
If the window is not a screen,
only that part covered by it is updated.
\*(Es
In this case, it will update whatever it can
without causing the scroll.
.sp
As a special case,
if
.Fn wrefresh
is called with the window
.Vn curscr
the screen is cleared
and repainted as it is currently.
This is very useful for allowing the redrawing of the screen
when the user has garbage dumped on his terminal.
.Ds
.Fn reset_prog_mode ""
.De
Restore the terminal to the \'in curses\' state.
.Ds
.Fn reset_shell_mode ""
.De
Restore the terminal to the \'not in curses\' state.
.Ds
.Fn resetty "" \(dg
.De
.Fn resetty
restores them to what
.Fn savetty
stored.
These functions are performed automatically by
.Fn initscr
and
.Fn endwin .
This function should not be used by the user.
.Ds
.Fn resizeterm "int lines" "int columns" \(dg
.De
Resizes the curses terminal to the given size.  All internal curses
structures are resized to the new dimensions and all curses windows that
would have boundaries outside the new terminal size will be resized to fit
within the new boundaries.  All windows will be cleared and it is expected
that the application will redraw the window contents.
.Ds
.Fn savetty "" \(dg
.De
.Fn savetty
saves the current tty characteristic flags. See
.Fn resetty .
This function should not be used by the user.
.Ds
.Fn scanw "char *fmt" "..."
.De
Perform a
.Fn scanf
through the window using
.Vn fmt .
It does this using consecutive calls to
.Fn getch
(or
.Fn wgetch ).
\*(Es
.ne 1i
.Ds
.Fn scrl "int n"
.De
Scroll the window by
.Vn n
lines. If
.Vn n
is positive, scroll upward, otherwise
scroll downward.
.Ds
.Fn scroll "WINDOW *win"
.De
Scroll the window upward one line.
This is normally not used by the user.
.Ds
.Fn scrollok "WINDOW *win" "int boolf" \(dg
.De
Set the scroll flag for the given window.
If
.Vn boolf
is 0, scrolling is not allowed.
This is its default setting.
.Ds
.Ft "SCREEN *"
.Fn set_term "SCREEN *new"
.De
Sets the current screen for input and output to be the one given.  The 
.Vn new
structure must be one that has been previously created by the 
.Fn newterm
function.  The 
.Fn set_term
function returns the previous screen on successful completion.
.Ds
.Fn standend "" \(dg
.De
End standout mode initiated by
.Fn standout .
This function is provided for compatibility
with older curses implementations.
.Ds
.Fn standout "" \(dg
.De
Causes any characters added to the window
to be put in standout mode on the terminal
(if it has that capability).  This function
is provided for compatibility with older curses
implementations.  A larger range of character
attributes supported by modern terminals can be
accessed using
.Fn attron
and
.Fn attrset .
.Ds
.Fn start_color ""
.De
Initialize the color routines. 
This must be called before any of the color routines are used.
The terminal is setup to use the curses default colors of white foreground
on black background, unless
.Fn assume_default_colors
or
.Fn use_default_colors
are called.
.Ds
.Ft "WINDOW *"
.Fn subpad "WINDOW *win" "int lines" "int cols" "int begin_y" "int begin_x"
.De
Create a new pad with
.Vn lines
lines and
.Vn cols
columns starting at position
.Vn begin\*_y\*,begin\*_x ) (
inside the pad
.i win .
This means that any change made to either pad
in the area covered
by the subpad will be made on both pads.
.Vn begin\*_y\*,begin\*_x
are specified relative to the relative (0\*,0) of
.Vn win .
.Ds
.Ft "WINDOW *"
.Fn subwin "WINDOW *win" "int lines" "int cols" "int begin_y" "int begin_x"
.De
Create a new window with
.Vn lines
lines and
.Vn cols
columns starting at position
.Vn begin\*_y\*,begin\*_x ) (
inside the window
.i win .
This means that any change made to either window
in the area covered
by the subwindow will be made on both windows.
.Vn begin\*_y\*,begin\*_x
are specified relative to the overall screen,
not the relative (0\*,0) of
.Vn win .
If either
.Vn lines
or
.Vn cols
is 0 (zero),
that dimension will be set to
.Vn "LINES \- begin\*_y" ) (
or
.Vn "COLS \- begin\*_x" ) (
respectively.
.Ds
.Fn termattrs ""
.De
Returns the attributes that can be applied to the screen.
.Ds
.Fn term_attrs ""
.De
Returns the wide attributes that can be applied to the screen.
.Ds
.Fn timeout "int delay" \(dg
.De
Sets blocking or non-blocking
.Fn getch .
If
.Vn delay
is positive,
.Fn getch
will block for
.Vn delay
milliseconds before returning.  If
.Vn delay
is zero,
.Fn getch
will return ERR is no input is waiting.  If
.Vn delay
is negative,
.Fn getch
will block indefinitely.  See also
.Fn keypad ,
.Fn nodelay
and
.Fn notimeout .
.Ds
.Fn touchline "WINDOW *win" "int y" "int startx" "int endx"
.De
This function performs a function similar to
.Fn touchwin
on a single line.
It marks the first change for the given line
to be
.Vn startx ,
if it is before the current first change mark,
and
the last change mark is set to be
.Vn endx
if it is currently less than
.Vn endx .
.Ds
.Fn touchoverlap "WINDOW *win1" "WINDOW *win2"
.De
Touch the window
.Vn win2
in the area which overlaps with
.Vn win1 .
If they do not overlap,
no changes are made.
.Ds
.Fn touchwin "WINDOW *win"
.De
Make it appear that the every location on the window
has been changed.
This is usually only needed for refreshes with overlapping windows.
.Ds
.Fn tstp
.De
This function
will save the current tty state
and then put the process to sleep.
When the process gets restarted,
it restores the saved tty state
and then calls
.Fn wrefresh "curscr"
to redraw the screen.
.Fn Initscr
sets the signal
SIGTSTP
to trap to this routine.
.Ds
.Fn unctrl "char *ch" \(dg
.De
Returns a string which is an ASCII representation of
.Vn ch .
Characters are 8 bits long.
.Ds
.Fn unctrllen "char *ch" \(dg
.De
Returns the length of the ASCII representation of
.Vn ch .
.ne 1i
.Ds
.Fn underend "" \(dg
.De
End underscore mode initiated by
.Fn underscore .
This is equivalent to
.Fn attroff "A_UNDERLINE" .
.Ds
.Fn underscore "" \(dg
.De
Causes any characters added to the window
to be put in underscore mode on the terminal
(if it has that capability).
This is equivalent to
.Fn attron "A_UNDERLINE" .
.Ds
.Fn ungetch "int c"
.De
Places the contents of
.Vn c
converted to a character back into the input queue.  Only one
character of push back before a subsequent call to
.Fn getch
or
.Fn wgetch
is guaranteed to function correctly.  The results of attempting more
than one character of push back is undefined.
.Ds
.Fn untouchwin "WINDOW *win"
.De
Make the window appear to have not been updated even if it has been.
.Ds
.Fn use_default_colors ""
.De
Use the terminal foreground and background colors as the curses default
foreground and background colors.
.Ds
.Fn vline "chtype ch" "int count"
.De
Draws a vertical line of character
.Vn ch
starting at the current cursor location and moving towards the bottom
of the screen.  At most
.Vn count
characters are drawn, less if the bottom of the screen is reached
before
.Vn count
expires.
.Ds
.Fn vwprintw "WINDOW *win" "const char *fmt" "va_list ap"
.De
Identical to
.Fn printw
except that it takes both a window specification and a pointer to a variable
length argument list.
.Ds
.Fn vwscanw "WINDOW *win" "const char *fmt" "va_list ap"
.De
Identical to
.Fn scanw
except that it takes both a window specification and a pointer to a variable
length argument list.
.Ds
.Fn wnoutrefresh "WINDOW *win"
.De
Add the window contents to a virtual screen.  Several windows can be added
before a call to
.Fn doupdate ,
thus allowing the screen to updated in an efficient manner.
.Ds
.Fn wredrawln "WINDOW *win" "int line" "int n" \(dg
.De
Mark
.Vn n
lines starting at
.Vn line
in the window as corrupted.
This is equivalent to
.Fn wtouchln "win" "line" "n" "1" .
.Ds
.Fn wresize "WINDOW *win" "int lines" "int columns"
.De
Resize the specified window to the given dimensions.  The window will be
cleared and the application is expected to redraw the window contents.
.Ds
.Fn wtouchln "WINDOW *win" "int line" "int n" "int changed"
.De
If 
.Vn changed
is 1 then 
.Vn n
lines starting at
.Vn line
in the window are touched.  If
.Vn changed
is 0 then 
.Vn n
lines starting at
.Vn line
in the window are untouched.
.sp 2
.pp
\fIThe following functions differ from the standard functions only in their
specification of a window, rather than the use of the default
.Vn stdscr.\fP
.Ds
.Fn waddbytes "WINDOW *win" "char* str" "int len"
.Fn waddch "WINDOW *win" "chtype ch"
.Fn waddchnstr "WINDOW *win" "chtype *str" "int len"
.Fn waddchstr "WINDOW *win" "chtype *str" "int len"
.Fn waddnstr "WINDOW *win" "char *str" "int len"
.Fn waddstr "WINDOW *win" "char *str"
.Fn wattroff "WINDOW *win" "int attr"
.Fn wattron "WINDOW *win" "int attr"
.Fn wattrset "WINDOW *win" "int attr"
.Fn wbkgd "WINDOW *win" "chtype ch"
.Fn wbkgdset "WINDOW *win" "chtype ch"
.Fn wborder "WINDOW *win" "chtype left" "chtype right" "chtype top" "chtype bottom" "chtype topleft" "chtype topright" "chtype botleft" "chtype botright"
.Fn wclear "WINDOW *win"
.Fn wclrtobot "WINDOW *win"
.Fn wclrtoeol "WINDOW *win"
.Fn wdelch "WINDOW *win"
.Fn wdeleteln "WINDOW *win"
.Fn wechochar "WINDOW *win" "chtype ch"
.Fn werase "WINDOW *win"
.Fn wgetch "WINDOW *win"
.Fn wgetnstr "WINDOW *win" "char *str" "int len"
.Fn wgetstr "WINDOW *win" "char *str"
.Fn whline "WINDOW *win" "chtype ch" "int count"
.Fn winch "WINDOW *win" \(dg
.Fn winchnstr "WINDOW *win" "chtype *chstr" "int n"
.Fn winchstr "WINDOW *win" "chtype *chstr"
.Fn winnstr "WINDOW *win" "char *str" "int n"
.Fn winsch "WINDOW *win" "char c"
.Fn winsdelln "WINDOW *win" "int n"
.Fn winsertln "WINDOW *win"
.Fn winstr "WINDOW *win" "char *str"
.Fn wmove "WINDOW *win" "int y" int x"
.Fn wprintw "WINDOW *win" "char *fmt" "..."
.Fn wrefresh "WINDOW *win"
.Fn wscanw "WINDOW *win" "char *fmt" "..."
.Fn wscrl "WINDOW *win" "int n"
.Fn wstandend "WINDOW *win"
.Fn wstandout "WINDOW *win"
.Fn wtimeout "WINDOW *win" "int delay"
.Fn wunderend "WINDOW *win"
.Fn wunderscore "WINDOW *win"
.Fn wvline "WINDOW *win" "chtype ch" "int count"
.Fn mvwaddch "WINDOW *win" "int y" "int x" "chtype ch"
.Fn mvwaddchstr "WINDOW *win" "int y" "int x" "chtype *str" \(dg
.Fn mvwaddchnstr "WINDOW *win" "int y" "int x" "chtype *str" \(dg
.Fn mvwaddnstr "WINDOW *win" "int y" "int x" "char *str" "int len"
.Fn mvwaddstr "WINDOW *win" "int y" "int x" "char *str"
.Fn mvwgetnstr "WINDOW *win" "int y" "int x" "char *str" "int len"
.Fn mvwgetstr "WINDOW *win" "int y" "int x" "char *str"
.Fn mvwhline "WINDOW *win" "int y" "int x" "chtype ch" "int count"
.Fn mvwvline "WINDOW *win" "int y" "int x" "chtype ch" "int count"

.Dg