File: rivet.xml

package info (click to toggle)
rivet 0.5.0-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,664 kB
  • ctags: 1,359
  • sloc: sh: 8,342; xml: 6,622; ansic: 4,367; tcl: 2,813; makefile: 99; lisp: 78; sql: 25
file content (4246 lines) | stat: -rw-r--r-- 122,338 bytes parent folder | download | duplicates (2)
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
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
  "http://www.oasis-open.org/committees/docbook/xml/4.1.2/docbookx.dtd" [
      <!ENTITY hello.rvt SYSTEM "examples/hello.rvt" >
      <!ENTITY table.rvt SYSTEM "examples/table.rvt" >
      <!ENTITY vars.html SYSTEM "examples/vars.html" >
      <!ENTITY vars.rvt SYSTEM "examples/vars.rvt" >
      <!ENTITY upload.html SYSTEM "examples/upload.html" >
      <!ENTITY upload.rvt SYSTEM "examples/upload.rvt" >
]>

<!--
   Copyright 2002-2004 The Apache Software Foundation

   Licensed under the Apache License, Version 2.0 (the "License"); you
   may not use this file except in compliance with the License.  You
   may obtain a copy of the License at

   	http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied.  See the License for the specific language governing
   permissions and limitations under the License.
-->

<!-- $Id: rivet.xml,v 1.52 2005/03/12 14:26:20 davidw Exp $ -->

<article>
  <articleinfo>
    <title>Apache Rivet</title>
    <copyright>
      <year>2002</year>
      <year>2003</year>
      <year>2004</year>
      <holder>Apache Software Foundation</holder>
    </copyright>
    <author>
      <firstname>The Rivet Team</firstname>
      <affiliation>
	<orgname>The Apache Software Foundation</orgname>
	<address>
	  <email>rivet-dev@tcl.apache.org</email>
	</address>
      </affiliation>
    </author>
  </articleinfo>
  <para>
    This document is also available in the following languages: <ulink
    url="index.it.html">Italian</ulink>, <ulink
    url="index.ru.html">Russian</ulink>
  </para>

  <para>
    Document revision: $Revision: 1.52 $, last modified $Date: 2005/03/12 14:26:20 $ by $Author: davidw $.
  </para>

  <section>
    <title>Introduction to Apache Rivet</title>
    <para>
      Apache Rivet is a system for creating dynamic web content via a
      programming language integrated with Apache Web Server.  It is
      designed to be fast, powerful and extensible, consume few system
      resources, be easy to learn, and to provide the user with a
      platform that can also be used for other programming tasks
      outside the web (GUI's, system administration tasks, text
      processing, database manipulation, XML, and so on).  In order to
      meet these goals, we have chosen the Tcl programming language to
      combine with the Apache Web Server.
    </para>
    <para>
      In this manual, we aim to help get you started, and then
      writing productive code as quickly as possible, as well as
      giving you ideas on how to best take advantage of Rivet's
      architecture to create different styles of web site.
    </para>

    <para>
      This documentation is a work in progress, and, like everything
      else about Apache Rivet, it is Free Software.  If you see
      something that needs improving, and have ideas or suggestions,
      don't hesitate to let us know.  If you want to contribute
      directly, better yet!
    </para>
  </section>


  <section id="installation">
    <title>Apache Rivet Installation</title>

    <procedure>
      <step>
	<title>Check Dependencies</title>
	<para>
	  To install Rivet, you will need Tcl 8.2 or greater and
	  Apache 1.3.xx.  It is known to run on Linux, FreeBSD,
	  OpenBSD, and Solaris and HPUX.  Windows NT is also possible
	  - please see the directions in the distribution.
	</para>
      </step>
      <step>
	<title>Get Rivet</title>
	<para>
	  Download the sources at <ulink
	    url="http://tcl.apache.org/rivet/download"/>.  Currently
	  the only way to obtain Rivet.  In the future, we hope to
	  have a FreeBSD port, Debian package, RPM's, and windows
	  binaries.
	</para>
      </step>
      <step performance="required">
	<title>Install Tcl</title>
	<para>
	  If you don't have Tcl already, you need it!  If you already
	  have it, you should just be able to use your system Tcl as
	  long as it is recent.  You can tell Rivet where Tcl is via
	  the <option>-with-tclconfig</option> option to
	  <command>configure.tcl</command> (see below).</para>
      </step>
      <step performance="optional">
	<title>Get and Install Apache Sources</title>
	<para>
          Rivet needs some Apache include (.h) files in order to
	  build.  The easiest way to get them is to download the
	  source code of the Apache web server, although some systems
	  (Debian GNU/Linux for example) make it possible to install
	  only the headers and other development files.  If you intend
	  to build Rivet statically (compiled into the Apache web
	  server instead of loaded dynamically), you definitely need
	  the sources.  We recommend that you build Rivet as a
	  loadable shared library, for maximum flexibility, meaning
	  that you also build Apache to be able to load modules.
	  Other than that, the default Apache install is fine.  We
	  will tell Rivet where it is located via the
	  <option>-with-apxs</option> option to
	  <command>configure.tcl</command> (see below).
	</para>
	<para>
          The source code for the Apache web server may be found by
          following the links here: <ulink
          url="http://httpd.apache.org/"/>.
	</para>
      </step>
      <step>
	<title>Uncompress Sources</title>
	<para>
	  We will assume that you have Apache installed at this point.
	  You must uncompress the Rivet sources in the directory where you
	  wish to compile them.

	  <programlisting>gunzip tcl-rivet-X.X.X.tar.gz
tar -xvf tcl-rivet-X.X.X.tar.gz</programlisting>

	</para>
      </step>
      <step>
	<title>Building Rivet</title>
	<para>
	  On Linux or Unix systems, Rivet uses the standard
	  ./configure ; make ; make install technique.
	</para>
	<substeps>
	  <step>
	    <title>Run ./configure.tcl</title>
	    <para>
	      This is similar to the <filename>configure</filename>
	      script included with many systems.  It's written in Tcl
	      though, for increased speed and clarity.  It takes
	      several arguments:
	    </para>

	    <variablelist>
	      <varlistentry>
		<term>-help</term>
		<listitem>
		  <para>Prints usage information.</para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>-enable-symbols</term>
		<listitem>
		  <para>Compiles Rivet with debugging symbols.</para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>-prefix <replaceable>directory</replaceable></term>
		<listitem>
		  <para>
		    Install Rivet Tcl packages to
		    <replaceable>directory</replaceable>.
		  </para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>-with-apxs <replaceable>file</replaceable></term>
		<listitem>
		  <para>Use <replaceable>file</replaceable> as apxs binary to
		  gather information about the local Apache installation.</para>
		</listitem>
	      </varlistentry>
	      <varlistentry>
		<term>-with-tclconfig <replaceable>path/to/tcl/tclConfig.sh</replaceable></term>
		<listitem>
		  <para>
		    Specify <replaceable>file</replaceable> as the
		    tclConfig.sh of the Tcl installation that you want
		    to use with Rivet.
		  </para>
		</listitem>
	      </varlistentry>
	    </variablelist>

	    <programlisting>cd src/
./configure.tcl
Configuring
.........done.</programlisting>

	  </step>
	  <step>
	    <title>Run make.tcl</title>
	    <para>
	      At this point, you are ready to run the build
	      system:
	    </para>

	    <programlisting>./make.tcl <replaceable>option</replaceable></programlisting>

	    <para>where <replaceable>option</replaceable> can be
	      either <option>shared</option> or
	      <option>static</option>.
	    </para>
	  </step>
	  <step>
	    <title>Install</title>
	    <para>
	      Now, you are ready to run the <command>./make.tcl
		install</command> command to install the resulting
	      files.  This should copy the shared object (like
	      <filename>mod_rivet.so</filename>, if one was
	      successfully created, into Apache's
	      <filename>libexec</filename> directory, as well as
	      install some support scripts and various code.
	    </para>
	  </step>
	</substeps>
      </step>
      <step>
	<title>Apache Configuration Files</title>
	<para>
	  Rivet is relatively easy to configure - we start off by
	  adding the module itself:
	</para>

	<programlisting>LoadModule rivet_module	<replaceable>/usr/lib/apache/1.3/mod_rivet.so</replaceable></programlisting>

	<para>
	  This tells Apache to load the Rivet shared object, wherever
	  it happens to reside on your file system.  Now we have to
	  tell Apache what kind of files are "Rivet" files and how to
	  process them:
	</para>

	<programlisting>AddType application/x-httpd-rivet .rvt
AddType application/x-rivet-tcl .tcl</programlisting>

	<para>
	  These tell Apache to process files with the
	  <filename>.rvt</filename> and <filename>.tcl</filename>
	  extensions as Rivet files.
	</para>
	<para>
	  For other directives that Rivet provides for Apache
	  configuration, please see <xref linkend="directives"/>.
	</para>
      </step>
    </procedure>
  </section>

  <section id="directives">
    <title>Rivet Apache Directives</title>

    <para>
      These directives are used within the Apache httpd server
      configuration files to modify Apache Rivet's behavior.  Their
      precedence is as follows: <command>RivetDirConf</command>,
      <command>RivetUserConf</command>,
      <command>RivetServerConf</command>, meaning that DirConf will
      override UserConf, which will in turn override ServerConf.
    </para>

    <variablelist>
      <varlistentry>
	<term>
	  <cmdsynopsis>
	    <command>RivetServerConf</command>
	    <group choice="req">
	      <arg>CacheSize</arg>
	      <arg>GlobalInitScript</arg>
	      <arg>ChildInitScript</arg>
	      <arg>ChildExitScript</arg>
	      <arg>BeforeScript</arg>
	      <arg>AfterScript</arg>
	      <arg>ErrorScript</arg>
	      <arg>UploadDirectory</arg>
	      <arg>UploadMaxSize</arg>
	      <arg>UploadFilesToVar</arg>
	      <arg>SeperateVirtualInterps</arg>
	    </group>
	  </cmdsynopsis>
	</term>
	<listitem>
	  <para><command>RivetServerConf</command> specifies a global
	    option that is valid for the whole server.  If you have a
	    virtual host, in some cases, the option specified in the
	    virtualhost takes precedence over the 'global' version.
	  </para>
	</listitem>
	<listitem>
	  <variablelist>
	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">CacheSize</arg>
		  <arg><replaceable>size</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Sets the size of the internal page cache, where
		  <option><replaceable>size</replaceable></option> is
		  the number of byte-compiled pages to be cached for
		  future use.  Default is
		  <command>MaxRequestsPerChild</command> / 5, or 50,
		  if <command>MaxRequestsPerChild</command> is 0.
		</para>
		<para>
		  This option is completely global, even when using
		  separate, per-virtual host interpreters.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">GlobalInitScript</arg>
		  <arg><replaceable>script</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Tcl script that is run when each interpreter is
		  initialized. <replaceable><option>script</option></replaceable>
		  is an actual Tcl script, so to run a file, you would
		  do:

		  <programlisting>RivetServerConf GlobalInitScript "source /var/www/foobar.tcl"</programlisting>
		</para>
		<para>
		  This option is ignored in virtual hosts.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">ChildInitScript</arg>
		  <arg><replaceable>script</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Script to be evaluated when each Apache child
		  process is initialized.  This is the recommended
		  place to load modules, create global variables, open
		  connections to other facilities (such as databases)
		  and so on.
		</para>
		<para>
		  In virtual hosts, this script is run in addition to
		  any global childinitscript.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">ChildExitScript</arg>
		  <arg><replaceable>script</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Script to be evaluated when each Apache child
		  process exits.  This is the logical place to clean
		  up resources created in
		  <option>ChildInitScript</option>, if necessary.
		</para>
		<para>
		  In virtual hosts, this script is run in addition to
		  any global childexitscript.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">BeforeScript</arg>
		  <arg><replaceable>script</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Script to be evaluated before each server parsed
		  (.rvt) page.  This can be used to create a standard
		  header, for instance.  It could also be used to load
		  code that you need for every page, if you don't want
		  to put it in a <option>GlobalInitScript</option>
		  <option>ChildInitScript</option> when you are first
		  developing a web site.
		  <note>
		    This code is evaluated at the global level, not
		    inside the request namespace where pages are
		    evaluated.
		  </note>
		</para>
		<para>
		  In virtual hosts, this option takes precedence over
		  the global setting.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">AfterScript</arg>
		  <arg><replaceable>script</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Script to be called after each server parsed (.rvt) page.
		</para>
		<para>
		  In virtual hosts, this option takes precedence over
		  the global setting.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">ErrorScript</arg>
		  <arg><replaceable>script</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  When Rivet encounters an error in a script, it
		  constructs an HTML page with some information about
		  the error, and the script that was being
		  evaluated. If an <option>ErrorScript</option> is
		  specified, it is possible to create custom error
		  pages.  This may be useful if you want to make sure
		  that users never view your source code.
		</para>
		<para>
		  In virtual hosts, this option takes precedence over
		  the global setting.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">UploadDirectory</arg>
		  <arg><replaceable>directory</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>Directory to place uploaded files.</para>
		<para>
		  In virtual hosts, this option takes precedence over
		  the global setting.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">UploadMaxSize</arg>
		  <arg><replaceable>size</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>Maximum size for uploaded files.</para>
		<para>
		  In virtual hosts, this option takes precedence over
		  the global setting.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">UploadFilesToVar</arg>
		  <group choice="req"><arg>yes</arg><arg>no</arg></group>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  This option controls whether it is possible to
		  upload files to a Tcl variable.  If you have a size
		  limit, and don't have to deal with large files, this
		  might be more convenient than sending the data to a
		  file on disk.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">SeperateVirtualInterps</arg>
		  <group choice="req">
		    <arg>yes</arg>
		    <arg>no</arg>
		  </group>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  If on, Rivet will create a separate Tcl interpreter
		  for each Apache virtual host.  This is useful in an
		  ISP type situation where it is desirable to separate
		  clients into separate interpreters, so that they
		  don't accidentally interfere with one another.
		</para>
		<para>This option is, by nature, only available at the
		global level.</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>
	  <cmdsynopsis>
	    <command>RivetDirConf</command>
	    <group choice="req">
	      <arg>BeforeScript</arg>
	      <arg>AfterScript</arg>
	      <arg>ErrorScript</arg>
	      <arg>UploadDirectory</arg>
	    </group>
	  </cmdsynopsis>
	</term>
	<listitem>
	  <para>
	    These options are the same as for
	    <command>RivetServerConf</command>, except that they are
	    only valid for the directory where they are specified, and
	    its subdirectories.  It may be specified in
	    <command>Directory</command> sections.
	  </para>
	</listitem>
      </varlistentry>

      <varlistentry>
	<term>
	  <cmdsynopsis>
	    <command>RivetUserConf</command>
	    <group choice="req">
	      <arg>BeforeScript</arg>
	      <arg>AfterScript</arg>
	      <arg>ErrorScript</arg>
	      <arg>UploadDirectory</arg>
	    </group>
	  </cmdsynopsis>
	</term>
	<listitem>
	  <para>
	    These options are the same as for
	    <command>RivetServerConf</command>, except that they are
	    only valid for the directory where they are specified, and
	    its subdirectories.
	  </para>
	</listitem>
      </varlistentry>
    </variablelist>

  </section>

  <section id="commands">
    <title>Rivet Tcl Commands and Variables</title>


    <refentry>
      <refnamediv>
	<refname>var</refname>
	<refname>var_qs</refname>
	<refname>var_post</refname>
	<refpurpose>get the value of a form variable.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>
	    var
	  </command>
	  <group choice="req">
	    <arg>get</arg>
	    <arg>list</arg>
	    <arg>exists</arg>
	    <arg>number</arg>
	    <arg>all</arg>
	  </group>
	</cmdsynopsis>

	<cmdsynopsis>
	  <command>
	    var_qs
	  </command>
	  <group choice="req">
	    <arg>get</arg>
	    <arg>list</arg>
	    <arg>exists</arg>
	    <arg>number</arg>
	    <arg>all</arg>
	  </group>
	</cmdsynopsis>

	<cmdsynopsis>
	  <command>
	    var_post
	  </command>
	  <group choice="req">
	    <arg>get</arg>
	    <arg>list</arg>
	    <arg>exists</arg>
	    <arg>number</arg>
	    <arg>all</arg>
	  </group>
	</cmdsynopsis>


      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  The <command>var</command> command retrieves information
	  about GET or POST variables sent to the script via client
	  request.  It treats both GET and POST variables the same,
	  regardless of their origin.  Note that there are two
	  additional forms of <command>var</command>:
	  <command>var_qs</command> and <command>var_post</command>.
	  These two restrict the retrieval of information to
	  parameters arriving via the querystring
	  (?foo=bar&amp;bee=bop) or POSTing, respectively.
	</para>
	<variablelist>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>var</command>
		<arg choice="plain">get</arg>
		<arg><replaceable>varname</replaceable></arg>
		<arg><replaceable><optional>default</optional></replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns the value of variable
		<option><replaceable>varname</replaceable></option>
		as a string (even if there are multiple values).  If
		the variable doesn't exist as a GET or POST
		variable, the
		<option><replaceable><optional>default</optional></replaceable></option>
		value is returned, otherwise "" - an empty string -
		is returned.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>var</command>
		<arg choice="plain">list</arg>
		<arg><replaceable>varname</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns the value of variable
		<option><replaceable>varname</replaceable></option> as a
		list, if there are multiple values.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>var</command>
		<arg choice="plain">exists</arg>
		<arg><replaceable>varname</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns 1 if
		<option><replaceable>varname</replaceable></option>
		exists, 0 if it doesn't.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>var</command>
		<arg choice="plain">number</arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns the number of variables.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>var</command>
		<arg choice="plain">all</arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Return a list of variable names and values.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>

	<para>
	  See <xref linkend="variable_access"/>.
	</para>

      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>upload</refname>
	<refpurpose>handle a file uploaded by a client.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>upload</command>
	  <group choice="req">
	    <arg>channel</arg>
	    <arg>save</arg>
	    <arg>data</arg>
	    <arg>exists</arg>
	    <arg>size</arg>
	    <arg>type</arg>
	    <arg>filename</arg>
	  </group>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>The upload command is for file upload manipulation.
	  See the relevant Apache Directives to further configure the
	  behavior of this Rivet feature.</para>


	<variablelist>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>upload</command>
		<arg choice="plain">channel</arg>
		<arg><replaceable>uploadname</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		When given the name of a file upload
		<option><replaceable>uploadname</replaceable></option>,
		returns a Tcl channel that can be used to access the
		uploaded file.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>upload</command>
		<arg choice="plain">save</arg>
		<arg><replaceable>uploadname</replaceable></arg>
		<arg><replaceable>filename</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Saves the
		<option><replaceable>uploadname</replaceable></option> in
		the file
		<option><replaceable>filename</replaceable></option>.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>upload</command>
		<arg choice="plain">data</arg>
		<arg><replaceable>uploadname</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns data uploaded to the server.  This is binary clean
		- in other words, it will work even with files like
		images, executables, compressed files, and so on.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>upload</command>
		<arg choice="plain">size</arg>
		<arg><replaceable>uploadname</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns the size of the file uploaded.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>upload</command>
		<arg choice="plain">type</arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		If the <varname>Content-type</varname> is set, it is
		returned, otherwise, an empty string.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>upload</command>
		<arg choice="plain">filename</arg>
		<arg><replaceable>uploadname</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns the filename on the remote host that uploaded the file.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>upload</command>
		<arg choice="plain">names</arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Returns the variable names, as a list, of all the files
		uploaded.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>

	<para>
	  See <xref linkend="upload"/>.
	</para>


      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>load_response</refname>
	<refpurpose>load form variables into an array.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>load_response</command>
	  <arg><replaceable>arrayName</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	Load any form variables passed to this page into an
	array.
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>load_headers</refname>
	<refpurpose>get client request's headers.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>load_headers</command>
	  <arg><replaceable>array_name</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Load the headers that come from a client request into the
	  provided array name, or use <option>headers</option> if no
	  name is provided.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>load_cookies</refname>
	<refpurpose>get any cookie variables sent by the client.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>load_cookies</command>
	  <arg choice="opt"><replaceable>array_name</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
      </refsect1>
      <para>
	Load the array of cookie variables into the specified
	array name.  Uses array <option>cookies</option> by
	default.
      </para>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>load_env</refname>
	<refpurpose>get the request's environment variables.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>load_env</command>
	  <arg choice="opt"><replaceable>array_name</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>

	<para>
	  Load the array of environment variables into the specified
	  array name.  Uses array <option>::request::env</option> by
	  default.
	</para>
	<para>
	  As Rivet pages are run in the <option>::request</option>
	  namespace, it isn't necessary to qualify the array name
	  for most uses - it's ok to access it as
	  <option>env</option>.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>env</refname> <refpurpose>Loads a single
	"environmental variable" into a Tcl variable.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>env</command>
	  <arg><replaceable>varName</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>

	<para>
	  If it is only necessary to load one environmental variable,
	  this command may be used to avoid the overhead of loading
	  and storing the entire array.
	</para>
      </refsect1>
    </refentry>


    <refentry>
      <refnamediv>
	<refname>include</refname>
	<refpurpose>includes a file into the output stream without modification.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>include</command>
	  <arg><replaceable>filename_name</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Include a file without parsing it for processing tags &lt;?
	  and ?&gt;.  This is the best way to include an HTML file or
	  any other static content.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>parse</refname>
	<refpurpose>parses a Rivet template file.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>parse</command>
	  <arg><replaceable>filename</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Like the Tcl <command>source</command> command, but also
	  parses for Rivet &lt;?  and ?&gt; processing tags.  Using
	  this command, you can use one .rvt file from another.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>headers</refname>
	<refpurpose>set and parse HTTP headers.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>headers</command>
	  <group choice="req">
	    <arg>set</arg>
	    <arg>redirect</arg>
	    <arg>add</arg>
	    <arg>type</arg>
	    <arg>numeric</arg>
	  </group>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  The <command>headers</command> command is for setting and
	  parsing HTTP headers.
	</para>

	<variablelist>

	  <varlistentry>
	    <term><cmdsynopsis>
		<command>headers</command>
		<arg choice="plain">set</arg>
		<arg><replaceable>headername</replaceable></arg>
		<arg><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Set arbitrary header names and values.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>headers</command>
		<arg choice="plain">redirect</arg>
		<arg><replaceable>uri</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Redirect from the current page to a new
		URI. <emphasis>Must</emphasis> be done in the first block
		of TCL code.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>headers</command>
		<arg choice="plain">add</arg>
		<arg><replaceable>headername</replaceable></arg>
		<arg><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>Add text to header
		<varname>headername</varname>.</para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term><cmdsynopsis>
		<command>headers</command>
		<arg choice="plain">type</arg>
		<arg><replaceable>content-type</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		This command sets the <constant>Content-type</constant>
		header returned by the script, which is useful if you wish
		to send content other than HTML with Rivet - PNG or jpeg
		images, for example.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<command>headers</command>
		<arg choice="plain">numeric</arg>
		<arg><replaceable>response code</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>Set a numeric response code, such as 200, 404 or 500.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>makeurl</refname>
	<refpurpose>construct url's based on hostname, port.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>makeurl</command>
	  <arg><replaceable>filename</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Create a self referencing URL from a filename.  For example:
	  <programlisting>makeurl /tclp.gif</programlisting>
	  returns
	  <computeroutput>http://[hostname]:[port]/tclp.gif</computeroutput>.
	  where hostname and port are the hostname and port of the
	  server in question.
	</para>
      </refsect1>
    </refentry>


    <refentry>
      <refnamediv>
	<refname>cookie</refname>
	<refpurpose>get and set cookies.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>cookie</command>
	  <arg>set</arg>
	  <arg><replaceable>cookieName</replaceable></arg>
	  <arg><replaceable><optional>cookiValue</optional></replaceable></arg>
	  <arg>-days <replaceable>expireInDays</replaceable></arg>
	  <arg>-hours <replaceable>expireInHours</replaceable></arg>
	  <arg>-minutes <replaceable>expireInMinutes</replaceable></arg>
	  <arg>-expires <replaceable>Wdy, DD-Mon-YYYY HH:MM:SS GMT</replaceable></arg>
	  <arg>-path <replaceable>uriPathCookieAppliesTo</replaceable></arg>
	  <arg>-secure <replaceable>1/0</replaceable></arg>
	</cmdsynopsis>
	<cmdsynopsis>
	  <command>cookie</command>
	  <arg>get</arg>
	  <arg><replaceable>cookieName</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  <command>cookie</command> gets or sets a cookie.  When you
	  get a cookie, the command returns the value of the cookie,
	  or an empty string if no cookie exists.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>clock_to_rfc850_gmt</refname>
	<refpurpose>create a rfc850 time from [clock seconds].</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>clock_to_rfc850_gmt</command>
	  <arg><replaceable>seconds</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Convert an integer-seconds-since-1970 click value to
	  RFC850 format, with the additional requirement that it be
	  GMT only.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>html</refname>
	<refpurpose>construct html tagged text.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>html</command>
	  <arg><replaceable>string</replaceable></arg>
	  <arg rep="repeat"><replaceable>arg</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Print text with the added ability to pass HTML tags
	  following the string.  Example:
	  <programlisting>html "Test" b i</programlisting>
	  produces: <computeroutput>&lt;b&gt;&lt;i&gt;Test&lt;/i&gt;&lt;/b&gt;</computeroutput>
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>incr0</refname>
	<refpurpose>increment a variable or set it to 1 if nonexistant.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>incr0</command>
	  <arg><replaceable>varname</replaceable></arg>
	  <arg><replaceable>num</replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Increment a variable
	  <option><replaceable>varname</replaceable></option> by
	  <option><replaceable>num</replaceable></option>.  If the
	  variable doesn't exist, create it instead of returning an
	  error.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>parray</refname>
	<refpurpose>Tcl's <command>parray</command> with html formatting.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>parray</command>
	  <arg><replaceable>arrayName</replaceable></arg>
	  <arg><replaceable><optional>pattern</optional></replaceable></arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  An html version of the standard Tcl
	  <command>parray</command> command.  Displays the entire
	  contents of an array in a sorted, nicely-formatted way.
	  Mostly used for debugging purposes.
	</para>

      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>abort_page</refname>
	<refpurpose>Stops outputing data to web page, similar in
	  purpose to PHP's <command>die</command> command.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>abort_page</command>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title> <para>This command flushes the
	output buffer and stops the Tcl script from sending any more
	data to the client.  A normal Tcl script might use the
	<command>exit</command> command, but that cannot be used in
	Rivet without actually exiting the apache child
	process!</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>no_body</refname>
	<refpurpose>Prevents Rivet from sending any content.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>no_body</command>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>

	<para>
	  This command is useful for situations where it is necessary
	  to only return HTTP headers and no actual content.  For
	  instance, when returning a 304 redirect.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>escape_string</refname>
	<refpurpose>convert a string into escaped characters.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>escape_string</command>
	  <arg>string</arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Scans through each character in the specified string looking
	  for special characters, escaping them as needed, mapping
	  special characters to a quoted hexadecimal equivalent,
	  returning the result.
	</para>
	<para>
	This is useful for quoting strings that are going to be
	part of a URL.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>escape_sgml_chars</refname>
	<refpurpose>escape special SGML characters in a string.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>escape_sgml_chars</command>
	  <arg>string</arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Scans through each character in the specified string looking
	  for any special (with respect to SGML, and hence HTML) characters
	  from the specified string, and returns the result.  
	  For example, the right angle
	  bracket is escaped to the corrected ampersand gt symbol.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>escape_shell_command</refname>
	<refpurpose>escape shell metacharacters in a string.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>escape_shell_command</command>
	  <arg>string</arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Scans through each character in the specified string looking
	  for any shell metacharacters, such as asterisk, less than and
	  greater than, parens, square brackets, curly brackets, angle 
	  brackets, dollar signs, backslashes, semicolons, ampersands,
	  vertical bars, etc.
	</para>
	<para>
	  For each metacharacter found, it is quoted in the result by
	  prepending it with a backslash, returning the result.
	</para>
      </refsect1>
    </refentry>

    <refentry>
      <refnamediv>
	<refname>unescape_string</refname>
	<refpurpose>unescape escaped characters in a string.</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>unescape_string</command>
	  <arg>string</arg>
	</cmdsynopsis>
      </refsynopsisdiv>

      <refsect1>
	<title>Description</title>
	<para>
	  Scans through each character in the specified string looking
	  for escaped character sequences (characters containing a
	  percent sign and two hexadecimal characters, unescaping them 
	  back to their original character values, as needed, also mapping
	  plus signs to spaces, and returning the result.
	</para>
	<para>
	This is useful for unquoting strings that have been quoted to
	be part of a URL.
	</para>
      </refsect1>
    </refentry>

  </section>

  <section id="examples">
    <title>Examples and Usage</title>

    <para>
      Some examples of Rivet usage follow.  Some prior Tcl knowledge
      is assumed.  If you don't know much Tcl, don't worry, it's easy,
      and there are some good resources available on the web that will
      get you up to speed quickly.  Go to the <link
	linkend="websites">web sites</link> section and have a look.
    </para>

    <example id="hello world">
      <title>Hello World</title>
      <para>
	As with any tool, it's always nice to see something work, so
	let's create a small "Hello World" page.</para>
      <para>
	Assuming you have Apache configured correctly, create a file
	called <filename>hello.rvt</filename> where Apache can find
	it, with the following content:
      </para>
      <programlisting>&hello.rvt;</programlisting>
      <para>
	If you then access it with your browser, you should see a
	blank page with the text "Hello World" (without the quotes) on
	it.
      </para>
    </example>

    <example id="table">
      <title>Generate a Table</title>
      <para>
	In another simple example, we dynamically generate a table:
      </para>
      <programlisting>&table.rvt;</programlisting>
      <para>
	If you read the code, you can see that this is pure Tcl.  We
	could take the same code, run it outside of Rivet, and it
	would generate the same HTML!
      </para>
      <para>
	The result should look something like this:
      </para>
      <graphic fileref="table.png"/>

    </example>

    <example id="variable_access">
      <title>Variable Access</title>
      <para>
	Here, we demonstrate how to access variables set by GET or
	POST operations.
      </para>
      <para>
	Given an HTML form like the following:
      </para>
      <programlisting>&vars.html;</programlisting>
      <para>
	We can use this Rivet script to get the variable values:
      </para>
      <programlisting>&vars.rvt;</programlisting>
      <para>
	The first statement checks to make sure that the
	<varname>boss</varname> variable has been passed to the
	script, and then does something with that information.  If
	it's not present, an error is added to the list of errors.
      </para>
      <para>
	In the second block of code, the variable
	<varname>salary</varname> is fetched, with one more error
	check - because it's a number, it needs to be composed of
	digits.
      </para>
      <para>
	The <varname>boss</varname> variable isn't required to have
	been sent - we set it to "Mr. Burns" if it isn't among the
	information we received.
      </para>
      <para>
	The last bit of variable handing code is a bit trickier.
	Because <varname>skills</varname> is a listbox, and can
	potentially have multiple values, we opt to receive them as a
	list, so that at some point, we could iterate over them.
      </para>
      <para>
	The script then checks to make sure that
	<varname>errlist</varname> is empty and outputting a thankyou
	message.  If <varname>errlist</varname> is not empty, the list
	of errors it contains is printed.
      </para>
    </example>

    <example id="upload">
      <title>File Upload</title>
      <para>
	The following HTML in one file, say,
	<filename>upload.html</filename>
      </para>
      <programlisting>&upload.html;</programlisting>
      <para>
	Can be used with the following Tcl code, in a second file
	(<filename>upload.rvt</filename> for instance)
	in order to create a file upload form.
      </para>
      <programlisting>&upload.rvt;</programlisting>
    </example>

  </section>

  <section id="tcl_packages">
    <title>Rivet Tcl Packages</title>
    <para>
      In addition to the core Apache module, Rivet provides a number
      of Tcl packages that include potentially useful code.
    </para>
    <itemizedlist>

      <listitem>
	<para>commserver is a package providing a server that can be
	used for IPC.  Still experimental.  Requires the comm package
	from tcllib.</para>
      </listitem>

      <listitem>
	<para>dio is a database abstraction layer.</para>
      </listitem>

      <listitem>
	<para>dtcl is a compatibility package for mod_dtcl
	applications.</para>
      </listitem>

      <listitem>
	<para>form - for creating forms.</para>
      </listitem>

      <listitem>
	<para>rivet - some additional, useful routines.</para>
      </listitem>

      <listitem>
	<para>tclrivet</para>
      </listitem>
    </itemizedlist>
  </section>

  <section id="dio">
    <title>DIO - Database Interface Objects</title>
    <refentry>
      <refnamediv>
	<refname>DIO</refname>
	<refpurpose>Database Interface Objects</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>::DIO::handle</command>
	  <arg choice="plain"><replaceable>interface</replaceable></arg>
	  <arg choice="opt"><replaceable>objectName</replaceable></arg>
	  <group choice="opt">
	    <arg>-option</arg>
	    <arg><replaceable>option</replaceable></arg>
	    <arg>-option</arg>
	    <arg><replaceable>option</replaceable></arg>
	    <arg>...</arg>
	  </group>
	</cmdsynopsis>
      </refsynopsisdiv>
      <refsect1>
	<title>Description</title>
	<para>
	  <command>DIO</command> is designed to be a generic,
	  object-oriented interface to SQL databases.  Its main goal
	  is to be as generic as possible, but since not all SQL
	  databases support the exact same syntaxes, keeping code
	  generic between databases is left to the abilities of the
	  programmer.  DIO simply provides a way to keep the Tcl
	  interface generic.
	</para>
	<para>
	  <option>interface</option> - The name of the database
	  interface.  Currently supported interfaces are
	  <option>Postgresql</option> and <option>Mysql</option>.
	</para>
	<para>
	  If <option><replaceable>objectName</replaceable></option> is
	  specified, DIO creates an object of that name.  If there is
	  no <option><replaceable>objectName</replaceable></option>
	  given, DIO will automatically generate a unique object ID
	</para>
      </refsect1>
      <refsect1>
	<title>Options</title>
	<variablelist>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-host</arg>
		<arg choice="opt"><replaceable>hostname</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		The hostname of the computer to connect to.  If none
		is given, DIO assumes the local host.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-port</arg>
		<arg><replaceable>portNumber</replaceable></arg>
	      </cmdsynopsis>
	      <para>The port number to connect to on <option>hostname</option>.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-user</arg>
		<arg><replaceable>username</replaceable></arg>
	      </cmdsynopsis>
	      <para>The username you wish to login to the server as.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-pass</arg>
		<arg><replaceable>password</replaceable></arg>
	      </cmdsynopsis>
	      <para>The password to login to the server with.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-db</arg>
		<arg><replaceable>database</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		The name of the database to connect to.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-table</arg>
		<arg><replaceable>tableName</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		The default table to use when using built-in commands
		for storing and fetching.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-keyfield</arg>
		<arg><replaceable>keyFieldname</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		The default field to use as the primary key when using
		built-in commands for storing and fetching.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-autokey</arg>
		<group>
		  <arg>1</arg>
		  <arg>0</arg>
		</group>
	      </cmdsynopsis>
	      <para>
		If this option is set to 1, DIO will attempt to
		determine an automatic key for
		<option>keyField</option> when storing and fetching.
		In most databases, this requires that the
		<option>sequence</option> also be specified.  In the
		case of MySQL, where sequences do not exist, autokey
		must be used in conjunction with a table which has a
		field specified as AUTO.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain">-sequence</arg>
		<arg><replaceable>sequenceName</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		If DIO is automatically generating keys, it will use
		this sequence as a means to gain a unique number for
		the stored key.</para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect1>
      <refsect1>
	<title>DIO Object Commands</title>
	<variablelist>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>array</arg>
		<arg><replaceable>request</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Execute <option>request</option> as a SQL query and
		create an array from the first record found.  The
		array is set with the fields of the table and the
		values of the record found.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>autokey</arg>
		<group choice="opt">
		  <arg>value</arg>
		  <arg>boolean</arg>
		</group>
	      </cmdsynopsis>
	      <para>
		Return the current autokey value.  If
		<option>value</option> is specified, it sets a new
		value for the autokey option.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>close</arg>
	      </cmdsynopsis>
	      <para>	      Close the current database connection.  This command is
		automatically called when the DIO object is destroyed.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>db</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current database.  If
		<option>value</option> is specified, it sets a new
		value for the database.  In most cases, the DIO object
		will automatically connect to the new database when
		this option is changed.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>delete</arg>
		<arg><replaceable>key</replaceable></arg>
		<group choice="opt">
		  <arg>-option</arg>
		  <arg><replaceable>option</replaceable></arg>
		  <arg>...</arg>
		</group>
	      </cmdsynopsis>
	      <para>
		Delete a record from the database where the primary
		key matches <option>key</option>.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>destroy</arg>
	      </cmdsynopsis>
	      <para>
		Destroy the DIO object.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>errorinfo</arg>
		<arg choice="opt">value</arg>
	      </cmdsynopsis>
	      <para><option>errorinfo</option> contains the value of
		the last error, if any, to occur while executing a
		request.  When a request fails for any reason, this
		variable is filled with the error message from the SQL
		interface package.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>exec</arg>
		<arg><replaceable>request</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Execute <option>request</option> as an SQL query.
		When the exec command is called, the query is
		executed, and a DIO result object is returned.  From
		there, the result object can be used to obtain
		information about the query status and records in a
		generic way.  See <link linkend="resultobj">Result
		  Object Commands</link>
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>fetch</arg>
		<arg><replaceable>key</replaceable></arg>
		<arg><replaceable>arrayName</replaceable></arg>
		<group choice="opt">
		  <arg>-option</arg>
		  <arg><replaceable>option</replaceable></arg>
		  <arg>...</arg>
		</group>
	      </cmdsynopsis>
	      <para>
		Fetch a record from the database where the primary key
		matches <option>key</option> and store the result in
		an array called <option>arrayName</option>.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>host</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current host value.  If
		<option>value</option> is specified, it sets a new
		value for the host.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>insert</arg>
		<arg><replaceable>arrayName</replaceable></arg>
		<group choice="opt">
		  <arg>-option</arg>
		  <arg><replaceable>option</replaceable></arg>
		  <arg>...</arg>
		</group>
	      </cmdsynopsis>
	      <para>
		Insert fields from <option>arrayName</option> into the specified table in the database.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>keyfield</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current keyfield.  If
		<option>value</option> is specified, it sets a new
		value for the keyfield.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>keys</arg>
		<arg choice="opt"><replaceable>pattern</replaceable></arg>
		<group choice="opt">
		  <arg>-option</arg>
		  <arg><replaceable>option</replaceable></arg>
		  <arg>...</arg>
		</group>
	      </cmdsynopsis>
	      <para>
		Return a list of keys in the database.  If
		<option>pattern</option> is specified, only the keys
		matching will be returned.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>lastkey</arg>
	      </cmdsynopsis>
	      <para>
		Return the last key that was used from
		<option>sequence</option>.  If sequence has not been
		specified, this command returns an empty string.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>list</arg>
		<arg>request</arg>
	      </cmdsynopsis>
	      <para>
		Execute <option>request</option> as a SQL query and
		return a list of the first column of each record
		found.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>nextkey</arg>
	      </cmdsynopsis>
	      <para>Increment <option>sequence</option> and return the
		next key to be used.  If sequence has not been
		specified, this command returns an empty
		string.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>open</arg>
	      </cmdsynopsis>
	      <para>Open the connection to the current database.  This
		command is automatically called from any command which
		accesses the database.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>pass</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current pass value.  If
		<option>value</option> is specified, it sets a new
		value for the password.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>port</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>Return the current port value.  If <option>value</option> is
		specified, it sets a new value for the port.</para>
	    </listitem>
	  </varlistentry>	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>sequence</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current sequence value.  If <option>value</option> is
		specified, it sets a new value for the sequence.
	      </para>
	    </listitem>
	  </varlistentry>	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>store</arg>
		<arg><replaceable>arrayName</replaceable></arg>
		<group choice="opt">
		  <arg>-option</arg>
		  <arg><replaceable>option</replaceable></arg>
		  <arg>...</arg>
		</group>
	      </cmdsynopsis>
	      <para>
		Store <option>arrayName</option> in the database, inserting it if the corresponding record isn't there, or updating it if it is.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>string</arg>
		<arg><replaceable>request</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Execute <option>request</option> as a SQL query and
		return a string containing the first record
		found.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>table</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>Return the current table.  If
		<option>value</option> is specified, it sets a new
		value for the table.</para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>objectName</replaceable></arg>
		<arg>user</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current user value.  If
		<option>value</option> is specified, it sets a new
		value for the user.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect1>
      <refsect1 id="resultobj">
	<title>Result Object Commands</title>
	<variablelist>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>autocache</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current autocache value.  If
		<option>value</option> is specified, it sets a new
		value for autocache.
	      </para>
	      <para>
		If autocache is true, the result object will
		automatically cache rows as you use them.  This means
		that the first time you execute a forall command, each
		row is being cached in the result object itself and
		will no longer need to access the SQL result.
		<emphasis>Default is true</emphasis>.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>cache</arg>
	      </cmdsynopsis>
	      <para>
		Cache the results of the current SQL result in the
		result object itself.  This means that even if the
		database connection is closed and all the results of
		the DIO object are lost, this result object will still
		maintain a cached copy of its records.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>errorcode</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current errorcode value.  If <option>value</option>
		is specified, it sets a new value for errorcode.
	      </para>
	      <para>
		<option>errorcode</option> contains the current code from the
		SQL database which specifies the result of the query
		statement which created this object.  This variable
		can be used to determine the success or failure of a
		query.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>errorinfo</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current errorinfo value.  If <option>value</option>
		is specified, it sets a new value for errorinfo.
	      </para>
	      <para>
		If an error occurred during the SQL query, DIO
		attempts to set the value of <option>errorinfo</option> to the
		resulting error message.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>fields</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current fields value.  If
		<option>value</option> is specified, it sets a new
		value for fields.
	      </para>
	      <para>
		<option>fields</option> contains the list of fields
		used in this query.  The fields are in order of the
		fields retrieved for each row.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>forall</arg>
		<arg><replaceable>-type</replaceable></arg>
		<arg><replaceable>varName</replaceable></arg>
		<arg><replaceable>body</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Execute <option>body</option> over each record in the
		result object.
	      </para>
	      <para>Types:</para>
	      <variablelist>
		<varlistentry>
		  <listitem>
		    <cmdsynopsis>
		      <arg choice="plain">-array</arg>
		    </cmdsynopsis>
		    <para>
		      Create
		      <option><replaceable>varName</replaceable></option>
		      as an array where the indexes are the names of
		      the fields in the table and the values are the
		      values of the current row.
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <listitem>
		    <cmdsynopsis>
		      <arg choice="plain">-keyvalue</arg>
		    </cmdsynopsis>
		    <para>
		      Set
		      <option><replaceable>varName</replaceable></option>
		      to a list containing key-value pairs of fields
		      and values from the current row. (-field value
		      -field value)
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <listitem>
		    <cmdsynopsis>
		      <arg choice="plain">-list</arg>
		    </cmdsynopsis>
		    <para>
		      Set
		      <option><replaceable>varName</replaceable></option>
		      to a list that contains the values of the
		      current row.
		    </para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>next</arg>
		<arg><replaceable>-type</replaceable></arg>
		<arg choice="opt"><replaceable>varName</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Retrieve the next record in the result object.
	      </para>
	      <para>Types:</para>
	      <variablelist>
		<varlistentry>
		  <listitem>
		    <cmdsynopsis>
		      <arg choice="plain">-array</arg>
		    </cmdsynopsis>
		    <para>
		      Create
		      <option><replaceable>varName</replaceable></option>
		      as an array where the indexes are the names of
		      the fields in the table and the values are the
		      values of the current row.
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <listitem>
		    <cmdsynopsis>
		      <arg choice="plain">-keyvalue</arg>
		    </cmdsynopsis>
		    <para>
		      Set
		      <option><replaceable>varName</replaceable></option>
		      to a list containing key-value pairs of fields
		      and values from the current row. (-field value
		      -field value)
		    </para>
		  </listitem>
		</varlistentry>
		<varlistentry>
		  <listitem>
		    <cmdsynopsis>
		      <arg choice="plain">-list</arg>
		    </cmdsynopsis>
		    <para>
		      Set
		      <option><replaceable>varName</replaceable></option>
		      to a list that contains the values of the
		      current row.
		    </para>
		  </listitem>
		</varlistentry>
	      </variablelist>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>numrows</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current numrows value.  If <option>value</option> is
		specified, it sets a new value for numrows.
	      </para>
	      <para>
		<option>numrows</option> is the number of rows in this result.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>resultid</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current resultid value.  If <option>value</option> is
		specified, it sets a new value for resultid.
	      </para>
	      <para>
		<option>resultid</option> in most databases is the result
		pointer which was given us by the database.  This
		variable is not generic and should not really be used,
		but it's there if you want it.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<arg choice="plain"><replaceable>resultObj</replaceable></arg>
		<arg>rowid</arg>
		<arg choice="opt"><replaceable>value</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Return the current rowid value.  If <option>value</option> is
		specified, it sets a new value for rowid.
	      </para>
	      <para>
		<option>rowid</option> contains the number of the
		current result record in the result object.  This
		variable should not really be accessed outside of the
		result object, but it's there if you want it.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </refsect1>
    </refentry>
  </section>


  <section id="diodisplay">
    <title>DIODisplay - Database Interface Objects Display Class</title>
    <refentry>
      <refnamediv>
	<refname>DIODisplay</refname>
	<refpurpose>Database Interface Objects Display Class</refpurpose>
      </refnamediv>

      <refsynopsisdiv>
	<cmdsynopsis>
	  <command>DIODisplay</command>
	  <group>
	    <arg><replaceable>objectName</replaceable></arg>
	    <arg>#auto</arg>
	  </group>
	  <group choice="opt">
	    <arg>-option</arg>
	    <arg><replaceable>option</replaceable></arg>
	    <arg>-option</arg>
	    <arg><replaceable>option</replaceable></arg>
	    <arg>...</arg>
	  </group>
	</cmdsynopsis>
      </refsynopsisdiv>
      <refsect1>
	<title>Description</title>
	<para>
	  DIODisplay is an HTML display class that uses a DIO object
	  to do the database work and a form object to do the
	  displaying.
	</para>
      </refsect1>
      <refsect1>
	<title>Options</title>
	<variablelist>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-DIO</arg>
		<arg choice="plain"><replaceable>dioObject</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		The DIO object to be used in conjunction with this
		display object.  This is a required field.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-cleanup</arg>
		<group>
		  <arg>1</arg>
		  <arg>0</arg>
		</group>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		If cleanup is true, when the display object is shown,
		it will automatically destroy the DIO object, the form
		object and itself. Default is true.
	      </para>
	    </listitem>
	  </varlistentry>


	  <!-- begin transform.html -->

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-confirmdelete</arg>
		<group>
		  <arg>1</arg>
		  <arg>0</arg>
		</group>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		If confirmdelete is true, attempting to delete a
		record from the database first requires that the user
		confirm that they wish to delete it.  If it is false,
		deletion occurs without prompting the user. Defaults
		to true.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-errorhandler</arg>
		<arg choice="plain"><replaceable>procName</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		The name of a procedure to handle errors when they
		occur.  During the processing of requests and pages,
		sometimes unexpected errors can occur.  This procedure
		will handle any errors.  It is called with a single
		argument, the error string.  Use of the Tcl errorInfo
		and errorCode variables is also recommended though.
	      </para>
	      <para>
		If no errorhandler is specified, the handle_error
		method within the Display object will handle the
		error.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-fields</arg>
		<arg choice="plain"><replaceable>fieldList</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		Specify a list of fields to be used in this object.
		The fields list is actually created by using the
		<command>field</command> command to add fields to the
		display, but this option can be useful to sometimes
		over-set the list of fields created.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-form</arg>
		<arg choice="plain"><replaceable>formObject</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		A Rivet form object to use when displaying a form.  If
		one is not specified, the display object will
		automatically create one when it is necessary.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-functions</arg>
		<arg choice="plain"><replaceable>functionList</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		A list of functions to be displayed in the main menu.
		This is a list of functions the user is allowed to
		execute.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-pagesize</arg>
		<arg choice="plain"><replaceable>pageSize</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		How many records to show per page on a search or
		list. Default is 25.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-rowfields</arg>
		<arg choice="plain"><replaceable>fieldList</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		A list of fields to display in each row of a search or
		list.  When a search or list is conducted and the
		resulting rows are displayed, this list will limit
		which fields are displayed.  Default is all fields.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-rowfunctions</arg>
		<arg choice="plain"><replaceable>functionList</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		A list of functions to display in each row of a search
		or list.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-searchfields</arg>
		<arg choice="plain"><replaceable>fieldList</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		A list of fields to allow a user to search by.  This
		list will appear in the main screen as a drop-down box
		of fields the user can search on.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>
	      <cmdsynopsis>
		<arg choice="plain">-title</arg>
		<arg choice="plain"><replaceable>title</replaceable></arg>
	      </cmdsynopsis>
	    </term>
	    <listitem>
	      <para>
		The title of the display object.  This will be output
		as the title of the HTML document.
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>


	<refsect2>
	  <title>DIO Display Object Commands</title>


	  <variablelist>
	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">cleanup</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current cleanup value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for the cleanup
		  option.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">delete</arg>
		  <arg choice="plain"><replaceable>key</replaceable></arg>
		</cmdsynopsis>
	      </term>
		<listitem>
		  <para>
		  Delete the specified <option>key</option> from the
		  database.
		</para>
		<para>
		  The default action of this method is to call the DIO
		  object's delete command.  This method can be
		  overridden.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">destroy</arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Destroy the diodisplay object.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">DIO</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current DIO value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for DIO.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">errorhandler</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current errorhandler value.  If
		  <option><replaceable>value</replaceable></option> is specified, it
		  sets a new value for errorhandler.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">fetch</arg>
		  <arg choice="plain"><replaceable>key</replaceable></arg>
		  <arg choice="plain"><replaceable>arrayName</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Fetch the specified <replaceable><option>key</option></replaceable>
		  from the database and store it as an array in
		  <replaceable><replaceable>arrayName</replaceable></replaceable>.
		</para>
		<para>
		  The default of this method is to call the DIO object's fetch command.
		  This method can be overridden.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">field</arg>
		  <arg choice="plain"><replaceable>fieldName</replaceable></arg>
		  <group rep="repeat">
		    <arg choice="plain">-arg</arg>
		    <arg choice="plain"><replaceable>arg</replaceable></arg>
		  </group>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Create a new field object and add it to the display.
		  When a field is added to the display, a new object
		  of the DIODisplayField class is created with its
		  values.  See [FIXME - LINK] DIO Display Fields for
		  options and values.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">fields</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current fields value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for fields.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">form</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current form value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for form.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">function</arg>
		  <arg choice="plain"><replaceable>functionName</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Add a new function to the list of possible
		  functions.  The display object will only execute
		  methods and procs which are defined as functions by
		  the object.  This is to protect the program from
		  executing a different procedure other than what is
		  allowed.  The <command>function</command> command
		  adds a new function to the list of allowable
		  functions.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain"><replaceable>objectName</replaceable></arg>
		  <arg choice="plain">functions</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current functions value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for functions.  See
		  [FIXME - LINK DIO Display Functions] for a list of
		  default functions.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">pagesize</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current form pagesize.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for pagesize.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">rowfields</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current form rowfields.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for rowfields.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">rowfooter</arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Output the footer of a list of rows to the web page.
		</para>
		<para>
		  This method can be overridden.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">rowfunctions</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current rowfunctions value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for rowfunctions.
		  
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">rowheader</arg>
		</cmdsynopsis>
	      </term>
	    <listitem>
	      <para>
		Output the header of a list of rows to the web page.
		By default, this is an HTML table with a top row
		listing the fields in the table.
		</para>
		<para>
		  This method can be overridden.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">searchfields</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current searchfields value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for searchfields.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">show</arg>
		</cmdsynopsis>
	      </term>
	    <listitem>
	      <para>
		Show the display object.
		</para>
		<para>
		  This is the main method of the display class.  It
		  looks for a variable called <varname>mode</varname>
		  to be passed in through a form response and uses
		  that mode to execute the appropriate function.  If
		  mode is not given, the <command>Main</command>
		  function is called.
		</para>
		<para>
		  This function should be called for every page.
		</para>
	      </listitem>
	    </varlistentry>


	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">showform</arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Display the form of the object.
		</para>
		<para>
		  This method displays the form for this display
		  object.  It is used in the <command>Add</command>
		  and <command>Edit</command> methods but can be
		  called separately if needed.
		</para>
		<para>
		  This method can be overridden if the default look of
		  a form needs to be changed.  By default, the form
		  displayed is simply the fields in a table, in order.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">showrow</arg>
		  <arg choice="plain"><replaceable>arrayName</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Display a single row of a resulting list or search.
		</para>
		<para>
		  This method is used to display a single row while
		  displaying the result of a list or search.
		  <option><replaceable>arrayName</replaceable></option>
		  is a fetched array of the record.
		</para>
		<para>
		  This method can be overriden if the default look of
		  a row needs to be changed.  By default, each row is
		  output as a table row with each field as a table
		  data cell.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">showview</arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Display the view of the object.
		</para>
		<para>
		  This method displays the view for this display
		  object.  It is used in the
		  <command>Details</command> methods but can be
		  called separately if needed.
		</para>
		<para>
		  This method can be overridden if the default look of
		  a view needs to be changed.  By default, the view
		  displayed is simply the fields in a table, in order.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">store</arg>
		  <arg choice="plain"><replaceable>arrayName</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Store the specified
		  <option><replaceable>arrayName</replaceable></option>
		  in the database.
		</para>
		<para>
		  The default of this method is to call the DIO
		  object's store command.  This method can be
		  overridden.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">text</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current text value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for text.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">title</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current title value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for title.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">type</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current type value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for type.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <command><replaceable>objectName</replaceable></command>
		  <arg choice="plain">value</arg>
		  <arg><replaceable>value</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  Return the current value value.  If
		  <option><replaceable>value</replaceable></option> is
		  specified, it sets a new value for value.
		</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</refsect2>

	<refsect2>
	  <title>DIO Display Functions</title>
	  <para>
	    These functions are called from the
	    <command>show</command> method when a form response
	    variable called <varname>mode</varname> is set.  If no
	    mode has been set, the default mode is
	    <command>Main</command>.  The show method will handle
	    the necessary switching of functions.  The show method
	    also handles checking to make sure the function given is a
	    true function.  If not, an error message is displayed.
	    New functions can be added as methods or by use of the
	    <command>function</command> command, and any of the
	    default functions can be overridden with new methods to
	    create an entirely new class.  These are the default
	    functions provided.
	  </para>

	  <variablelist>
	    <varlistentry>
	      <term><command>Add</command></term>
	      <listitem>
		<para>
		  Show a form that allows the user to add a new entry
		  to the database.  This function calls
		  <command>showform</command> to display the form
		  for adding the entry.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>Cancel</command></term>
	      <listitem>
		<para>
		  The <command>Cancel</command> function does nothing
		  but redirect back to the <command>Main</command>
		  function.  This is handy for forms which have a
		  cancel button to point to.
		</para>
	      </listitem>
	    </varlistentry>


	    <varlistentry>
	      <term><command>Delete</command></term>
	      <listitem>
		<para>
		  If <varname>confirmdelete</varname> is true (the
		  default), the <command>Delete</command> function
		  will ask the user if they're sure they want to
		  delete the record from the database.  If
		  <varname>confirmdelete</varname> is false, or if the
		  user confirms they wish to delete, this function
		  calls the <command>DoDelete</command> function to do
		  the actual deletion of a record.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>Details</command></term>
	      <listitem>
		<para>
		  Display the view of a single record from the database.  This function calls
		  the <command>showview</command> method to display a single record from the database.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>DoDelete</command></term>
	      <listitem>
		<para>
		  This function actually deletes a record from the
		  database.  Once it has deleted the record, it
		  redirects the user back to the
		  <command>Main</command> function.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>Edit</command></term>
	      <listitem>
		<para>
		  Show a form that allows the user to edit an existing
		  entry to the database.  This function calls
		  <command>showform</command> to display the form for
		  editing the entry and fills in the fields with the
		  values retrieved from the database.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>List</command></term>
	      <listitem>
		<para>
		  This function lists the entires contents of the
		  database.  Each record is output in a row using the
		  <command>showrow</command> method.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>Main</command></term>
	      <listitem>
		<para>
		  This function is the main function of the display
		  object.  If there is no mode, or once most commands
		  complete, the user will be redirected to this
		  function.  The default <command>Main</command>
		  function displays a list of functions the user can
		  execute, a list of searchfields the user can search
		  on, and a query field.  This query field is used by
		  all of the other functions to determine what the
		  user is trying to find.
		</para>
		<para>
		  In the case of a <command>search</command>, query
		  specifies what string the user is looking for in the
		  specified search field.  In the case of
		  <command>delete</command>,
		  <command>details</command> or
		  <command>edit</command>, the query specifies the
		  database key to access.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>Save</command></term>
	      <listitem>
		<para>
		  This function saves any data passed to using the
		  <command>store</command> method.  This is primarily
		  used by the <command>add</command> and
		  <command>edit</command> commands to store the
		  results of the form the user has filled out.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term><command>Search</command></term>
	      <listitem>
		<para>
		  This function searches the database for any row
		  whose <varname>searchBy</varname> field matches
		  <varname>query</varname>. Once any number of records
		  are found, <command>Search</command> displays the
		  results in rows.
		</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>
	</refsect2>

	<refsect2>
	  <title>DIO Display Fields</title>
	  <para>
	    Display fields are created with the
	    <command>field</command> command of the DIODisplay object.
	    Each field is created as a new DIODisplayField object or
	    as a subclass of DIODisplayField.  The standard form
	    fields use the standard field class, while specialized
	    field types use a class with different options but still
	    supports all of the same commands and values a generic
	    field does.
	  </para>

	  <cmdsynopsis>
	    <command><replaceable>displayObject</replaceable></command>
	    <arg choice="plain">field</arg>
	    <arg
	    choice="plain"><replaceable>fieldname</replaceable></arg>
	    <group choice="opt" rep="repeat">
	      <arg choice="plain">-option</arg>
	      <arg choice="plain"><replaceable>option</replaceable></arg>
	    </group>
	  </cmdsynopsis>

	  <para>
	    These are the standard options supported by field types:
	  </para>

	  <variablelist>
	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">-formargs</arg>
		  <arg choice="plain"><replaceable>arguments</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  When a field is created, any argument which is not a
		  standard option is assumed to be an argument passed
		  to the form object when the field is shown in a
		  form.  These arguments are all appended to the
		  <varname>formargs</varname> variable.  You can use
		  this option to override or add options after the
		  initial creation of an object
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">-readonly</arg>
		  <group>
		    <arg>1</arg>
		    <arg>0</arg>
		  </group>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  If <varname>readonly</varname> is set to true, the
		  field will not display a form entry when displaying
		  in a form.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">-text</arg>
		  <arg choice="plain"><replaceable>text</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  The text displayed next to the form or view field.
		  By default, DIODisplay tries to figure out a pretty
		  way to display the field name.  This text will
		  override that default and display whatever is
		  specified.
		</para>
	      </listitem>
	    </varlistentry>

	    <varlistentry>
	      <term>
		<cmdsynopsis>
		  <arg choice="plain">-type</arg>
		  <arg choice="plain"><replaceable>fieldType</replaceable></arg>
		</cmdsynopsis>
	      </term>
	      <listitem>
		<para>
		  The type of field this is.  This type is used when
		  creating the field in the form object.
		  <option><replaceable>fieldType</replaceable></option>
		  can be any of the accepted form field types.  See
		  [FIXME - LINK DIO Field Types] for a list of types
		  available.
		</para>
	      </listitem>
	    </varlistentry>
	  </variablelist>

	  <para>
	    All other arguments, unless specified in an individual
	    field type, are passed directly to the form object when
	    the field is created.  So, you can pass
	    <option>-size</option> or <option>-maxsize</option> to
	    specify the length and maximum length of the field entry.
	    Or, if type were textarea, you could define
	    <option>-rows</option> and <option>-cols</option> to
	    specify its row and column count.
	  </para>
	</refsect2>
	<refsect2>
	  <title>DIO Display Field Types</title>
	  <para>
	    The following is a list of recognized field types by
	    DIODisplay.  Some are standard HTML form fields, and
	    others are DIODisplay fields which execute special actions
	    and functions.
	  </para>
	</refsect2>
      </refsect1>
    </refentry>
  </section>



  <section id="session_package">
    <title>Session Package</title>
    <section>
      <title>Introduction</title>
      <para>
	This is session management code.  It provides an interface
	to allow you to generate and track a browser's visit as a
	"session", giving you a unique session ID and an interface
	for storing and retrieving data for that session on the
	server.
      </para>

      <para>
	This is an alpha/beta release -- documentation is not in
	final form, but everything you need should be in this file.
      </para>

      <para>
	Using sessions and their included ability to store and
	retrieve session-related data on the server, programmers can
	generate more secure and higher-performance websites.  For
	example, hidden fields do not have to be included in forms
	(and the risk of them being manipulated by the user
	mitigated) since data that would be stored in hidden fields
	can now be stored in the session cache on the server.  Forms
	are then faster since no hidden data is transmitted --
	hidden fields must be sent twice, once in the form to the
	broswer and once in the response from it.
      </para>

      <para>
	Robust login systems, etc, can be built on top of this code.
      </para>
    </section>

    <section>
      <title>Requirements</title>


	<para>
	  Rivet.  Currently has only been tested with Postgresql.
	  All DB interfacing is done through DIO, though, so it
	  should be relatively easy to add support for other
	  databases.
	</para>
      </section>

      <section>
	<title>Preparing To Use It</title>

	<para>Create the tables in your SQL server.  With Postgres,
	  do a <command>psql www</command> or whatever DB you
	  connect as, then a backslash-i on
	  <filename>session-create.sql</filename></para>

	<para>(If you need to delete the tables, use <filename>session-drop.sql</filename>)</para>

	<para>The session code by default requires a DIO handle
	  called <varname>DIO</varname> (the name of which can be
	  overridden).  We get it by doing a</para>

<programlisting>
  RivetServerConf ChildInitScript "package require DIO"
  RivetServerConf ChildInitScript "::DIO::handle Postgresql DIO -user www"
</programlisting>

      </section>

      <section>
	<title>Example Usage</title>

	<para>In your httpd.conf, add:</para>

	<programlisting>RivetServerConf ChildInitScript "package require Session; Session SESSION"</programlisting>

	<para>
	  This tells Rivet you want to create a session object named
	  SESSION in every child process Apache creates.</para>

	<para>
	  You can configure the session at this point using numerous
	  key-value pairs (which are defined later in this doc).
	  Here's a quick example:</para>

	<programlisting>RivetServerConf ChildInitScript "package require Session; Session SESSION \
  -cookieLifetime 120 -debugMode 1"</programlisting>

	<para>
	  Turn debugging on <option>-debugMode 1</option> to figure
	  out what's going on -- it's really useful, if
	  verbose.</para>

	<para>
	  In your .rvt file, when you're generating the &lt;HEAD&gt;
	  section:
	</para>

	<programlisting>SESSION activate</programlisting>

	<para>
	  Activate handles everything for you with respect to
	  creating new sessions, and for locating, validating, and
	  updating existing sessions.  Activate will either locate
	  an existing session, or create a new one.  Sessions will
	  automatically be refreshed (their lifetimes extended) as
	  additional requests are received during the session, all
	  under the control of the key-value pairs controlling the
	  session object.
	</para>
      </section>

      <section>
	<title>Using Sessions From Your Code</title>

	<para>The main methods your code will use are:</para>

	<variablelist>
	  <varlistentry>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION</command> <command>id</command>
	      </cmdsynopsis>
	      <para>
		After doing a <command>SESSION activate</command>,
		this will return a 32-byte ASCII-encoded random
		hexadecimal string.  Every time this browser comes
		to us with a request within the timeout period, this
		same string will be returned (assuming they have
		cookies enabled).
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION</command>
		<command>is_new_session</command>
	      </cmdsynopsis>
	      <para>returns 1 if it's a new session or 0 if it has
		previously existed (i.e. it's a zero if this request
		represents a "return" or subsequent visit to a
		current session.)</para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION new_session_reason</command></cmdsynopsis>
	      <para>
		This will return why this request is the first
		request of a new session, either "no_cookie" saying
		the browser didn't give us a session cookie,
		"no_session" indicating we got a cookie but couldn't
		find it in our session table, or "timeout" where
		they had a cookie and we found the matching session
		but the session has timed out.
	      </para>
	    </listitem>
	  </varlistentry>
	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION store</command>
		<arg><replaceable>packageName</replaceable></arg>
		<arg><replaceable>key</replaceable></arg>
		<arg><replaceable>data</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Given the name of a package, a key, and some data.
		Stores the data in the rivet session cache table.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION fetch</command>
		<arg><replaceable>packageName</replaceable></arg>
		<arg><replaceable>key</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Given a package name and a key, return the data
		stored by the store method, or an empty string if
		none was set.  (Status is set to the DIO error that
		occurred, it can be fetched using the status
		method.)
	      </para>
	    </listitem>
	  </varlistentry>
	</variablelist>
      </section>

      <section>
	<title>Session Configuration Options</title>

	<para>The following key-value pairs can be specified when a
	  session object (like SESSION above) is created:</para>

	<variablelist>

	  <varlistentry>
	    <term><option>sessionLifetime</option></term>

	    <listitem>
	      <para>how many seconds the session will live for.
		7200 == 2 hours
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>sessionRefreshInterval</term>
	    <listitem>
	      <para>
		If a request is processed for a browser that
		currently has a session and this long has elapsed
		since the session update time was last updated,
		update it.  900 == 15 minutes.  so if at least 15
		minutes has elapsed and we've gotten a new request
		for a page, update the session update time,
		extending the session lifetime (sessions that are in
		use keep getting extended).
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term>cookieName</term>
	    <listitem>
	      <para></para>
	      name of the cookie stored on the user's web browser
	      default rivetSession
	    </listitem>
	  </varlistentry>

	  <varlistentry><term>dioObject</term> 
	    <listitem>
	      <para>
		The name of the DIO object we'll use to access the
		database (default DIO)
	      </para>
	    </listitem></varlistentry>

	  <varlistentry><term>gcProbability</term>
	    <listitem>
	      <para>
		The probability that garbage collection will occur
		in percent.  (default 1%, i.e. 1)</para></listitem></varlistentry>

	  <varlistentry><term>gcMaxLifetime</term>
		<listitem><para>the number of seconds after which
		data will be seen as "garbage" and cleaned up --
		defaults to 1 day (86400)</para></listitem></varlistentry>

	  <varlistentry><term>refererCheck</term>
		<listitem><para>The substring you want to check each
		HTTP referer for.  If the referer was sent by the
		browser and the substring is not found, the session
		will be deleted. (not coded yet)</para></listitem></varlistentry>

	  <varlistentry><term>entropyFile</term> <listitem><para>The
		name of a file that random binary data can be read
		from.  (<filename>/dev/urandom</filename>) Data will
		be used from this file to help generate a
		super-hard-to-guess session ID.</para></listitem></varlistentry>

	  <varlistentry><term>entropyLength</term>
		<listitem><para>The number of bytes which will be
		read from the entropy file.  If 0, the entropy file
		will not be read (default 0)</para></listitem></varlistentry>

	  <varlistentry><term>scrambleCode</term> <listitem><para>
		Set the scramble code to something unique for the
		site or your app or whatever, to slightly increase
		the unguessability of session ids (default "some
		random string")</para></listitem></varlistentry>

	  <varlistentry><term>cookieLifetime</term>
		<listitem><para>The lifetime of the cookie in
		minutes.  0 means until the browser is closed (I
		think). (default 0)</para></listitem></varlistentry>

	  <varlistentry><term>cookiePath</term> <listitem><para>The
		webserver subpath that the session cookie applies to
		(defaults to
		<filename>/</filename>)</para></listitem></varlistentry>

	  <varlistentry><term>cookieDomain</term>
	  <listitem><para>The domain to set in the session cookie
	  (FIXME - not coded yet)</para></listitem></varlistentry>

	  <varlistentry><term>cookieSecure</term>
		<listitem><para>Specifies whether the cookie should
		only be sent over secure connections, 0 = any, 1 =
		secure connections only (default
		0)</para></listitem></varlistentry>

	  <varlistentry><term>sessionTable</term>
		<listitem><para>The name of the table that session
		info will be stored in (default
		<varname>rivet_session</varname>)</para></listitem></varlistentry>

	  <varlistentry><term>sessionCacheTable</term>
		<listitem><para>The name of the table that contains
		cached session data (default
		<varname>rivet_session_cache</varname>)</para></listitem></varlistentry>

	  <varlistentry><term>debugMode</term> <listitem><para>Set
		debug mode to 1 to trace through and see the session
		object do its thing (default 0)</para></listitem></varlistentry>

	  <varlistentry><term>debugFile</term> <listitem><para>The
		file handle that debugging messages will be written
		to (default
		<varname>stdout</varname>)
	      </para>
	    </listitem>
	  </varlistentry>

	</variablelist>
      </section>

      <section>
	<title>Session Methods</title>

	<para>
	  The following methods can be invoked to find out
	  information about the current session, store and fetch
	  server data identified with this session, etc:
	</para>

	<variablelist>
	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION status</command></cmdsynopsis>
	      <para>
		Return the status of the last operation
	      </para>
	    </listitem>
	  </varlistentry>


	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION id</command></cmdsynopsis>
	      <para>
		Get the session ID of the current browser.  Returns
		an empty string if there's no session (will not
		happen is SESSION activate has been issued.)
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION new_session_reason</command>
	      </cmdsynopsis>
	      <para>
		Returns the reason why there wasn't a previous
		session, either "no_cookie" saying the browser
		didn't give us a session cookie, "no_session"
		indicating we got a cookie but couldn't find it in
		the session table, or "timeout" when we had a cookie
		and a session but the session had timed out.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION store</command>
		<arg><replaceable>packageName</replaceable></arg>
		<arg><replaceable>key</replaceable></arg>
		<arg><replaceable>data</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Given a package name, a key string, and a data
		string, store the data in the rivet session
		cache.
	      </para>
	    </listitem>
	  </varlistentry>


	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION fetch</command>
		<arg><replaceable>packageName</replaceable></arg>
		<arg><replaceable>key</replaceable></arg>
	      </cmdsynopsis>
	      <para>
		Given a package name and a key, return the data
		stored by the store method, or an empty string if
		none was set.  Status is set to the DIO error that
		occurred, it can be fetched using the status
		method.
	      </para>
	    </listitem></varlistentry>

	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION delete</command></cmdsynopsis>

	      <para>
		Given a user ID and looking at their IP address we
		inherited from the environment (thanks, Apache),
		remove them from the session table.  (the session
		table is how the server remembers stuff about
		sessions). If the session ID was not specified the
		current session is deleted.
	      </para>
	    </listitem>
	  </varlistentry>

	  <varlistentry>
	    <term></term>
	    <listitem>
	      <cmdsynopsis>
		<command>SESSION activate</command></cmdsynopsis>

	      <para>
		Find and validate the session ID if they have one.
		If they don't have one or it isn't valid (timed out,
		etc), create a session and drop a cookie on
		them.
	      </para>
	    </listitem>
	  </varlistentry></variablelist>
      </section>

      <section>
	<title>Getting Additional Randomness From The Entropy File</title>

	<programlisting>RivetServerConf ChildInitScript "Session SESSION -entropyFile /dev/urandom \
  -entropyLength 10 -debugMode 1"</programlisting>

	<para>
	  This options say we want to get randomness from an entropy
	  file (random data pseudo-device) of /dev/urandom, to get ten
	  bytes of random data from that entropy device, and to turn
	  on debug mode, which will cause the SESSION object to output
	  all manner of debugging information as it does stuff.  This
	  has been tested on FreeBSD and appears to work.
      </para>
    </section>
  </section>

  <section id="help">
    <title>Resources - How to Get Help</title>

    <section>
      <title>Mailing Lists</title>
      <para>
	The Rivet mailing list is the first place you should turn for
	help, if you haven't found the solution to your problem in the
	documentation.  Send email to
	<email>rivet-dev@tcl.apache.org</email>.  If you have a
	question, idea, or comment about the Rivet code itself, please
	send us email at <email>rivet-dev@tcl.apache.org</email>.  To
	subscribe to either list, post email to
	<email>rivet-<replaceable>list</replaceable>-subscribe@tcl.apache.org</email>,
	where <replaceable>list</replaceable> is either dev or user.
	Currently, dev is the preferred list to use.
      </para>
      <para>
	The mailing list archives are available at <ulink
	  url="http://mail-archives.apache.org/eyebrowse/SummarizeList?listId=118"/>
      </para>
    </section>

    <section>
      <title>Newsgroup</title>
      <para>
	The <ulink url="news:comp.lang.tcl"/> newsgroup is a good
	place to ask about Tcl questions in general.  Rivet developers
	also follow the newsgroup, but it's best to ask Rivet-specific
	questions on the Rivet list.
      </para>
    </section>

    <section id="websites">
      <title>Web Sites</title>

      <para>
	There are several web sites that cover Apache and Tcl
	extensively.
      </para>
      <itemizedlist>
	<listitem>
	  <para>
	    <ulink url="http://tcl.apache.org"/> is the home for the
	    Apache Tcl project.  Go there for the latest versions of
	    our software (if you aren't reading these pages off of the
	    site!).
	  </para>
	</listitem>
	<listitem>
	  <para>
	    <ulink url="http://httpd.apache.org/docs/"/> is the first
	    place to go for questions about the Apache web server.
	  </para>
	</listitem>
	<listitem>
	  <para>
	    <ulink url="http://www.tcl.tk"/> is the canonical site
	    for Tcl information.
	  </para>
	</listitem>
	<listitem>
	  <para>
	    <ulink url="http://wiki.tcl.tk"/> is the Tcl'ers Wiki, a
	    free-form place to search for answers and ask for help.
	  </para>
	</listitem>
      </itemizedlist>
    </section>

    <section>
      <title>Bug Tracking System</title>

      <para>
	Apache Rivet uses the Apache Bug Tracking system at <ulink
	  url="http://issues.apache.org/bugzilla/"></ulink>.  Here,
	you can report problems, or check and see if existing issues
	are already known and being dealt with.
      </para>
    </section>

    <section>
      <title>IRC</title>

      <para>
        Occasionally, someone from the Rivet team is on IRC at
        irc.freenode.net, channel #tcl.
      </para>
    </section>

    <section>
      <title>Editing Rivet Template Files</title>
      <para>
	Rivet makes available code for two popular editors,
	<application>emacs</application> and
	<application>vim</application> to facilitate the editing of
	Rivet template files.  The key concept is that the editor is
	aware of the &lt;? and ?&gt; tags and switches back and forth
	between Tcl and HTML modes as the cursor moves.  These files,
	<filename>two-mode-mode.el</filename> and
	<filename>rvt.vim</filename> are available in the
	<filename>contrib/</filename> directory.
      </para>
    </section>


  </section>

  <section id="internals">
    <title>Rivet Internals</title>
    <para>
      This section easily falls out of date, as new code is added, old
      code is removed, and changes are made.  The best place to look
      is the source code itself.  If you are interested in the changes
      themselves, <command>cvs</command> can provide you with
      information about what has been happening with the code.
    </para>
    <section>
      <title>Initialization</title>
      <para>
	When Apache is started, (or when child Apache processes are
	started if a threaded Tcl is used),
	<function>Rivet_InitTclStuff</function> is called, which
	creates a new interpreter, or one interpreter per virtual
	host, depending on the configuration. It also initializes
	various things, like the <structname>RivetChan</structname>
	channel system, creates the Rivet-specific Tcl commands, and
	executes Rivet's <filename>init.tcl</filename>.  The caching
	system is also set up, and if there is a
	<command>GlobalInitScript</command>, it is run.
      </para>
    </section>
    <section>
      <title>RivetChan</title>
      <para>
	The <structname>RivetChan</structname> system was created in
	order to have an actual Tcl channel that we could redirect
	standard output to.  This lets us use, for instance, the
	regular <command>puts</command> command in .rvt pages.  It
	works by creating a channel that buffers output, and, at
	predetermined times, passes it on to Apache's IO system.
	Tcl's regular standard output is replaced with an instance of
	this channel type, so that, by default, output will go to the
	web page.
      </para>
    </section>
    <section>
      <title>The <command>global</command> Command</title>
      <para>
	Rivet aims to run standard Tcl code with as few surprises as
	possible.  At times this involves some compromises - in this
	case regarding the <command>global</command> command.  The
	problem is that the command will create truly global
	variables.  If the user is just cut'n'pasting some Tcl code
	into Rivet, they most likely just want to be able to share the
	variable in question with other procs, and don't really care
	if the variable is actually persistant between pages.  The
	solution we have created is to create a proc
	<command>::request::global</command> that takes the place of
	the <command>global</command> command in Rivet templates.  If
	you really need a true global variable, use either
	<command>::global</command> or add the :: namespace qualifier
	to variables you wish to make global.
      </para>
    </section>
    <section>
      <title>Page Parsing, Execution and Caching</title>
      <para>
	When a Rivet page is requested, it is transformed into an
	ordinary Tcl script by parsing the file for the &lt;? ?&gt;
	processing instruction tags.  Everything outside these tags
	becomes a large <command>puts</command> statement, and
	everything inside them remains Tcl code.
      </para>
      <para>
	Each .rvt file is evaluated in its own
	<constant>::request</constant> namespace, so that it is not
	necessary to create and tear down interpreters after each
	page.  By running in its own namespace, though, each page will
	not run afoul of local variables created by other scripts,
	because they will be deleted automatically when the namespace
	goes away after Apache finishes handling the request.
      <note>
	    One current problem with this system is that while
	    variables are garbage collected, file handles are not, so
	    that it is very important that Rivet script authors make
	    sure to close all the files they open.
      </note>
      </para>
      <para>
	After a script has been loaded and parsed into it's "pure Tcl"
	form, it is also cached, so that it may be used in the future
	without having to reload it (and re-parse it) from the disk.
	The number of scripts stored in memory is configurable.  This
	feature can significantly improve performance.
      </para>
    </section>

    <section>
      <title>Debugging Rivet and Apache</title>
      <para>
	If you are interested in hacking on Rivet, you're welcome to
	contribute!  Invariably, when working with code, things go
	wrong, and it's necessary to do some debugging.  In a server
	environment like Apache, it can be a bit more difficult to
	find the right way to do this.  Here are some techniques to
	try.
      </para>
      <para>
	The first thing you should know is that Apache can be launched
	as a <emphasis>single process</emphasis> with the
	<option>-X</option> argument:</para>
      <programlisting>httpd -X</programlisting>.
      <para>
	On Linux, one of the first things to try is the system call
	tracer, <command>strace</command>.  You don't even have to
	recompile Rivet or Apache for this to work.
      </para>

      <programlisting>strace -o /tmp/outputfile -S 1000 httpd -X</programlisting>

      <para>This command will run httpd in the system call tracer,
	which leaves its output (there is potentially a lot of it) in
	<filename>/tmp/outputfile</filename>.  The <option>-S</option>
	option tells <command></command>strace to only record the
	first 1000 bytes of a syscall.  Some calls such as
	<function>write</function> can potentially be much longer than
	this, so you may want to increase this number.  The results
	are a list of all the system calls made by the program.  You
	want to look at the end, where the failure presumably occured,
	to see if you can find anything that looks like an error.  If
	you're not sure what to make of the results, you can always
	ask on the Rivet development mailing list.
      </para>

      <para>
	If <command>strace</command> (or its equivalent on your
	operating system) doesn't answer your question, it may be time
	to debug Apache and Rivet.  To do this, you will need to run
	the <command>./configure.tcl</command> script with the
	<option>-enable-symbols</option> option, and recompile.
      </para>
      <para>
	Since it's easier to debug a single process, we'll still run
	Apache in single process mode with -X:
      </para>

      <programlisting>
@ashland [~] $ gdb /usr/sbin/apache.dbg
GNU gdb 5.3-debian
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-linux"...
(gdb) run -X
Starting program: /usr/sbin/apache.dbg -X
[New Thread 16384 (LWP 13598)]
.
.
.
      </programlisting>

      <para>
	When your apache session is up and running, you can request a
	web page with the browser, and see where things go wrong (if
	you are dealing with a crash, for instance).  A helpful
	<command>gdb</command> tutorial is available here: <ulink
	  url="http://www.delorie.com/gnu/docs/gdb/gdb_toc.html"></ulink>
      </para>

    </section>

  </section>
  <section id="upgrading">
    <title>Upgrading from mod_dtcl or NeoWebScript</title>
    <para>
      Rivet is a break from the past, in that we, the authors, have
      attempted to take what we like best about our past efforts, and
      leave out or change things we no longer care for.  Backwards
      compatibility was not a primary goal when creating Rivet, but we
      do provide this information which may be of use to those wishing
      to upgrade from mod_dtcl or NWS installations.
    </para>
    <section>
      <title>mod_dtcl</title>
      <para>
	Rivet was originally based on the dtcl code, but it has
	changed (improved!) quite a bit.  The concepts remain the
	same, but many of the commands have changed.
      </para>
    </section>
    <section>
      <title>NeoWebScript</title>
      <para>TODO</para>
    </section>
  </section>
</article>