Browse Source

Plan 9 from Bell Labs 2006-01-28

David du Colombier 17 years ago
parent
commit
cea4c6c1a6
76 changed files with 7134 additions and 1017 deletions
  1. 78 43
      dist/replica/_plan9.db
  2. 76 39
      dist/replica/plan9.db
  3. 77 0
      dist/replica/plan9.log
  4. 1 2
      rc/bin/9fs
  5. 5 2
      sys/doc/8½/8½.ms
  6. 1 0
      sys/doc/9.ms
  7. 4 1
      sys/doc/acid.ms
  8. 1 0
      sys/doc/acidpaper.ms
  9. 17 5
      sys/doc/acme/acme.ms
  10. 1 0
      sys/doc/ape.ms
  11. 101 0
      sys/doc/asm.ms
  12. 4 1
      sys/doc/auth.ms
  13. 1 0
      sys/doc/comp.ms
  14. 1 0
      sys/doc/compiler.ms
  15. 46 31
      sys/doc/contents.ms
  16. 1 0
      sys/doc/fossil.ms
  17. 1 0
      sys/doc/fs/p0
  18. 1 0
      sys/doc/il/il.ms
  19. 1 0
      sys/doc/lexnames.ms
  20. 1 0
      sys/doc/libmach.ms
  21. 1 0
      sys/doc/mk.ms
  22. 92 204
      sys/doc/mkfile
  23. 1 0
      sys/doc/mkfiles.ms
  24. 1 0
      sys/doc/names.ms
  25. 1 0
      sys/doc/net/net.ms
  26. 3 0
      sys/doc/plumb.ms
  27. 1 0
      sys/doc/port.ms
  28. 1 0
      sys/doc/prog4.ms
  29. 1 0
      sys/doc/rc.ms
  30. 1 0
      sys/doc/release3.ms
  31. 1 0
      sys/doc/release4.ms
  32. 9 4
      sys/doc/sam/sam.ms
  33. 1 0
      sys/doc/sleep.ms
  34. 1 0
      sys/doc/spin.ms
  35. 1 0
      sys/doc/utf.ms
  36. 94 0
      sys/lib/tmac/tmac.html
  37. 7 2
      sys/lib/tmac/tmac.s
  38. 119 0
      sys/man/1/htmlroff
  39. 6 0
      sys/man/1/tcs
  40. 358 0
      sys/man/6/htmlroff
  41. 105 0
      sys/man/6/mhtml
  42. 148 0
      sys/src/cmd/htmlroff/a.h
  43. 116 0
      sys/src/cmd/htmlroff/char.c
  44. 287 0
      sys/src/cmd/htmlroff/html.c
  45. 241 0
      sys/src/cmd/htmlroff/input.c
  46. 72 0
      sys/src/cmd/htmlroff/main.c
  47. 38 0
      sys/src/cmd/htmlroff/mkfile
  48. 750 0
      sys/src/cmd/htmlroff/roff.c
  49. 186 0
      sys/src/cmd/htmlroff/t1.c
  50. 140 0
      sys/src/cmd/htmlroff/t10.c
  51. 107 0
      sys/src/cmd/htmlroff/t11.c
  52. 67 0
      sys/src/cmd/htmlroff/t12.c
  53. 17 0
      sys/src/cmd/htmlroff/t13.c
  54. 33 0
      sys/src/cmd/htmlroff/t14.c
  55. 13 0
      sys/src/cmd/htmlroff/t15.c
  56. 156 0
      sys/src/cmd/htmlroff/t16.c
  57. 131 0
      sys/src/cmd/htmlroff/t17.c
  58. 68 0
      sys/src/cmd/htmlroff/t18.c
  59. 142 0
      sys/src/cmd/htmlroff/t19.c
  60. 274 0
      sys/src/cmd/htmlroff/t2.c
  61. 79 0
      sys/src/cmd/htmlroff/t20.c
  62. 49 0
      sys/src/cmd/htmlroff/t3.c
  63. 142 0
      sys/src/cmd/htmlroff/t4.c
  64. 110 0
      sys/src/cmd/htmlroff/t5.c
  65. 74 0
      sys/src/cmd/htmlroff/t6.c
  66. 543 0
      sys/src/cmd/htmlroff/t7.c
  67. 449 0
      sys/src/cmd/htmlroff/t8.c
  68. 6 0
      sys/src/cmd/htmlroff/t9.c
  69. 123 0
      sys/src/cmd/htmlroff/util.c
  70. 275 0
      sys/src/cmd/tcs/8859.h
  71. 0 27
      sys/src/cmd/tcs/cyrillic.h
  72. 1 1
      sys/src/cmd/tcs/html.c
  73. 304 0
      sys/src/cmd/tcs/misc.h
  74. 3 0
      sys/src/cmd/tcs/mkfile
  75. 737 0
      sys/src/cmd/tcs/ms.h
  76. 29 655
      sys/src/cmd/tcs/tcs.c

+ 78 - 43
dist/replica/_plan9.db

@@ -273,6 +273,7 @@
 386/bin/hoc - 775 sys sys 1135570817 99860
 386/bin/html2ms - 775 sys sys 1135570817 66078
 386/bin/htmlfmt - 775 sys sys 1135570817 160781
+386/bin/htmlroff - 775 sys sys 1138406772 148065
 386/bin/ico - 775 sys sys 1135570818 161740
 386/bin/iconv - 775 sys sys 1135570818 113279
 386/bin/idiff - 775 sys sys 1135570818 76099
@@ -417,7 +418,7 @@
 386/bin/tail - 775 sys sys 1135570847 66163
 386/bin/tar - 775 sys sys 1135570847 93423
 386/bin/tbl - 775 sys sys 1131302431 113308
-386/bin/tcs - 775 sys sys 1130384340 256598
+386/bin/tcs - 775 sys sys 1138393253 309719
 386/bin/tee - 775 sys sys 1130384340 38446
 386/bin/telco - 775 sys sys 1134389878 103347
 386/bin/telnet - 775 sys sys 1135570847 80400
@@ -5391,7 +5392,7 @@ power/mkfile - 664 sys sys 948141304 46
 rc - 20000000775 sys sys 944959447 0
 rc/bin - 20000000775 sys sys 1018637942 0
 rc/bin/9fat: - 775 sys sys 1133179689 367
-rc/bin/9fs - 775 sys sys 1138240042 1027
+rc/bin/9fs - 775 sys sys 1138385380 986
 rc/bin/B - 775 sys sys 945617206 645
 rc/bin/C - 775 sys sys 1127395076 855
 rc/bin/Kill - 775 sys sys 1018637942 115
@@ -5592,48 +5593,48 @@ sparc64/mkfile - 664 sys sys 1114458667 46
 sys - 20000000775 sys sys 952648870 0
 sys/doc - 20000000775 sys sys 1018471272 0
 sys/doc/8½ - 20000000775 sys sys 945616779 0
-sys/doc/8½/8½.ms - 664 sys sys 1020895859 31593
+sys/doc/8½/8½.ms - 664 sys sys 1138396551 31721
 sys/doc/8½/8½.ps - 664 sys sys 1020895860 797150
 sys/doc/8½/fig1.ps - 664 sys sys 1020895859 473747
 sys/doc/8½/mkfile - 664 sys sys 1020895860 215
-sys/doc/9.ms - 664 sys sys 953237044 84632
+sys/doc/9.ms - 664 sys sys 1138396402 84662
 sys/doc/9.ps - 664 sys sys 960837924 508340
-sys/doc/acid.ms - 664 sys sys 1127411211 65062
+sys/doc/acid.ms - 664 sys sys 1138396403 65160
 sys/doc/acid.ps - 664 sys sys 1015012454 426359
-sys/doc/acidpaper.ms - 664 sys sys 952880777 44805
+sys/doc/acidpaper.ms - 664 sys sys 1138396403 44851
 sys/doc/acidpaper.ps - 664 sys sys 960837913 359639
 sys/doc/acme - 20000000775 sys sys 945616779 0
 sys/doc/acme/acme.fig1 - 664 sys sys 944959632 164559
 sys/doc/acme/acme.fig2 - 664 sys sys 944959632 56026
-sys/doc/acme/acme.ms - 664 sys sys 952880782 49851
+sys/doc/acme/acme.ms - 664 sys sys 1138396552 50028
 sys/doc/acme/acme.pdf - 664 sys sys 1020384351 117006
 sys/doc/acme/acme.ps - 664 sys sys 960837907 611301
 sys/doc/acme/bs - 664 sys sys 944959634 556
 sys/doc/acme/mkfile - 664 sys sys 961259926 304
-sys/doc/ape.ms - 664 sys sys 953344517 12595
+sys/doc/ape.ms - 664 sys sys 1138396403 12637
 sys/doc/ape.ps - 664 sys sys 960837914 258779
-sys/doc/asm.ms - 664 sys sys 958247686 28542
+sys/doc/asm.ms - 664 sys sys 1138396403 31516
 sys/doc/asm.ps - 664 sys sys 960837915 322051
-sys/doc/auth.ms - 664 sys sys 1021579975 66803
+sys/doc/auth.ms - 664 sys sys 1138396404 66854
 sys/doc/auth.ps - 664 sys sys 1021579976 451672
 sys/doc/cleanps - 775 sys sys 961259933 184
 sys/doc/colophon.ps - 664 sys sys 960837922 214122
-sys/doc/comp.ms - 664 sys sys 954266992 37792
+sys/doc/comp.ms - 664 sys sys 1138396405 37832
 sys/doc/comp.ps - 664 sys sys 960837915 345786
-sys/doc/compiler.ms - 664 sys sys 1067721142 30279
+sys/doc/compiler.ms - 664 sys sys 1138396405 30305
 sys/doc/compiler.ps - 664 sys sys 1091459054 309735
-sys/doc/contents.ms - 664 sys sys 1019916701 4920
+sys/doc/contents.ms - 664 sys sys 1138396405 5409
 sys/doc/contents.ps - 664 sys sys 1019916845 232629
 sys/doc/docfonts - 664 sys sys 1038117516 208
 sys/doc/fonts - 664 sys sys 944959649 137
-sys/doc/fossil.ms - 664 sys sys 1063856349 31400
+sys/doc/fossil.ms - 664 sys sys 1138396406 31439
 sys/doc/fossil.pdf - 664 sys sys 1042123169 63200
 sys/doc/fossil.ps - 664 sys sys 1135487951 313552
 sys/doc/fs - 20000000775 sys sys 945616779 0
 sys/doc/fs/fs.pdf - 664 sys sys 1020384351 47177
 sys/doc/fs/fs.ps - 664 sys sys 960837905 276918
 sys/doc/fs/mkfile - 664 sys sys 961259926 282
-sys/doc/fs/p0 - 664 sys sys 953844580 652
+sys/doc/fs/p0 - 664 sys sys 1138396562 682
 sys/doc/fs/p1 - 664 sys sys 953844581 989
 sys/doc/fs/p2 - 664 sys sys 953844581 3749
 sys/doc/fs/p3 - 664 sys sys 944959592 1475
@@ -5644,7 +5645,7 @@ sys/doc/fs/p7 - 664 sys sys 953844581 958
 sys/doc/fs/p8 - 664 sys sys 953844574 881
 sys/doc/fs/xx - 664 sys sys 944959592 65957
 sys/doc/il - 20000000775 sys sys 945616779 0
-sys/doc/il/il.ms - 664 sys sys 952880783 11367
+sys/doc/il/il.ms - 664 sys sys 1138396552 11390
 sys/doc/il/il.pdf - 664 sys sys 1020384351 44630
 sys/doc/il/il.ps - 664 sys sys 960837905 258028
 sys/doc/il/mkfile - 664 sys sys 961259927 214
@@ -5653,42 +5654,42 @@ sys/doc/il/transition.fig - 664 sys sys 944959591 15431
 sys/doc/il/transition.pic - 664 sys sys 944959591 11912
 sys/doc/il/xx - 664 sys sys 944959591 48924
 sys/doc/index.htm - 664 sys sys 1019916696 6906
-sys/doc/lexnames.ms - 664 sys sys 954383595 34046
+sys/doc/lexnames.ms - 664 sys sys 1138396406 34107
 sys/doc/lexnames.ps - 664 sys sys 960837909 335546
-sys/doc/libmach.ms - 664 sys sys 1021579974 24145
+sys/doc/libmach.ms - 664 sys sys 1138396406 24212
 sys/doc/libmach.ps - 664 sys sys 960837916 291283
 sys/doc/lp.ms - 664 sys sys 954614673 22366
 sys/doc/lp.ps - 664 sys sys 960837917 294399
-sys/doc/mk.ms - 664 sys sys 952880779 34413
+sys/doc/mk.ms - 664 sys sys 1138396445 34456
 sys/doc/mk.ps - 664 sys sys 960837917 329779
-sys/doc/mkfile - 664 sys sys 1091459055 4411
-sys/doc/mkfiles.ms - 664 sys sys 952880779 17888
+sys/doc/mkfile - 664 sys sys 1138396461 2393
+sys/doc/mkfiles.ms - 664 sys sys 1138396445 17910
 sys/doc/mkfiles.ps - 664 sys sys 960837918 269496
-sys/doc/names.ms - 664 sys sys 954269607 22103
+sys/doc/names.ms - 664 sys sys 1138396445 22143
 sys/doc/names.ps - 664 sys sys 960837918 288716
 sys/doc/net - 20000000775 sys sys 954033300 0
 sys/doc/net/mkfile - 664 sys sys 961259927 345
-sys/doc/net/net.ms - 664 sys sys 952880783 41191
+sys/doc/net/net.ms - 664 sys sys 1138396534 41237
 sys/doc/net/net.pdf - 664 sys sys 1020384351 82603
 sys/doc/net/net.ps - 664 sys sys 960837908 350053
 sys/doc/net/tree - 664 sys sys 944959636 866
 sys/doc/net/tree.pout - 664 sys sys 944959636 1755
 sys/doc/network.art - 664 sys sys 944959651 2260
 sys/doc/network.pic - 664 sys sys 944959651 4124
-sys/doc/plumb.ms - 664 sys sys 954383596 53250
+sys/doc/plumb.ms - 664 sys sys 1138396446 53312
 sys/doc/plumb.ps - 664 sys sys 960837910 391830
-sys/doc/port.ms - 664 sys sys 1020111393 16694
+sys/doc/port.ms - 664 sys sys 1138396446 16719
 sys/doc/port.ps - 664 sys sys 1020111394 268901
 sys/doc/preamble - 664 sys sys 961259497 203475
 sys/doc/prfile - 775 sys sys 944959668 3782
-sys/doc/prog4.ms - 664 sys sys 1019932830 16485
+sys/doc/prog4.ms - 664 sys sys 1138396446 16563
 sys/doc/prog4.ps - 664 sys sys 1019932831 271581
 sys/doc/ps - 664 sys sys 944959649 1739
-sys/doc/rc.ms - 664 sys sys 1063856321 34373
+sys/doc/rc.ms - 664 sys sys 1138396446 34404
 sys/doc/rc.ps - 664 sys sys 960837920 337955
-sys/doc/release3.ms - 664 sys sys 961261276 5492
+sys/doc/release3.ms - 664 sys sys 1138396446 5538
 sys/doc/release3.ps - 664 sys sys 961261277 230682
-sys/doc/release4.ms - 664 sys sys 1063856338 5160
+sys/doc/release4.ms - 664 sys sys 1138396446 5207
 sys/doc/release4.ps - 664 sys sys 1091459052 230868
 sys/doc/sam - 20000000775 sys sys 945617037 0
 sys/doc/sam/fig1.bm - 464 sys sys 944959645 42200
@@ -5704,20 +5705,20 @@ sys/doc/sam/fig6.pic - 464 sys sys 944959644 1105
 sys/doc/sam/fig7.pic - 464 sys sys 944959644 258
 sys/doc/sam/mkfile - 664 sys sys 961259927 574
 sys/doc/sam/refs - 464 sys sys 944959644 2652
-sys/doc/sam/sam.ms - 464 sys sys 954266468 94536
+sys/doc/sam/sam.ms - 464 sys sys 1138396552 94640
 sys/doc/sam/sam.pdf - 664 sys sys 1020384352 156123
 sys/doc/sam/sam.ps - 664 sys sys 960837910 707546
 sys/doc/sam/sam.tut - 464 sys sys 944959644 40481
-sys/doc/sleep.ms - 664 sys sys 953237030 15206
+sys/doc/sleep.ms - 664 sys sys 1138396447 15272
 sys/doc/sleep.ps - 664 sys sys 960837920 263882
-sys/doc/spin.ms - 664 sys sys 953344522 67475
+sys/doc/spin.ms - 664 sys sys 1138396447 67493
 sys/doc/spin.ps - 664 sys sys 960837923 443064
 sys/doc/title - 664 sys sys 1018974170 740
 sys/doc/title.ps - 664 sys sys 1018974170 214289
 sys/doc/trademarks.ps - 664 sys sys 960837912 217896
 sys/doc/troff.ms - 664 sys sys 953237047 120683
 sys/doc/troff.ps - 664 sys sys 1091459051 782310
-sys/doc/utf.ms - 664 sys sys 952880781 41659
+sys/doc/utf.ms - 664 sys sys 1138396447 41735
 sys/doc/utf.ps - 664 sys sys 960837922 363085
 sys/doc/venti - 20000000775 sys sys 1019852318 0
 sys/doc/venti/Block.gif - 664 sys sys 1019852315 3292
@@ -7036,6 +7037,7 @@ sys/lib/tmac/tmac.antimes - 664 sys sys 964454718 7809
 sys/lib/tmac/tmac.bits - 664 sys sys 944956202 1089
 sys/lib/tmac/tmac.cs - 664 sys sys 1112039298 21324
 sys/lib/tmac/tmac.e - 664 sys sys 964454711 11992
+sys/lib/tmac/tmac.html - 664 sys sys 1138396384 1950
 sys/lib/tmac/tmac.jsdisp - 664 sys sys 944956203 828
 sys/lib/tmac/tmac.m - 664 sys sys 944956203 87
 sys/lib/tmac/tmac.mcs - 664 sys sys 955115425 43067
@@ -7045,7 +7047,7 @@ sys/lib/tmac/tmac.pictures - 664 sys sys 944956203 4320
 sys/lib/tmac/tmac.psychrefs - 664 sys sys 944956203 608
 sys/lib/tmac/tmac.ptx - 664 sys sys 944956203 330
 sys/lib/tmac/tmac.rscover - 664 sys sys 944956203 2070
-sys/lib/tmac/tmac.s - 664 sys sys 1127393909 23027
+sys/lib/tmac/tmac.s - 664 sys sys 1138396381 23086
 sys/lib/tmac/tmac.scover - 664 sys sys 944956204 4616
 sys/lib/tmac/tmac.sdisp - 664 sys sys 944956204 864
 sys/lib/tmac/tmac.skeep - 664 sys sys 944956204 1346
@@ -7294,6 +7296,7 @@ sys/man/1/gzip - 664 sys sys 1124839836 3226
 sys/man/1/hget - 664 sys sys 1067722859 1483
 sys/man/1/history - 664 sys sys 1109685635 1709
 sys/man/1/hoc - 664 sys sys 1136378274 2357
+sys/man/1/htmlroff - 644 sys sys 1138396051 1831
 sys/man/1/idiff - 664 sys sys 1113743324 914
 sys/man/1/join - 664 sys sys 1113743324 2561
 sys/man/1/jpg - 664 sys sys 1113743325 4842
@@ -7360,7 +7363,7 @@ sys/man/1/syscall - 664 sys sys 1016466457 1439
 sys/man/1/tail - 664 sys sys 1113743327 1413
 sys/man/1/tar - 664 sys sys 1131884436 3439
 sys/man/1/tbl - 664 sys sys 944959674 4308
-sys/man/1/tcs - 664 sys sys 952627441 2575
+sys/man/1/tcs - 664 sys sys 1138383991 2682
 sys/man/1/tee - 664 sys sys 969499886 351
 sys/man/1/tel - 664 sys sys 1045501423 941
 sys/man/1/test - 664 sys sys 1079372544 3535
@@ -7407,7 +7410,7 @@ sys/man/2/auth - 664 sys sys 1017423719 7539
 sys/man/2/authsrv - 664 sys sys 1055734550 4145
 sys/man/2/bin - 664 sys sys 985023077 1880
 sys/man/2/bind - 664 sys sys 1015091518 4685
-sys/man/2/bio - 664 sys sys 1017423720 6538
+sys/man/2/bio - 664 sys sys 1138335268 6523
 sys/man/2/blowfish - 664 sys sys 1032058672 1280
 sys/man/2/brk - 664 sys sys 944959694 1179
 sys/man/2/cachechars - 664 sys sys 1082222350 7061
@@ -7637,11 +7640,13 @@ sys/man/6/authsrv - 664 sys sys 1128483124 13304
 sys/man/6/color - 664 sys sys 988225304 5181
 sys/man/6/face - 664 sys sys 1062505426 2846
 sys/man/6/font - 664 sys sys 1077594184 2528
+sys/man/6/htmlroff - 644 sys sys 1138396325 6608
 sys/man/6/image - 664 sys sys 988225304 6209
 sys/man/6/keyboard - 664 sys sys 1079575918 4418
 sys/man/6/keys.who - 664 sys sys 1110641163 775
 sys/man/6/man - 664 sys sys 944959678 4961
 sys/man/6/map - 664 sys sys 944959678 1892
+sys/man/6/mhtml - 644 sys sys 1138396055 1710
 sys/man/6/mpictures - 664 sys sys 944959678 2899
 sys/man/6/ms - 664 sys sys 958249504 6815
 sys/man/6/namespace - 664 sys sys 1048637182 1576
@@ -12228,6 +12233,35 @@ sys/src/cmd/htmlfmt/html.c - 664 sys sys 1060876449 6032
 sys/src/cmd/htmlfmt/main.c - 664 sys sys 1034015651 1108
 sys/src/cmd/htmlfmt/mkfile - 664 sys sys 1034015650 297
 sys/src/cmd/htmlfmt/util.c - 664 sys sys 1015364025 1765
+sys/src/cmd/htmlroff - 20000000775 sys sys 1138396082 0
+sys/src/cmd/htmlroff/a.h - 664 sys sys 1138396079 3200
+sys/src/cmd/htmlroff/char.c - 664 sys sys 1138396079 2178
+sys/src/cmd/htmlroff/html.c - 664 sys sys 1138396079 3991
+sys/src/cmd/htmlroff/input.c - 664 sys sys 1138396079 3147
+sys/src/cmd/htmlroff/main.c - 664 sys sys 1138396080 1065
+sys/src/cmd/htmlroff/mkfile - 664 sys sys 1138396082 330
+sys/src/cmd/htmlroff/roff.c - 664 sys sys 1138396080 10842
+sys/src/cmd/htmlroff/t1.c - 664 sys sys 1138396080 2816
+sys/src/cmd/htmlroff/t10.c - 664 sys sys 1138396080 1911
+sys/src/cmd/htmlroff/t11.c - 664 sys sys 1138396080 1200
+sys/src/cmd/htmlroff/t12.c - 664 sys sys 1138396080 600
+sys/src/cmd/htmlroff/t13.c - 664 sys sys 1138396080 210
+sys/src/cmd/htmlroff/t14.c - 664 sys sys 1138396080 561
+sys/src/cmd/htmlroff/t15.c - 664 sys sys 1138396080 138
+sys/src/cmd/htmlroff/t16.c - 664 sys sys 1138396080 2270
+sys/src/cmd/htmlroff/t17.c - 664 sys sys 1138396081 1711
+sys/src/cmd/htmlroff/t18.c - 664 sys sys 1138396081 1125
+sys/src/cmd/htmlroff/t19.c - 664 sys sys 1138396081 2353
+sys/src/cmd/htmlroff/t2.c - 664 sys sys 1138396081 4079
+sys/src/cmd/htmlroff/t20.c - 664 sys sys 1138396081 1025
+sys/src/cmd/htmlroff/t3.c - 664 sys sys 1138396081 851
+sys/src/cmd/htmlroff/t4.c - 664 sys sys 1138396081 1974
+sys/src/cmd/htmlroff/t5.c - 664 sys sys 1138396081 1749
+sys/src/cmd/htmlroff/t6.c - 664 sys sys 1138396081 1135
+sys/src/cmd/htmlroff/t7.c - 664 sys sys 1138396082 8626
+sys/src/cmd/htmlroff/t8.c - 664 sys sys 1138396082 6245
+sys/src/cmd/htmlroff/t9.c - 664 sys sys 1138396082 47
+sys/src/cmd/htmlroff/util.c - 664 sys sys 1138396082 1615
 sys/src/cmd/iconv.c - 664 sys sys 1039753035 1801
 sys/src/cmd/idiff.c - 664 sys sys 1014926695 6896
 sys/src/cmd/import.c - 664 sys sys 1133180705 7028
@@ -13299,6 +13333,7 @@ sys/src/cmd/tbl/tt.c - 664 sys sys 944961244 1708
 sys/src/cmd/tbl/tu.c - 664 sys sys 944961244 4817
 sys/src/cmd/tbl/tv.c - 664 sys sys 944961244 3329
 sys/src/cmd/tcs - 20000000775 sys sys 954034511 0
+sys/src/cmd/tcs/8859.h - 644 sys sys 1138382778 16466
 sys/src/cmd/tcs/big5.c - 664 sys sys 944961288 99606
 sys/src/cmd/tcs/big5.h - 664 sys sys 944961287 112
 sys/src/cmd/tcs/conv.h - 664 sys sys 1135487940 941
@@ -13306,7 +13341,7 @@ sys/src/cmd/tcs/conv_big5.c - 664 sys sys 944961288 2821
 sys/src/cmd/tcs/conv_gb.c - 664 sys sys 944961287 2210
 sys/src/cmd/tcs/conv_jis.c - 664 sys sys 944961289 10998
 sys/src/cmd/tcs/conv_ksc.c - 664 sys sys 944961288 2716
-sys/src/cmd/tcs/cyrillic.h - 664 sys sys 944961287 9508
+sys/src/cmd/tcs/cyrillic.h - 664 sys sys 1138382779 7921
 sys/src/cmd/tcs/desc.latin - 664 sys sys 944961287 20189
 sys/src/cmd/tcs/ex2.utf - 664 sys sys 944961288 14431
 sys/src/cmd/tcs/ex3.utf - 664 sys sys 944961288 807
@@ -13330,7 +13365,7 @@ sys/src/cmd/tcs/font/qbits.c - 664 sys sys 944961251 2037
 sys/src/cmd/tcs/gb.c - 664 sys sys 944961288 62707
 sys/src/cmd/tcs/gb.h - 664 sys sys 944961287 183
 sys/src/cmd/tcs/hdr.h - 664 sys sys 944961287 1213
-sys/src/cmd/tcs/html.c - 664 sys sys 1135958471 5247
+sys/src/cmd/tcs/html.c - 664 sys sys 1138381110 5244
 sys/src/cmd/tcs/jis.h - 664 sys sys 944961287 2873
 sys/src/cmd/tcs/ksc.c - 664 sys sys 944961289 72413
 sys/src/cmd/tcs/ksc.h - 664 sys sys 944961287 112
@@ -13338,9 +13373,11 @@ sys/src/cmd/tcs/kuten208.c - 664 sys sys 948046995 59960
 sys/src/cmd/tcs/kuten208.h - 664 sys sys 944961287 94
 sys/src/cmd/tcs/kuten212.c - 664 sys sys 944961289 55407
 sys/src/cmd/tcs/kuten212.h - 664 sys sys 944961287 94
-sys/src/cmd/tcs/mkfile - 664 sys sys 1135487940 542
+sys/src/cmd/tcs/misc.h - 644 sys sys 1138382780 19274
+sys/src/cmd/tcs/mkfile - 664 sys sys 1138382781 591
+sys/src/cmd/tcs/ms.h - 644 sys sys 1138382780 44069
 sys/src/cmd/tcs/plan9.h - 664 sys sys 944961287 751
-sys/src/cmd/tcs/tcs.c - 664 sys sys 1135487940 54089
+sys/src/cmd/tcs/tcs.c - 664 sys sys 1138382781 15489
 sys/src/cmd/tcs/utf.c - 664 sys sys 1125501123 7962
 sys/src/cmd/tee.c - 664 sys sys 954970286 1062
 sys/src/cmd/telco - 20000000775 sys sys 1015701205 0
@@ -13935,7 +13972,7 @@ sys/src/cmd/upas/ml/mlmgr.c - 664 sys sys 1045505888 2332
 sys/src/cmd/upas/ml/mlowner.c - 664 sys sys 1015096763 1142
 sys/src/cmd/upas/ned - 20000000775 sys sys 1015013194 0
 sys/src/cmd/upas/ned/mkfile - 664 sys sys 1060041738 233
-sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1136911937 44584
+sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1138335303 44583
 sys/src/cmd/upas/pop3 - 20000000775 sys sys 1015009816 0
 sys/src/cmd/upas/pop3/mkfile - 664 sys sys 1064589604 186
 sys/src/cmd/upas/pop3/pop3.c - 664 sys sys 1115039848 14327
@@ -15540,5 +15577,3 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
-sys/man/2/bio - 664 sys sys 1138335268 6523
-sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1138335303 44583

+ 76 - 39
dist/replica/plan9.db

@@ -273,6 +273,7 @@
 386/bin/hoc - 775 sys sys 1135570817 99860
 386/bin/html2ms - 775 sys sys 1135570817 66078
 386/bin/htmlfmt - 775 sys sys 1135570817 160781
+386/bin/htmlroff - 775 sys sys 1138406772 148065
 386/bin/ico - 775 sys sys 1135570818 161740
 386/bin/iconv - 775 sys sys 1135570818 113279
 386/bin/idiff - 775 sys sys 1135570818 76099
@@ -417,7 +418,7 @@
 386/bin/tail - 775 sys sys 1135570847 66163
 386/bin/tar - 775 sys sys 1135570847 93423
 386/bin/tbl - 775 sys sys 1131302431 113308
-386/bin/tcs - 775 sys sys 1130384340 256598
+386/bin/tcs - 775 sys sys 1138393253 309719
 386/bin/tee - 775 sys sys 1130384340 38446
 386/bin/telco - 775 sys sys 1134389878 103347
 386/bin/telnet - 775 sys sys 1135570847 80400
@@ -5391,7 +5392,7 @@ power/mkfile - 664 sys sys 948141304 46
 rc - 20000000775 sys sys 944959447 0
 rc/bin - 20000000775 sys sys 1018637942 0
 rc/bin/9fat: - 775 sys sys 1133179689 367
-rc/bin/9fs - 775 sys sys 1138240042 1027
+rc/bin/9fs - 775 sys sys 1138385380 986
 rc/bin/B - 775 sys sys 945617206 645
 rc/bin/C - 775 sys sys 1127395076 855
 rc/bin/Kill - 775 sys sys 1018637942 115
@@ -5592,48 +5593,48 @@ sparc64/mkfile - 664 sys sys 1114458667 46
 sys - 20000000775 sys sys 952648870 0
 sys/doc - 20000000775 sys sys 1018471272 0
 sys/doc/8½ - 20000000775 sys sys 945616779 0
-sys/doc/8½/8½.ms - 664 sys sys 1020895859 31593
+sys/doc/8½/8½.ms - 664 sys sys 1138396551 31721
 sys/doc/8½/8½.ps - 664 sys sys 1020895860 797150
 sys/doc/8½/fig1.ps - 664 sys sys 1020895859 473747
 sys/doc/8½/mkfile - 664 sys sys 1020895860 215
-sys/doc/9.ms - 664 sys sys 953237044 84632
+sys/doc/9.ms - 664 sys sys 1138396402 84662
 sys/doc/9.ps - 664 sys sys 960837924 508340
-sys/doc/acid.ms - 664 sys sys 1127411211 65062
+sys/doc/acid.ms - 664 sys sys 1138396403 65160
 sys/doc/acid.ps - 664 sys sys 1015012454 426359
-sys/doc/acidpaper.ms - 664 sys sys 952880777 44805
+sys/doc/acidpaper.ms - 664 sys sys 1138396403 44851
 sys/doc/acidpaper.ps - 664 sys sys 960837913 359639
 sys/doc/acme - 20000000775 sys sys 945616779 0
 sys/doc/acme/acme.fig1 - 664 sys sys 944959632 164559
 sys/doc/acme/acme.fig2 - 664 sys sys 944959632 56026
-sys/doc/acme/acme.ms - 664 sys sys 952880782 49851
+sys/doc/acme/acme.ms - 664 sys sys 1138396552 50028
 sys/doc/acme/acme.pdf - 664 sys sys 1020384351 117006
 sys/doc/acme/acme.ps - 664 sys sys 960837907 611301
 sys/doc/acme/bs - 664 sys sys 944959634 556
 sys/doc/acme/mkfile - 664 sys sys 961259926 304
-sys/doc/ape.ms - 664 sys sys 953344517 12595
+sys/doc/ape.ms - 664 sys sys 1138396403 12637
 sys/doc/ape.ps - 664 sys sys 960837914 258779
-sys/doc/asm.ms - 664 sys sys 958247686 28542
+sys/doc/asm.ms - 664 sys sys 1138396403 31516
 sys/doc/asm.ps - 664 sys sys 960837915 322051
-sys/doc/auth.ms - 664 sys sys 1021579975 66803
+sys/doc/auth.ms - 664 sys sys 1138396404 66854
 sys/doc/auth.ps - 664 sys sys 1021579976 451672
 sys/doc/cleanps - 775 sys sys 961259933 184
 sys/doc/colophon.ps - 664 sys sys 960837922 214122
-sys/doc/comp.ms - 664 sys sys 954266992 37792
+sys/doc/comp.ms - 664 sys sys 1138396405 37832
 sys/doc/comp.ps - 664 sys sys 960837915 345786
-sys/doc/compiler.ms - 664 sys sys 1067721142 30279
+sys/doc/compiler.ms - 664 sys sys 1138396405 30305
 sys/doc/compiler.ps - 664 sys sys 1091459054 309735
-sys/doc/contents.ms - 664 sys sys 1019916701 4920
+sys/doc/contents.ms - 664 sys sys 1138396405 5409
 sys/doc/contents.ps - 664 sys sys 1019916845 232629
 sys/doc/docfonts - 664 sys sys 1038117516 208
 sys/doc/fonts - 664 sys sys 944959649 137
-sys/doc/fossil.ms - 664 sys sys 1063856349 31400
+sys/doc/fossil.ms - 664 sys sys 1138396406 31439
 sys/doc/fossil.pdf - 664 sys sys 1042123169 63200
 sys/doc/fossil.ps - 664 sys sys 1135487951 313552
 sys/doc/fs - 20000000775 sys sys 945616779 0
 sys/doc/fs/fs.pdf - 664 sys sys 1020384351 47177
 sys/doc/fs/fs.ps - 664 sys sys 960837905 276918
 sys/doc/fs/mkfile - 664 sys sys 961259926 282
-sys/doc/fs/p0 - 664 sys sys 953844580 652
+sys/doc/fs/p0 - 664 sys sys 1138396562 682
 sys/doc/fs/p1 - 664 sys sys 953844581 989
 sys/doc/fs/p2 - 664 sys sys 953844581 3749
 sys/doc/fs/p3 - 664 sys sys 944959592 1475
@@ -5644,7 +5645,7 @@ sys/doc/fs/p7 - 664 sys sys 953844581 958
 sys/doc/fs/p8 - 664 sys sys 953844574 881
 sys/doc/fs/xx - 664 sys sys 944959592 65957
 sys/doc/il - 20000000775 sys sys 945616779 0
-sys/doc/il/il.ms - 664 sys sys 952880783 11367
+sys/doc/il/il.ms - 664 sys sys 1138396552 11390
 sys/doc/il/il.pdf - 664 sys sys 1020384351 44630
 sys/doc/il/il.ps - 664 sys sys 960837905 258028
 sys/doc/il/mkfile - 664 sys sys 961259927 214
@@ -5653,42 +5654,42 @@ sys/doc/il/transition.fig - 664 sys sys 944959591 15431
 sys/doc/il/transition.pic - 664 sys sys 944959591 11912
 sys/doc/il/xx - 664 sys sys 944959591 48924
 sys/doc/index.htm - 664 sys sys 1019916696 6906
-sys/doc/lexnames.ms - 664 sys sys 954383595 34046
+sys/doc/lexnames.ms - 664 sys sys 1138396406 34107
 sys/doc/lexnames.ps - 664 sys sys 960837909 335546
-sys/doc/libmach.ms - 664 sys sys 1021579974 24145
+sys/doc/libmach.ms - 664 sys sys 1138396406 24212
 sys/doc/libmach.ps - 664 sys sys 960837916 291283
 sys/doc/lp.ms - 664 sys sys 954614673 22366
 sys/doc/lp.ps - 664 sys sys 960837917 294399
-sys/doc/mk.ms - 664 sys sys 952880779 34413
+sys/doc/mk.ms - 664 sys sys 1138396445 34456
 sys/doc/mk.ps - 664 sys sys 960837917 329779
-sys/doc/mkfile - 664 sys sys 1091459055 4411
-sys/doc/mkfiles.ms - 664 sys sys 952880779 17888
+sys/doc/mkfile - 664 sys sys 1138396461 2393
+sys/doc/mkfiles.ms - 664 sys sys 1138396445 17910
 sys/doc/mkfiles.ps - 664 sys sys 960837918 269496
-sys/doc/names.ms - 664 sys sys 954269607 22103
+sys/doc/names.ms - 664 sys sys 1138396445 22143
 sys/doc/names.ps - 664 sys sys 960837918 288716
 sys/doc/net - 20000000775 sys sys 954033300 0
 sys/doc/net/mkfile - 664 sys sys 961259927 345
-sys/doc/net/net.ms - 664 sys sys 952880783 41191
+sys/doc/net/net.ms - 664 sys sys 1138396534 41237
 sys/doc/net/net.pdf - 664 sys sys 1020384351 82603
 sys/doc/net/net.ps - 664 sys sys 960837908 350053
 sys/doc/net/tree - 664 sys sys 944959636 866
 sys/doc/net/tree.pout - 664 sys sys 944959636 1755
 sys/doc/network.art - 664 sys sys 944959651 2260
 sys/doc/network.pic - 664 sys sys 944959651 4124
-sys/doc/plumb.ms - 664 sys sys 954383596 53250
+sys/doc/plumb.ms - 664 sys sys 1138396446 53312
 sys/doc/plumb.ps - 664 sys sys 960837910 391830
-sys/doc/port.ms - 664 sys sys 1020111393 16694
+sys/doc/port.ms - 664 sys sys 1138396446 16719
 sys/doc/port.ps - 664 sys sys 1020111394 268901
 sys/doc/preamble - 664 sys sys 961259497 203475
 sys/doc/prfile - 775 sys sys 944959668 3782
-sys/doc/prog4.ms - 664 sys sys 1019932830 16485
+sys/doc/prog4.ms - 664 sys sys 1138396446 16563
 sys/doc/prog4.ps - 664 sys sys 1019932831 271581
 sys/doc/ps - 664 sys sys 944959649 1739
-sys/doc/rc.ms - 664 sys sys 1063856321 34373
+sys/doc/rc.ms - 664 sys sys 1138396446 34404
 sys/doc/rc.ps - 664 sys sys 960837920 337955
-sys/doc/release3.ms - 664 sys sys 961261276 5492
+sys/doc/release3.ms - 664 sys sys 1138396446 5538
 sys/doc/release3.ps - 664 sys sys 961261277 230682
-sys/doc/release4.ms - 664 sys sys 1063856338 5160
+sys/doc/release4.ms - 664 sys sys 1138396446 5207
 sys/doc/release4.ps - 664 sys sys 1091459052 230868
 sys/doc/sam - 20000000775 sys sys 945617037 0
 sys/doc/sam/fig1.bm - 464 sys sys 944959645 42200
@@ -5704,20 +5705,20 @@ sys/doc/sam/fig6.pic - 464 sys sys 944959644 1105
 sys/doc/sam/fig7.pic - 464 sys sys 944959644 258
 sys/doc/sam/mkfile - 664 sys sys 961259927 574
 sys/doc/sam/refs - 464 sys sys 944959644 2652
-sys/doc/sam/sam.ms - 464 sys sys 954266468 94536
+sys/doc/sam/sam.ms - 464 sys sys 1138396552 94640
 sys/doc/sam/sam.pdf - 664 sys sys 1020384352 156123
 sys/doc/sam/sam.ps - 664 sys sys 960837910 707546
 sys/doc/sam/sam.tut - 464 sys sys 944959644 40481
-sys/doc/sleep.ms - 664 sys sys 953237030 15206
+sys/doc/sleep.ms - 664 sys sys 1138396447 15272
 sys/doc/sleep.ps - 664 sys sys 960837920 263882
-sys/doc/spin.ms - 664 sys sys 953344522 67475
+sys/doc/spin.ms - 664 sys sys 1138396447 67493
 sys/doc/spin.ps - 664 sys sys 960837923 443064
 sys/doc/title - 664 sys sys 1018974170 740
 sys/doc/title.ps - 664 sys sys 1018974170 214289
 sys/doc/trademarks.ps - 664 sys sys 960837912 217896
 sys/doc/troff.ms - 664 sys sys 953237047 120683
 sys/doc/troff.ps - 664 sys sys 1091459051 782310
-sys/doc/utf.ms - 664 sys sys 952880781 41659
+sys/doc/utf.ms - 664 sys sys 1138396447 41735
 sys/doc/utf.ps - 664 sys sys 960837922 363085
 sys/doc/venti - 20000000775 sys sys 1019852318 0
 sys/doc/venti/Block.gif - 664 sys sys 1019852315 3292
@@ -7036,6 +7037,7 @@ sys/lib/tmac/tmac.antimes - 664 sys sys 964454718 7809
 sys/lib/tmac/tmac.bits - 664 sys sys 944956202 1089
 sys/lib/tmac/tmac.cs - 664 sys sys 1112039298 21324
 sys/lib/tmac/tmac.e - 664 sys sys 964454711 11992
+sys/lib/tmac/tmac.html - 664 sys sys 1138396384 1950
 sys/lib/tmac/tmac.jsdisp - 664 sys sys 944956203 828
 sys/lib/tmac/tmac.m - 664 sys sys 944956203 87
 sys/lib/tmac/tmac.mcs - 664 sys sys 955115425 43067
@@ -7045,7 +7047,7 @@ sys/lib/tmac/tmac.pictures - 664 sys sys 944956203 4320
 sys/lib/tmac/tmac.psychrefs - 664 sys sys 944956203 608
 sys/lib/tmac/tmac.ptx - 664 sys sys 944956203 330
 sys/lib/tmac/tmac.rscover - 664 sys sys 944956203 2070
-sys/lib/tmac/tmac.s - 664 sys sys 1127393909 23027
+sys/lib/tmac/tmac.s - 664 sys sys 1138396381 23086
 sys/lib/tmac/tmac.scover - 664 sys sys 944956204 4616
 sys/lib/tmac/tmac.sdisp - 664 sys sys 944956204 864
 sys/lib/tmac/tmac.skeep - 664 sys sys 944956204 1346
@@ -7294,6 +7296,7 @@ sys/man/1/gzip - 664 sys sys 1124839836 3226
 sys/man/1/hget - 664 sys sys 1067722859 1483
 sys/man/1/history - 664 sys sys 1109685635 1709
 sys/man/1/hoc - 664 sys sys 1136378274 2357
+sys/man/1/htmlroff - 644 sys sys 1138396051 1831
 sys/man/1/idiff - 664 sys sys 1113743324 914
 sys/man/1/join - 664 sys sys 1113743324 2561
 sys/man/1/jpg - 664 sys sys 1113743325 4842
@@ -7360,7 +7363,7 @@ sys/man/1/syscall - 664 sys sys 1016466457 1439
 sys/man/1/tail - 664 sys sys 1113743327 1413
 sys/man/1/tar - 664 sys sys 1131884436 3439
 sys/man/1/tbl - 664 sys sys 944959674 4308
-sys/man/1/tcs - 664 sys sys 952627441 2575
+sys/man/1/tcs - 664 sys sys 1138383991 2682
 sys/man/1/tee - 664 sys sys 969499886 351
 sys/man/1/tel - 664 sys sys 1045501423 941
 sys/man/1/test - 664 sys sys 1079372544 3535
@@ -7637,11 +7640,13 @@ sys/man/6/authsrv - 664 sys sys 1128483124 13304
 sys/man/6/color - 664 sys sys 988225304 5181
 sys/man/6/face - 664 sys sys 1062505426 2846
 sys/man/6/font - 664 sys sys 1077594184 2528
+sys/man/6/htmlroff - 644 sys sys 1138396325 6608
 sys/man/6/image - 664 sys sys 988225304 6209
 sys/man/6/keyboard - 664 sys sys 1079575918 4418
 sys/man/6/keys.who - 664 sys sys 1110641163 775
 sys/man/6/man - 664 sys sys 944959678 4961
 sys/man/6/map - 664 sys sys 944959678 1892
+sys/man/6/mhtml - 644 sys sys 1138396055 1710
 sys/man/6/mpictures - 664 sys sys 944959678 2899
 sys/man/6/ms - 664 sys sys 958249504 6815
 sys/man/6/namespace - 664 sys sys 1048637182 1576
@@ -12228,6 +12233,35 @@ sys/src/cmd/htmlfmt/html.c - 664 sys sys 1060876449 6032
 sys/src/cmd/htmlfmt/main.c - 664 sys sys 1034015651 1108
 sys/src/cmd/htmlfmt/mkfile - 664 sys sys 1034015650 297
 sys/src/cmd/htmlfmt/util.c - 664 sys sys 1015364025 1765
+sys/src/cmd/htmlroff - 20000000775 sys sys 1138396082 0
+sys/src/cmd/htmlroff/a.h - 664 sys sys 1138396079 3200
+sys/src/cmd/htmlroff/char.c - 664 sys sys 1138396079 2178
+sys/src/cmd/htmlroff/html.c - 664 sys sys 1138396079 3991
+sys/src/cmd/htmlroff/input.c - 664 sys sys 1138396079 3147
+sys/src/cmd/htmlroff/main.c - 664 sys sys 1138396080 1065
+sys/src/cmd/htmlroff/mkfile - 664 sys sys 1138396082 330
+sys/src/cmd/htmlroff/roff.c - 664 sys sys 1138396080 10842
+sys/src/cmd/htmlroff/t1.c - 664 sys sys 1138396080 2816
+sys/src/cmd/htmlroff/t10.c - 664 sys sys 1138396080 1911
+sys/src/cmd/htmlroff/t11.c - 664 sys sys 1138396080 1200
+sys/src/cmd/htmlroff/t12.c - 664 sys sys 1138396080 600
+sys/src/cmd/htmlroff/t13.c - 664 sys sys 1138396080 210
+sys/src/cmd/htmlroff/t14.c - 664 sys sys 1138396080 561
+sys/src/cmd/htmlroff/t15.c - 664 sys sys 1138396080 138
+sys/src/cmd/htmlroff/t16.c - 664 sys sys 1138396080 2270
+sys/src/cmd/htmlroff/t17.c - 664 sys sys 1138396081 1711
+sys/src/cmd/htmlroff/t18.c - 664 sys sys 1138396081 1125
+sys/src/cmd/htmlroff/t19.c - 664 sys sys 1138396081 2353
+sys/src/cmd/htmlroff/t2.c - 664 sys sys 1138396081 4079
+sys/src/cmd/htmlroff/t20.c - 664 sys sys 1138396081 1025
+sys/src/cmd/htmlroff/t3.c - 664 sys sys 1138396081 851
+sys/src/cmd/htmlroff/t4.c - 664 sys sys 1138396081 1974
+sys/src/cmd/htmlroff/t5.c - 664 sys sys 1138396081 1749
+sys/src/cmd/htmlroff/t6.c - 664 sys sys 1138396081 1135
+sys/src/cmd/htmlroff/t7.c - 664 sys sys 1138396082 8626
+sys/src/cmd/htmlroff/t8.c - 664 sys sys 1138396082 6245
+sys/src/cmd/htmlroff/t9.c - 664 sys sys 1138396082 47
+sys/src/cmd/htmlroff/util.c - 664 sys sys 1138396082 1615
 sys/src/cmd/iconv.c - 664 sys sys 1039753035 1801
 sys/src/cmd/idiff.c - 664 sys sys 1014926695 6896
 sys/src/cmd/import.c - 664 sys sys 1133180705 7028
@@ -13299,6 +13333,7 @@ sys/src/cmd/tbl/tt.c - 664 sys sys 944961244 1708
 sys/src/cmd/tbl/tu.c - 664 sys sys 944961244 4817
 sys/src/cmd/tbl/tv.c - 664 sys sys 944961244 3329
 sys/src/cmd/tcs - 20000000775 sys sys 954034511 0
+sys/src/cmd/tcs/8859.h - 644 sys sys 1138382778 16466
 sys/src/cmd/tcs/big5.c - 664 sys sys 944961288 99606
 sys/src/cmd/tcs/big5.h - 664 sys sys 944961287 112
 sys/src/cmd/tcs/conv.h - 664 sys sys 1135487940 941
@@ -13306,7 +13341,7 @@ sys/src/cmd/tcs/conv_big5.c - 664 sys sys 944961288 2821
 sys/src/cmd/tcs/conv_gb.c - 664 sys sys 944961287 2210
 sys/src/cmd/tcs/conv_jis.c - 664 sys sys 944961289 10998
 sys/src/cmd/tcs/conv_ksc.c - 664 sys sys 944961288 2716
-sys/src/cmd/tcs/cyrillic.h - 664 sys sys 944961287 9508
+sys/src/cmd/tcs/cyrillic.h - 664 sys sys 1138382779 7921
 sys/src/cmd/tcs/desc.latin - 664 sys sys 944961287 20189
 sys/src/cmd/tcs/ex2.utf - 664 sys sys 944961288 14431
 sys/src/cmd/tcs/ex3.utf - 664 sys sys 944961288 807
@@ -13330,7 +13365,7 @@ sys/src/cmd/tcs/font/qbits.c - 664 sys sys 944961251 2037
 sys/src/cmd/tcs/gb.c - 664 sys sys 944961288 62707
 sys/src/cmd/tcs/gb.h - 664 sys sys 944961287 183
 sys/src/cmd/tcs/hdr.h - 664 sys sys 944961287 1213
-sys/src/cmd/tcs/html.c - 664 sys sys 1135958471 5247
+sys/src/cmd/tcs/html.c - 664 sys sys 1138381110 5244
 sys/src/cmd/tcs/jis.h - 664 sys sys 944961287 2873
 sys/src/cmd/tcs/ksc.c - 664 sys sys 944961289 72413
 sys/src/cmd/tcs/ksc.h - 664 sys sys 944961287 112
@@ -13338,9 +13373,11 @@ sys/src/cmd/tcs/kuten208.c - 664 sys sys 948046995 59960
 sys/src/cmd/tcs/kuten208.h - 664 sys sys 944961287 94
 sys/src/cmd/tcs/kuten212.c - 664 sys sys 944961289 55407
 sys/src/cmd/tcs/kuten212.h - 664 sys sys 944961287 94
-sys/src/cmd/tcs/mkfile - 664 sys sys 1135487940 542
+sys/src/cmd/tcs/misc.h - 644 sys sys 1138382780 19274
+sys/src/cmd/tcs/mkfile - 664 sys sys 1138382781 591
+sys/src/cmd/tcs/ms.h - 644 sys sys 1138382780 44069
 sys/src/cmd/tcs/plan9.h - 664 sys sys 944961287 751
-sys/src/cmd/tcs/tcs.c - 664 sys sys 1135487940 54089
+sys/src/cmd/tcs/tcs.c - 664 sys sys 1138382781 15489
 sys/src/cmd/tcs/utf.c - 664 sys sys 1125501123 7962
 sys/src/cmd/tee.c - 664 sys sys 954970286 1062
 sys/src/cmd/telco - 20000000775 sys sys 1015701205 0

+ 77 - 0
dist/replica/plan9.log

@@ -27247,3 +27247,80 @@
 1138240891 0 c rc/bin/9fs - 775 sys sys 1138240042 1027
 1138336318 0 c sys/man/2/bio - 664 sys sys 1138335268 6523
 1138336318 1 c sys/src/cmd/upas/ned/nedmail.c - 664 sys sys 1138335303 44583
+1138381270 0 c sys/src/cmd/tcs/html.c - 664 sys sys 1138381110 5244
+1138383071 0 c 386/bin/tcs - 775 sys sys 1138382789 309719
+1138383071 1 a sys/src/cmd/tcs/8859.h - 644 sys sys 1138382778 16466
+1138383071 2 c sys/src/cmd/tcs/cyrillic.h - 664 sys sys 1138382779 7921
+1138383071 3 a sys/src/cmd/tcs/misc.h - 644 sys sys 1138382780 19274
+1138383071 4 c sys/src/cmd/tcs/mkfile - 664 sys sys 1138382781 591
+1138383071 5 a sys/src/cmd/tcs/ms.h - 644 sys sys 1138382780 44069
+1138383071 6 c sys/src/cmd/tcs/tcs.c - 664 sys sys 1138382781 15489
+1138384871 0 c sys/man/1/tcs - 664 sys sys 1138383991 2682
+1138386672 0 c rc/bin/9fs - 775 sys sys 1138385380 986
+1138393874 0 c 386/bin/tcs - 775 sys sys 1138393253 309719
+1138397475 0 c sys/doc/8½/8½.ms - 664 sys sys 1138396551 31721
+1138397475 1 c sys/doc/9.ms - 664 sys sys 1138396402 84662
+1138397475 2 c sys/doc/acid.ms - 664 sys sys 1138396403 65160
+1138397475 3 c sys/doc/acidpaper.ms - 664 sys sys 1138396403 44851
+1138397475 4 c sys/doc/acme/acme.ms - 664 sys sys 1138396552 50028
+1138397475 5 c sys/doc/ape.ms - 664 sys sys 1138396403 12637
+1138397475 6 c sys/doc/asm.ms - 664 sys sys 1138396403 31516
+1138397475 7 c sys/doc/auth.ms - 664 sys sys 1138396404 66854
+1138397475 8 c sys/doc/comp.ms - 664 sys sys 1138396405 37832
+1138397475 9 c sys/doc/compiler.ms - 664 sys sys 1138396405 30305
+1138397475 10 c sys/doc/fs/p0 - 664 sys sys 1138396562 682
+1138397475 11 c sys/doc/il/il.ms - 664 sys sys 1138396552 11390
+1138397475 12 c sys/doc/lexnames.ms - 664 sys sys 1138396406 34107
+1138397475 13 c sys/doc/libmach.ms - 664 sys sys 1138396406 24212
+1138397475 14 c sys/doc/mk.ms - 664 sys sys 1138396445 34456
+1138397475 15 c sys/doc/mkfile - 664 sys sys 1138396461 2393
+1138397475 16 c sys/doc/mkfiles.ms - 664 sys sys 1138396445 17910
+1138397475 17 c sys/doc/names.ms - 664 sys sys 1138396445 22143
+1138397475 18 c sys/doc/net/net.ms - 664 sys sys 1138396534 41237
+1138397475 19 c sys/doc/plumb.ms - 664 sys sys 1138396446 53312
+1138397475 20 c sys/doc/port.ms - 664 sys sys 1138396446 16719
+1138397475 21 c sys/doc/prog4.ms - 664 sys sys 1138396446 16563
+1138397475 22 c sys/doc/rc.ms - 664 sys sys 1138396446 34404
+1138397475 23 c sys/doc/release3.ms - 664 sys sys 1138396446 5538
+1138397475 24 c sys/doc/release4.ms - 664 sys sys 1138396446 5207
+1138397475 25 c sys/doc/sam/sam.ms - 464 sys sys 1138396552 94640
+1138397475 26 c sys/doc/sleep.ms - 664 sys sys 1138396447 15272
+1138397475 27 c sys/doc/utf.ms - 664 sys sys 1138396447 41735
+1138397475 28 c sys/doc/contents.ms - 664 sys sys 1138396405 5409
+1138397475 29 c sys/doc/fossil.ms - 664 sys sys 1138396406 31439
+1138397475 30 c sys/doc/spin.ms - 664 sys sys 1138396447 67493
+1138397475 31 a sys/lib/tmac/tmac.html - 664 sys sys 1138396384 1950
+1138397475 32 c sys/lib/tmac/tmac.s - 664 sys sys 1138396381 23086
+1138397475 33 a sys/man/1/htmlroff - 644 sys sys 1138396051 1831
+1138397475 34 a sys/man/6/htmlroff - 644 sys sys 1138396325 6608
+1138397475 35 a sys/man/6/mhtml - 644 sys sys 1138396055 1710
+1138397475 36 a sys/src/cmd/htmlroff - 20000000775 sys sys 1138396082 0
+1138397475 37 a sys/src/cmd/htmlroff/a.h - 664 sys sys 1138396079 3200
+1138397475 38 a sys/src/cmd/htmlroff/char.c - 664 sys sys 1138396079 2178
+1138397475 39 a sys/src/cmd/htmlroff/html.c - 664 sys sys 1138396079 3991
+1138397475 40 a sys/src/cmd/htmlroff/input.c - 664 sys sys 1138396079 3147
+1138397475 41 a sys/src/cmd/htmlroff/main.c - 664 sys sys 1138396080 1065
+1138397475 42 a sys/src/cmd/htmlroff/mkfile - 664 sys sys 1138396082 330
+1138397475 43 a sys/src/cmd/htmlroff/roff.c - 664 sys sys 1138396080 10842
+1138397475 44 a sys/src/cmd/htmlroff/t1.c - 664 sys sys 1138396080 2816
+1138397475 45 a sys/src/cmd/htmlroff/t10.c - 664 sys sys 1138396080 1911
+1138397475 46 a sys/src/cmd/htmlroff/t11.c - 664 sys sys 1138396080 1200
+1138397475 47 a sys/src/cmd/htmlroff/t12.c - 664 sys sys 1138396080 600
+1138397475 48 a sys/src/cmd/htmlroff/t13.c - 664 sys sys 1138396080 210
+1138397475 49 a sys/src/cmd/htmlroff/t14.c - 664 sys sys 1138396080 561
+1138397475 50 a sys/src/cmd/htmlroff/t15.c - 664 sys sys 1138396080 138
+1138397475 51 a sys/src/cmd/htmlroff/t16.c - 664 sys sys 1138396080 2270
+1138397475 52 a sys/src/cmd/htmlroff/t17.c - 664 sys sys 1138396081 1711
+1138397475 53 a sys/src/cmd/htmlroff/t18.c - 664 sys sys 1138396081 1125
+1138397475 54 a sys/src/cmd/htmlroff/t19.c - 664 sys sys 1138396081 2353
+1138397475 55 a sys/src/cmd/htmlroff/t2.c - 664 sys sys 1138396081 4079
+1138397475 56 a sys/src/cmd/htmlroff/t20.c - 664 sys sys 1138396081 1025
+1138397475 57 a sys/src/cmd/htmlroff/t3.c - 664 sys sys 1138396081 851
+1138397475 58 a sys/src/cmd/htmlroff/t4.c - 664 sys sys 1138396081 1974
+1138397475 59 a sys/src/cmd/htmlroff/t5.c - 664 sys sys 1138396081 1749
+1138397475 60 a sys/src/cmd/htmlroff/t6.c - 664 sys sys 1138396081 1135
+1138397475 61 a sys/src/cmd/htmlroff/t7.c - 664 sys sys 1138396082 8626
+1138397475 62 a sys/src/cmd/htmlroff/t8.c - 664 sys sys 1138396082 6245
+1138397475 63 a sys/src/cmd/htmlroff/t9.c - 664 sys sys 1138396082 47
+1138397475 64 a sys/src/cmd/htmlroff/util.c - 664 sys sys 1138396082 1615
+1138408277 0 a 386/bin/htmlroff - 775 sys sys 1138406772 148065

+ 1 - 2
rc/bin/9fs

@@ -21,8 +21,7 @@ case juke
 	srv -q il!jukefs && mount /srv/il!jukefs /n/njuke && bind -c /n/njuke/juke /n/juke
 case sources
 	srv -q tcp!sources.cs.bell-labs.com sources /n/sources &&
-		{ mount /srv/sources /n/sources ||
-		  mount -n /srv/sources /n/sources }
+		mount -n /srv/sources /n/sources
 case sourcesdump
 	9fs sources
 	mount /srv/sources /n/sourcesdump main/archive

+ 5 - 2
sys/doc/8½/8½.ms

@@ -1,3 +1,4 @@
+.HTML "8½, the Plan 9 Window System
 .TL
 8½, the Plan 9 Window System
 .AU
@@ -499,7 +500,8 @@ message:
 2 bytes of boolean function code
 .DE
 .KF
-.BP fig1.ps 4.16 5.6 r 0 0
+.ie h .html - <center><a href="8½.fig1.png"><img src="8½.fig1s.png"></a></center>
+.el .BP fig1.ps 4.16 5.6 r 0 0
 .EP
 .IP
 Figure 1.
@@ -657,7 +659,8 @@ An example
 .PP
 Here is a complete program that runs under 8½.
 It prints the string
-.CW \&"hello\ world"
+.CW \&"hello
+.CW world"
 wherever the left mouse button is depressed, and exits when the
 right mouse button is depressed.
 It also prints the string in the center of its window, and maintains

+ 1 - 0
sys/doc/9.ms

@@ -1,3 +1,4 @@
+.HTML "Plan 9 from Bell Labs"
 .TL
 Plan 9 from Bell Labs
 .AU

+ 4 - 1
sys/doc/acid.ms

@@ -1,3 +1,4 @@
+.HTML "Acid Manual
 .am DS
 .ft I
 ..
@@ -1037,8 +1038,10 @@ description; where a parameter can be of any type it is specified as type
 .I item .
 .de Ip
 .KS
+.in 0
 .LP
-.tl '\f2\\$1\fP\ \ \f(CW\\$2(\f2\\$3\f(CW)\f1''\\$4'
+.ie h \&\f2\\$1\fP\ \ \f(CW\\$2(\f2\\$3\f(CW)\f1\ \ \ \ \ \ \ \ \\$4
+.el .tl '\f2\\$1\fP\ \ \f(CW\\$2(\f2\\$3\f(CW)\f1''\\$4'
 .IP
 ..
 .de Ex

+ 1 - 0
sys/doc/acidpaper.ms

@@ -1,3 +1,4 @@
+.HTML "Acid: A Debugger Built From A Language
 .TL
 Acid: A Debugger Built From A Language
 .AU

+ 17 - 5
sys/doc/acme/acme.ms

@@ -1,3 +1,4 @@
+.HTML "Acme: A User Interface for Programmers
 .de EX
 .nr x \\$1v
 \\!h0c n \\nx 0
@@ -6,7 +7,7 @@
 .KF
 .BP \\$1 \\$2
 .sp .5v
-.EX \\$2v
+.if !h .EX \\$2v
 .ps -1
 .vs -1
 ..
@@ -17,6 +18,17 @@
 \l'1i'
 .KE
 ..
+.if h \{\
+.de FG
+.B1 10 60
+.html - <center><a href="\\$1.png"><img src="\\$1s.png" /></a></center>
+.\" .sp .5v
+..
+.de fg
+.br
+.B2
+..
+.\}
 .TL
 Acme: A User Interface for Programmers
 .AU
@@ -25,8 +37,8 @@ Acme: A User Interface for Programmers
 .SP .22i exactly
 .AB
 .FS
-\l'1i'
-.br
+.if !h \l'1i'
+.if !h .br
 Originally appeared in
 .I
 Proc. of the Winter 1994 USENIX Conf.,
@@ -78,7 +90,7 @@ that do involve the mouse as an integral part of the interaction
 are geared towards general users, not experts, and certainly
 not programmers.
 Software developers, at least on time-sharing systems, have been left behind.
-.FG /usr/rob/doc/acme.fig1 5i
+.FG acme.fig1 5i
 Figure 1.  A small Acme screen\(emnormally it runs on a larger display\(emdemonstrating
 some of the details discussed in the text.
 The right column contains some guide files,
@@ -162,7 +174,7 @@ and finally presents some unusual aspects of its implementation.
 .SH
 User interface
 .PP
-.FG /usr/rob/doc/acme.fig2 3i
+.FG acme.fig2 3i
 Figure 2.  An Acme window showing a section of code.
 The upper line of text is the tag containing the file name,
 relevant commands, and a scratch area (right of the vertical bar);

+ 1 - 0
sys/doc/ape.ms

@@ -1,3 +1,4 @@
+.HTML "APE — The ANSI/POSIX Environment
 .de XX
 .IP \ \ \ \-
 ..

+ 101 - 0
sys/doc/asm.ms

@@ -1,3 +1,4 @@
+.HTML "A Manual for the Plan 9 assembler
 .ft CW
 .ta 8n +8n +8n +8n +8n +8n +8n
 .ft
@@ -291,6 +292,9 @@ The 386 has all three:
 .CW WORD ,
 and
 .CW BYTE .
+The AMD64 adds
+.CW QUAD
+to that for 64-bit values.
 The 960 has only one,
 .CW LONG .)
 .PP
@@ -894,6 +898,103 @@ Segment override prefixes in
 .CW MOD/RM
 fields are not supported.
 .SH
+AMD64
+.PP
+The assembler assumes 64-bit mode unless a
+.CW MODE
+pseudo-operation is given:
+.P1
+	MODE $32
+.P2
+to change to 32-bit mode.
+The effect is mainly to diagnose instructions that are illegal in
+the given mode, but the loader will also assume 32-bit operands and addresses,
+and 32-bit PC values for call and return.
+The assembler's conventions are similar to those for the 386, above.
+The architecture provides extra fixed-point registers
+.CW R8
+to
+.CW R15 .
+All registers are 64 bit, but instructions access low-order 8, 16 and 32 bits
+as described in the processor handbook.
+For example,
+.CW MOVL
+to
+.CW AX
+puts a value in the low-order 32 bits and clears the top 32 bits to zero.
+Literal operands are limited to signed 32 bit values, which are sign-extended
+to 64 bits in 64 bit operations; the exception is
+.CW MOVQ ,
+which allows 64-bit literals.
+The external registers in Plan 9's C are allocated from
+.CW R15
+down.
+There are many new instructions, including the MMX and XMM media instructions,
+and conditional move instructions.
+MMX registers are
+.CW M0
+to
+.CW M7 ,
+and
+XMM registers are
+.CW X0
+to
+.CW X15 .
+As with the 386 instruction names,
+all new 64-bit integer instructions, and the MMX and XMM instructions
+uniformly use
+.CW L
+for `long word' (32 bits) and
+.CW Q
+for `quad word' (64 bits).
+Some instructions use
+.CW O
+(`octword') for 128-bit values, where the processor handbook
+variously uses
+.CW O
+or
+.CW DQ .
+The assembler also consistently uses
+.CW PL
+for `packed long' in
+XMM instructions, instead of
+.CW Q ,
+.CW DQ
+or
+.CW PI .
+Either
+.CW MOVL
+or
+.CW MOVQ
+can be used to move values to and from control registers, even when
+the registers might be 64 bits.
+The assembler often accepts the handbook's name to ease conversion
+of existing code (but remember that the operand order is uniformly
+source then destination).
+C's
+.CW "long long"
+type is 64 bits, but passed and returned by value, not by reference.
+More notably, C pointer values are 64 bits, and thus
+.CW "long long"
+and
+.CW "unsigned long long"
+are the only integer types wide enough to hold a pointer value.
+The C compiler and library use the XMM floating-point instructions, not
+the old 387 ones, although the latter are implemented by assembler and loader.
+Unlike the 386, the first integer or pointer argument is passed in a register, which is
+.CW BP
+for an integer or pointer (it can be referred to in assembly code by the pseudonym
+.CW RARG ).
+.CW AX
+holds the return value from subroutines as before.
+Floating-point results are returned in
+.CW X0 ,
+although currently the first floating-point parameter is not passed in a register.
+All parameters less than 8 bytes in length have 8 byte slots reserved on the stack
+to preserve alignment and simplify variable-length argument list access,
+including the first parameter when passed in a register,
+even though bytes 4 to 7 are not initialized.
+.SH
 Alpha
 .PP
 On the Alpha, all registers are 64 bits.  The architecture handles 32-bit values

+ 4 - 1
sys/doc/auth.ms

@@ -1,3 +1,4 @@
+.HTML "Security in Plan 9
 .de SS
 .NH 2
 ..
@@ -46,7 +47,7 @@ applications.
 has an unusual architecture: it is implemented
 as a Plan 9 file server.
 .FS
-To appear, in a slightly different form, in
+Appeared, in a slightly different form, in
 .I
 Proc. of the 2002 Usenix Security Symposium,
 .R
@@ -155,6 +156,7 @@ Transport Layer Security (TLS)
 [RFC2246];
 and began using encryption for all communications within the system.
 The overall architecture is illustrated in Figure 1a.
+.if h .B1 10 60
 .KF
 .EQ
 gsize 9
@@ -221,6 +223,7 @@ is a shared resource for storing private information such as keys;
 consults it for the user during bootstrap.
 .sp
 .KE
+.if h .B2
 .EQ
 gsize 11
 .EN

+ 1 - 0
sys/doc/comp.ms

@@ -1,3 +1,4 @@
+.HTML "How to Use the Plan 9 C Compiler
 .TL
 How to Use the Plan 9 C Compiler
 .AU

+ 1 - 0
sys/doc/compiler.ms

@@ -1,3 +1,4 @@
+.HTML "Plan 9 C Compilers
 .TL
 Plan 9 C Compilers
 .AU

+ 46 - 31
sys/doc/contents.ms

@@ -1,3 +1,4 @@
+.HTML "Plan 9 — The Documents (Volume 2)
 .FP lucidasans
 .na
 .ds CH
@@ -12,8 +13,18 @@
 ..
 .de Ti
 .ft R
+.ie h \{\
+\\$3 
+(\c
+.if !'\\$2'troff' \! \<a href="\\$2.html"\>html\</a\> |
+\! \<a href="\\$2.ps"\>ps\</a\>
+|
+\! \<a href="\\$2.pdf"\>pdf\</a\>)
+.\}
+.el \{\
 .ta \\n(LLuR
-\\$2 \a\|\|\\$1
+\\$3 \a\|\|\\$1
+.\}
 .br
 ..
 .de Au
@@ -42,122 +53,126 @@
 .LP
 .ps 12
 .ce
-.B "Table of Contents
+.ie h .B "Plan 9 \(em The Documents (Volume 2)
+.el .B "Table of Contents
 .ps
 .sp .5i
 .He "Introduction
-.Ti 1 "Plan 9 From Bell Labs
+.Ti 1 9 "Plan 9 From Bell Labs
 .Au "Rob Pike, Dave Presotto, Sean Dorward, Bob Flandrena, Ken Thompson, Howard Trickey, and Phil \%Winterbottom
 .De "An overview of the system; read at least this paper before you install.
 .Co seems ok; a little dated; unchanged except to mention appearance in Computing Systems
-.Ti 23 "The Use of Name Spaces in Plan 9
+.Ti 23 names "The Use of Name Spaces in Plan 9
 .Au "Rob Pike, Dave Presotto, Ken Thompson, Howard Trickey, and Phil \%Winterbottom
 .Co updated only to mention appearance in SIGOPS
 .De "What's in a name?
-.Ti 29 "The Organization of Networks in Plan 9
+.Ti 29 net "The Organization of Networks in Plan 9
 .Au "Dave Presotto and Phil Winterbottom
 .De "Connecting the pieces.  The details in the paper are outdated but the ideas still apply.
-.Ti 43 "Security in Plan 9
+.Ti 43 auth "Security in Plan 9
 .Au "Russ Cox, Eric Grosse, Rob Pike, Dave Presotto, and Sean Quinlan
 .De "An overview of the security architecture.
 .He "Programming
-.Ti 63 "How to Use the Plan 9 C Compiler
+.Ti 63 comp "How to Use the Plan 9 C Compiler
 .Au "Rob Pike
 .Co updated
 .De "The starting point for C programming under Plan 9.
-.Ti 77 "Changes to the Programming Environment in the Fourth Release of Plan 9
+.Ti 77 prog4 "Changes to the Programming Environment in the Fourth Release of Plan 9
 .Au "Rob Pike
 .De "An overview of the changes to the C library since the Third Release.
-.Ti 83 "APE \(em The ANSI/POSIX Environment
+.Ti 83 ape "APE \(em The ANSI/POSIX Environment
 .Au "Howard Trickey
 .Co updated
 .De "Moving C code between UNIX and Plan 9.
-.Ti 87 "Acid: A Debugger Built From A Language
+.Ti 87 acidpaper "Acid: A Debugger Built From A Language
 .Au "Phil Winterbottom
 .Co fine
 .De "An overview paper about the Acid debugger.
-.Ti 101 "Acid Manual
+.Ti 101 acid "Acid Manual
 .Au "Phil Winterbottom
 .Co updated
 .De "The reference manual for the language and its libraries.
-.Ti 127 "Maintaining Files on Plan 9 with Mk
+.Ti 127 mk "Maintaining Files on Plan 9 with Mk
 .Au "Andrew G. Hume and Bob Flandrena
 .Co updated
 .De "An introduction to Plan 9's replacement for \f(CWmake\fP.
-.Ti 141 "Plan 9 Mkfiles
+.Ti 141 mkfiles "Plan 9 Mkfiles
 .Au "Bob Flandrena
 .Co updated
 .De "The conventions for using \f(CWmk\fP in Plan 9.
-.Ti 149 "A Manual for the Plan 9 assembler
+.Ti 149 asm "A Manual for the Plan 9 assembler
 .Au "Rob Pike
 .Co updated
 .De "Things you'd rather not know.
 .bp
 .He "User Interfaces
-.Ti 159 "8½, the Plan 9 Window System
+.Ti 159 "8½, the Plan 9 Window System
 .Au "Rob Pike
 .Co fine - introductory footnote tweaked
 .De "An introduction to the (previous) window system and its unusual implementation.
-.Ti 169 "Rc \(em The Plan 9 Shell
+.Ti 169 rc "Rc \(em The Plan 9 Shell
 .Au "Tom Duff
 .Co updated
 .De "An introduction to the new shell, complete with examples.
-.Ti 185 "The Text Editor \&\f(CWsam\fP
+.Ti 185 sam "The Text Editor \&\f(CWsam\fP
 .Au "Rob Pike
 .Co fine
 .De "\f(CWSam\fP is the standard editor on Plan 9.
-.Ti 215 "Acme: A User Interface for Programmers
+.Ti 215 acme "Acme: A User Interface for Programmers
 .Au "Rob Pike
 .Co fine
 .De "A system with a more radical approach to programming and editing.
-.Ti 231 "Plumbing and Other Utilities
+.Ti 231 plumb "Plumbing and Other Utilities
 .Au "Rob Pike
 .Co new
 .De "Inter-process communication that enlivens the interactive user interface.
 .He "Implementation
-.Ti 247 "Hello World, or Καλημέρα κόσμε, or \f(Jpこんにちは 世界\fP
+.Ti 247 utf "Hello World, or Καλημέρα κόσμε, or \f(Jpこんにちは 世界\fP
 .Au "Rob Pike and Ken Thompson
 .Co fine
 .De "The details about Plan 9's character set: the Unicode Standard plus an ASCII-compatible encoding.
-.Ti 259 "Plan 9 C Compilers
+.Ti 259 compiler "Plan 9 C Compilers
 .Au "Ken Thompson
 .Co updated
 .De "The design and some internals of the compiler suite.
-.Ti 271 "Adding Application Support for a New Architecture in Plan 9
+.Ti 271 libmach "Adding Application Support for a New Architecture in Plan 9
 .Au "Bob Flandrena
 .Co updated
 .De "The procedures necessary to add a new instruction set to Plan 9's programming environment.
-.Ti 279 "The Plan 9 File Server
+.Ti 279 fs "The Plan 9 File Server
 .Au "Ken Thompson
 .Co updated
 .De "The design of the central file server and its novel backup system.
-.Ti 287 "Venti: A new approach to archival storage
+.Ti 287 venti "Venti: A new approach to archival storage
 .Au "Sean Quinlan and Sean Dorward
 .De "Archival block-level storage using secure hashes as block identifiers.
-.Ti 301 "The IL protocol
+.Ti 301 il "The IL protocol
 .Au "Dave Presotto and Phil Winterbottom
 .De "A description of the Internet protocol Plan 9 uses for internal communication.
-.Ti 307 "Lexical File Names in Plan 9, or, Getting Dot-Dot Right
+.Ti 307 lexnames "Lexical File Names in Plan 9, or, Getting Dot-Dot Right
 .Au "Rob Pike
 .Co new
 .De "A vexing old problem solved: how to make \f(CWpwd\fP get the right answer in the face of multiply-bound directories.
-.Ti 319 "Process Sleep and Wakeup on a Shared-memory Multiprocessor
+.Ti 319 sleep "Process Sleep and Wakeup on a Shared-memory Multiprocessor
 .Au "Rob Pike, Dave Presotto, Ken Thompson, and Gerard Holzmann
 .Co fine - updated with citation footnote
 .De "A detailed study of a central issue in the Plan 9 kernel.
 .He "Miscellany
-.Ti 325 "A Guide to the Lp Printer Spooler
+.Ti 325 lp "A Guide to the Lp Printer Spooler
 .Au "Paul Glick
 .De "Adminstering the suite of tools to drive PostScript printers.
-.Ti 333 "Troff User's Manual
+.Ti 333 troff "Troff User's Manual
 .Au "Joseph F. Ossanna and Brian W. Kernighan
 .Co updated
 .De "The old warhorse, updated for Unicode characters.
 .bp
-.Ti 373 "Using SPIN
+.Ti 373 spin "Using SPIN
 .Au "Gerard Holzmann
 .Co updated
 .De "An introduction to a tool for analyzing parallel and distributed programs.
 .He "Installation
-.Ti 400 "The Various Ports
+.Ti 400 port "The Various Ports
 .De "The hardware requirements for the Plan 9 compilers and kernels.
+.if h \{\
+.sp 1
+\! \<center\>\<a href="/plan9/"\>Plan 9 Home Page\</a\>\</center\>

+ 1 - 0
sys/doc/fossil.ms

@@ -1,3 +1,4 @@
+.HTML "Fossil, an Archival File Server
 ... .FP times
 ... .fp 1 R R.nomath
 ... .fp 5 CW LucidaSansCW83

+ 1 - 0
sys/doc/fs/p0

@@ -1,3 +1,4 @@
+.HTML "The Plan 9 File Server
 .FP lucidasans
 .TL
 The Plan 9 File Server

+ 1 - 0
sys/doc/il/il.ms

@@ -1,3 +1,4 @@
+.HTML "The IL Protocol
 .TL
 The IL protocol
 .AU

+ 1 - 0
sys/doc/lexnames.ms

@@ -1,3 +1,4 @@
+.HTML "Lexical File Names in Plan 9 or Getting Dot-Dot Right
 .hw re-create
 .hw re-created
 .TL

+ 1 - 0
sys/doc/libmach.ms

@@ -1,3 +1,4 @@
+.HTML "Adding Application Support for a New Architecture in Plan 9
 .TL
 Adding Application Support for a New Architecture in Plan 9
 .AU

+ 1 - 0
sys/doc/mk.ms

@@ -1,3 +1,4 @@
+.HTML "Maintaining Files on Plan 9 with Mk
 .TL
 Maintaining Files on Plan 9 with Mk
 .AU

+ 92 - 204
sys/doc/mkfile

@@ -1,127 +1,67 @@
+# Changes made in this directory are invisible to the
+# external web server.  To publish changed documents
+# to the external web server, mk install or name.install
+# To publish changed ps/pdf files, see the install rule.
+
 < /sys/doc/fonts
 NPROC = 1
-FILES = \
-	title.ps \
-	trademarks.ps \
-	contents.ps \
-	9.ps \
-	acid.ps \
-	acidpaper.ps \
-	ape.ps \
-	asm.ps \
-	auth.ps \
-	comp.ps \
-	compiler.ps \
-	lexnames.ps \
-	libmach.ps \
-	lp.ps \
-	mk.ps \
-	mkfiles.ps \
-	names.ps \
-	plumb.ps \
-	port.ps \
-	rc.ps \
-	sleep.ps \
-	spin.ps \
-	troff.ps \
-	utf.ps \
-	colophon.ps \
-	release4.ps \
-	prog4.ps\
-
-DIRS = \
-	8½ \
-	acme \
-	fs \
-	venti \
-	il \
-	net \
-	sam \
-
-all:V: dirs
-
-print:V: \
-	title.ps \
-	trademarks.ps \
-	contents.ps\
-	9.ps \
-	names.ps \
-	net/net.ps \
-	auth.ps \
-	comp.ps \
-	prog4.ps \
-	ape.ps \
-	acidpaper.ps \
-	acid.ps \
-	mk.ps \
-	mkfiles.ps \
-	asm.ps \
-	8½/8½.ps \
-	rc.ps \
-	sam/sam.ps \
-	acme/acme.ps \
-	plumb.ps \
-	utf.ps \
-	compiler.ps \
-	libmach.ps \
-	fs/fs.ps \
-	venti/venti.ps \
-	il/il.ps \
-	sleep.ps \
-	lexnames.ps \
-	lp.ps \
-	troff.ps \
-	spin.ps \
-	port.ps \
-	colophon.ps
-	lp -dfn -H -i0 $prereq
 
-html:V: \
-	9.html \
-	names.html \
-	net/net.html \
-	auth.html \
-	comp.html \
-	prog4.html \
-	ape.html \
-	acidpaper.html \
-	acid.html \
-	mk.html \
-	mkfiles.html \
-	asm.html \
-	8½/8½.html \
-	rc.html \
-	sam/sam.html \
-	acme/acme.html \
-	plumb.html \
-	utf.html \
-	compiler.html \
-	libmach.html \
-	fs/fs.html \
-	il/il.html \
-	sleep.html \
-	lexnames.html \
-	lp.html \
-	troff.html \
-	spin.html \
-	port.html \
-	release4.html
-	cp index.htm index.html
-
-dirs:V:	$FILES $DIRS
+ALL=\
+	title\
+	trademarks\
+	contents\
+	9\
+	names\
+	net/net\
+	auth\
+	comp\
+	prog4\
+	ape\
+	acidpaper\
+	acid\
+	mk\
+	mkfiles\
+	asm\
+	8½/8½\
+	rc\
+	sam/sam\
+	acme/acme\
+	plumb\
+	utf\
+	compiler\
+	libmach\
+	fs/fs\
+	venti/venti\
+	il/il\
+	lexnames\
+	sleep\
+	lp\
+	troff\
+	spin\
+	port\
+	colophon\
+
+ALLPS=${ALL:%=%.ps}
+HTML=${ALL:%=%.html} release3.html release4.html
+FILES=`{mkfilelist $ALL}
+DIRS=`{mkdirlist $ALL}
+NAMES=$FILES $DIRS
+
+all:V: ${FILES:%=%.ps} dirs
+
+dirs:V:
 	for(i in $DIRS) @{
 		cd $i
 		mk
 	}
 
+print:V: $ALLPS
+	lp -dfn -H -i0 $prereq
+
 title.ps:D:	title
 	troff $prereq | lp -dstdout > $target
 	cleanps $target
 
-contents.ps:D:	contents.ms
-	{ echo $FONTS; cat $prereq } | troff -ms -mnihongo | lp -dstdout > $target
-	cleanps $target
-
 trademarks.ps:D:	/sys/lib/man/trademarks
 	troff $prereq | lp -dstdout > $target
 	cleanps $target
@@ -130,109 +70,38 @@ colophon.ps:D:	/sys/lib/man/colophon
 	troff $prereq | lp -dstdout > $target
 	cleanps $target
 
-%.page:D:	%.ps
-	page -w $stem.ps
-
+# troff gets some scary-looking errors but they're okay
 %.ps:D:	%.ms
-	{ echo $FONTS; cat $stem.ms } | tbl | troff -ms | lp -dstdout > $target
+	mac=(-ms)
+	if(~ $stem comp utf 9 contents) mac=(-ms -mnihongo)
+	{ echo $FONTS; cat $stem.ms } | pic | tbl | eqn | 
+		troff $mac | lp -dstdout > $target
 	cleanps $target
 
 %.trout:D:	%.ms
-	{ echo $FONTS; cat $stem.ms } | tbl | troff -ms > $stem.trout
+	mac=(-ms)
+	if(~ $stem comp utf 9 contents) mac=($mac -mnihongo)
+	{ echo $FONTS; cat $stem.ms } | pic | tbl | eqn | 
+		troff $mac > $target
 
-troff.trout:D:	troff.ms
-	{ echo $FONTS; cat $prereq } | tbl | eqn | troff -ms > $target
+html:V: $HTML
 
-troff.ps:D:	troff.ms
-	echo this gets some scary-looking errors, but they''''re fine
-	{ echo $FONTS; cat $prereq } | tbl | eqn | troff -ms | lp -dstdout > $target
-	cleanps $target
+9.trout 9.ps 9.html: network.pic
 
-fossil.ps:D: fossil.ms
-	{ echo $FONTS; cat $prereq } | pic | troff -ms | lp -dstdout >$target
-	cleanps $target
+%.html: /$objtype/bin/htmlroff /sys/lib/tmac/tmac.s
 
-auth.ps:D:	auth.ms
-	{ echo $FONTS; cat $prereq } | pic | tbl | eqn  | troff -ms | lp -dstdout > $target
-	cleanps $target
+index.html: contents.html
+	cp contents.html index.html
 
-plumb.ps:D:	plumb.ms
-	{ echo $FONTS; cat $prereq } | pic | troff -ms | lp -dstdout > $target
-	cleanps $target
-
-comp.ps:D:	comp.ms
-	{ echo $FONTS; cat $prereq } | tbl | troff -ms -mnihongo | lp -dstdout > $target
-	cleanps $target
-
-utf.ps:D:	utf.ms
-	{ echo $FONTS; cat $prereq } | tbl | troff -ms -mnihongo | lp -dstdout > $target
-	cleanps $target
-
-9.ps:D:	9.ms network.pic
-	{ echo $FONTS; cat 9.ms } | tbl | pic | troff -ms -mnihongo | lp -dstdout > $target
-	cleanps $target
-
-9.trout:D:	9.ms network.pic
-	{ echo $FONTS; cat 9.ms } | tbl | pic | troff -ms -mnihongo > $target
-
-spin.ps:D:	spin.ms
-	{ echo $FONTS; cat $prereq } | eqn | tbl | troff -ms | lp -dstdout > $target
-	cleanps $target
+&.html:D:	&.ms
+	pic $stem.ms | tbl | eqn | htmlroff -ms -mhtml >$target
 
-%.html:D:	%.ms
-	{ echo $FONTS; cat $stem.ms } | tbl | ms2html > $target
+^(8½|acme|fs|il|net|sam|venti)/([^/]*\.(pdf|ps|html))'$':R:
+	cd $stem1
+	mk $stem2
 
-troff.html:D:	troff.ms
-	{ echo $FONTS; cat $prereq } | tbl | eqn | ms2html > $target
-
-plumb.html:D:	plumb.ms
-	{ echo $FONTS; cat $prereq } | pic | ms2html > $target
-
-auth.html:D:	auth.ms
-	{ echo $FONTS; cat $prereq } | pic |eqn | tbl | ms2html > $target
-
-comp.html:D:	comp.ms
-	{ echo $FONTS; cat $prereq } | tbl | ms2html > $target
-
-utf.html:D:	utf.ms
-	{ echo $FONTS; cat $prereq } | tbl | ms2html > $target
-
-9.html:D:	9.ms network.pic
-	{ echo $FONTS; cat 9.ms } | tbl | pic | ms2html > $target
-
-spin.html:D:	spin.ms
-	{ echo $FONTS; cat $prereq } | eqn | tbl | ms2html > $target
-
-gfx.html:D:	gfx.ms
-	{ echo $FONTS; cat $prereq } | tbl | pic | ms2html > $target
-
-fs/fs.html:
-	cd fs
-	mk fs.html
-
-net/net.html:
-	cd net
-	mk net.html
-
-sam/sam.html:
-	cd sam
-	mk sam.html
-
-acme/acme.html:
-	cd acme
-	mk acme.html
-
-venti/venti.html:
-	cd venti
-	mk venti.html
-
-il/il.html:
-	cd il
-	mk il.html
-
-release4.html:	release4.ms
-	# remove all those extra blank lines
-	{ echo $FONTS; cat release4.ms } | tbl | ms2html | uniq > $target
+^(8½|acme|fs|il|net|sam|venti)\.html'$':R: \1/\1.html
+	cp $stem1/$stem1.html .
 
 %.pdf: %.ps
 	{ cat docfonts $stem.ps } >_$stem.ps
@@ -242,3 +111,22 @@ release4.html:	release4.ms
 %.all:V:
 	mk $stem.ps $stem.pdf $stem.html
 
+%.install:V: %.html
+	9fs other
+	files=`{ls $stem.html $stem^*.png $stem/*.png $stem/*.html >[2]/dev/null}
+	whatis stem
+	whatis files
+	cp $files /n/other/crp/sources.copy/sys/doc
+
+%.page:V:	%.ps
+	page -w $stem.ps
+
+install:V: ${NAMES:%=%.install} release4.install release3.install
+
+# ignore these
+IGNHTML=title trademarks colophon troff
+IGN=${IGNHTML:%=%.html} ${IGNHTML:%=%.install}
+
+$IGN:QV:
+	# nothing
+

+ 1 - 0
sys/doc/mkfiles.ms

@@ -1,3 +1,4 @@
+.HTML "Plan 9 Mkfiles
 .TL
 Plan 9 Mkfiles
 .AU

+ 1 - 0
sys/doc/names.ms

@@ -1,3 +1,4 @@
+.HTML "The Use of Name Spaces in Plan 9
 .TL
 The Use of Name Spaces in Plan 9
 .AU

+ 1 - 0
sys/doc/net/net.ms

@@ -1,3 +1,4 @@
+.HTML "The Organization of Networks in Plan 9
 .TL
 The Organization of Networks in Plan 9
 .AU

+ 3 - 0
sys/doc/plumb.ms

@@ -1,3 +1,4 @@
+.HTML "Plumbing and Other Utilities
 .TL
 Plumbing and Other Utilities
 .AU
@@ -91,6 +92,7 @@ For example,
 is by convention the file from which a text editor reads messages requesting it to
 open and display a file for editing.
 (See Figure 1.)
+.if h .B1 10 60
 .KF
 .PS
 down
@@ -135,6 +137,7 @@ Although the figure doesn't illustrate it, some programs may both send and recei
 and some ports are read by multiple applications.
 .sp
 .KE
+.if h .B2
 .LP
 The plumber takes messages from the
 .CW send

+ 1 - 0
sys/doc/port.ms

@@ -1,3 +1,4 @@
+.HTML "The Various Ports
 .TL
 The Various Ports
 .PP

+ 1 - 0
sys/doc/prog4.ms

@@ -1,3 +1,4 @@
+.HTML "Changes to the Programming Environment in the Fourth Release of Plan 9
 .FP lucidasans
 .TL
 Changes to the Programming Environment

+ 1 - 0
sys/doc/rc.ms

@@ -1,3 +1,4 @@
+.HTML "Rc — The Plan 9 Shell
 .	\" /*% refer -k -e -n -l3,2 -s < % | tbl | troff -ms | lp -dfn
 .Tm shell programming language	g
 .de TP	\" An indented paragraph describing some command, tagged with the command name

+ 1 - 0
sys/doc/release3.ms

@@ -1,3 +1,4 @@
+.HTML "Plan 9 — Third Edition Release Notes
 .TL
 Plan 9 From Bell Labs
 .br

+ 1 - 0
sys/doc/release4.ms

@@ -1,3 +1,4 @@
+.HTML "Plan 9 — Fourth Edition Release Notes
 .TL
 Plan 9 From Bell Labs
 .br

+ 9 - 4
sys/doc/sam/sam.ms

@@ -1,3 +1,4 @@
+.HTML "The Text Editor sam
 .Vx 17 11 November 87 1 32 "ROB PIKE" "THE TEXT EDITOR SAM"
 .ds DY "31 May 1987
 .ds DR "Revised 1 July 1987
@@ -19,6 +20,10 @@
 .vs
 .sp
 ..
+.de XP
+.ie h .html - <center><img src="sam.\\$1.png" /></center>
+.el .BP \\$1.ps \\$2
+..
 .TL
 The Text Editor \&\f(CWsam\fP
 .AU
@@ -255,7 +260,7 @@ the command is assumed to apply to the current text.
 For the moment, ignore the presence of multiple files and consider
 editing a single file.
 .KF L
-.BP fig1.ps 3.5i
+.XP fig1 3.5i
 .Cs
 Figure 1. A typical
 .CW sam
@@ -1272,7 +1277,7 @@ will highlight it on the screen \(em in fact,
 dot is always highlighted (see Figure 2).
 .WS 1
 .KF
-.BP fig3.ps 2.04i
+.XP fig3 2.04i
 .Cs
 Figure 2. A
 .CW sam
@@ -1357,7 +1362,7 @@ Selecting it makes the
 window the current window,
 causing subsequent typing to be interpreted as commands.
 .KF
-.BP fig2.ps 2.74i
+.XP fig2 2.74i
 .Cs
 Figure 3. The menu on button 3.
 The black rectangle on the left is a scroll bar; the menu is limited to
@@ -1449,7 +1454,7 @@ to search
 forward for the next occurrence of a match for the expression.
 .WS 1
 .KF
-.BP fig4.ps 1.20i
+.XP fig4 1.20i
 .Cs
 Figure 4. The menu on button 2.
 The bottom entry tracks the most recently used regular expression, which may

+ 1 - 0
sys/doc/sleep.ms

@@ -1,3 +1,4 @@
+.HTML "Process Sleep and Wakeup on a Shared-memory Multiprocessor
 .TL
 Process Sleep and Wakeup on a Shared-memory Multiprocessor
 .AU

+ 1 - 0
sys/doc/spin.ms

@@ -1,3 +1,4 @@
+.HTML "Using SPIN
 .\" runoff as:
 .\" eqn file | tbl | troff -ms
 .\"

+ 1 - 0
sys/doc/utf.ms

@@ -1,3 +1,4 @@
+.HTML "Hello World or Καλημέρα κόσμε or こんにちは 世界
 .TL
 Hello World
 .br

+ 94 - 0
sys/lib/tmac/tmac.html

@@ -0,0 +1,94 @@
+.de HTML
+\! \<?xml version="1.0" encoding="utf-8"?\>
+\! \<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+\!   "http://www.w3.org/TR/html4/loose.dtd"\>
+.html html <html>
+.html head <head>
+.if !'\\$1'' .html title <title>\\$1</title>
+.HEAD
+.html head
+.html body <body>
+..
+.de FSFIRST
+.de NOTES xx
+._NOTES
+.rm _NOTES
+xx
+.em NOTES
+.da _NOTES
+.sp
+.B "Notes
+.sp
+.da
+..
+.de FS
+.FSFIRST
+.rm FSFIRST
+.da _NOTES
+..
+.de FE
+.sp
+.da
+..
+.nr png -1 1
+.de TS
+.ds pngbase "\\*[basename]
+.if '\\*[pngbase]'' .ds pngbase \\n(.B
+.ds pngfile \\*[pngbase]\\n+[png].png
+.html - <center><img src="\\*[pngfile]"></center>
+.\" The .inputpipe must be the last line of the macro!
+.inputpipe .TE troff2png >\\*[pngfile]
+..
+.de TE
+..
+.de PS
+.ds pngbase "\\*[basename]
+.if '\\*[pngbase]'' .ds pngbase \\n(.B
+.ds pngfile \\*[pngbase]\\n+[png].png
+.html - <center><img src="\\*[pngfile]"></center>
+.inputpipe .PE troff2png >\\*[pngfile]
+..
+.de PE
+..
+.de B1
+.margin 0
+.nr TW 10
+.nr TW1 80
+.if !'\\$1'' .nr TW \\$1
+.if !'\\$2'' .nr TW1 \\$2
+.html box \
+<center>\
+<table width=\\n[TW1]% cellspacing=0 cellpadding=0 border=0>\
+<tr height=1>\
+	<td width=1 bgcolor=#000000 />\
+	<td width=\\n(TW bgcolor=#000000 />\
+	<td bgcolor=#000000 />\
+	<td width=\\n(TW bgcolor=#000000 />\
+	<td width=1 bgcolor=#000000 />\
+</tr>\
+<tr height=\\n(TW>\
+	<td width=1 bgcolor=#000000 />\
+	<td width=\\n(TW />\
+	<td />\
+	<td width=\\n(TW />\
+	<td width=1 bgcolor=#000000 />\
+</tr>
+.html box0 <tr>
+.html box1 <td width=1 bgcolor=#000000 /><td width=\\n(TW /><td>
+..
+.de B2
+.html box1 <td width=\\n(TW /><td width=1 bgcolor=#000000 />
+.html box0 <tr height=\\n(TW><td width=1 bgcolor=#000000 />\
+	<td width=\\n(TW /><td /><td width=\\n(TW />\
+	<td width=1 bgcolor=#000000 />\
+</tr>\
+<tr height=1>\
+	<td width=1 bgcolor=#000000 />\
+	<td width=\\n(TW bgcolor=#000000 />\
+	<td bgcolor=#000000 />\
+	<td width=\\n(TW bgcolor=#000000 />\
+	<td width=1 bgcolor=#000000 />\
+</tr>
+.html box
+.margin 1
+..

+ 7 - 2
sys/lib/tmac/tmac.s

@@ -308,9 +308,11 @@
 .di WT
 .na
 .fi
+.ie h .ll \\n(LLu
+.el \{\
 .ll 5.0i
 .if n .if \\n(TN .ll 29
-.if t .if \\n(TN .ll 3.5i
+.if t .if \\n(TN .ll 3.5i \}
 .ft 3
 .ps \\n(PS
 .if !\\n(TN \{\
@@ -318,6 +320,7 @@
 .	vs \\n(.s+2
 .	rm CS\}
 .hy 0
+.if h .ce 999
 ..
 .de TX
 .rs
@@ -358,6 +361,7 @@
 .		ft 3
 .		ll 16\}\}
 .ps \\n(PS
+.if h .ce 999
 ..
 .de AX
 .ft 1
@@ -1259,7 +1263,8 @@ ABSTRACT
 .ta \\n(JQu \\n(TYuR
 .if \\n(.$ \{\
 .ti \\n(I\\n(IRu
-\&\\$1\t\c\}
+\&\\$1\t\c
+.\}
 ..
 .	\"LP - left aligned (block) paragraph
 .de LP

+ 119 - 0
sys/man/1/htmlroff

@@ -0,0 +1,119 @@
+.TH HTMLROFF 1
+.SH NAME
+htmlroff \- HTML formatting and typesetting
+.SH SYNOPSIS
+.B htmlroff
+[
+.B -iuv
+]
+[
+.B -m
+.I name
+]
+[
+.B -r
+.I aN
+]
+[
+.I file
+\&...
+]
+.SH DESCRIPTION
+.I Htmlroff
+accepts
+.IR troff (1)
+input in the named 
+.I files
+and formats it as HTML for viewing in a web browser.
+.PP
+If no
+.I file
+argument is given, 
+.I htmlroff
+reads the standard input.
+An argument consisting of a single minus
+.RB ( - )
+is taken to be
+a file name corresponding to the standard input.
+The options are:
+.TP
+.B -i
+Read standard input after the input files are exhausted.
+.TP
+.BI -m name
+Process the macro file
+.BI /sys/lib/tmac/tmac. name
+before the input
+.IR files .
+.TP
+.BI -r aN
+Set register
+.I a
+(one character name) to
+.IR N .
+.TP
+.B -u
+Generate UTF output.
+By default, 
+.I htmlroff
+converts Unicode runes into the corresponding
+HTML entity sequences
+.RB ( &alpha; ,
+.BR &nbsp; ,
+and so on).
+.I Htmlroff
+invokes
+.IR tcs (1)
+for the conversion.
+.TP
+.B -v
+Generate debugging output and warnings about suspicious input.
+.PD
+.PP
+Most 
+.I troff
+input files, especially those using the
+.IR ms (6)
+macros, can be used unaltered.
+In general, the macro file
+.B tmac.html
+should be processed after processing other standard macro files,
+as in 
+.B htmlroff
+.B -ms
+.BR -mhtml .
+.PP
+.IR Htmlroff (6)
+describes the changes to the input language.
+.PP
+.IR Mhtml (6)
+describes the new macros.
+.SH EXAMPLES
+Format the Plan 9 web page:
+.IP
+.EX
+cd /usr/web/plan9
+htmlroff -mhtml index.tr >index.html
+.EE
+.PP
+Format a paper:
+.IP
+.EX
+cd /sys/doc
+pic auth.ms | tbl | eqn | htmlroff -ms -mhtml >auth.html
+.EE
+.SH FILES
+.TP
+.B /sys/lib/troff/font/devutf/utfmap
+Mapping from
+.I troff
+two-character names like
+.B \e(*a
+to Unicode characters like α.
+.SH SOURCE
+.B /sys/src/cmd/htmlroff
+.SH "SEE ALSO
+.IR tcs (1),
+.IR troff (1),
+.IR htmlroff (6),
+.IR mhtml (6)

+ 6 - 0
sys/man/1/tcs

@@ -108,6 +108,9 @@ Part 8 (Hebrew)
 .B 8859-9
 Latin-5 (Finnish .. Portuguese)
 .TP
+.B html
+Unicode as encoded by HTML
+.TP
 .B koi8
 KOI-8 (GOST 19769-74)
 .TP
@@ -157,6 +160,9 @@ Unknown Kanji will be converted into
 .B 0xFFFD
 characters.
 .TP
+.B tcs -t html
+Convert UTF into character set-independent HTML.
+.TP
 .B tcs -lv
 Print an up to date list of the supported character sets.
 .SH SOURCE

+ 358 - 0
sys/man/6/htmlroff

@@ -0,0 +1,358 @@
+.TH HTMLROFF 6
+.SH NAME
+htmlroff \- HTML formatting and typesetting
+.SH DESCRIPTION
+.I Htmlroff (1)
+accepts 
+.I troff
+input with a few extensions and changes.
+This manual describes the changes to the input language,
+assuming a working knowledge of
+.I troff
+itself.
+.SS Name lengths
+.PP
+Request, macro, string, and number names can be longer
+than two letters, as in:
+.IP
+.EX
+\&.html c <center>
+\&.de footnote
+Footnote here.
+\&..
+\&.footnote
+\&.ds string "hello
+\&\e*[string]
+\&.nr number 1
+\&\en[number]
+.EE
+.SS HTML output
+.PP
+Two new requests:
+.IP
+.EX
+\&.html \fIid\fP \fR[ \fI<html>\fP ]\fL
+\&.ihtml \fIid\fP \fR[ \fI<ihtml>\fP ]\fL
+.EE
+.LP
+.B .html
+and
+.B .ihtml
+insert HTML into the output.
+The requests are only for opening new HTML tags.
+To close previously-opened tags, repeat the request
+with the same
+.IR id .
+For example, the input:
+.IP
+.EX
+\&.html t <table><tr>
+\&.html td <td>Cell 1
+\&.html td <td>Cell 2
+\&.html td
+\&.html t
+.EX
+.LP
+produces this output:
+.IP
+.EX
+<table><tr><td>Cell 1</td><td>Cell 2</td></tr></table>
+.EE
+.LP
+The
+.B .html
+request is intended for block-level HTML constructs (those that can contain
+.BR <p> )
+and maintains the HTML tag stack automatically.
+Intermediate tags need not be explicitly closed:
+removing the final
+.B \&.html t
+line in the example above would produce the same output.
+The special
+.I id
+.L -
+closes the HTML tags immediately after printing them.
+.PP
+The
+.B .ihtml
+request is similar to
+.B .html
+but is intended for inline HTML constructs such as
+.B <b>
+or
+.B <i>
+(those that can be contained
+within 
+.BR <p> ).
+Unlike
+.BR .html ,
+.B .ihtml
+treats the open HTML tags as a set rather than a stack:
+each must be explicitly closed.
+Although it treats the tags as a set, 
+.B .ihtml
+treats nesting properly in the output,
+closing and reopening tags as necessary.
+For example, the input:
+.IP
+.EX
+\&.ihtml style <b>
+\&.ihtml link <a href="link.html">
+Bold
+\&.ihtml style <i>
+and italic, still linked.
+\&.ihtml link <a>
+Unlinked.
+\&.ihtml style
+.EE
+.LP
+produces this output:
+.IP
+.EX
+<b><a href="link.html">Bold</a></b>
+<i><a href="link.html">and italic, still linked.</i></a>
+<i>Unlinked.</i>
+.EE
+.PP
+Outside of
+.B .html
+and
+.B .ihtml
+requests, the characters
+.LR < ,
+.LR > ,
+and
+.L &
+are treated as normal characters, not HTML markers,
+and are translated to
+.LR &lt; ,
+.LR &gt; ,
+and
+.L &amp;
+on output.
+To embed the raw HTML markers, use
+.LR \e< ,
+.LR \e> ,
+and
+.L \e@
+.RI [ sic ].
+.SS Font changes
+.PP
+.I Htmlroff
+interprets the usual 
+.BR \ef ,
+.BR .ft ,
+.BR \es ,
+and
+.B .ps
+requests to change the font and point size.
+After applying each such change to its internal registers,
+.I htmlroff
+invokes the
+.B .font
+macro to emit corresponding HTML.
+The default definition of
+.B .font
+is:
+.IP
+.EX
+\&.de font
+\&.ihtml f1
+\&.ihtml f
+\&.ihtml f <span style=\"font-size=\\n(.spt\">
+\&.if \\n(.f==2 .ihtml f1 <i>
+\&.if \\n(.f==3 .ihtml f1 <b>
+\&.if \\n(.f==4 .ihtml f1 <b><i>
+\&.if \\n(.f==5 .ihtml f1 <tt>
+\&.if \\n(.f==6 .ihtml f1 <tt><i>
+\&..
+.EE
+.LP
+Input files can redefine
+.B .font
+like any other request or macro.
+.SS Paragraphs
+.I Htmlroff
+implements line height, text adjustment, and margins by 
+wrapping all output text in 
+.B <p style="...">
+tags.
+This behavior can be disabled by setting the
+.B .paragraph
+number register to zero.
+Setting the
+.B .margin
+register to zero
+eliminates only the margin annotations.
+.SS Subscripts and superscripts
+.PP
+.I Htmlroff
+interprets the
+.BR \eu ,
+.BR \ed ,
+and
+.BR \ev 
+requests to move vertically during output.
+It emits output vertically offset up the page inside
+.B <sup>
+tags and output vertically offset down the page 
+inside
+.B <sub>
+tags.  
+This heuristic handles simple equations formatted by
+.IR eqn (1).
+.SS Conditional input
+.PP
+To make it easier to write input files that can be formatted by both
+.I troff
+and
+.IR htmlroff ,
+.I htmlroff
+adds a new condition
+.B h
+which evaluates true in
+.B .if
+and
+.B .ie
+requests.
+The
+.B t
+condition continues to evaluate true, to accomodate 
+input files trying to distinguish between
+.I troff
+and
+.IR nroff .
+To write a conditional matching
+.I troff
+alone, use
+.RB ` ".if !h .if t" '.
+.PP
+.I Htmlroff 's
+handling of conditional input does not match
+.IR troff 's
+exactly.
+For example,
+.IP
+.EX
+\&.if 0 \e{\e
+\&.de xx
+\&..
+\&.\e}
+.EE
+.LP
+redefines the
+.B xx
+macro in 
+.I troff
+but not in
+.IR htmlroff .
+Do not write files depending on this behavior, as this bug may be fixed
+in the future.
+.I Htmlroff
+also mishandles
+.B \e}
+in some cases.  To work around them, use
+.B .\e}
+on a line by itself, as in the last example.
+.SS Diversions
+.PP
+Diversions in 
+.I htmlroff
+use the alignment in effect at the time of the
+diversion
+when output.
+In particular,
+.IP
+.EX
+\&.di xx
+Line here.
+\&.di
+\&.nf
+\&.ce 
+\&.xx
+.EE
+.LP
+produces a centered line in 
+.I troff
+but not in 
+.IR htmlroff .
+The solution is to center inside the diversion, as in
+.IP
+.EX
+\&.di xx
+\&.if h .ce 999
+Line here
+\&.di
+.EE
+.SS Traps
+.I Htmlroff
+implements traps at vertical position 0,
+which run when the first character is about
+to be printed.
+Other position traps are ignored.
+Input traps are implemented.
+.SS Input pipes
+.PP
+.I Htmlroff
+adds a new request
+.B .inputpipe
+.I stop
+.I cmd
+that redirects
+.IR htmlroff 's
+input into a pipe to 
+.IR cmd .
+The redirection stops on encountering the line
+.IR stop ,
+optionally followed by white space and extra text.
+This is a dangerous and clusmy request, as 
+.I htmlroff
+stops interpreting its input during the redirection, so
+.I stop
+must be found in the input itself, not in a macro that
+the input might appear to call.
+Although clusmy,
+.B .inputpipe
+allows input files to invoke
+.I troff
+to handle complicated input.
+For example, 
+.B tmac.html
+redefines the
+.B PS
+macro that marks the beginning of a
+.IR pic (1)
+picture:
+.IP
+.EX
+\&.nr png -1 1
+\&.de PS
+\&.ds pngbase "\e\e*[basename]
+\&.if '\e\e*[pngbase]'' .ds pngbase \e\en(.B
+\&.ds pngfile \e\e*[pngbase]\e\en+[png].png
+\&.html - <center><img src="\e\e*[pngfile]"></center>
+\&.inputpipe .PE troff2png >\e\e*[pngfile]
+\&..
+.EE
+.LP
+This macro invokes the shell script
+.I troff2png
+to run troff and convert the Postscript
+output to a PNG image file.
+Before starting the program, the macro creates
+a new file name for the image and prints
+HTML referring to it.
+The
+.B .B
+register holds the final path element
+(the base name) of the current input file.
+.SS Unimplemented
+Tabs are set every eight spaces and cannot be changed.
+.PP
+Some requests, such as 
+.BR .tl ,
+are unimplemented for lack of a good implementation.
+Workarounds can be defined as necessary in input files.
+.SH SEE ALSO
+.IR htmlroff (1),
+.IR mhtml (6)

+ 105 - 0
sys/man/6/mhtml

@@ -0,0 +1,105 @@
+.TH MHTML 6
+.SH NAME
+mhtml \- macros for formatting HTML
+.SH SYNOPSIS
+.B pic
+.B |
+.B tbl
+.B |
+.B eqn
+.B |
+.B htmlroff
+[
+.B -man
+|
+.B -ms
+]
+.B -mhtml
+.I file
+\&...
+.SH DESCRIPTION
+This package of
+.IR htmlroff (1)
+macro definitions provides convenient macros for formatting HTML.
+It is usually used along with 
+.I troff (1)
+macro packages such as
+.IR man (6)
+and
+.IR ms (6).
+.I Mhtml
+replaces some macros defined in the other packages,
+so it should be listed after them on the
+.I htmlroff 
+command line.
+.PP
+The following macros are defined:
+.TP
+.B .HTML \fItitle
+Print an HTML header marking the output as 
+HTML 4.01 loose transitional encoded in UTF.
+If given, the
+.I title
+is printed inside
+.B <title>
+tags.
+This macro opens the
+.B <html>
+tag, opens and closes the
+.B <head>
+section, and opens
+.B <body> .
+It invokes the
+.B .HEAD
+macro inside the
+.B <head>
+section.
+To add arbitrary lines to the header,
+append to
+.B .HEAD
+before invoking
+.BR .HTML .
+.TP
+.B .FS\fR, \fP.FE
+Accumulate footnotes and print them at the end of the
+document under a \fBNotes\fP heading.
+These replace the macros in
+.IR ms (6).
+To emit the notes accumulated so far, invoke
+.BR .NOTES .
+.TP
+.B .PS\fR, \fP.PE
+Replace input bracketed
+.B .PS
+and
+.B .PE
+with a PNG image corresponding to the output of
+running
+.I troff(1)
+on the input.
+.TP
+.B .TS\fR, \fP.TE
+Identical to
+.B .PS
+and
+.BR .PE .
+.TP
+.B .B1 \fImargin\fP \fIwidth\fR, \fL.B2
+Format the input between
+.B .B1
+and
+.B .B2
+inside a box, with
+.I margin
+(default 10)
+pixels between the box and the text.
+The box is set to be
+.I width
+(default 60)
+percent of the current output width.
+.SH FILES
+.B /sys/lib/tmac/tmac.html
+.SH  SEE ALSO
+.IR htmlroff (1),
+.IR htmlroff (6),
+.IR ms (6)

+ 148 - 0
sys/src/cmd/htmlroff/a.h

@@ -0,0 +1,148 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include <ctype.h>
+
+enum
+{
+	Unbsp = 0x00A0,
+	Uprivate = 0xF000,
+	Uempty,	/* \& */
+	Uamp,	/* raw & */
+	Ult,		/* raw < */
+	Ugt,		/* raw > */
+	Utick,	/* raw ' */
+	Ubtick,	/* raw ` */
+	Uminus,	/* raw - */
+	Uspace,	/* raw space */
+	Upl,		/* symbol + */
+	Ueq,		/* symbol = */
+	Umi,		/* symbol - */
+	Uformatted,	/* start diverted output */
+	Uunformatted,	/* end diverted output */
+
+	UPI = 720,	/* units per inch */
+	UPX = 10,	/* units per pixel */
+	
+	/* special input modes */
+	CopyMode = 1<<1,
+	ExpandMode = 1<<2,
+	ArgMode = 1<<3,
+	HtmlMode = 1<<4,
+	
+	MaxLine = 1024,
+};
+
+Rune*	L(char*);
+
+void		addesc(Rune, int (*)(void), int);
+void		addraw(Rune*, void(*)(Rune*));
+void		addreq(Rune*, void(*)(int, Rune**), int);
+void		af(Rune*, Rune*);
+void		as(Rune*, Rune*);
+void		br(void);
+void		closehtml(void);
+Rune*	copyarg(void);
+void		delraw(Rune*);
+void		delreq(Rune*);
+void		ds(Rune*, Rune*);
+int		dv(int);
+int		e_nop(void);
+int		e_warn(void);
+void*	emalloc(uint);
+void*	erealloc(void*, uint);
+Rune*	erunesmprint(char*, ...);
+Rune*	erunestrdup(Rune*);
+char*	esmprint(char*, ...);
+char*	estrdup(char*);
+int		eval(Rune*);
+int		evalscale(Rune*, int);
+Rune*	getname(void);
+int		getnext(void);
+Rune*	getds(Rune*);
+Rune*	_getnr(Rune*);
+int		getnr(Rune*);
+int		getnrr(Rune*);
+int		getrune(void);
+Rune*	getqarg(void);
+Rune*	getline(void);
+void		hideihtml(void);
+void		html(Rune*, Rune*);
+void		htmlinit(void);
+void		ihtml(Rune*, Rune*);
+void		inputnotify(void(*)(void));
+void		itrap(void);
+void		itrapset(void);
+int		linefmt(Fmt*);
+void		nr(Rune*, int);
+void		_nr(Rune*, Rune*);
+void		out(Rune*);
+void		(*outcb)(Rune);
+void		outhtml(Rune*);
+void		outrune(Rune);
+void		outtrap(void);
+int		popinput(void);
+void		printds(int);
+int		pushinputfile(Rune*);
+void		pushinputstring(Rune*);
+int		pushstdin(void);
+int		queueinputfile(Rune*);
+int		queuestdin(void);
+void		r_nop(int, Rune**);
+void		r_warn(int, Rune**);
+Rune	*readline(int);
+void		reitag(void);
+void		renraw(Rune*, Rune*);
+void		renreq(Rune*, Rune*);
+void		run(void);
+void		runinput(void);
+int		runmacro(int, int, Rune**);
+void		runmacro1(Rune*);
+Rune*	rune2html(Rune);
+void		setlinenumber(Rune*, int);
+void		showihtml(void);
+void		sp(int);
+void		t1init(void);
+void		t2init(void);
+void		t3init(void);
+void		t4init(void);
+void		t5init(void);
+void		t6init(void);
+void		t7init(void);
+void		t8init(void);
+void		t9init(void);
+void		t10init(void);
+void		t11init(void);
+void		t12init(void);
+void		t13init(void);
+void		t14init(void);
+void		t15init(void);
+void		t16init(void);
+void		t17init(void);
+void		t18init(void);
+void		t19init(void);
+void		t20init(void);
+Rune	troff2rune(Rune*);
+void		unfont(void);
+void		ungetnext(Rune);
+void		ungetrune(Rune);
+void		unitag(void);
+void		warn(char*, ...);
+
+extern	int		backslash;
+extern	int		bol;
+extern	Biobuf	bout;
+extern	int		broke;
+extern	int		dot;
+extern	int		inputmode;
+extern	int		inrequest;
+extern	int		tick;
+extern	int		utf8;
+extern	int		verbose;
+extern	int		linepos;
+
+#define	runemalloc(n)	(Rune*)emalloc((n)*sizeof(Rune))
+#define	runerealloc(r, n)	(Rune*)erealloc(r, (n)*sizeof(Rune))
+#define	runemove(a, b, n)	memmove(a, b, (n)*sizeof(Rune))
+
+#pragma varargck type "L" void

+ 116 - 0
sys/src/cmd/htmlroff/char.c

@@ -0,0 +1,116 @@
+#include "a.h"
+
+/*
+ * Translate Unicode to HTML by asking tcs(1).
+ * This way we don't have yet another table.
+ */
+Rune*
+rune2html(Rune r)
+{
+	static Biobuf b;
+	static int fd = -1;
+	static Rune **tcscache[256];
+	int p[2];
+	char *q;
+	
+	if(r == '\n')
+		return L("\n");
+
+	if(tcscache[r>>8] && tcscache[r>>8][r&0xFF])
+		return tcscache[r>>8][r&0xFF];
+
+	if(fd < 0){
+		if(pipe(p) < 0)
+			sysfatal("pipe: %r");
+		switch(fork()){
+		case -1:
+			sysfatal("fork: %r");
+		case 0:
+			dup(p[0], 0);
+			dup(p[0], 1);
+			close(p[1]);
+			execl("/bin/tcs", "tcs", "-t", "html", nil);
+			_exits(0);
+		default:
+			close(p[0]);
+			fd = p[1];
+			Binit(&b, fd, OREAD);
+			break;
+		}
+	}
+	fprint(fd, "%C\n", r);
+	q = Brdline(&b, '\n');
+	if(q == nil)
+		sysfatal("tcs: early eof");
+	q[Blinelen(&b)-1] = 0;
+	if(tcscache[r>>8] == nil)
+		tcscache[r>>8] = emalloc(256*sizeof tcscache[0][0]);
+	tcscache[r>>8][r&0xFF] = erunesmprint("%s", q);
+	return tcscache[r>>8][r&0xFF];
+}
+
+/*
+ * Translate troff to Unicode by looking in troff's utfmap.
+ * This way we don't have yet another hard-coded table.
+ */
+typedef struct Trtab Trtab;
+struct Trtab
+{
+	char t[3];
+	Rune r;
+};
+
+static Trtab trtab[200];
+int ntrtab;
+
+static Trtab trinit[] =
+{
+	"pl",		Upl,
+	"eq",	Ueq,
+	"em",	0x2014,
+	"en",	0x2013,
+	"mi",	Umi,
+	"fm",	0x2032,
+};
+