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
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
'\" t
.\" $Id: dialog.3,v 1.93 2013/09/22 23:58:11 tom Exp $
.\" Copyright 2005-2012,2013  Thomas E. Dickey
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU Lesser General Public License, version 2.1
.\" as published by the Free Software Foundation.
.\"
.\" 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.  See the GNU
.\" Lesser General Public License for more details.
.\"
.\" You should have received a copy of the GNU Lesser General Public
.\" License along with this program; if not, write to
.\"	Free Software Foundation, Inc.
.\"	51 Franklin St., Fifth Floor
.\"	Boston, MA 02110, USA.
.\"
.\" definitions for renaming
.ds p dialog
.ds l dialog
.ds L Dialog
.ds D DIALOG
.
.de ES
.ne 8
.IP
..
.de EX
.RS +10
.nf
..
.de EE
.fi
.RE
..
.\" Bulleted paragraph
.de bP
.IP \(bu 4
..
.TH \*D 3 "" "$Date: 2013/09/22 23:58:11 $"
.SH NAME
dialog \- widgets and utilities for the \*p program
.SH SYNOPSIS
.B cc [ flag ... ] file ...  -l\*l [ library ... ]
.br
\ \ \ or
.br
.B cc `\*p-config --cflags` file ... `\*p-config --libs` ]
.sp
.B #include <\*l.h>
.PP
\fB\*L\fP
is a program that will let you to present a variety of questions or
display messages using dialog boxes from a shell script.
It is built from the \fB\*l\fP library,
which consists of several widgets
as well as utility functions that are used by the widgets
or the main program.
.
.SH DESCRIPTION
This manpage documents the features from \fI<\*l.h>\fP which
are likely to be important to developers using the widgets directly.
Some hints are also given for developing new widgets.
.
.\" ************************************************************************
.SH DEFINITIONS
Exit codes (passed back to the main program for its use)
are defined with a "\fIDLG_EXIT_\fP prefix.
The defined constants can be mapped using environment variables
as described in \fB\*p\fP(1),
e.g., \fIDLG_EXIT_OK\fP corresponds to \fI$DIALOG_OK\fP.
.PP
Useful character constants which correspond to user input
are named with the "\fICHR_\fP" prefix, e.g.,
\fICHR_BACKSPACE\fP.
.PP
Colors and video attributes are categorized and associated with
settings in the configuration file
(see the discussion of \fI$DIALOGRC\fP in \fB\*p\fP(1)).
The \fIDIALOG_ATR(n)\fP macro is used for defining the references
to the combined color and attribute table \fBdlg_color_table[]\fP.
.PP
The \fB\*p\fP application passes its command-line parameters
to the widget functions.  Some of those parameters are single values,
but some of the widgets accept data as an array of values.
Those include checklist/radiobox, menubox and formbox.
When the \fB--item-help\fP option is given, an extra column
of data is expected.
The USE_ITEM_HELP(), CHECKBOX_TAGS, MENUBOX_TAGS and FORMBOX_TAGS
macros are used to hide this difference from the calling application.
.PP
Most of the other definitions found in \fI<\*l.h>\fP
are used for convenience in building the library or main program.
These include definitions based on the generated \fI<dlg_config.h>\fP header.

.\" ************************************************************************
.SH DATA STRUCTURES
All of the global data for the \fB\*l\fP library is stored in
a few structures: \fIDIALOG_STATE\fP, \fIDIALOG_VARS\fP and \fIDIALOG_COLORS\fP.
The corresponding \fBdialog_state\fP, \fBdialog_vars\fP and \fBdlg_color_table\fP
global variables should be initialized to zeros,
and then populated with the data to use.
A few of these must be nonzero for the corresponding widgets to function.
As as the case with function names,
variables beginning with "\fIdialog_\fP"
are designed for use by the calling application
while variables beginning with "\fIdlg_\fP"
are intended for lower levels, e.g., by the \fB\*l\fP library.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.all_subwindows
This is a linked list of all subwindows created by the library.
The \fBdlg_del_window\fP function uses this
to free storage for subwindows when deleting a window.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.all_windows
This is a linked list of all windows created by the library.
The \fBdlg_del_window\fP function uses this to locate windows which
may be redrawn after deleting a window.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.aspect_ratio
This corresponds to the command-line option "\fB--aspect-ratio\fP".
The value gives the application
some control over the box dimensions when using auto
sizing (specifying 0 for height and width).
It represents width / height.
The default is 9, which means 9 characters wide to every 1 line high.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.finish_string
When set to true, this allows calls to \fBdlg_finish_string\fP to discard the
corresponding data which is created to speed up layout computations for the
given string parameter.  The \fBgauge\fP widget uses this feature.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.getc_callbacks
This is setup in \fIui_getc.c\fP to record windows which must be polled
for input, e.g,. to handle the background tailbox widget.
One window is designated as the foreground or control window.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.getc_redirect
If the control window for \fIDIALOG_STATE.getc_callbacks\fP is
closed, the list is transferred to this variable.
Closing all windows causes the application to exit.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.no_mouse
This corresponds to the command-line option "\fB--no-mouse\fP".
If true, \fB\*p\fP will not initialize (and enable) the mouse in
\fIinit_dialog\fP.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.output
This is set in the \fB\*p\fP application to the stream on
which the application and library functions may write text results.
Normally that is the standard error,
since the curses library prefers to write its data to the standard output.
Some scripts, trading portability for convenience,
prefer to write results to the standard output,
e.g., by using the "\fB--stdout\fP" option.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.output_count
This is incremented by \fBdlg_does_output\fP,
which is called by each widget that writes text to the output.
The \fB\*p\fP application uses that to decide if it should
also write a separator, i.e.,
\fIDIALOG_STATE.separate_str\fP,
between calls to each widget.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.pipe_input
This is set in \fIinit_dialog\fP to a stream which can be used by the
\fBgauge\fP widget, which must be the application's standard input.
The \fB\*p\fP application calls \fIinit_dialog\fP normally with
\fIinput\fP set to the standard input, but optionally based on the
"\fB--input-fd\fP" option.
Since the application cannot read from
a pipe (standard input) and at the same time read
the curses input from the standard input,
it must allow for reopening the latter from either
a specific file descriptor,
or directly from the terminal.
The adjusted pipe stream value is stored in this variable.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.screen_initialized
This is set in \fIinit_dialog\fP and
reset in \fIend_dialog\fP.
It is used to check if curses has been initialized,
and if the \fIendwin\fP function must be called on exit.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.screen_output
This is set in \fIinit_dialog\fP to the output stream used
by the curses library.
Normally that is the standard output,
unless that happens to not be a terminal (and if \fIinit_dialog\fP can
successfully open the terminal directly).
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.separate_str
This corresponds to the command-line option "\fB--separate-widget\fP".
The given string
specifies a string that will separate the output on \fB\*p\fP's output from
each widget.
This is used to simplify parsing the result of a dialog with several widgets.
If this option is not given,
the default separator string is a tab character.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.tab_len
This corresponds to the command-line option "\fB--tab-len\fP \fInumber\fP".
Specify the number of spaces that a tab character occupies if the
"\fB--tab-correct\fP"
option is given.
The default is 8.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.trace_output
This corresponds to the command-line option "\fB--trace\fP \fIfile\fP".
It is the file pointer to which trace messages are written.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.use_colors
This is set in \fIinit_dialog\fP if the curses implementation supports color.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.use_scrollbar
This corresponds to the command-line option "\fB--scrollbar\fP".
If true,
draw a scrollbar to make windows holding scrolled data more readable.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.use_shadow
This corresponds to the command-line option "\fB--no-shadow\fP".
This is set in \fIinit_dialog\fP if the curses implementation supports color.
If true,
suppress shadows that would be drawn to the right and bottom of each dialog box.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_STATE.visit_items
This corresponds to the command-line option "\fB--visit-items\fP".
.\" ---------------------------------------------------------------------------
.PP
The \fB\*p\fP application resets the \fBdialog_vars\fP data before
accepting options to invoke each widget.
Most of the \fIDIALOG_VARS\fP members are set directly from \fB\*p\fP's
command-line options:
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.ascii_lines
This corresponds to the command-line option "\fB--ascii-lines\fP.
It causes line-drawing to be done with ASCII characters, e.g., "+" and "-".
See \fIDIALOG_VARS.no_lines\fP.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.backtitle
This corresponds to the command-line option "\fB--backtitle\fP \fIbacktitle\fP".
It specifies a
\fIbacktitle\fP
string to be displayed on the backdrop, at the top of the screen.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.beep_after_signal
This corresponds to the command-line option "\fB--beep-after\fP".
If true, beep after a user has completed a widget by pressing one of the buttons.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.beep_signal
This corresponds to the command-line option "\fB--beep\fP".
It is obsolete.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.begin_set
This is true if the command-line option "\fB--begin y x\fP" was used.
It specifies the position of the upper left corner of a dialog box on the screen.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.begin_x
This corresponds to the \fIx\fP value from
the command-line option "\fB--begin\fP \fIy x\fP" (second value).
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.begin_y
This corresponds to the \fIy\fP value from
the command-line option "\fB--begin\fP \fIy x\fP" (first value).
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.cancel_label
This corresponds to the command-line option "\fB--cancel-label\fP \fIstring\fP".
The given \fIstring\fP overrides the label used for "Cancel" buttons.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.cant_kill
This corresponds to the command-line option "\fB--no-kill\fP".
If true, this tells
\fB\*p\fP
to put the
\fBtailboxbg\fP
box in the background,
printing its process id to \fB\*p\fP's output.
SIGHUP is disabled for the background process.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.colors
This corresponds to the command-line option "\fB--colors\fP".
If true, interpret embedded "\\Z" sequences in the dialog text
by the following character,
which tells \fB\*p\fP to set colors or video attributes:
0 through 7 are the ANSI codes used in curses:
black,
red,
green,
yellow,
blue,
magenta,
cyan and
white respectively.
Bold is set by 'b', reset by 'B'.
Reverse is set by 'r', reset by 'R'.
Underline is set by 'u', reset by 'U'.
The settings are cumulative, e.g., "\\Zb\\Z1" makes the following text
bright red.
Restore normal settings with "\\Zn".
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.column_separator
This corresponds to the command-line option "\fB--column-separator\fP".
\fB\*L\fP splits data for radio/checkboxes and menus on the
occurrences of the given string, and aligns the split data into columns.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.cr_wrap
This corresponds to the command-line option "\fB--cr-wrap\fP".
If true,
interpret embedded newlines in the dialog text as a newline on the screen.
Otherwise, \fB\*p\fR will only wrap lines where needed to fit inside the text box.
Even though you can control line breaks with this,
\fB\*p\fR will still wrap any lines that are too long for the width of the box.
Without cr-wrap, the layout of your text may be formatted to look nice
in the source code of your script without affecting the way it will
look in the dialog.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.date_format
This corresponds to the command-line option "\fB--date-format\fP \fIstring\fP".
If the host provides \fBstrftime\fP, and the value is nonnull,
the calendar widget uses this to format its output.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.default_button
This is set by the command-line option "\fB--default-button\fP.
It is used by \fBdlg_default_button\fP.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.default_item
This corresponds to the command-line option "\fB--default-item\fP \fIstring\fP".
The given string is used as
the default item in a checklist, form or menu box.
Normally the first item in the box is the default.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.defaultno
This corresponds to the command-line option "\fB--defaultno\fP".
If true,
make the default value of the
\fByes/no\fP
box a
.BR No .
Likewise, make the default button of widgets that provide "OK" and "Cancel"
a \fBCancel\fP.
If \fB--nocancel\fP was given that option overrides this,
making the default button always "Yes" (internally the same as "OK").
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.dlg_clear_screen
This corresponds to the command-line option "\fB--clear\fP".
This option is implemented in the main program, not the library.
If true,
the screen will be cleared on exit.
This may be used alone, without other options.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.exit_label
This corresponds to the command-line option "\fB--exit-label string\fP".
The given string overrides the label used for "EXIT" buttons.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.extra_button
This corresponds to the command-line option "\fB--extra-button\fP".
If true, some widgets show an extra button,
between "OK" and "Cancel" buttons.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.extra_label
This corresponds to the command-line option "\fB--extra-label\fP \fIstring\fP".
The given string overrides the label used for "Extra" buttons.
Note: for inputmenu widgets, this defaults to "Rename".
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.formitem_type
This is set by the command-line option "\fB--passwordform\fP"
to tell the form widget that its text fields should be treated like
password widgets.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_button
This corresponds to the command-line option "\fB--help-button\fP".
If true, some widgets show a help-button after "OK" and "Cancel" buttons,
i.e., in checklist, radiolist and menu boxes.
If \fB--item-help\fR is also given, on exit
the return status will be the same as for the "OK" button,
and the item-help text will be written to \fB\*p\fP's output after the token "HELP".
Otherwise, the return status will indicate that the Help button was pressed,
and no message printed.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_file
This corresponds to the command-line option "\fB--hfile\fP \fIstring\fP".
The given filename is passed to \fBdialog_helpfile\fP when the user
presses F1.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_label
This corresponds to the command-line option "\fB--help-label\fP \fIstring\fP".
The given string overrides the label used for "Help" buttons.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_line
This corresponds to the command-line option "\fB--hline\fP \fIstring\fP".
The given string is displayed in the bottom of dialog windows,
like a subtitle.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_status
This corresponds to the command-line option "\fB--help-status\fP".
If true, and the the help-button is selected,
writes the checklist or radiolist information
after the item-help "HELP" information.
This can be used to reconstruct the state of a checklist after processing
the help request.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.help_tags
This corresponds to the command-line option "\fB--help-tags\fP".
If true,
\fBdlg_add_help_formitem\fP and
\fBdlg_add_help_listitem\fP use the item's tag value consistently
rather than using the tag's help-text value
when \fIDIALOG_VARS.item_help\fP is set.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.input_length
This is nonzero if \fIDIALOG_VARS.input_result\fP is allocated,
versus being a pointer to the user's local variables.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.input_menu
This flag is set to denote whether the menubox widget
implements a menu versus a inputmenu widget.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.input_result
This may be either a user-supplied buffer,
or a buffer dynamically allocated by the library,
depending on \fIDIALOG_VARS.input_length\fP:
.RS
.bP
If \fIDIALOG_VARS.input_length\fP is zero,
this is a pointer to user buffer (on the stack, or static).
The buffer size is assumed to be \fBMAX_LEN\fP,
which is defined in \fI<\*l.h>\fP.
.bP
When \fIDIALOG_VARS.input_length\fP is nonzero,
this is a dynamically-allocated buffer used by the widgets to return
printable results to the calling application.
.RE
.IP
Certain widgets copy a result to this buffer.
If the pointer is NULL, or if the length is insufficient for
the result, then the \fB\*l\fP library allocates a buffer which is large enough,
and sets \fIDIALOG_VARS.input_length\fP.
Callers should check for this case if they have supplied their own buffer.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.insecure
This corresponds to the command-line option "\fB--insecure\fP".
If true, make the password widget friendlier but less secure,
by echoing asterisks for each character.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.in_helpfile
This variable is used to prevent \fBdialog_helpfile\fP from showing
anything, e.g., if F1 were pressed within a help-file display.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.item_help
This corresponds to the command-line option "\fB--item-help\fP".
If true,
interpret the tags data for checklist, radiolist and menu boxes
adding a column whose text is displayed in the bottom line of the
screen, for the currently selected item.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.keep_tite
This is set by the command-line option "\fB--keep-tite\fP"
to tell \fB\*p\fP to not attempt to cancel the terminal initialization
(termcap \fIti\fP/\fIte\fP) sequences which correspond to xterm's alternate-screen
switching.
Normally \fB\*p\fP does this to avoid flickering when run several times
in a script.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.keep_window
This corresponds to the command-line option "\fB--keep-window\fP".
If true, do not remove/repaint the window on exit.
This is useful for keeping the window contents visible when several
widgets are run in the same process.
Note that curses will clear the screen when starting a new process.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.last_key
This corresponds to the command-line option "\fB--last-key\fP".
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.max_input
This corresponds to the command-line option "\fB--max-input\fP \fIsize\fP".
Limit input strings to the given size.
If not specified, the limit is 2048.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.no_items
This corresponds to the command-line option "\fB--no-items\fP".
Some widgets (checklist, inputmenu, radiolist, menu) display a list
with two columns (a "tag" and "item", i.e., "description").
This tells \fB\*p\fP to read shorter rows from data,
omitting the "list".
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.no_label
This corresponds to the command-line option "\fB--no-label\fP \fIstring\fP".
The given string overrides the label used for "No" buttons.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.no_lines
This corresponds to the command-line option "\fB--no-lines\fP.
It suppresses line-drawing.
See \fIDIALOG_VARS.ascii_lines\fP.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.no_nl_expand
This corresponds to the command-line option "\fB--no-nl-expand\fP".
If false, \fBdlg_trim_string\fP converts literal "\\n" substrings
in a message into newlines.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.no_tags
This corresponds to the command-line option "\fB--no-tags\fP".
Some widgets (checklist, inputmenu, radiolist, menu) display a list
with two columns (a "tag" and "item", also known as "description").
The tag is useful for scripting, but may not help the user.
The \fB--no-tags\fP option (from Xdialog) may be used to suppress the
column of tags from the display.
.IP
Normally \fB\*p\fP allows you to quickly move to entries on the displayed list,
by matching a single character to the first character of the tag.
When the \fB--no-tags\fP option is given, \fB\*p\fP matches against
the first character of the description.
In either case, the matchable character is highlighted.
.IP
Here is a table showing how the no_tags and no_items values interact:
.TS
tab(/);
l l l l l
_ _ _ _ _
l l l c c.
Widget/Fields Shown/Fields Read/.no_items/.no_tags
buildlist/item/tag,item/0/0*
buildlist/item/tag,item/0/1
buildlist/tag/tag/1/0*
buildlist/tag/tag/1/1
checklist/tag,item/tag,item/0/0
checklist/item/tag,item/0/1
checklist/tag/tag/1/0
checklist/tag/tag/1/1
inputmenu/tag,item/tag,item/0/0
inputmenu/item/tag,item/0/1
inputmenu/tag/tag/1/0
inputmenu/tag/tag/1/1
menu/tag,item/tag,item/0/0
menu/item/tag,item/0/1
menu/tag/tag/1/0
menu/tag/tag/1/1
radiolist/tag,item/tag,item/0/0
radiolist/item/tag,item/0/1
radiolist/tag/tag/1/0
radiolist/tag/tag/1/1
treeview/item/tag,item/0/0*
treeview/item/tag,item/0/1
treeview/tag/tag/1/0*
treeview/tag/tag/1/1
_
.TE
.RS
.TP 2
*
Xdialog does not display the tag column for the analogous buildlist
and treeview widgets.
\fB\*L\fP does the same on the command-line.
However the library interface defaults to displaying the tag column.
Your application can enable or disable the tag column as needed for each widget.
.RE
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.nocancel
This corresponds to the command-line option "\fB--no-cancel\fP".
If true,
suppress the "Cancel" button in checklist, inputbox and menu box modes.
A script can still test if the user pressed the ESC key to cancel to quit.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.nocollapse
This corresponds to the command-line option "\fB--no-collapse\fP".
Normally \fB\*p\fR converts tabs to spaces and reduces multiple
spaces to a single space for text which is displayed in a message boxes, etc.
It true, that feature is disabled.
Note that \fB\*p\fR will still wrap text, subject to the \fB--cr-wrap\fR
option.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.nook
This corresponds to the command-line option "\fB--nook\fP.
\fB\*L\fP will suppress the "ok" (or "yes") button from the widget.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.ok_label
This corresponds to the command-line option "\fB--ok-label\fP \fIstring\fP".
The given string overrides the label used for "OK" buttons.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.print_siz
This corresponds to the command-line option "\fB--print-size\fP".
If true,
each widget prints its size to \fB\*p\fP's output when it is invoked.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.quoted
This corresponds to the command-line option "\fB--quoted\fP.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.separate_output
This corresponds to the command-line option "\fB--separate-output\fP".
If true,
checklist widgets output result one line at a time, with no quoting.
This facilitates parsing by another program.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.single_quoted
This corresponds to the command-line option "\fB--single-quoted\fP".
If true,
Use single-quoting as needed (and no quotes if unneeded) for the
output of checklist's as well as the item-help text.
If this option is not set, \fB\*p\fP uses double quotes around each item.
The latter requires occasional use of backslashes to make the output useful in
shell scripts.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.size_err
This corresponds to the command-line option "\fB--size-err\fP".
If true,
check the resulting size of a dialog box before trying to use it,
printing the resulting size if it is larger than the screen.
(This option is obsolete, since all new-window calls are checked).
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.sleep_secs
This corresponds to the command-line option "\fB--sleep\fP \fIsecs\fP".
This option is implemented in the main program, not the library.
If nonzero, this is the number of seconds after to delay after processing a dialog box.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.tab_correct
This corresponds to the command-line option "\fB--tab-correct\fP".
If true, convert each tab character of the text to one or more spaces.
Otherwise, tabs are rendered according to the curses library's interpretation.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.time_format
This corresponds to the command-line option "\fB--time-format\fP \fIstring\fP".
If the host provides \fBstrftime\fP, and the value is nonnull,
the timebox widget uses this to format its output.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.timeout_secs
This corresponds to the command-line option "\fB--timeout\fP \fIsecs\fP".
If nonzero, timeout input requests (exit with error code)
if no user response within the given number of seconds.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.title
This corresponds to the command-line option "\fB--title\fP \fItitle\fP".
Specifies a
\fItitle\fP
string to be displayed at the top of the dialog box.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.trim_whitespace
This corresponds to the command-line option "\fB--trim\fP".
If true, eliminate leading blanks,
trim literal newlines and repeated blanks from message text.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.visit_items
This corresponds to the command-line option "\fB--visit-items\fP".
Modify the tab-traversal of the list-oriented widgets
(buildlist, checklist, radiobox, menubox, inputmenu, and treeview)
to include the list of items as one of the states.
This is useful as a visual aid,
i.e., the cursor position helps some users.
.\" ---------------------------------------------------------------------------
.IP \fIDIALOG_VARS.yes_label
This corresponds to the command-line option "\fB--yes-label\fP \fIstring\fP".
The given string overrides the label used for "Yes" buttons.
.
.\" ************************************************************************
.\" ************************************************************************
.SH WIDGETS
Functions that implement major functionality for the command-line \fB\*p\fP
program, e.g., widgets, have names beginning "\fIdialog_\fP".

All dialog boxes have at least three parameters:
.TP 5
\fItitle\fP
the caption for the box, shown on its top border.
.TP 5
\fIheight\fP
the height of the dialog box.
.TP 5
\fIwidth\fP
the width of the dialog box.
.PP
Other parameters depend on the box type.
.
.\" ************************************************************************
.IP \fBdialog_buildlist
implements the "\fB--buildlist\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIlist_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B char ** \fIitems
is an array of strings which is viewed either as a list of rows
.RS
\fItag item status \fR
.RE
.IP
or
.RS
\fItag item status help\fR
.RE
.IP
depending on whether \fBdialog_vars.item_help\fP is set.
.TP 5
.B int \fIorder_mode
is reserved for future enhancements
.RE
.
.\" ************************************************************************
.IP \fBdialog_calendar
implements the "\fB--calendar\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIsubtitle
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the height excluding the fixed-height calendar grid.
.TP 5
.B int \fIwidth
is the overall width of the box,
which is adjusted up to the calendar grid's minimum width if needed.
.TP 5
.B int \fIday
is the initial day of the week shown,
counting zero as Sunday.
If the value is negative, the current day of the week is used.
.TP 5
.B int \fImonth
is the initial month of the year shown,
counting one as January.
If the value is negative, the current month of the year is used.
.TP 5
.B int \fIyear
is the initial year shown.
If the value is negative, the current year is used.
.RE
.\" ************************************************************************
.IP \fBdialog_checklist
implements the "\fB--checklist\fP" and "\fB--radiolist\fP" options
depending on the \fIflag\fP parameter.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIlist_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows
.RS
\fItag item status \fR
.RE
.IP
or
.RS
\fItag item status help\fR
.RE
.IP
depending on whether \fBdialog_vars.item_help\fP is set.
.IP flag
is either \fIFLAG_CHECK\fP, for checklists,
or \fIFLAG_RADIO\fP for radiolists.
.RE
.\" ************************************************************************
.IP \fBdialog_dselect
implements the "\fB--dselect\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIpath
is the preselected value to show in the input-box,
which is used also to set the directory- and file-windows.
.TP 5
.B int \fIheight
is the height excluding the minimum needed to show the dialog box framework.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.RE
.\" ************************************************************************
.IP \fBdialog_editbox
implements the "\fB--editbox\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIfile
is the name of the file from which to read.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.RE
.\" ************************************************************************
.IP \fBdialog_form
implements the "\fB--form\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIform_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows
.RS
\fIName NameY NameX Text TextY TextX FLen ILen\fR
.RE
.IP
or
.RS
\fIName NameY NameX Text TextY TextX FLen ILen Help\fR
.RE
.IP
depending on whether \fBdialog_vars.item_help\fP is set.
.RE
.\" ************************************************************************
.IP \fBdialog_fselect
implements the "\fB--fselect\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIpath
is the preselected value to show in the input-box,
which is used also to set the directory- and file-windows.
.TP 5
.B int \fIheight
is the height excluding the minimum needed to show the dialog box framework.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.RE
.\" ************************************************************************
.IP \fBdialog_gauge
implements the "\fB--gauge\fP" option.
Alternatively, a simpler or customized gauge widget can be
setup using
\fBdlg_allocate_gauge\fP,
\fBdlg_reallocate_gauge\fP,
\fBdlg_update_gauge\fP and
\fBdlg_free_gauge\fP.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIpercent
is the percentage to show in the progress bar.
.RE
.\" ************************************************************************
.IP \fBdialog_inputbox
implements the "\fB--inputbox\fP" or
"\fB--password\fP" option, depending on the value of \fIpassword\fP.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B const char * \fIinit
is the initial value of the input box, whose length is taken into account
when auto-sizing the width of the dialog box.
.TP 5
.B int \fIpassword
if true, causes typed input to be echoed as asterisks.
.RE
.\" ************************************************************************
.IP \fBdialog_helpfile
implements the "\fB--hfile\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIfile
is the name of a file containing the text to display.
This function is internally bound to F1 (function key "1"),
passing \fBdialog_vars.help_file\fP as a parameter.
The \fBdialog\fP program sets that variable when the \fB--hfile\fP option
is given.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.RE
.\" ************************************************************************
.IP \fBdialog_menu
implements the "\fB--menu\fP" or "\fB--inputmenu\fP" option
depending on whether \fBdialog_vars.input_menu\fP is set.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fImenu_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows
.RS
\fItag item\fR
.RE
.IP
or
.RS
\fItag item help\fR
.RE
.IP
depending on whether \fBdialog_vars.item_help\fP is set.
.RE
.\" ************************************************************************
.IP \fBdialog_mixedform
implements the "\fB--mixedform\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIform_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B int \fIitems
is an array of strings which is viewed either as a list of rows
.RS
\fIName NameY NameX Text TextY TextX FLen ILen Ityp\fR
.RE
.IP
or
.RS
\fIName NameY NameX Text TextY TextX FLen ILen Ityp Help\fR
.RE
.IP
depending on whether \fBdialog_vars.item_help\fP is set.
.RE
.\" ************************************************************************
.IP \fBdialog_mixedgauge
implements the "\fB--mixedgauge\fP" option
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the caption text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIpercent
is the percentage to show in the progress bar.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B int \fIitems
is an array of strings which is viewed as a list of \fItag\fP and \fIitem\fP values.
The \fItag\fP values are listed, one per row, in the list at the top of
the widget.
.IP
The \fIitem\fP values are decoded: digits 0-9 are the following strings
.RS
.IP 0
Succeeded
.IP 1
Failed
.IP 2
Passed
.IP 3
Completed
.IP 4
Checked
.IP 5
Done
.IP 6
Skipped
.IP 7
In Progress
.IP 8
(blank)
.IP 9
N/A
.RE
.IP
A string with a leading "-" character is centered, marked with "%".
For example, "-75" is displayed as "75%".
Other strings are displayed as is.
.RE
.\" ************************************************************************
.IP \fBdialog_msgbox
implements the "\fB--msgbox\fP" or "\fB--infobox\fP" option
depending on whether \fIpauseopt\fP is set.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIpauseopt
if true, an "OK" button will be shown,
and the dialog will wait for it to complete.
With an "OK" button, it is denoted a "msgbox",
without an "OK" button, it is denoted an "infobox".
.RE
.\" ************************************************************************
.IP \fBdialog_pause
implements the "\fB--pause\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIseconds
is the timeout to use for the progress bar.
.RE
.\" ************************************************************************
.IP \fBdialog_prgbox
implements the "\fB--prgbox\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
If empty or null, no prompt is shown.
.TP 5
.B const char * \fIcommand
is the name of the command to execute.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIpauseopt
if true, an "OK" button will be shown,
and the dialog will wait for it to complete.
.RE
.\" ************************************************************************
.IP \fBdialog_progressbox
implements the "\fB--progressbox\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
If empty or null, no prompt is shown.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.RE
.\" ************************************************************************
.IP \fBdialog_rangebox
implements the "\fB--rangebox\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
If empty or null, no prompt is shown.
.TP 5
.B int \fIheight
is the desired height of the widget.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the widget.
If zero, the height is based on the screen size.
.TP 5
.B int \fImin_value
is the minimum value to allow.
.TP 5
.B int \fImax_value
is the maximum value to allow.
.TP 5
.B int \fIdefault_value
is the default value, if no change is made.
.RE
.\" ************************************************************************
.IP \fBdialog_tailbox
implements the "\fB--tailbox\fP" or "\fB--tailboxbg\fP" option
depending on whether \fIbg_task\fP is set.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIfile
is the name of the file to display in the dialog.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIbg_task
if true,
the window is added to the callback list in \fBdialog_state\fP,
and the application will poll for the window to be updated.
Otherwise an "OK" button is added to the window,
and it will be closed when the button is activated.
.RE
.\" ************************************************************************
.IP \fBdialog_textbox
implements the "\fB--textbox\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIfile
is the name of the file to display in the dialog.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.RE
.\" ************************************************************************
.IP \fBdialog_timebox
implements the "\fB--timebox\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIsubtitle
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIhour
is the initial hour shown.
If the value is negative, the current hour is used.
Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 24.
.TP 5
.B int \fIminute
is the initial minute shown.
If the value is negative, the current minute is used.
Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
.TP 5
.B int \fIsecond
is the initial second shown.
If the value is negative, the current second is used.
Returns DLG_EXIT_ERROR if the value specified is greater than or equal to 60.
.RE
.\" ************************************************************************
.IP \fBdialog_treeview
implements the "\fB--treeview\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIlist_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B char ** \fIitems
is the list of items, contain tag, name, and optionally help strings
(if \fBdialog_vars.item_help\fP is set).
The initial selection state for each item is also in this list.
.TP 5
.B int \fIflag
.IP flag
is either \fIFLAG_CHECK\fP, for checklists (multiple selections),
or \fIFLAG_RADIO\fP for radiolists (a single selection).
.RE
.\" ************************************************************************
.IP \fBdialog_yesno
implements the "\fB--yesno\fP" option.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.RE
.
.\" ************************************************************************
.SH UTILITY FUNCTIONS
Most functions that implement lower-level
functionality for the command-line \fB\*p\fP
program or widgets, have names beginning "\fIdlg_\fP".
Bowing to longstanding usage, the functions that initialize the
display and end it are named \fIinit_dialog\fP and \fIend_dialog\fP.
.PP
The only non-widget function whose name begins with "\fIdialog_\fP"
is \fBdialog_version\fP, which returns the version number of the
library as a string.
.
.PP
Here is a brief summary of the utility functions and their parameters:
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_callback
Add a callback, used to allow polling input from multiple tailbox
widgets.
.RS
.TP 5
.B DIALOG_CALLBACK *\fIp\fP
contains the callback information.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_callback_ref
Like \fBdlg_add_callback\fP, but passes a reference to the \fBDIALOG_CALLBACK\fP
as well as a pointer to a cleanup function which will be called when the
associated input ends.
.RS
.TP 5
.B DIALOG_CALLBACK **\fIp\fP
points to the callback information.
This is a reference to the pointer so that the caller's pointer can be
zeroed when input ends.
.TP 5
.B DIALOG_FREEBACK \fIfunc\fP
function to call when input ends, e.g., to free caller's additional data.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_help_formitem
This is a utility function used enforce consistent behavior for
the \fIDIALOG_VARS.help_tags\fP and \fIDIALOG_VARS.item_help\fP variables.
.RS
.TP 5
.B int *\fIresult\fP
this is updated to DLG_EXIT_ITEM_HELP if \fIDIALOG_VARS.item_help\fP is set.
.TP 5
.B char **\fItag\fP
the tag- or help-text is stored here.
.TP 5
.B DIALOG_FORMITEM *\fIitem\fP
contains the list item to use for tag- or help-text.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_help_listitem
This is a utility function used enforce consistent behavior for
the \fIDIALOG_VARS.help_tags\fP and \fIDIALOG_VARS.item_help\fP variables.
.RS
.TP 5
.B int *\fIresult\fP
this is updated to DLG_EXIT_ITEM_HELP if \fIDIALOG_VARS.item_help\fP is set.
.TP 5
.B char **\fItag\fP
the tag- or help-text is stored here.
.TP 5
.B DIALOG_LISTITEM *\fIitem\fP
contains the list item to use for tag- or help-text.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_last_key
Report the last key entered by the user.
This implements the \fB\-\-last\-key\fP command-line option,
using \fBdialog_vars.last_key\fP.
.RS
.TP 5
.B int \fImode
controls the way the last key report is separated from other results:
.RS
.TP 5
-2
(no separator)
.TP 5
-1
(separator after the key name)
.TP 5
0
(separator is optionally before the key name)
.TP 5
1
(same as -1)
.RE
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_quoted
Add a quoted string to the result buffer (see \fBdlg_add_result\fP).
If no quotes are necessary, none are used.
If \fBdialog_vars.single_quoted\fR is set, single-quotes are used.
Otherwise, double-quotes are used.
.RS
.TP 5
.B char * \fIstring
is the string to add.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_result
Add a string to the result buffer \fBdialog_vars.input_result\fP.
.RS
.TP 5
.B char * \fIstring
is the string to add.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_separator
Add an output-separator to the result buffer \fBdialog_vars.input_result\fP.
If \fBdialog_vars.output_separator\fP is set, use that.
Otherwise, if \fBdialog_vars.separate_output\fP is set, use newline.
If neither is set, use a space.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_add_string
Add a quoted or unquoted string to the result buffer
(see \fBdlg_add_quoted\fP) and \fBdlg_add_result\fP),
according to whether \fBdialog_vars.quoted\fP is true.
.RS
.TP 5
.B char * \fIstring
is the string to add.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_align_columns
Copy and reformat an array of pointers to strings, aligning according to
the column separator \fBdialog_vars.column_separator\fP.
If no column separator is set, the array will be unmodified;
otherwise it is copied and reformatted.
.IP
Caveat: This function is only implemented for 8-bit characters.
.RS
.TP 5
.B char **\fItarget
This is the array to reformat.
It points to the first string to modify.
.TP 5
.B int \fIper_row
This is the size of the struct for each row of the array.
.TP 5
.B int \fInum_rows
This is the number of rows in the array.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_allocate_gauge
Allocates a gauge widget.
Use \fBdlg_update_gauge\fP to display the result.
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIpercent
is the percentage to show in the progress bar.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_asciibox
returns its parameter transformed to the
corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP.
If the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns 0.
.RS
.TP 5
.B chtype \fIch
is the parameter, usually one of the \fBACS_\fP\fIxxx\fP constants.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_attr_clear
Set window to the given attribute.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B int \fIheight
is the number of rows to update.
.TP 5
.B int \fIwidth
is the number of columns to update.
.TP 5
.B chtype \fIattr
is the attribute, e.g., \fBA_BOLD\fP.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_auto_size
Automatically size the window used for a widget.
If the given height or width are zero,
justify the \fIprompt\fP text and return the actual limits.
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIprompt
is the message text which will be displayed in the widget,
used here to determine how large the widget should be.
.TP 5
.B int * \fIheight
is the nominal height.
.TP 5
.B int * \fIwidth
is the nominal width.
.TP 5
.B int \fIboxlines
is the number of lines to reserve in the vertical direction.
.TP 5
.B int \fImincols
is the minimum number of columns to use.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_auto_sizefile
Like \fBdlg_auto_size\fP, but use a file contents to decide how large
the widget should be.
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIfile
is the name of the file.
.TP 5
.B int * \fIheight
is the nominal height.
If it is -1, use the screen's height (after subtracting \fBdialog_vars.begin_y\fP
if \fBdialog_vars.begin_set\fP is true).
.TP 5
.B int * \fIwidth
is the nominal width.
If it is -1, use the screen's width (after subtracting \fBdialog_vars.begin_x\fP
if \fBdialog_vars.begin_set\fP is true).
.TP 5
.B int \fIboxlines
is the number of lines to reserve on the screen for drawing boxes.
.TP 5
.B int \fImincols
is the number of columns to reserve on the screen for drawing boxes.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_beeping
If \fBdialog_vars.beep_signal\fP is nonzero,
this calls \fBbeep\fP once and sets
\fBdialog_vars.beep_signal\fP to zero.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_boxchar
returns its \fBchtype\fP parameter transformed as follows:
.RS
.bP
if neither \fBdialog_vars.ascii_lines\fP nor \fBdialog_vars.no_lines\fP is set.
.bP
if \fBdialog_vars.ascii_lines\fP is set, returns the corresponding "+" or "-", etc. for the line-drawing characters used in \fB\*p\fP.
.bP
otherwise, if \fBdialog_vars.no_lines\fP is set, returns a space for the line-drawing characters.
.bP
if the parameter is not a line-drawing or other special character such as ACS_DARROW, it returns the parameter unchanged.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_box_x_ordinate
returns a suitable x-ordinate (column) for a new widget.
If \fBdialog_vars.begin_set\fP is 1,
use \fBdialog_vars.begin_x\fP;
otherwise center the widget on the screen (using the \fIwidth\fP parameter).
.RS
.TP 5
.B int \fIwidth
is the width of the widget.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_box_y_ordinate
returns a suitable y-ordinate (row) for a new widget.
If \fBdialog_vars.begin_set\fP is 1,
use \fBdialog_vars.begin_y\fP;
otherwise center the widget on the screen (using the \fIheight\fP parameter).
.RS
.TP 5
.B int \fIheight
is the height of the widget.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_buildlist
This is an alternate interface to the \fBbuildlist\fP widget
which allows the application to read the list item states back
directly without putting them in the output buffer.
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIlist_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B DIALOG_LISTITEM * \fIitems
is the list of items, contain tag, name, and optionally help strings
(if \fBdialog_vars.item_help\fP is set).
The initial selection state for each item is also in this list.
.TP 5
.B const char * \fIstates
This is a list of characters to display for the given states.
Normally a buildlist provides true (1) and false (0) values,
which the widget displays as "*" and space, respectively.
An application may set this parameter to an arbitrary null-terminated string.
The widget determines the number of states from the length of this string,
and will cycle through the corresponding display characters as the user
presses the space-bar.
.TP 5
.B int \fIorder_mode
is reserved for future enhancements
.TP 5
.B int * \fIcurrent_item
The widget sets the referenced location to the index of the current display
item (cursor) when it returns.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_button_count
Count the buttons in the list.
.RS
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_button_layout
Make sure there is enough space for the buttons by
computing the width required for their labels,
adding margins and limiting based on the screen size.
.RS
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.TP 5
.B int * \fIlimit
the function sets the referenced \fIlimit\fP to the width required for
the buttons (limited by the screen size)
if that is wider than the passed-in limit.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_button_sizes
Compute the size of the button array in columns.
.RS
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.TP 5
.B int \fIvertical
is true if the buttons are arranged in a column rather than a row.
.TP 5
.B int * \fIlongest
Return the total number of columns in the referenced location.
.TP 5
.B int * \fIlength
Return the longest button's columns in the referenced location.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_button_x_step
Compute the step-size needed between elements of the button array.
.RS
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.TP 5
.B int \fIlimit
is the maximum number of columns to allow for the buttons.
.TP 5
.B int * \fIgap
store the nominal gap between buttons in the referenced location.
This is constrained to be at least one.
.TP 5
.B int * \fImargin
store the left+right total margins (for the list of buttons) in the referenced
location.
.TP 5
.B int * \fIstep
store the step-size in the referenced location.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_button_to_char
Find the first uppercase character in the label, which we may use for an
abbreviation.
If the label is empty, return -1.
If no uppercase character is found, return 0.
Otherwise return the uppercase character.
.IP
Normally
.B dlg_draw_buttons
and
.B dlg_char_to_button
use the first uppercase character.
However, they keep track of all of the labels and
if the first has already been used in another label,
they will continue looking for another uppercase character.
This function does not have enough information to make that check.
.RS
.TP 5
.B const char * \fIlabel
is the label to test.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_calc_list_width
Calculate the minimum width for the list,
assuming none of the items are truncated.
.RS
.TP 5
.B int \fIitem_no
is the number of \fIitems\fP.
.TP 5
.B DIALOG_LISTITEM * \fIitems
contains a \fIname\fP and \fItext\fP field,
e.g., for checklists or radiobox lists.
The function returns the sum of the widest columns
needed for of each of these fields.
.IP
If \fBdialog_vars.no_items\fP is set,
the \fItext\fP fields in the list are ignored.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_calc_listh
Calculate new height and list_height values.
.RS
.TP 5
.B int * \fIheight
on input, is the height without adding the list-height.
On return, this contains the total list-height and is the
actual widget's height.
.TP 5
.B int * \fIlist_height
on input, is the requested list-height.
On return, this contains the number of rows available for displaying
the list after taking into account the screen size and
the \fBdialog_vars.begin_set\fP and \fBdialog_vars.begin_y\fP variables.
.TP 5
.B int \fIitem_no
is the number of \fIitems\fP in the list.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_calc_listw
This function is obsolete, provided for library-compatibility.
It is replaced by \fBdlg_calc_list_width\fP.
.RS
.TP 5
.B int \fIitem_no
is the number of \fIitems\fP.
.TP 5
.B char ** \fIitems
is a list of character pointers.
.TP 5
.B int \fIgroup
is the number of items in each group, e.g., the second array index.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_char_to_button
Given a list of button labels,
and a character which may be the abbreviation for one, find it, if it exists.
An abbreviation will be the first character
which happens to be capitalized in the label.
If the character is found, return its index within the list of \fIlabels\fP.
Otherwise, return \fBDLG_EXIT_UNKNOWN\fP.
.RS
.TP 5
.B int \fIch
is the character to find.
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_checklist
This entrypoint provides the \fB--checklist\fP or \fP--radiolist\fP
functionality without the limitations of \fB\*p\fP's command-line syntax
(compare to \fBdialog_checklist\fP).
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIlist_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of \fIitems\fP.
.TP 5
.B DIALOG_LISTITEM * \fIitems
This is a list of the items to display in the checklist.
.TP 5
.B const char * \fIstates
This is a list of characters to display for the given states.
Normally a checklist provides true (1) and false (0) values,
which the widget displays as "*" and space, respectively.
An application may set this parameter to an arbitrary null-terminated string.
The widget determines the number of states from the length of this string,
and will cycle through the corresponding display characters as the user
presses the space-bar.
.TP 5
.B int \fIflag
This is should be one of \fBFLAG_CHECK\fP or \fPFLAG_RADIO\fP,
depending on whether the widget should act as a checklist or radiobox.
.TP 5
.B int * \fIcurrent_item
The widget sets the referenced location to the index of the current display
item (cursor) when it returns.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_check_scrolled
given a function key (or other key that was mapped to a function key),
check if it is one of the up/down scrolling functions:
.sp
.RS
	DLGK_PAGE_FIRST,
.br
	DLGK_PAGE_LAST,
.br
	DLGK_GRID_UP,
.br
	DLGK_GRID_DOWN,
.br
	DLGK_PAGE_PREV or
.br
	DLGK_PAGE_NEXT.
.RE
.fi
.IP
Some widgets use these key bindings for scrolling the prompt-text up and
down, to allow for display in very small windows.
.IP
The function returns 0 (zero) if it finds one of these keys,
and -1 if not.
.RS
.TP 5
.B int \fIkey
is the function-key to check
.TP 5
.B int \fIlast
is the number of lines
which would be used to display the scrolled prompt in
an arbitrarily tall window.
It is used here to check limits for the \fIoffset\fP value.
.TP 5
.B int \fIpage
this is the available height for writing scrolled text,
which is smaller than the window if it contains buttons.
.TP 5
.B bool * \fIshow
on return, holds TRUE if \fBdlg_print_scrolled\fP should be used to redisplay
the prompt text.
.TP 5
.B int * \fIoffset
on entry, holds the starting line number (counting from zero)
last used for \fBdlg_print_scrolled\fP.
On return, holds the updated starting line number.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_clear
Set window to the default \fB\*p\fP screen attribute.
This is set in the rc-file with \fBscreen_color\fP.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_clr_result
Free storage used for the result buffer (\fBdialog_vars.input_result\fP).
The corresponding pointer is set to NULL.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_color_count
Return the number of colors that can be configured in \fB\*p\fP.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_color_setup
Initialize the color pairs used in \fB\*p\fP.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_count_argv
Count the entries in an argument vector.
.RS
.TP 5
.B argv
Points to the argument vector.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_count_columns
Returns the number of columns used for a string.
This is not necessarily the number of bytes in a string.
.RS
.TP 5
.B const char * \fIstring
is the string to measure.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_count_real_columns
Returns the number of columns used for a string,
accounting for "\\Z" sequences which can be used for
coloring the text if \fBdialog_vars.colors\fP is set.
This is not necessarily the number of bytes in a string.
.RS
.TP 5
.B const char * \fIstring
is the string to measure.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_count_wchars
Returns the number of wide-characters in the string.
.RS
.TP 5
.B const char * \fIstring
is the string to measure.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_create_rc
Create a configuration file,
i.e., write internal tables to a file which can be read back by \fB\*p\fP
as an rc-file.
.RS
.TP 5
.B const char * \fIfilename
is the name of the file to write to.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_ctl_size
If \fBdialog_vars.size_err\fP is true,
check if the given window size is too large to fit on the screen.
If so, exit with an error reporting the size of the window.
.RS
.TP 5
.B int \fIheight
is the window's height
.TP 5
.B int \fIwidth
is the window's width
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_default_button
If \fBdialog_vars.default_button\fP is positive,
return the button-index for that button code,
using \fBdlg_ok_buttoncode\fP to test indices starting with zero.
Otherwise (or if no match was found for the button code), return zero.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_default_formitem
If \fBdialog_vars.default_item\fP is not null,
find that name by matching the \fIname\fP field in the list of form \fIitems\fP.
If found, return the index of that item in the list.
Otherwise, return zero.
.RS
.TP 5
.B DIALOG_FORMITEM * \fIitems
is the list of items to search.
It is terminated by an entry with a null \fIname\fP field.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_default_item
This function is obsolete, provided for library-compatibility.
It is replaced by \fBdlg_default_formitem\fP and \fBdlg_default_listitem\fP.
.RS
.TP 5
.B char ** \fIitems
is the list of items to search.
.TP 5
.B int \fIllen
is the number of items in each group, e.g., the second array index.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_defaultno_button
If \fBdialog_vars.defaultno\fP is true, and \fBdialog_vars.nocancel\fP is not,
find the button-index for the "Cancel" button.
Otherwise, return the index for "OK" (always zero).
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_del_window
Remove a window, repainting everything else.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to remove.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_does_output
This is called each time a widget is invoked which may do output.
It increments \fBdialog_state.output_count\fP,
so the output function in \fB\*p\fP can test this and add a separator.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_arrows
Draw up/down arrows on a window, e.g., for scrollable lists.
It calls \fBdlg_draw_arrows2\fP using the
\fImenubox_color\fP and \fImenubox_border_color\fP attributes.
.RS
.TP 5
.B WINDOW * \fIdialog
is the window on which to draw an arrow.
.TP 5
.B int \fItop_arrow
is true if an up-arrow should be drawn at the top of the window.
.TP 5
.B int \fIbottom_arrow
is true if an down-arrow should be drawn at the bottom of the window.
.TP 5
.B int \fIx
is the zero-based column within the window on which to draw arrows.
.TP 5
.B int \fItop
is the zero-based row within the window on which to draw up-arrows
as well as a horizontal line to show the window's top.
.TP 5
.B int \fIbottom
is the zero-based row within the window on which to draw down-arrows
as well as a horizontal line to show the window's bottom.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_arrows2
Draw up/down arrows on a window, e.g., for scrollable lists.
.RS
.TP 5
.B WINDOW * \fIdialog
is the window on which to draw an arrow.
.TP 5
.B int \fItop_arrow
is true if an up-arrow should be drawn at the top of the window.
.TP 5
.B int \fIbottom_arrow
is true if an down-arrow should be drawn at the bottom of the window.
.TP 5
.B int \fIx
is the zero-based column within the window on which to draw arrows.
.TP 5
.B int \fItop
is the zero-based row within the window on which to draw up-arrows
as well as a horizontal line to show the window's top.
.TP 5
.B int \fIbottom
is the zero-based row within the window on which to draw down-arrows
as well as a horizontal line to show the window's bottom.
.TP 5
.B chtype \fIattr
is the window's background attribute.
.TP 5
.B chtype \fIborderattr
is the window's border attribute.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_bottom_box
Draw a partial box at the bottom of a window,
e.g., to surround a row of buttons.
It is designed to merge with an existing box around
the whole window (see \fBdlg_draw_box\fP),
so it uses tee-elements rather than corner-elements
on the top corners of this box.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_bottom_box2
Draw a partial box at the bottom of a window,
e.g., to surround a row of buttons.
It is designed to merge with an existing box around
the whole window (see \fBdlg_draw_box2\fP),
so it uses tee-elements rather than corner-elements
on the top corners of this box.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.B chtype \fIon_left
is used to color the upper/left edges of the box, i.e., the tee-element and
horizontal line
.B chtype \fIon_right
is used to color the right edge of the box, i.e., the tee-element
.B chtype \fIon_inside
is used to fill-color the inside of the box
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_box
Draw a rectangular box with line drawing characters.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B int \fIy
is the top row of the box.
.TP 5
.B int \fIx
is the left column of the box.
.TP 5
.B int \fIheight
is the height of the box.
.TP 5
.B int \fIwidth
is the width of the box.
.TP 5
.B chtype \fIboxchar
is used to color the right/lower edges.
It also is fill-color used for the box contents.
.TP 5
.B chtype \fIborderchar
is used to color the upper/left edges.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_box2
Draw a rectangular box with line drawing characters.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B int \fIy
is the top row of the box.
.TP 5
.B int \fIx
is the left column of the box.
.TP 5
.B int \fIheight
is the height of the box.
.TP 5
.B int \fIwidth
is the width of the box.
.TP 5
.B chtype \fIboxchar
is used to fill-color for the box contents.
.TP 5
.B chtype \fIborderchar
is used to color the upper/left edges.
.TP 5
.B chtype \fIborderchar2
is used to color the right/lower edges.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_buttons
Print a list of buttons at the given position.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B int \fIy
is the starting row.
.TP 5
.B int \fIx
is the starting column.
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.TP 5
.B int \fIselected
is the index within the list of the selected button.
.TP 5
.B int \fIvertical
is true if the buttons are arranged in a column rather than a row.
.TP 5
.B int \fIlimit
is the number of columns (or rows if \fIvertical\fP) allowed for the display.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_helpline
draw the text in \fBdialog_vars.help_line\fP at the bottom of the given window.
.RS
.TP 5
.B WINDOW * \fIdialog
is the window to modify.
.TP 5
.B bool \fIdecorations
if true, allow room for the scrolling arrows.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_scrollbar
If \fBdialog_state.use_scrollbar\fP is set,
draw a scrollbar on the right margin of windows holding scrollable data.
Also (whether or not the scrollbar is drawn),
annotate the bottom margin of the window with the percentage of data
by the bottom of that window,
and call \fBdlg_draw_arrows2\fP to put markers on the window showing
when more data is available.
.RS
.TP 5
.B WINDOW * \fIwin
is the window in which the data is scrolled.
Because \fIleft\fP, \fIright\fP, \fItop\fP, \fIbottom\fP
are passed as parameters, this window can contain additional data.
.TP 5
.B long \fIfirst_data
is the zero-based index to the first row of data in the current window.
.TP 5
.B long \fIthis_data
is the zero-based index to the current row of data.
.TP 5
.B long \fInext_data
is the zero-based index to the next data after the current row.
.TP 5
.B long \fItotal_data
is the total number of rows of data.
.TP 5
.B int \fIleft
is the zero-based left margin/column of the window.
The up/down arrows are draw inset by 5 columns from this point.
.TP 5
.B int \fIright
is the zero-based right margin/column of the window.
The scrollbar is drawn flush against this column.
.TP 5
.B int \fItop
is the zero-based row within the window on which to draw up-arrows
as well as a horizontal line to show the window's top.
.TP 5
.B int \fIbottom
is the zero-based row within the window on which to draw down-arrows
as well as a horizontal line to show the window's bottom.
.TP 5
.B chtype \fIattr
is the window's background attribute.
.TP 5
.B chtype \fIborderattr
is the window's border attribute.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_shadow
Draw shadows along the right and bottom edge of a window to give it
a 3-dimensional look.
(The height, etc., may not be the same as the window's actual values).
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B int \fIheight
is the height of the window.
.TP 5
.B int \fIwidth
is the width of the window.
.TP 5
.B int \fIy
is the top row of the window.
.TP 5
.B int \fIx
is the left column of the window.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_draw_title
Draw a title centered at the top of the window.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_dummy_menutext
This is a utility function which supports the \fB--inputmenu\fP option of
the \fB\*p\fP program.
If \fBdialog_vars.input_menu\fP is set, \fBdialog_menu\fP passes this
pointer to \fBdlg_menu\fP as the \fIrename_menutext\fP parameter.
Otherwise, it passes \fBdlg_dummy_menutext\fP.
.IP
The function should only return \fBDLG_EXIT_ERROR\fP.
.RS
.TP 5
.B DIALOG_LISTITEM * \fIitems
is the list of menu items
.TP 5
.B int \fIcurrent
is the index of the currently-selected item
.TP 5
.B char * \fInewtext
is the updated text for the menu item
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_dump_keys
Write all user-defined key-bindings to the given stream,
e.g., as part of \fBdlg_create_rc\fP.
.RS
.TP 5
.B FILE * \fIfp
is the stream on which to write the bindings.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_dump_window_keys
Write all user-defined key-bindings to the given stream,
e.g., as part of \fBdlg_create_rc\fP.
.RS
.TP 5
.B FILE * \fIfp
is the stream on which to write the bindings.
.TP 5
.B WINDOW * \fIwin
is the window for which bindings should be dumped.
If it is null, then only built-in bindings are dumped.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_eat_argv
Remove one or more items from an argument vector.
.RS
.TP 5
.B int *argcp
in/out parameter giving the length of the argument vector.
.B char ***argvp
in/out parameter pointing to the argument vector.
.B int start
starting index.
.B int count
number of arguments to remove.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_edit_offset
Given the character-offset in the string,
returns the display-offset where
\fB\*p\fP should position the cursor.
In this context, "characters" may be multicolumn,
since the string can be a multibyte character string.
.RS
.TP 5
.B char * \fIstring
is the string to analyze
.TP 5
.B int \fIoffset
is the character-offset
.TP 5
.B int \fIx_last
is a limit on the column positions that can be used,
e.g., the window's size.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_edit_string
Updates the string and character-offset, given various editing characters
or literal characters which are inserted at the character-offset.
Returns true if an editing change was made (and the display should
be updated), and false if the key was something like KEY_ENTER,
which is a non-editing action outside this function.
.RS
.TP 5
.B char * \fIstring
is the (multibyte) string to update
.TP 5
.B int * \fIoffset
is the character-offset
.TP 5
.B int \fIkey
is the editing key
.TP 5
.B int \fIfkey
is true if the editing key is a function-key
.TP 5
.B bool \fIforce
is used in a special loop case by calling code to force the return
value of this function when a function-key code 0 is passed in.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_exit
Given an internal exit code,
check if the corresponding environment variable is set.
If so, remap the exit code to match the environment variable.
Finally call \fBexit\fP with the resulting exit code.
.RS
.TP 5
.B int \fIcode
is the internal exit code, e.g., \fBDLG_EXIT_OK\fP,
which may be remapped.
.RE
.IP
The \fB\*p\fP program uses this function
to allow shell scripts to remap the exit codes so they can distinguish ESC
from ERROR.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_exit_buttoncode
Map the given button index for \fBdlg_exit_label\fP into \fB\*p\fP's exit-code.
.RS
.TP 5
.B int \fIbutton
is the button index
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_exit_label
Return a list of button labels.
If dialog_var.extra_button is true, return the result of \fBdlg_ok_labels\fP.
Otherwise, return a list with the "Exit" label and (if \fBdialog_vars.help_button\fP
is set) the "Help" button as well.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_exiterr
Quit program killing all \fBtailboxbg\fP widgets.
.RS
.TP 5
.B const char * \fIfmt
is the format of the \fBprintf\fP-like message to write.
.TP 5
.B ...
.br
are the variables to apply to the \fIfmt\fP format.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_find_index
Given the character-offset to find in the list, return the corresponding
array index.
.RS
.TP 5
.B const int *\fIlist
contains a list of character-offsets,
i.e., indices into a string that denote the beginning of multibyte characters.
.TP 5
.B int \fIlimit
is the last index into \fBlist\fP to search.
.TP 5
.B int \fIto_find
is the character-offset to find.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_finish_string
If \fIDIALOG_STATE.finish_string\fP is true,
this function discards data used to speed up layout computations.
.RS
.TP 5
.B const char * \fIstring
is the address of the string whose data should be discarded.
The address rather than contents is used as the unique identifier because
some of the caching is used for editable input-fields.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_flush_getc
Cancel the local data saved by \fBdlg_last_getc\fP.
.\" ---------------------------------------------------------------------------
.IP dlg_editbox
This entrypoint provides the \fB--editbox\fP
functionality without the limitations of \fB\*p\fP's command-line syntax
(compare to \fBdialog_editbox\fP).
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B char *** \fIlist
is a pointer to an array of \fBchar\ *\fP pointers.
The array is allocated by the caller,
and so are the strings to which it points.
The \fBdlg_editbox\fP function may reallocate the
array and the strings.
.TP 5
.B int * \fIrows
points to the nominal length of \fIlist\fP.
The referenced value is updated if\fIlist\fP is reallocated.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_form
This entrypoint provides the \fB--form\fP
functionality without the limitations of \fB\*p\fP's command-line syntax
(compare to \fBdialog_form\fP).
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIform_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of \fIitems\fP.
.TP 5
.B DIALOG_FORMITEM * \fIitems
This is a list of the items to display in the form.
.TP 5
.B int * \fIcurrent_item
The widget sets the referenced location to the index of the current display
item (cursor) when it returns.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_free_columns
Free data allocated by \fBdlg_align_columns\fP.
.RS
.TP 5
.B char **\fItarget
This is the array which was reformatted.
It points to the first string to free.
.TP 5
.B int \fIper_row
This is the size of the struct for each row of the array.
.TP 5
.B int \fInum_rows
This is the number of rows in the array.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_free_formitems
Free memory owned by a list of DIALOG_FORMITEM's.
.RS
.TP 5
.B DIALOG_FORMITEM * \fIitems
is the list to free.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_free_gauge
Remove the gauge widget from the screen and free its associated memory.
.RS
.TP 5
.B void *\fIobjptr
points to the gauge widget.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_getc
Read a character from the given window.
Handle repainting here (to simplify
things in the calling application).
Also, if input-callback(s) are set up,
poll the corresponding files and handle the updates,
e.g., for displaying a tailbox.
Returns the key-code.
.RS
.TP 5
.B WINDOW * \fIwin
is the window within which to read.
.TP 5
.B int * \fIfkey
as a side-effect, set this to true if the key-code is really a function-key.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_get_attrs
extract the video attributes from the given window.
.RS
.TP 5
.B WINDOW * \fIwin
is the window from which to get attributes.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_getc_callbacks
passes the given key-code \fIch\fP to the current window that
has established a callback.
If the callback returns zero, remove it and try the next window.
If no more callbacks remain, return.
If any callbacks were found, return true, otherwise false.
.RS
.TP 5
.B int \fIch
is the key-code
.TP 5
.B int \fIfkey
is true if the key is a function-key
.TP 5
.B int * \fIresult
is used to pass an exit-code to the caller,
which should pass that via \fBdlg_exit\fP.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_index_columns
Build a list of the display-columns for the given multibyte string's characters.
.RS
.TP 5
.B const char * \fIstring
is the string to analyze
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_index_wchars
Build an index of the wide-characters in the string,
so the caller can easily tell
which byte-offset begins a given wide-character.
.RS
.TP 5
.B const char * \fIstring
is the string to analyze
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_item_help
Draw the string for the \fBdialog_vars.item_help\fP feature.
.RS
.TP 5
.B const char * \fItxt
is the help-message
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_killall_bg
If \fB\*p\fP has callbacks active,
purge the list of all that are not marked
to keep in the background.
If any remain, run those in a background process.
.RS
.TP 5
.B int * \fIretval
stores the exit-code to pass back to the caller.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_last_getc
returns the most recent character that was read via \fBdlg_getc\fP.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_limit_columns
Given a column limit,
count the number of wide characters that can fit into that limit.
The offset is used to skip over a leading character
that was already written.
.RS
.TP 5
.B const char * \fIstring
is the string to analyze
.TP 5
.B int \fIlimit
is the column limit
.TP 5
.B int \fIoffset
is the starting offset from which analysis should continue
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_lookup_key
Check for a key-binding.
If there is no binding associated with the widget, it simply returns
the given curses-key.
Otherwise, it returns the result of the binding
.RS
.TP 5
.B WINDOW * \fIwin
is the window on which the binding is checked
.TP 5
.B int \fIcurses_key
is the curses key-code
.TP 5
.B int * \fIdialog_key
is the corresponding \fB\*p\fP internal code
(see \fBDLG_KEYS_ENUM\fP in dlg_key.h).
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_max_input
Limit the parameter according to \fBdialog_vars.max_input\fP
.RS
.TP 5
.B int \fImax_len
is the value to limit
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_match_char
Match a given character against the beginning of the string,
ignoring case of the given character.
The matching string must begin with an uppercase character.
.RS
.TP 5
.B int \fIch
is the character to check
.TP 5
.B const char * \fIstring
is the string to search
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_menu
This entrypoint provides the \fB--menu\fP
functionality without the limitations of \fB\*p\fP's command-line syntax
(compare to \fBdialog_menu\fP).
.RS
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fImenu_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of \fIitems\fP.
.TP 5
.B DIALOG_LISTITEM * \fIitems
This is a list of the items to display in the form.
.TP 5
.B int * \fIcurrent_item
The widget sets the referenced location to the index of the current display
item (cursor) when it returns.
.TP 5
.B DIALOG_INPUTMENU \fIrename_menutext
If this is not \fBdlg_dummy_menutext\fP,
the widget acts like an \fIinputmenu\fP widget,
providing an extra "Rename" button,
which activates an edit feature on the selected menu item.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_move_window
Moves/resizes the given window to the given position and size.
.RS
.TP 5
.B WINDOW *\fIwin
is the window to move/resize.
.TP 5
.B WINDOW *\fIheight
is the height of the resized window.
.TP 5
.B WINDOW *\fIwidth
is the width of the resized window.
.TP 5
.B WINDOW *\fIy
y-ordinate to use for the repositioned window.
.TP 5
.B WINDOW *\fIx
x-ordinate to use for the repositioned window.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_bigregion
Retrieve the big-region under the pointer.
.RS
.TP 5
.B int \fIy
is the row on which the mouse click occurred
.TP 5
.B int \fIx
is the column on which the mouse click occurred
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_free_regions
Free the memory associated with mouse regions.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_mkbigregion
Creates a region on which the mouse-clicks will return a specifed code.
.RS
.TP 5
.B int \fIy
is the top-row of the region.
.TP 5
.B int \fIx
is the left-column of the region.
.TP 5
.B int \fIheight
is the height of the region.
.TP 5
.B int \fIwidth
is the width of the region.
.TP 5
.B int \fIcode
is a code used to make the region unique within a widget
.TP 5
.B int \fIstep_x
is used in modes 2 (columns) and 3 (cells) to determine the width
of a column/cell.
.TP 5
.B int \fIstep_y
is currently unused
.TP 5
.B int \fImode
is used to determine how the mouse position is translated into
a code (like a function-key):
.RS
.TP
1
index by lines
.TP
2
index by columns
.TP
3
index by cells
.RE
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_mkregion
.RS
.TP 5
.B int \fIy
is the top-row of the region.
.TP 5
.B int \fIx
is the left-column of the region.
.TP 5
.B int \fIheight
is the height of the region.
.TP 5
.B int \fIwidth
is the width of the region.
.TP 5
.B int \fIcode
is a code used to make the region unique within a widget
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_region
Retrieve the frame under the mouse pointer
.RS
.TP 5
.B int \fIy
is the row of the mouse-click
.TP 5
.B int \fIx
is the column of the mouse-click
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_setbase
Sets a base for subsequent calls to \fBdlg_mouse_mkregion\fP,
so they can make regions relative to the start of a given window.
.RS
.TP 5
.B int \fIx
is the left-column for the base
.TP 5
.B int \fIy
is the top-row for the base
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_setcode
Sets a value used internally by \fBdlg_mouse_mkregion\fP
which is added to the \fIcode\fP parameter.
By providing different values,
e.g., multiples of \fBKEY_MAX\fP,
it is possible to support multiple "big" regions in a widget.
The \fIbuildlist\fP widget uses this feature to recognize mouse-clicks
in the left/right panes.
.RS
.TP 5
.B int \fIcode
is the value to add to \fBdlg_mouse_mkregion\fP's \fIcode\fP parameter.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_wgetch
is a wrapper for \fBdlg_getc\fP which additionally maps mouse-clicks
(if the curses library supports those) into extended function-keys
which encode the position according to the \fImode\fP in
\fBdlg_mouse_mkbigregion\fP.
Returns the corresponding key-code.
.RS
.TP 5
.B WINDOW * \fIwin
is the window on which to perform the input
.TP 5
.B int * \fIfkey
the referenced location is set to true if the key-code is an actual
or extended (mouse) function-key.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_mouse_wgetch_nowait
This is a non-blocking variant of \fBdlg_mouse_wgetch\fP.
.RS
.TP 5
.B WINDOW * \fIwin
is the window on which to perform the input
.TP 5
.B int * \fIfkey
the referenced location is set to true if the key-code is an actual
or extended (mouse) function-key.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_need_separator
Check if an output-separator is needed.
If \fBdialog_vars.output_separator\fP is set, return true.
Otherwise, if \fBdialog_vars.input_result\fP is nonempty, return true.
If neither, return false.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_new_modal_window
Create a modal window, optionally with a shadow.
The shadow is created if \fBdialog_state.use_shadow\fP is true.
.RS
.TP 5
.B WINDOW * \fIparent
is the parent window (usually the top-level window of a widget)
.TP 5
.B int \fIheight
is the window's height
.TP 5
.B int \fIwidth
is the window's width
.TP 5
.B int \fIy
is the window's top-row
.TP 5
.B int \fIx
is the window's left-column
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_new_window
Create a window, optionally with a shadow.
The shadow is created if \fBdialog_state.use_shadow\fP is true.
.RS
.TP 5
.B int \fIheight
is the window's height
.TP 5
.B int \fIwidth
is the window's width
.TP 5
.B int \fIy
is the window's top-row
.TP 5
.B int \fIx
is the window's left-column
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_next_button
Return the next index in the list of labels.
.RS
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.TP 5
.B int \fIbutton
is the current button-index.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_next_ok_buttonindex
Assuming that the caller is using \fBdlg_ok_labels\fP to list buttons,
find the next index in the list of buttons.
.RS
.TP 5
.B int \fIcurrent
is the current index in the list of buttons
.TP 5
.B int \fIextra
if negative, provides a way to enumerate extra active areas on the widget.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_ok_buttoncode
Map the given button index for \fBdlg_ok_labels\fP
into \fB\*p\fP's exit-code.
.RS
.TP 5
.B int \fIbutton
is the button-index (which is not necessarily the same as the index
in the list of labels).
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_ok_label
Returns a list with the "Ok" label,
and if \fBdialog_vars.help_button\fP is true, the "Help" label as well.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_ok_labels
Return a list of button labels for the OK/Cancel group of widgets.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_ordinate
Decode the string as an integer, decrement if greater than zero to make
a curses-ordinate from a dialog-ordinate.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_parse_bindkey
Parse the parameters of the "bindkeys" configuration-file entry.  This
expects widget name which may be "*", followed by curses key definition and
then \fB\*p\fP key definition.
.RS
.TP 5
.B char * \fIparams
is the parameter string to parse.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_parse_rc
Parse the configuration file and set up variables.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_prev_button
Return the previous index in the list of labels.
.RS
.TP 5
.B const char ** \fIlabels
is a list of (pointers to) button labels terminated by a null pointer.
.TP 5
.B int \fIbutton
is the current button index
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_print_listitem
This is a helper function used for the various "list" widgets,
e.g., checklist, menu, buildlist, treeview.
Each list-widget has "tag" and "description" values for each item
which can be displayed.
If \fBdialog_vars.no_tags\fP is true,
the "tag" value is not shown.
The first character of the first value shown (tag or description)
is highlighted to indicate that the widget will match it for quick navigation.
.RS
.TP 5
.B WINDOW *\fIwin
the window in which to display the text
.TP 5
.B const char *\fItext
the value to display
.TP 5
.B int \fIclimit
the number of columns available for printing the text
.TP 5
.B bool \fIfirst
true if this is the first call (for "tag" and "description"),
and the first character of the value should be highlighted.
.TP 5
.B int \fIselected
nonzero if the text should be displayed using the "selected" colors
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_print_scrolled
This is a wrapper for \fBdlg_print_autowrap\fP which allows the user
to scroll too-long prompt text up/down.
.IP
See \fBdlg_check_scrolled\fP for a function which updates the \fIoffset\fP
variable used as a parameter here.
It complements this function; you need both.
If \fIpauseopt\fP is set, this function returns an updated \fIlast\fP
parameter, needed for \fBdlg_check_scrolled\fP calls.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B const char * \fIprompt
is the string to print
.TP 5
.B int \fIoffset
is the starting line-number to write wrapped text.
.TP 5
.B int \fIheight
is the available height for writing the wrapped text
.TP 5
.B int \fIwidth
is the width that the wrapping should occur in
.TP 5
.B int \fIpauseopt
is true if the extra functionality for scrolling should be enabled.
If false, this calls \fBdlg_print_autowrap\fP without doing any scrolling.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_print_line
Print one line of the prompt in the window within the limits of the
specified right margin.
The line will end on a word boundary and a pointer
to the start of the next line is returned, or a NULL pointer if the end of
*prompt is reached.
.RS
.TP 5
.B WINDOW *\fIwin
is the window to update.
.TP 5
.B chtype *\fIattr
holds the starting attributes, and is updated to reflect the final attributes
applied to the string.
.TP 5
.B const char *\fIprompt
is the string to print
.TP 5
.B int \fIlm
is the left margin.
.TP 5
.B int \fIrm
is the right margin
.TP 5
.B int *\fIx
returns the ending x-ordinate.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_prev_ok_buttonindex
Find the previous button index in the list from \fBdlg_ok_labels\fP.
.RS
.TP 5
.B int \fIcurrent
is the current index
.TP 5
.B int \fIextra
if negative provides a way to enumerate extra active areas on the widget.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_print_autowrap
Print a string of text in a window, automatically wrap around to the next
line if the string is too long to fit on one line.
Note that the string may contain embedded newlines.
The text is written starting at the top of the window.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B const char * \fIprompt
is the string to print
.TP 5
.B int \fIheight
is the nominal height the wrapped string is limited to
.TP 5
.B int \fIwidth
is the width that the wrapping should occur in
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_print_size
If \fBdialog_vars.print_siz\fP is true,
print the given height/width (from a widget)
to \fBdialog_state.output\fP, e.g.,
\fBSize: height, width\fP.
.RS
.TP 5
.B int \fIheight
is the window's height
.TP 5
.B int \fIwidth
is the window's width
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_print_text
Print up to \fIcols\fP columns from \fBtext\fP,
optionally rendering \fB\*p\fP's escape sequences for attributes and color.
.RS
.TP 5
.B WINDOW * \fIwin
is the window to update.
.TP 5
.B const char * \fItxt
is the string to print
.TP 5
.B int \fIcol
is the column limit
.TP 5
.B chtype * \fIattr
holds the starting attributes, and is updated to reflect the final attributes
applied to the string.
.RE
.\" ---------------------------------------------------------------------------
.B dlg_progressbox
implements the "\fB--prgbox\fP" and "\fB--progressbox\fP" options.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
If empty or null, no prompt is shown.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIpauseopt
if true, an "OK" button will be shown,
and the dialog will wait for it to complete.
With an "OK" button, it is denoted a "programbox",
without an "OK" button, it is denoted a "progressbox".
.TP 5
.B FILE * \fIfp
is the file pointer, which may be a pipe or a regular file.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_put_backtitle
Display the background title if \fBdialog_vars.backtitle\fP is non-null.
The background title is shown at the top of the screen.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_reallocate_gauge
Allocates or reallocates a gauge widget (see \fBdlg_allocate_gauge\fP).
Use \fBdlg_update_gauge\fP to display the result.
.RS
.TP 5
.B void ** \fIobjptr
If the pointer referenced by this parameter is null, the function creates
a new gauge widget using \fBdlg_allocate_gauge\fP.
Otherwise, it updates the title and cprompt values, reusing the window
from the previous call on this function.
As a side-effect, the function stores the updated object-pointer via
the \fIobjptr\fP parameter.
.TP 5
.B const char * \fItitle
is the title string to display at the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is adjusted to use the available screen size.
.TP 5
.B int \fIpercent
is the percentage to show in the progress bar.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_register_buttons
The widget developer should call this function after \fBdlg_register_window\fP,
for the list of button labels associated with the widget.
One may bind a key to a button, e.g., "OK" for \fBDLGK_OK\fP,
.RS
.TP 5
.B WINDOW * \fIwin
is the window with which to associate the buttons
.TP 5
.B const char * \fIname
is the widget's binding name (usually the name of the widget).
.TP 5
.B const char ** \fIbuttons
is the list of buttons
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_register_window
For a given named widget's window, associate a binding table.
.RS
.TP 5
.B WINDOW * \fIwin
is the window with which to associate the buttons
.TP 5
.B const char * \fIname
is the widget's binding name (usually the name of the widget).
.TP 5
.B DLG_KEYS_BINDING * \fIbinding
is the binding table
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_remove_callback
Remove a callback.
.RS
.TP 5
.B DIALOG_CALLBACK * \fIp
contains the callback information.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_renamed_menutext
This is a utility function which supports the \fB--inputmenu\fP option of
the \fB\*p\fP program.
If \fBdialog_vars.input_menu\fP is set, \fBdialog_menu\fP passes this
pointer to \fBdlg_menu\fP as the \fIrename_menutext\fP parameter.
Otherwise, it passes \fBdlg_dummy_menutext\fP.
.IP
The function should add "RENAMED" to \fBdialog_vars.input_result\fP ,
followed by the menu item's name and the \fInewtext\fP value
(with a space separating the three items),
and return \fBDLG_EXIT_EXTRA\fP.
.RS
.TP 5
.B DIALOG_LISTITEM * \fIitems
is the list of menu items
.TP 5
.B int \fIcurrent
is the index of the currently-selected item
.TP 5
.B char * \fInewtext
is the updated text for the menu item
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_restore_vars
Restore \fB\*p\fP's variables from the given variable (see \fBdialog_save_vars\fP).
.RS
.TP 5
.B DIALOG_VARS * \fIsave
is the variable from which to restore.
.RE
.IP
The
\fIDIALOG_VARS.input_length\fP and
\fIDIALOG_VARS.input_result\fP members are treated specially,
since these are used by a widget to pass data to the caller.
They are not modified by this function.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_result_key
Test a \fB\*p\fP internal keycode to see if it corresponds to one of the push
buttons on the widget such as "OK".
This is only useful if there are user-defined key bindings, since there are
no built-in bindings that map directly to \fBDLGK_OK\fP, etc.
Return true if a mapping was done.
.RS
.TP 5
.B int \fIdialog_key
is the \fB\*p\fP key to test
.TP 5
.B int \fIfkey
is true if this is a function key
.TP 5
.B int * \fIresultp
store the result of the mapping in the referenced location.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_save_vars
Save \fB\*p\fP's variables into the given variable (see \fBdlg_restore_vars\fP).
.RS
.TP 5
.B DIALOG_VARS * \fIsave
is the variable into which to save.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_set_focus
Set focus on the given window,
making it display above other windows on the screen.
.RS
.TP 5
.B WINDOW * \fIparent
is the parent window (usually the top-level window of a widget)
.TP 5
.B WINDOW * \fIwin
is the window on which to place focus (usually a subwindow of a widget)
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_set_result
Setup a fixed-buffer for the result in \fBdialog_vars.input_result\fP
.RS
.TP 5
.B const char * \fIstring
is the new contents for the result
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_show_string
Displays the string, shifted as necessary, to fit within the box and show
the current character-offset.
.RS
.TP 5
.B WINDOW * \fIwin
is the window within which to display
.TP 5
.B const char * \fIstring
is the string to display
.TP 5
.B int \fIoffset
is the starting (character, not bytes) offset
.TP 5
.B chtype \fIattr
is the window attribute to use for the string
.TP 5
.B int \fIy_base
beginning row on screen
.TP 5
.B int \fIx_base
beginning column on screen
.TP 5
.B int \fIx_last
number of columns on screen
.TP 5
.B bool \fIhidden
if true, do not echo input
.TP 5
.B bool \fIforce
if true, force repaint
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_strclone
duplicate the string, like \fBstrdup\fP.
.RS
.TP 5
.B const char * \fIcprompt
is the string to duplicate
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_strcmp
compare two strings, ignoring case.
.RS
.TP 5
.B const char * \fIa
is one string
.TP 5
.B const char * \fIb
is the other string
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_string_to_argv
Convert a string to an argument vector
returning an index (which must be freed by the caller).
The string is modified (replacing gaps between tokens with nulls).
.RS
.TP 5
.B char *\fIblob
is the string to convert.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_sub_window
create a subwindow, e.g., for an input area of a widget
.RS
.TP 5
.B WINDOW * \fIwin
is the parent window
.TP 5
.B int \fIheight
is the subwindow's height
.TP 5
.B int \fIwidth
is the subwindow's width
.TP 5
.B int \fIy
is the subwindow's top-row
.TP 5
.B int \fIx
is the subwindow's left-column
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_tab_correct_str
If the \fBdialog_vars.tab_correct\fP is true, convert tabs to single spaces.
Return the converted result.
The caller is responsible for freeing the string.
.RS
.TP 5
.B char * \fIprompt
is the string to convert
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_trace
If the parameter is non-null, opens a trace file with that
name and stores the file pointer in \fBdialog_state.trace\fP.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_trace_chr
If \fBdialog_state.trace\fP is set,
translate the parameters into a printable representation,
log it on a "chr" line.
.RS
.TP 5
.B int ch
is the nominal keycode value.
.TP 5
.B int fkey
is nonzero if the value is really a function key.
Some of these may be values declared in the DLG_KEYS_ENUM.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_trace_msg
Write a formatted message to the trace file.
.RS
.TP 5
.B const char * \fIfmt
is the format of the \fBprintf\fP-like message to write.
.TP 5
.B ...
.br
are the variables to apply to the \fIfmt\fP format.
.RE
.IP
Use the DLG_TRACE macro for portability, in case the trace
feature is not compiled into the library.
It uses an extra level of parentheses to work with a variable number of
parameters, e.g.,
.ES
.EX
DLG_TRACE(("this is dialog version %s\\n", dialog_version()));
.EE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_trace_win
If \fBdialog_state.trace\fP is set,
log a printable picture of the given window.
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_treeview
This is an alternate interface to 'treeview' which allows the application
to read the list item states back directly without putting them in the
output buffer.
.RS
.TP 5
.B const char * \fItitle
is the title on the top of the widget.
.TP 5
.B const char * \fIcprompt
is the prompt text shown within the widget.
.TP 5
.B int \fIheight
is the desired height of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIwidth
is the desired width of the box.
If zero, the height is based on the screen size.
.TP 5
.B int \fIlist_height
is the minimum height to reserve for displaying the list.
If zero, it is computed based on the given \fIheight\fP and \fIwidth\fP.
.TP 5
.B int \fIitem_no
is the number of rows in \fIitems\fP.
.TP 5
.B DIALOG_LISTITEM * \fIitems
is the list of items, contain tag, name, and optionally help strings
(if \fBdialog_vars.item_help\fP is set).
The initial selection state for each item is also in this list.
.TP 5
.B const char * \fIstates
This is a list of characters to display for the given states.
Normally a buildlist provides true (1) and false (0) values,
which the widget displays as "*" and space, respectively.
An application may set this parameter to an arbitrary null-terminated string.
The widget determines the number of states from the length of this string,
and will cycle through the corresponding display characters as the user
presses the space-bar.
.TP 5
.B int * \fIdepths
This is a list of depths of each item in the tree.
It is a separate parameter from \fIitems\fP to allow reuse of
the existing functions.
.TP 5
.B int \fIflag
is either \fIFLAG_CHECK\fP, for checklists (multiple selections),
or \fIFLAG_RADIO\fP for radiolists (a single selection).
.TP 5
.B int * \fIcurrent_item
The widget sets the referenced location to the index of the current display
item (cursor) when it returns.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_trim_string
The \fBdialog\fP program uses this in each widget to adjust the
message string,
which may contain the newline character (referred to as '\\n')
and/or the special substring "\\n"
(which can be translated into a newline character).
.IP
There are several optional features:
.RS
.bP
Unless \fBdialog_vars.no_nl_expand\fP is set,
.RS
.bP
If it has "\\n" substrings,
the function preserves extra spaces.
For instance, spaces following a newline (substring or character)
are preserved to use as an indentation.
.bP
The function changes embedded "\\n" substrings to '\\n' characters.
.RE
.bP
If \fBdialog_vars.no_nl_expand\fP is not set,
or if there are no "\\n" substrings,
this function strips all extra spaces to simplify justification.
.bP
If \fBdialog_vars.cr_wrap\fP is set,
the function preserves '\\n' newline characters.
Otherwise, each '\\n' newline character is converted to a space.
.bP
Unless \fBdialog_vars.nocollapse\fP is set,
each tab character is converted to a space,
and sequences of blanks (space or tab) are reduced to a single space.
.RE
.RS
.TP 5
.B char * \fIsrc
is the string to trim
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_unregister_window
Remove the bindings for a given window.
.RS
.TP 5
.B WINDOW * \fIwin
is the window from which to remove bindings
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_update_gauge
Update a gauge widget to show a different percentage value.
.RS
.TP 5
.B void *\fIobjptr
points to the gauge object to update.
.TP 5
.B int \fIpercent
is the new percentage value to display.
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_yes_buttoncode
Map the given button index for \fBdlg_yes_labels\fP into \fB\*p\fP's exit-code.
.RS
.TP 5
.B int \fIbutton
is the button index
.RE
.\" ---------------------------------------------------------------------------
.TP 5
.B dlg_yes_labels
Return a list of buttons for Yes/No labels.
.
.\" ************************************************************************
.SH SEE ALSO
\fB\*p\fP (1).
.
.\" ************************************************************************
.SH AUTHOR
Thomas E. Dickey