Browse Source

Plan 9 from Bell Labs 2006-03-13

David du Colombier 18 years ago
parent
commit
eb22300eaa

+ 32 - 33
dist/replica/_plan9.db

@@ -289,14 +289,14 @@
 386/bin/ip/gping - 775 sys sys 1135570820 183130
 386/bin/ip/hogports - 775 sys sys 1130384298 42901
 386/bin/ip/httpd - 20000000775 sys sys 1016920846 0
-386/bin/ip/httpd/httpd - 775 sys sys 1140717388 292569
-386/bin/ip/httpd/imagemap - 775 sys sys 1135570822 114780
-386/bin/ip/httpd/man2html - 775 sys sys 1139680592 123361
-386/bin/ip/httpd/netlib_find - 775 sys sys 1135570822 115637
-386/bin/ip/httpd/netlib_history - 775 sys sys 1135570822 114435
-386/bin/ip/httpd/save - 775 sys sys 1135570823 131200
-386/bin/ip/httpd/webls - 775 sys sys 1135570823 131299
-386/bin/ip/httpd/wikipost - 775 sys sys 1135570824 112661
+386/bin/ip/httpd/httpd - 775 sys sys 1142186773 294685
+386/bin/ip/httpd/imagemap - 775 sys sys 1142186774 116762
+386/bin/ip/httpd/man2html - 775 sys sys 1142186774 125324
+386/bin/ip/httpd/netlib_find - 775 sys sys 1142186775 117619
+386/bin/ip/httpd/netlib_history - 775 sys sys 1142186776 116417
+386/bin/ip/httpd/save - 775 sys sys 1142186776 133176
+386/bin/ip/httpd/webls - 775 sys sys 1142186776 133275
+386/bin/ip/httpd/wikipost - 775 sys sys 1142186777 114643
 386/bin/ip/httpfile - 775 sys sys 1140717389 283942
 386/bin/ip/imap4d - 775 sys sys 1140717389 237709
 386/bin/ip/ipconfig - 775 sys sys 1135570825 137844
@@ -417,7 +417,7 @@
 386/bin/swap - 775 sys sys 1135570847 62130
 386/bin/syscall - 775 sys sys 1130594788 73568
 386/bin/tail - 775 sys sys 1135570847 66163
-386/bin/tar - 775 sys sys 1141012626 93114
+386/bin/tar - 775 sys sys 1142186778 93165
 386/bin/tbl - 775 sys sys 1131302431 113308
 386/bin/tcs - 775 sys sys 1138393253 309719
 386/bin/tee - 775 sys sys 1130384340 38446
@@ -874,7 +874,7 @@ dist/replica - 20000000775 sys sys 1019277119 0
 dist/replica/cd - 664 sys sys 1019527959 390
 dist/replica/kfs - 664 sys sys 1019527929 237
 dist/replica/network - 775 sys sys 1139499513 956
-dist/replica/plan9.proto - 664 sys sys 1114460221 2560
+dist/replica/plan9.proto - 664 sys sys 1142183449 2561
 env - 20000000775 sys sys 1015094872 0
 fd - 20000000775 sys sys 947958544 0
 lib - 20000000775 sys sys 958504315 0
@@ -1491,10 +1491,6 @@ lib/face/48x48x8/y - 20000000775 sys sys 944941834 0
 lib/face/48x48x8/z - 20000000775 sys sys 944941834 0
 lib/face/48x48x8/z/zed.1 - 664 sys sys 1060174022 2364
 lib/face/48x48x8/z/zfolkerts.1 - 664 sys sys 1118196805 2364
-lib/face/512x512x24 - 20000000775 sys sys 1123100641 0
-lib/face/512x512x24/.dict - 664 sys sys 944941683 0
-lib/face/512x512x8 - 20000000775 sys sys 1123100641 0
-lib/face/512x512x8/.dict - 664 sys sys 944941683 0
 lib/font - 20000000775 sys sys 945201891 0
 lib/font/bit - 20000000775 sys sys 945202016 0
 lib/font/bit/MAP - 664 sys sys 944943734 20775
@@ -5217,7 +5213,7 @@ lib/tftpd - 20000000775 sys sys 944944178 0
 lib/unicode - 664 sys sys 958440028 223312
 lib/unicode.notice - 664 sys sys 958504386 1398
 lib/units - 664 sys sys 1071415518 9997
-lib/vgadb - 664 sys sys 1142017813 28743
+lib/vgadb - 664 sys sys 1142177527 28931
 lib/volcanoes - 664 sys sys 944944024 119831
 lib/words - 664 sys sys 1014923442 247097
 lp - 20000000775 sys sys 958199268 0
@@ -6185,7 +6181,7 @@ sys/lib/dist/pc/inst/textonly - 775 sys sys 1112361039 182
 sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
 sys/lib/dist/pc/mkfile - 664 sys sys 1123094452 2158
-sys/lib/dist/pc/plan9.ini - 664 sys sys 1020361168 512
+sys/lib/dist/pc/plan9.ini - 664 sys sys 1142177575 236
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
 sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1132452554 369
 sys/lib/dist/pc/plan9.ini.vmware - 664 sys sys 1045500078 168
@@ -7219,6 +7215,7 @@ sys/log/cs - 10000000666 sys sys 958934039 0
 sys/log/dns - 10000000666 sys sys 1022008449 0
 sys/log/ftp - 10000000666 sys sys 958934040 0
 sys/log/httpd - 20000000775 sys sys 958933934 0
+sys/log/httpd/clf - 666 sys sys 1142177993 0
 sys/log/httpd/log - 666 sys sys 958933934 0
 sys/log/httpd/pathstat - 666 sys sys 958933934 0
 sys/log/httpd/url - 666 sys sys 958933934 0
@@ -7363,7 +7360,7 @@ sys/man/1/size - 664 sys sys 944959674 393
 sys/man/1/sleep - 664 sys sys 944959673 389
 sys/man/1/sort - 664 sys sys 1113743328 4719
 sys/man/1/spell - 664 sys sys 1113743329 1876
-sys/man/1/spin - 664 sys sys 1113743327 3620
+sys/man/1/spin - 664 sys sys 1142177238 7246
 sys/man/1/split - 664 sys sys 1038183072 1171
 sys/man/1/src - 664 sys sys 954266293 1138
 sys/man/1/ssh - 664 sys sys 1048643947 6622
@@ -7586,7 +7583,7 @@ sys/man/4 - 20000000775 sys sys 1018581459 0
 sys/man/4/0intro - 664 sys sys 944959699 472
 sys/man/4/INDEX - 664 sys sys 1141357442 1018
 sys/man/4/INDEX.html - 664 sys sys 1141352366 5045
-sys/man/4/acme - 664 sys sys 1134233060 10274
+sys/man/4/acme - 664 sys sys 1142172883 10392
 sys/man/4/archfs - 664 sys sys 960000712 533
 sys/man/4/cdfs - 664 sys sys 1026846913 3638
 sys/man/4/cfs - 664 sys sys 1015024813 1758
@@ -8072,7 +8069,7 @@ sys/src/9/port/dev.c - 664 sys sys 1131289870 8219
 sys/src/9/port/devaudio.c - 664 sys sys 1142086793 21147
 sys/src/9/port/devbridge.c - 664 sys sys 1055688301 24308
 sys/src/9/port/devcap.c - 664 sys sys 1048644215 4113
-sys/src/9/port/devcons.c - 664 sys sys 1139667186 23014
+sys/src/9/port/devcons.c - 664 sys sys 1142177608 22993
 sys/src/9/port/devdraw.c - 664 sys sys 1131289870 43537
 sys/src/9/port/devdup.c - 664 sys sys 1014931172 2332
 sys/src/9/port/devenv.c - 664 sys sys 1048644225 6992
@@ -8139,7 +8136,6 @@ sys/src/9/port/segment.c - 664 sys sys 1138749368 13939
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
 sys/src/9/port/sysfile.c - 664 sys sys 1141940070 22192
 sys/src/9/port/sysproc.c - 664 sys sys 1137622456 15153
-sys/src/9/port/systab.h - 664 sys sys 1062721698 3044
 sys/src/9/port/taslock.c - 664 sys sys 1131290039 3928
 sys/src/9/port/thwack.c - 664 sys sys 1057323394 7253
 sys/src/9/port/thwack.h - 664 sys sys 1015278340 1792
@@ -8155,7 +8151,7 @@ sys/src/9/ppc/devether.c - 664 sys sys 1131290184 9327
 sys/src/9/ppc/devflash.c - 664 sys sys 1138469487 19884
 sys/src/9/ppc/devirq.c - 664 sys sys 1100701675 6314
 sys/src/9/ppc/devtls.c - 664 sys sys 1059490751 43721
-sys/src/9/ppc/etherfcc.c - 664 sys sys 1131290110 19599
+sys/src/9/ppc/etherfcc.c - 664 sys sys 1142177622 19576
 sys/src/9/ppc/etherif.h - 664 sys sys 1059490751 785
 sys/src/9/ppc/ethersaturn.c - 664 sys sys 1059490751 4321
 sys/src/9/ppc/fns.h - 664 sys sys 1111851554 3095
@@ -9840,7 +9836,6 @@ sys/src/cmd/cc/mkfile - 664 sys sys 1107365240 563
 sys/src/cmd/cc/pickle.c - 664 sys sys 1063855374 4829
 sys/src/cmd/cc/scon.c - 664 sys sys 1138463621 8788
 sys/src/cmd/cc/sub.c - 664 sys sys 1138463622 34377
-sys/src/cmd/cc/y.tab.c - 664 sys sys 1098501521 53564
 sys/src/cmd/cc/y.tab.h - 664 sys sys 1098501521 1680
 sys/src/cmd/cdfs - 20000000775 sys sys 959922196 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 964456822 1848
@@ -12317,11 +12312,11 @@ sys/src/cmd/ip/httpd/classify.c - 664 sys sys 1078840017 9665
 sys/src/cmd/ip/httpd/content.c - 664 sys sys 1015090170 3140
 sys/src/cmd/ip/httpd/emem.c - 664 sys sys 984773807 278
 sys/src/cmd/ip/httpd/hints.c - 664 sys sys 1024927592 6314
-sys/src/cmd/ip/httpd/httpd.c - 664 sys sys 1072729008 10663
-sys/src/cmd/ip/httpd/httpsrv.h - 664 sys sys 1016466463 1388
+sys/src/cmd/ip/httpd/httpd.c - 664 sys sys 1142178185 11356
+sys/src/cmd/ip/httpd/httpsrv.h - 664 sys sys 1142178186 1388
 sys/src/cmd/ip/httpd/imagemap.c - 664 sys sys 984773808 5229
 sys/src/cmd/ip/httpd/init.c - 664 sys sys 1015090171 2182
-sys/src/cmd/ip/httpd/log.c - 664 sys sys 1015090171 1391
+sys/src/cmd/ip/httpd/log.c - 664 sys sys 1142178185 3055
 sys/src/cmd/ip/httpd/man2html.c - 664 sys sys 1139667314 9069
 sys/src/cmd/ip/httpd/mkfile - 664 sys sys 1123902339 1353
 sys/src/cmd/ip/httpd/netlib_find.c - 664 sys sys 1015090172 6247
@@ -13082,7 +13077,7 @@ sys/src/cmd/rc/haventfork.c - 664 sys sys 1055698771 3122
 sys/src/cmd/rc/here.c - 664 sys sys 1135080780 2504
 sys/src/cmd/rc/io.c - 664 sys sys 1132448641 3752
 sys/src/cmd/rc/io.h - 664 sys sys 1132448641 535
-sys/src/cmd/rc/lex.c - 664 sys sys 1100894085 6100
+sys/src/cmd/rc/lex.c - 664 sys sys 1142172919 6102
 sys/src/cmd/rc/mkfile - 664 sys sys 1055698774 812
 sys/src/cmd/rc/pcmd.c - 664 sys sys 1100894086 2681
 sys/src/cmd/rc/pfnc.c - 664 sys sys 1100894087 1320
@@ -13319,7 +13314,7 @@ sys/src/cmd/tapefs/v10fs.c - 664 sys sys 1140814624 3776
 sys/src/cmd/tapefs/v6fs.c - 664 sys sys 1140814625 3993
 sys/src/cmd/tapefs/zip.h - 664 sys sys 1097914153 1428
 sys/src/cmd/tapefs/zipfs.c - 664 sys sys 1140814625 6588
-sys/src/cmd/tar.c - 664 sys sys 1141007861 24018
+sys/src/cmd/tar.c - 664 sys sys 1142172914 24068
 sys/src/cmd/tbl - 20000000775 sys sys 954038038 0
 sys/src/cmd/tbl/mkfile - 664 sys sys 944961243 268
 sys/src/cmd/tbl/t.h - 664 sys sys 944961244 3987
@@ -13459,9 +13454,9 @@ sys/src/cmd/unix/drawterm - 20000000775 sys sys 964488190 0
 sys/src/cmd/unix/drawterm/9ball.ico - 664 sys sys 1135900533 9326
 sys/src/cmd/unix/drawterm/9ball.rc - 664 sys sys 1135900533 39
 sys/src/cmd/unix/drawterm/LICENSE - 664 sys sys 1135900534 12184
-sys/src/cmd/unix/drawterm/Make.config - 664 sys sys 1135900534 29
+sys/src/cmd/unix/drawterm/Make.config - 664 sys sys 1142177508 40
 sys/src/cmd/unix/drawterm/Make.irix - 664 sys sys 1137502401 493
-sys/src/cmd/unix/drawterm/Make.unix - 664 sys sys 1135900534 429
+sys/src/cmd/unix/drawterm/Make.unix - 664 sys sys 1142177512 453
 sys/src/cmd/unix/drawterm/Make.win32 - 664 sys sys 1141662620 826
 sys/src/cmd/unix/drawterm/Makefile - 664 sys sys 1135900534 1112
 sys/src/cmd/unix/drawterm/README - 664 sys sys 1138469123 1002
@@ -13517,13 +13512,17 @@ sys/src/cmd/unix/drawterm/include/u.h - 664 sys sys 1135900763 336
 sys/src/cmd/unix/drawterm/include/unix.h - 664 sys sys 1137506303 349
 sys/src/cmd/unix/drawterm/include/user.h - 664 sys sys 1135900764 2532
 sys/src/cmd/unix/drawterm/kern - 20000000775 sys sys 1135900801 0
-sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1135900764 571
+sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1142177517 608
 sys/src/cmd/unix/drawterm/kern/allocb.c - 664 sys sys 1135900764 3172
 sys/src/cmd/unix/drawterm/kern/cache.c - 664 sys sys 1135900764 466
 sys/src/cmd/unix/drawterm/kern/chan.c - 664 sys sys 1135900764 29593
 sys/src/cmd/unix/drawterm/kern/dat.h - 664 sys sys 1135900765 10716
 sys/src/cmd/unix/drawterm/kern/data.c - 664 sys sys 1135900765 423
 sys/src/cmd/unix/drawterm/kern/dev.c - 664 sys sys 1135900765 8523
+sys/src/cmd/unix/drawterm/kern/devaudio-none.c - 664 sys sys 1142177493 471
+sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1142177493 3064
+sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1142177494 6144
+sys/src/cmd/unix/drawterm/kern/devaudio.h - 664 sys sys 1142177494 328
 sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1135900765 19526
 sys/src/cmd/unix/drawterm/kern/devdraw.c - 664 sys sys 1135900765 42481
 sys/src/cmd/unix/drawterm/kern/devfs-posix.c - 664 sys sys 1135900765 9772
@@ -13538,7 +13537,7 @@ sys/src/cmd/unix/drawterm/kern/devmouse.c - 664 sys sys 1135900767 3799
 sys/src/cmd/unix/drawterm/kern/devpipe.c - 664 sys sys 1135900767 5927
 sys/src/cmd/unix/drawterm/kern/devroot.c - 664 sys sys 1137502216 4755
 sys/src/cmd/unix/drawterm/kern/devssl.c - 664 sys sys 1135900767 26455
-sys/src/cmd/unix/drawterm/kern/devtab.c - 664 sys sys 1135900767 470
+sys/src/cmd/unix/drawterm/kern/devtab.c - 664 sys sys 1142177519 509
 sys/src/cmd/unix/drawterm/kern/error.c - 664 sys sys 1135900767 2100
 sys/src/cmd/unix/drawterm/kern/error.h - 664 sys sys 1135900768 2583
 sys/src/cmd/unix/drawterm/kern/exportfs.c - 664 sys sys 1135900768 13444
@@ -13841,7 +13840,7 @@ sys/src/cmd/unix/drawterm/libsec/smallprimetest.c - 664 sys sys 1135900591 70640
 sys/src/cmd/unix/drawterm/libsec/thumb.c - 664 sys sys 1135900592 1891
 sys/src/cmd/unix/drawterm/libsec/tlshand.c - 664 sys sys 1135900592 53926
 sys/src/cmd/unix/drawterm/libsec/x509.c - 664 sys sys 1135900592 50237
-sys/src/cmd/unix/drawterm/main.c - 664 sys sys 1137502212 2414
+sys/src/cmd/unix/drawterm/main.c - 664 sys sys 1142177501 2443
 sys/src/cmd/unix/drawterm/posix-386 - 20000000775 sys sys 1135900540 0
 sys/src/cmd/unix/drawterm/posix-386/Makefile - 664 sys sys 1135900540 378
 sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c - 664 sys sys 1135900540 90
@@ -14024,7 +14023,7 @@ sys/src/cmd/upas/smtp/mkfile - 664 sys sys 1108910002 801
 sys/src/cmd/upas/smtp/mxdial.c - 664 sys sys 1131293478 6420
 sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
-sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1127394218 20091
+sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1142187216 20134
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1108827986 1270
 sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1132331205 31097
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111

+ 32 - 33
dist/replica/plan9.db

@@ -289,14 +289,14 @@
 386/bin/ip/gping - 775 sys sys 1135570820 183130
 386/bin/ip/hogports - 775 sys sys 1130384298 42901
 386/bin/ip/httpd - 20000000775 sys sys 1016920846 0
-386/bin/ip/httpd/httpd - 775 sys sys 1140717388 292569
-386/bin/ip/httpd/imagemap - 775 sys sys 1135570822 114780
-386/bin/ip/httpd/man2html - 775 sys sys 1139680592 123361
-386/bin/ip/httpd/netlib_find - 775 sys sys 1135570822 115637
-386/bin/ip/httpd/netlib_history - 775 sys sys 1135570822 114435
-386/bin/ip/httpd/save - 775 sys sys 1135570823 131200
-386/bin/ip/httpd/webls - 775 sys sys 1135570823 131299
-386/bin/ip/httpd/wikipost - 775 sys sys 1135570824 112661
+386/bin/ip/httpd/httpd - 775 sys sys 1142186773 294685
+386/bin/ip/httpd/imagemap - 775 sys sys 1142186774 116762
+386/bin/ip/httpd/man2html - 775 sys sys 1142186774 125324
+386/bin/ip/httpd/netlib_find - 775 sys sys 1142186775 117619
+386/bin/ip/httpd/netlib_history - 775 sys sys 1142186776 116417
+386/bin/ip/httpd/save - 775 sys sys 1142186776 133176
+386/bin/ip/httpd/webls - 775 sys sys 1142186776 133275
+386/bin/ip/httpd/wikipost - 775 sys sys 1142186777 114643
 386/bin/ip/httpfile - 775 sys sys 1140717389 283942
 386/bin/ip/imap4d - 775 sys sys 1140717389 237709
 386/bin/ip/ipconfig - 775 sys sys 1135570825 137844
@@ -417,7 +417,7 @@
 386/bin/swap - 775 sys sys 1135570847 62130
 386/bin/syscall - 775 sys sys 1130594788 73568
 386/bin/tail - 775 sys sys 1135570847 66163
-386/bin/tar - 775 sys sys 1141012626 93114
+386/bin/tar - 775 sys sys 1142186778 93165
 386/bin/tbl - 775 sys sys 1131302431 113308
 386/bin/tcs - 775 sys sys 1138393253 309719
 386/bin/tee - 775 sys sys 1130384340 38446
@@ -874,7 +874,7 @@ dist/replica - 20000000775 sys sys 1019277119 0
 dist/replica/cd - 664 sys sys 1019527959 390
 dist/replica/kfs - 664 sys sys 1019527929 237
 dist/replica/network - 775 sys sys 1139499513 956
-dist/replica/plan9.proto - 664 sys sys 1114460221 2560
+dist/replica/plan9.proto - 664 sys sys 1142183449 2561
 env - 20000000775 sys sys 1015094872 0
 fd - 20000000775 sys sys 947958544 0
 lib - 20000000775 sys sys 958504315 0
@@ -1491,10 +1491,6 @@ lib/face/48x48x8/y - 20000000775 sys sys 944941834 0
 lib/face/48x48x8/z - 20000000775 sys sys 944941834 0
 lib/face/48x48x8/z/zed.1 - 664 sys sys 1060174022 2364
 lib/face/48x48x8/z/zfolkerts.1 - 664 sys sys 1118196805 2364
-lib/face/512x512x24 - 20000000775 sys sys 1123100641 0
-lib/face/512x512x24/.dict - 664 sys sys 944941683 0
-lib/face/512x512x8 - 20000000775 sys sys 1123100641 0
-lib/face/512x512x8/.dict - 664 sys sys 944941683 0
 lib/font - 20000000775 sys sys 945201891 0
 lib/font/bit - 20000000775 sys sys 945202016 0
 lib/font/bit/MAP - 664 sys sys 944943734 20775
@@ -5217,7 +5213,7 @@ lib/tftpd - 20000000775 sys sys 944944178 0
 lib/unicode - 664 sys sys 958440028 223312
 lib/unicode.notice - 664 sys sys 958504386 1398
 lib/units - 664 sys sys 1071415518 9997
-lib/vgadb - 664 sys sys 1142017813 28743
+lib/vgadb - 664 sys sys 1142177527 28931
 lib/volcanoes - 664 sys sys 944944024 119831
 lib/words - 664 sys sys 1014923442 247097
 lp - 20000000775 sys sys 958199268 0
@@ -6185,7 +6181,7 @@ sys/lib/dist/pc/inst/textonly - 775 sys sys 1112361039 182
 sys/lib/dist/pc/inst/watchfd - 775 sys sys 1127670125 362
 sys/lib/dist/pc/inst/xxx - 775 sys sys 1018469719 160
 sys/lib/dist/pc/mkfile - 664 sys sys 1123094452 2158
-sys/lib/dist/pc/plan9.ini - 664 sys sys 1020361168 512
+sys/lib/dist/pc/plan9.ini - 664 sys sys 1142177575 236
 sys/lib/dist/pc/plan9.ini.blank - 664 sys sys 1018469720 512
 sys/lib/dist/pc/plan9.ini.cd - 664 sys sys 1132452554 369
 sys/lib/dist/pc/plan9.ini.vmware - 664 sys sys 1045500078 168
@@ -7219,6 +7215,7 @@ sys/log/cs - 10000000666 sys sys 958934039 0
 sys/log/dns - 10000000666 sys sys 1022008449 0
 sys/log/ftp - 10000000666 sys sys 958934040 0
 sys/log/httpd - 20000000775 sys sys 958933934 0
+sys/log/httpd/clf - 666 sys sys 1142177993 0
 sys/log/httpd/log - 666 sys sys 958933934 0
 sys/log/httpd/pathstat - 666 sys sys 958933934 0
 sys/log/httpd/url - 666 sys sys 958933934 0
@@ -7363,7 +7360,7 @@ sys/man/1/size - 664 sys sys 944959674 393
 sys/man/1/sleep - 664 sys sys 944959673 389
 sys/man/1/sort - 664 sys sys 1113743328 4719
 sys/man/1/spell - 664 sys sys 1113743329 1876
-sys/man/1/spin - 664 sys sys 1113743327 3620
+sys/man/1/spin - 664 sys sys 1142177238 7246
 sys/man/1/split - 664 sys sys 1038183072 1171
 sys/man/1/src - 664 sys sys 954266293 1138
 sys/man/1/ssh - 664 sys sys 1048643947 6622
@@ -7586,7 +7583,7 @@ sys/man/4 - 20000000775 sys sys 1018581459 0
 sys/man/4/0intro - 664 sys sys 944959699 472
 sys/man/4/INDEX - 664 sys sys 1141357442 1018
 sys/man/4/INDEX.html - 664 sys sys 1141352366 5045
-sys/man/4/acme - 664 sys sys 1134233060 10274
+sys/man/4/acme - 664 sys sys 1142172883 10392
 sys/man/4/archfs - 664 sys sys 960000712 533
 sys/man/4/cdfs - 664 sys sys 1026846913 3638
 sys/man/4/cfs - 664 sys sys 1015024813 1758
@@ -8072,7 +8069,7 @@ sys/src/9/port/dev.c - 664 sys sys 1131289870 8219
 sys/src/9/port/devaudio.c - 664 sys sys 1142086793 21147
 sys/src/9/port/devbridge.c - 664 sys sys 1055688301 24308
 sys/src/9/port/devcap.c - 664 sys sys 1048644215 4113
-sys/src/9/port/devcons.c - 664 sys sys 1139667186 23014
+sys/src/9/port/devcons.c - 664 sys sys 1142177608 22993
 sys/src/9/port/devdraw.c - 664 sys sys 1131289870 43537
 sys/src/9/port/devdup.c - 664 sys sys 1014931172 2332
 sys/src/9/port/devenv.c - 664 sys sys 1048644225 6992
@@ -8139,7 +8136,6 @@ sys/src/9/port/segment.c - 664 sys sys 1138749368 13939
 sys/src/9/port/swap.c - 664 sys sys 1138028310 7019
 sys/src/9/port/sysfile.c - 664 sys sys 1141940070 22192
 sys/src/9/port/sysproc.c - 664 sys sys 1137622456 15153
-sys/src/9/port/systab.h - 664 sys sys 1062721698 3044
 sys/src/9/port/taslock.c - 664 sys sys 1131290039 3928
 sys/src/9/port/thwack.c - 664 sys sys 1057323394 7253
 sys/src/9/port/thwack.h - 664 sys sys 1015278340 1792
@@ -8155,7 +8151,7 @@ sys/src/9/ppc/devether.c - 664 sys sys 1131290184 9327
 sys/src/9/ppc/devflash.c - 664 sys sys 1138469487 19884
 sys/src/9/ppc/devirq.c - 664 sys sys 1100701675 6314
 sys/src/9/ppc/devtls.c - 664 sys sys 1059490751 43721
-sys/src/9/ppc/etherfcc.c - 664 sys sys 1131290110 19599
+sys/src/9/ppc/etherfcc.c - 664 sys sys 1142177622 19576
 sys/src/9/ppc/etherif.h - 664 sys sys 1059490751 785
 sys/src/9/ppc/ethersaturn.c - 664 sys sys 1059490751 4321
 sys/src/9/ppc/fns.h - 664 sys sys 1111851554 3095
@@ -9840,7 +9836,6 @@ sys/src/cmd/cc/mkfile - 664 sys sys 1107365240 563
 sys/src/cmd/cc/pickle.c - 664 sys sys 1063855374 4829
 sys/src/cmd/cc/scon.c - 664 sys sys 1138463621 8788
 sys/src/cmd/cc/sub.c - 664 sys sys 1138463622 34377
-sys/src/cmd/cc/y.tab.c - 664 sys sys 1098501521 53564
 sys/src/cmd/cc/y.tab.h - 664 sys sys 1098501521 1680
 sys/src/cmd/cdfs - 20000000775 sys sys 959922196 0
 sys/src/cmd/cdfs/buf.c - 664 sys sys 964456822 1848
@@ -12317,11 +12312,11 @@ sys/src/cmd/ip/httpd/classify.c - 664 sys sys 1078840017 9665
 sys/src/cmd/ip/httpd/content.c - 664 sys sys 1015090170 3140
 sys/src/cmd/ip/httpd/emem.c - 664 sys sys 984773807 278
 sys/src/cmd/ip/httpd/hints.c - 664 sys sys 1024927592 6314
-sys/src/cmd/ip/httpd/httpd.c - 664 sys sys 1072729008 10663
-sys/src/cmd/ip/httpd/httpsrv.h - 664 sys sys 1016466463 1388
+sys/src/cmd/ip/httpd/httpd.c - 664 sys sys 1142178185 11356
+sys/src/cmd/ip/httpd/httpsrv.h - 664 sys sys 1142178186 1388
 sys/src/cmd/ip/httpd/imagemap.c - 664 sys sys 984773808 5229
 sys/src/cmd/ip/httpd/init.c - 664 sys sys 1015090171 2182
-sys/src/cmd/ip/httpd/log.c - 664 sys sys 1015090171 1391
+sys/src/cmd/ip/httpd/log.c - 664 sys sys 1142178185 3055
 sys/src/cmd/ip/httpd/man2html.c - 664 sys sys 1139667314 9069
 sys/src/cmd/ip/httpd/mkfile - 664 sys sys 1123902339 1353
 sys/src/cmd/ip/httpd/netlib_find.c - 664 sys sys 1015090172 6247
@@ -13082,7 +13077,7 @@ sys/src/cmd/rc/haventfork.c - 664 sys sys 1055698771 3122
 sys/src/cmd/rc/here.c - 664 sys sys 1135080780 2504
 sys/src/cmd/rc/io.c - 664 sys sys 1132448641 3752
 sys/src/cmd/rc/io.h - 664 sys sys 1132448641 535
-sys/src/cmd/rc/lex.c - 664 sys sys 1100894085 6100
+sys/src/cmd/rc/lex.c - 664 sys sys 1142172919 6102
 sys/src/cmd/rc/mkfile - 664 sys sys 1055698774 812
 sys/src/cmd/rc/pcmd.c - 664 sys sys 1100894086 2681
 sys/src/cmd/rc/pfnc.c - 664 sys sys 1100894087 1320
@@ -13319,7 +13314,7 @@ sys/src/cmd/tapefs/v10fs.c - 664 sys sys 1140814624 3776
 sys/src/cmd/tapefs/v6fs.c - 664 sys sys 1140814625 3993
 sys/src/cmd/tapefs/zip.h - 664 sys sys 1097914153 1428
 sys/src/cmd/tapefs/zipfs.c - 664 sys sys 1140814625 6588
-sys/src/cmd/tar.c - 664 sys sys 1141007861 24018
+sys/src/cmd/tar.c - 664 sys sys 1142172914 24068
 sys/src/cmd/tbl - 20000000775 sys sys 954038038 0
 sys/src/cmd/tbl/mkfile - 664 sys sys 944961243 268
 sys/src/cmd/tbl/t.h - 664 sys sys 944961244 3987
@@ -13459,9 +13454,9 @@ sys/src/cmd/unix/drawterm - 20000000775 sys sys 964488190 0
 sys/src/cmd/unix/drawterm/9ball.ico - 664 sys sys 1135900533 9326
 sys/src/cmd/unix/drawterm/9ball.rc - 664 sys sys 1135900533 39
 sys/src/cmd/unix/drawterm/LICENSE - 664 sys sys 1135900534 12184
-sys/src/cmd/unix/drawterm/Make.config - 664 sys sys 1135900534 29
+sys/src/cmd/unix/drawterm/Make.config - 664 sys sys 1142177508 40
 sys/src/cmd/unix/drawterm/Make.irix - 664 sys sys 1137502401 493
-sys/src/cmd/unix/drawterm/Make.unix - 664 sys sys 1135900534 429
+sys/src/cmd/unix/drawterm/Make.unix - 664 sys sys 1142177512 453
 sys/src/cmd/unix/drawterm/Make.win32 - 664 sys sys 1141662620 826
 sys/src/cmd/unix/drawterm/Makefile - 664 sys sys 1135900534 1112
 sys/src/cmd/unix/drawterm/README - 664 sys sys 1138469123 1002
@@ -13517,13 +13512,17 @@ sys/src/cmd/unix/drawterm/include/u.h - 664 sys sys 1135900763 336
 sys/src/cmd/unix/drawterm/include/unix.h - 664 sys sys 1137506303 349
 sys/src/cmd/unix/drawterm/include/user.h - 664 sys sys 1135900764 2532
 sys/src/cmd/unix/drawterm/kern - 20000000775 sys sys 1135900801 0
-sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1135900764 571
+sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1142177517 608
 sys/src/cmd/unix/drawterm/kern/allocb.c - 664 sys sys 1135900764 3172
 sys/src/cmd/unix/drawterm/kern/cache.c - 664 sys sys 1135900764 466
 sys/src/cmd/unix/drawterm/kern/chan.c - 664 sys sys 1135900764 29593
 sys/src/cmd/unix/drawterm/kern/dat.h - 664 sys sys 1135900765 10716
 sys/src/cmd/unix/drawterm/kern/data.c - 664 sys sys 1135900765 423
 sys/src/cmd/unix/drawterm/kern/dev.c - 664 sys sys 1135900765 8523
+sys/src/cmd/unix/drawterm/kern/devaudio-none.c - 664 sys sys 1142177493 471
+sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1142177493 3064
+sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1142177494 6144
+sys/src/cmd/unix/drawterm/kern/devaudio.h - 664 sys sys 1142177494 328
 sys/src/cmd/unix/drawterm/kern/devcons.c - 664 sys sys 1135900765 19526
 sys/src/cmd/unix/drawterm/kern/devdraw.c - 664 sys sys 1135900765 42481
 sys/src/cmd/unix/drawterm/kern/devfs-posix.c - 664 sys sys 1135900765 9772
@@ -13538,7 +13537,7 @@ sys/src/cmd/unix/drawterm/kern/devmouse.c - 664 sys sys 1135900767 3799
 sys/src/cmd/unix/drawterm/kern/devpipe.c - 664 sys sys 1135900767 5927
 sys/src/cmd/unix/drawterm/kern/devroot.c - 664 sys sys 1137502216 4755
 sys/src/cmd/unix/drawterm/kern/devssl.c - 664 sys sys 1135900767 26455
-sys/src/cmd/unix/drawterm/kern/devtab.c - 664 sys sys 1135900767 470
+sys/src/cmd/unix/drawterm/kern/devtab.c - 664 sys sys 1142177519 509
 sys/src/cmd/unix/drawterm/kern/error.c - 664 sys sys 1135900767 2100
 sys/src/cmd/unix/drawterm/kern/error.h - 664 sys sys 1135900768 2583
 sys/src/cmd/unix/drawterm/kern/exportfs.c - 664 sys sys 1135900768 13444
@@ -13841,7 +13840,7 @@ sys/src/cmd/unix/drawterm/libsec/smallprimetest.c - 664 sys sys 1135900591 70640
 sys/src/cmd/unix/drawterm/libsec/thumb.c - 664 sys sys 1135900592 1891
 sys/src/cmd/unix/drawterm/libsec/tlshand.c - 664 sys sys 1135900592 53926
 sys/src/cmd/unix/drawterm/libsec/x509.c - 664 sys sys 1135900592 50237
-sys/src/cmd/unix/drawterm/main.c - 664 sys sys 1137502212 2414
+sys/src/cmd/unix/drawterm/main.c - 664 sys sys 1142177501 2443
 sys/src/cmd/unix/drawterm/posix-386 - 20000000775 sys sys 1135900540 0
 sys/src/cmd/unix/drawterm/posix-386/Makefile - 664 sys sys 1135900540 378
 sys/src/cmd/unix/drawterm/posix-386/getcallerpc.c - 664 sys sys 1135900540 90
@@ -14024,7 +14023,7 @@ sys/src/cmd/upas/smtp/mkfile - 664 sys sys 1108910002 801
 sys/src/cmd/upas/smtp/mxdial.c - 664 sys sys 1131293478 6420
 sys/src/cmd/upas/smtp/rfc822.y - 664 sys sys 1064589606 13417
 sys/src/cmd/upas/smtp/rmtdns.c - 664 sys sys 1015013150 1069
-sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1127394218 20091
+sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1142187216 20134
 sys/src/cmd/upas/smtp/smtp.h - 664 sys sys 1108827986 1270
 sys/src/cmd/upas/smtp/smtpd.c - 664 sys sys 1132331205 31097
 sys/src/cmd/upas/smtp/smtpd.h - 664 sys sys 1067722781 1111

+ 45 - 0
dist/replica/plan9.log

@@ -27993,3 +27993,48 @@
 1142087443 2 c sys/src/cmd/faces/facedb.c - 664 sys sys 1142086801 10551
 1142100046 0 c 386/bin/faces - 775 sys sys 1142099815 194163
 1142124411 0 c sys/src/9/pc/mmu.c - 664 sys sys 1142124315 25229
+1142173866 0 c sys/man/4/acme - 664 sys sys 1142172883 10392
+1142173866 1 c sys/src/cmd/rc/lex.c - 664 sys sys 1142172919 6102
+1142173866 2 c sys/src/cmd/tar.c - 664 sys sys 1142172914 24068
+1142177468 0 c sys/man/1/spin - 664 sys sys 1142177238 7246
+1142177468 1 c sys/src/cmd/unix/drawterm/Make.config - 664 sys sys 1142177508 40
+1142177468 2 c sys/src/cmd/unix/drawterm/Make.unix - 664 sys sys 1142177512 453
+1142177468 3 c sys/src/cmd/unix/drawterm/kern/Makefile - 664 sys sys 1142177517 608
+1142177468 4 a sys/src/cmd/unix/drawterm/kern/devaudio-none.c - 664 sys sys 1142177493 471
+1142177468 5 a sys/src/cmd/unix/drawterm/kern/devaudio-unix.c - 664 sys sys 1142177493 3064
+1142177468 6 a sys/src/cmd/unix/drawterm/kern/devaudio.c - 664 sys sys 1142177494 6144
+1142177468 7 a sys/src/cmd/unix/drawterm/kern/devaudio.h - 664 sys sys 1142177494 328
+1142177468 8 c sys/src/cmd/unix/drawterm/kern/devtab.c - 664 sys sys 1142177519 509
+1142177468 9 c sys/src/cmd/unix/drawterm/main.c - 664 sys sys 1142177501 2443
+1142177468 10 d lib/face/512x512x8/.dict - 664 sys sys 944941683 0
+1142177468 11 d lib/face/512x512x8 - 20000000775 sys sys 1123100641 0
+1142177468 12 d lib/face/512x512x24/.dict - 664 sys sys 944941683 0
+1142177468 13 d lib/face/512x512x24 - 20000000775 sys sys 1123100641 0
+1142179267 0 c lib/vgadb - 664 sys sys 1142177527 28931
+1142179267 1 c sys/lib/dist/pc/plan9.ini - 664 sys sys 1142177575 236
+1142179267 2 a sys/log/httpd/clf - 666 sys sys 1142177993 0
+1142179267 3 m sys/log/httpd/clf - 10000000666 sys sys 1142177993 0
+1142179267 4 c sys/src/9/port/devcons.c - 664 sys sys 1142177608 22993
+1142179267 5 c sys/src/9/ppc/etherfcc.c - 664 sys sys 1142177622 19576
+1142179267 6 c sys/src/cmd/ip/httpd/httpd.c - 664 sys sys 1142178185 11356
+1142179267 7 c sys/src/cmd/ip/httpd/httpsrv.h - 664 sys sys 1142178186 1388
+1142179267 8 c sys/src/cmd/ip/httpd/log.c - 664 sys sys 1142178185 3055
+1142179267 9 c dist/replica/plan9.proto - 664 sys sys 1142178166 2580
+1142179267 10 d sys/src/cmd/cc/y.tab.c - 664 sys sys 1098501521 0
+1142179267 11 d sys/src/9/port/systab.h - 664 sys sys 1062721698 0
+1142181069 0 m sys/log/httpd/clf - 666 sys sys 1142177993 0
+1142181069 1 m sys/log/httpd/clf - 10000000666 sys sys 1142177993 0
+1142182870 0 m sys/log/httpd/clf - 666 sys sys 1142177993 0
+1142182870 1 m sys/log/httpd/clf - 10000000666 sys sys 1142177993 0
+1142184671 0 m sys/log/httpd/clf - 666 sys sys 1142177993 0
+1142184671 1 c dist/replica/plan9.proto - 664 sys sys 1142183449 2561
+1142188272 0 c 386/bin/ip/httpd/httpd - 775 sys sys 1142186773 294685
+1142188272 1 c 386/bin/ip/httpd/imagemap - 775 sys sys 1142186774 116762
+1142188272 2 c 386/bin/ip/httpd/man2html - 775 sys sys 1142186774 125324
+1142188272 3 c 386/bin/ip/httpd/netlib_find - 775 sys sys 1142186775 117619
+1142188272 4 c 386/bin/ip/httpd/netlib_history - 775 sys sys 1142186776 116417
+1142188272 5 c 386/bin/ip/httpd/save - 775 sys sys 1142186776 133176
+1142188272 6 c 386/bin/ip/httpd/webls - 775 sys sys 1142186776 133275
+1142188272 7 c 386/bin/ip/httpd/wikipost - 775 sys sys 1142186777 114643
+1142188272 8 c 386/bin/tar - 775 sys sys 1142186778 93165
+1142188272 9 c sys/src/cmd/upas/smtp/smtp.c - 664 sys sys 1142187216 20134

+ 1 - 1
dist/replica/plan9.proto

@@ -140,7 +140,7 @@ sys	- sys sys
 		*	a666 sys sys 
 		timesync.d	d775 sys sys
 		httpd	- sys sys
-			*	666 sys sys
+			*	a666 sys sys
 	man	- sys sys
 		+	- sys sys
 	src	- sys sys

+ 0 - 0
lib/face/512x512x8/.dict


+ 10 - 0
lib/vgadb

@@ -616,6 +616,16 @@ dell2000fp=1600x1200
 	defaultclock=200
 	shb=1664 ehb=1864 ht=2136
 	vrs=1202 vre=1207 vt=1251
+#
+# Dell 2001FP at 1600x1200 with geforce2 DVI card
+#
+dell2001fp
+	videobw=162
+	alias=multisync
+dell2001fp=1600x1200
+	defaultclock=162
+	shb=1624 ehb=1976 ht=2160
+	vrs=1201 vre=1204 vt=1250
 
 #
 # EIZO (Nanao) FlexScan 6600 (greyscale)

+ 16 - 10
sys/lib/dist/pc/plan9.ini

@@ -1,10 +1,16 @@
-THIS IS A 512 byte BLANK PLAN9.INI
-                                                       
-                                                       
-                                                       
-                                                       
-                                                       
-                                                       
-                                                       
-                                                       
-                            
+*nomp=1
+distname=plan9
+nobootprompt=local!/boot/bzroot
+*nodumpstack=1
+partition=new
+mouseport=ask
+monitor=ask
+vgasize=ask
+dmamode=ask
+
+# serial console on COM1
+#console=0
+
+# disable ether and usb probing
+#*nousbprobe=1
+#*noetherprobe=1

+ 0 - 0
lib/face/512x512x24/.dict → sys/log/httpd/clf


+ 282 - 102
sys/man/1/spin

@@ -1,151 +1,331 @@
 .TH SPIN 1
 .SH NAME
-spin \- verification tool for concurrent systems
+spin \- verification tool for models of concurrent systems
 .SH SYNOPSIS
 .B spin
+.B -a
+[
+.B -m
+]
+[
+.BI -P cpp
+]
+.I file
+.PP
+.B spin
+[
+.B -bglmprsv
+]
 [
 .BI -n N
 ]
 [
-.B -cplgrsmv
+.BI -P cpp
 ]
+.I file
+.PP
+.B spin
+.B -c
 [
-.B -iat
+.B -t
 ]
 [
-.B -V
+.BI -P cpp
 ]
+.I file
+.PP
+.B spin
+.B -d
 [
+.BI -P cpp
+]
 .I file
+.PP
+.B spin
+.B -f
+.I ltl
+.PP
+.B spin
+.B -F
+.I file
+.PP
+.B spin
+.B -i
+[
+.B -bglmprsv
+]
+[
+.BI -n N
+]
+[
+.BI -P cpp
+]
+.I file
+.PP
+.B spin
+.B -M
+[
+.B -t
+]
+[
+.BI -P cpp
+]
+.I file
+.PP
+.B spin
+.BR -t [ \fIN ]
+[
+.B -bglmprsv
+]
+[
+.BI -j N
+]
+[
+.BI -P cpp
 ]
+.I file
+.PP
+.B spin
+.B -V
 .SH DESCRIPTION
 .I Spin
 is a tool for analyzing the logical consistency of
-concurrent systems, specifically communication protocols.
-The system is specified in a guarded command language called
-.SM PROMELA\c
-\&.
-The language, described in the references,
-allows for the dynamic creation of processes,
-nondeterministic case selection, loops, gotos,
-variables, and the specification of correctness requirements.
-The tool has fast algorithms for analyzing arbitrary
-liveness and safety conditions.
+asynchronous systems, specifically distributed software
+amd communication protocols.
+A verification model of the system is first specified
+in a guarded command language called Promela.
+This specification language, described in the reference,
+allows for the modeling of dynamic creation of
+asynchronous processes,
+nondeterministic case selection, loops, gotos, local and
+global variables.
+It also allows for a concise specification of logical
+correctness requirements, including, but not restricted
+to requirements expressed in linear temporal logic.
 .PP
-Given a model system specified in
-.SM PROMELA\c
-,
+Given a Promela model
+stored in
+.I file ,
 .I spin
 can perform interactive, guided, or random simulations
-of the system's execution
-or it can generate a C program that performs an exhaustive
-or approximate verification of the system.
-The verifier can check, for instance, if user specified system
-invariants are violated during a protocol's execution, or
-if non-progress execution cycles exist.
+of the system's execution.
+It can also generate a C program that performs an exhaustive
+or approximate verification of the correctness requirements
+for the system.
 .PP
-Without any options the program performs a random simulation of the system
-defined in the input
-.IR file ,
-default standard input.
-The option
-.BI -n N
-sets the random seed to the integer value
+The basic command options are:
+.\"----------------------a----------------
+.TP
+.B -a
+Generate a verifier (model checker) for the specification.
+The output is written into a set of C files, named
+.BR pan.[cbhmt] ,
+that can be compiled
+.RB ( "pcc pan.c" )
+to produce an executable verifier.
+The online
+.I spin
+manuals (see below) contain
+the details on compilation and use of the verifiers.
+.\"--------------------------c------------
+.TP
+.B -c
+Produce an ASCII approximation of a message sequence
+chart for a random or guided (when combined with 
+.BR -t )
+simulation run. 
+See also option
+.BR -M .
+.\"--------------------------d------------
+.TP
+.BI -d
+Produce symbol table information for the model specified in
+.I file .
+For each Promela object this information includes the type, name and
+number of elements (if declared as an array), the initial
+value (if a data object) or size (if a message channel), the
+scope (global or local), and whether the object is declared as
+a variable or as a parameter.  For message channels, the data types
+of the message fields are listed.
+For structure variables, the third field defines the
+name of the structure declaration that contains the variable.
+.\"--------------------------f------------
+.TP
+.B "-f \f2ltl\f1"
+Translate the LTL formula
+.I ltl
+into a never claim.
+.br
+This option reads a formula in LTL syntax from the second argument
+and translates it into Promela syntax (a never claim, which is Promela's
+equivalent of a Büchi Automaton).
+The LTL operators are written: 
+.B []
+(always),
+.B <>
+(eventually),
+and
+.B U
+(strong until).  There is no 
+.B X
+(next) operator, to secure
+compatibility with the partial order reduction rules that are
+applied during the verification process.
+If the formula contains spaces, it should be quoted to form a
+single argument to the
+.I spin
+command.
+.\"--------------------------F------------
+.TP
+.B "-F \f2file\f1"
+Translate the LTL formula stored in
+.I file
+into a never claim.
+.br
+This behaves identical to option
+.B -f
+but will read the formula from the
+.I file
+instead of from the command line.
+The file should contain the formula as the first line.  Any text
+that follows this first line is ignored, so it can be used to
+store comments or annotation on the formula.
+(On some systems the quoting conventions of the shell complicate
+the use of option
+.BR -f .
+Option
+.B -F
+is meant to solve those problems.)
+.\"--------------------------i------------
+.TP
+.B -i
+Perform an interactive simulation, prompting the user at
+every execution step that requires a nondeterministic choice
+to be made.  The simulation proceeds without user intervention
+when execution is deterministic.
+.\"--------------------------M------------
+.TP
+.B -M
+Produce a message sequence chart in Postscript form for a
+random simulation or a guided simulation
+(when combined with 
+.BR -t ),
+for the model in
+.I file ,
+and write the result into
+.I file.ps .
+See also option
+.BR -c .
+.\"--------------------------m------------
+.TP
+.B -m
+Changes the semantics of send events.
+Ordinarily, a send action will be (blocked) if the
+target message buffer is full.
+With this option a message sent to a full buffer is lost.
+.\"--------------------------n------------
+.TP
+.B "-n\f2N"
+Set the seed for a random simulation to the integer value
+.I N .
+There is no space between the
+.B -n
+and the integer
 .IR N .
+.\"--------------------------t------------
+.TP
+.B -t
+Perform a guided simulation, following the error trail that
+was produces by an earlier verification run, see the online manuals
+for the details on verification.
+.\"--------------------------V------------
+.TP
+.B -V
+Prints the
+.I spin
+version number and exits.
+.\"--------------------------.------------
+.PD
 .PP
+With only a filename as an argument and no option flags,
+.I spin
+performs a random simulation of the model specified in
+the file (standard input is the default if the filename is omitted).
+If option
+.B -i
+is added, the simulation is 
+.IR interactive ,
+or if option
+.B -t
+is added, the simulation is
+.IR guided .
+.PP
+The simulation normally does not generate output, except what is generated
+explicitly by the user within the model with
+.B printf
+statements, and some details about the final state that is
+reached after the simulation completes.
 The group of options
-.B -pglmrsv
-is used to set the level of information reported
-about the simulation run.
+.B -bglprsv
+sets the desired level of information that the user wants
+about a random, guided, or interactive simulation run.
 Every line of output normally contains a reference to the source
-line in the specification that caused it.
+line in the specification that generated it.
+The options are:
+.\"--------------------------bglprsv------------
 .TP
-.B c
-Show message send and receive operations in tabular form, but
-no other information about the execution.
+.B -b
+Suppress the execution of
+.B printf
+statements within the model.
 .TP
-.B p
-Show at each time step which process changed state and what source
-statement was executed.
+.B -g
+Show at each time step the current value of global variables.
 .TP
-.B l
+.B -l
 In combination with option
-.BR p ,
+.BR -p ,
 show the current value of local variables of the process.
 .TP
-.B g
-Show the value of global variables at each time step.
+.B -p
+Show at each simulation step which process changed state,
+and what source statement was executed.
 .TP
-.B r
+.B -r
 Show all message-receive events, giving
 the name and number of the receiving process
-and the corresponding source line number.
+and the corresponding the source line number.
 For each message parameter, show
 the message type and the message channel number and name.
 .TP
-.B s
+.B -s
 Show all message-send events.
 .TP
-.B m
-Ordinarily, a send action will be delayed if the
-target message buffer if full.
-With this option a message sent to a full buffer is lost.
-The option can be combined with
-.B -a
-(see below).
-.TP
-.B v
-Verbose mode: add extra detail and include more warnings.
-.TP
-.BI i
-Perform an interactive simulation.
-.TP
-.B a
-Generate a protocol-specific verifier.
-The output is written into a set of C files, named
-.BR pan. [ cbhmt ],
-that can be compiled
-.RB ( "cc pan.c" )
-to produce an executable verifier.
-Systems that require more memory than available
-on the target machine can still be analyzed by compiling
-the verifier with a bit state space:
-.IP
-.B "   cc -DBITSTATE pan.c
-.IP
-This collapses the state space to 1 bit per system state,
-with minimal side-effects.
-Partial order reduction rules normally take effect during the
-verification unless the compiler directive
-.B -DNOREDUCE
-is used.
-.IP
-The compiled verifiers have their own sets of options,
-which can be seen by running them with option
-.BR -? .
-.TP
-.B t
-If the verifier finds a violation of a correctness property,
-it writes an error trail.
-The trail can be inspected in detail by invoking
-.I spin
-with the
-.B -t
-option.
-In combination with the options
-.BR pglrsv ,
-different views of the error sequence are then be obtained.
-.TP
-.B V
-Print the version number and exit.
+.B -v
+Verbose mode, add some more detail, and generat more
+hints and warnings about the model.
+.PD
 .SH SOURCE
 .B /sys/src/cmd/spin
 .SH SEE ALSO
 G.J. Holzmann,
-.I
-Design and Validation of Computer Protocols,
+.IR "Design and Validation of Computer Protocols" ,
 Prentice Hall, 1991.
 .br
+\(em, ``Design and validation of protocols: a tutorial,''
+.I "Computer Networks and ISDN Systems" ,
+Vol. 25, No. 9, 1993, pp. 981-1017.
+.br
+\(em, ``The model checker
+.SM SPIN\c
+\&,''
+.I "IEEE Trans. on Software Engineering" ,
+Vol, 23, No. 5, May 1997.
+.br
 \(em, ``Using
 .SM SPIN\c
-\&''.
+\&,''
+this manual.
+.PP
+.B http://spinroot.com/
+

+ 10 - 8
sys/man/4/acme

@@ -147,18 +147,20 @@ file.
 When read, it returns the value of the address that would next be read
 or written through the
 .B data
-file, in the format
-.BI # m ,# n
-where
+file, formatted as 2 decimal numbers
 .I m
 and
-.I n
-are character (not byte) offsets.  If
-.I m
+.IR n ,
+each formatted in 11 characters plus a blank.
+.I M
 and
 .I n
-are identical, the format is just
-.BI # m\f1.
+are the character (not byte) offsets of the
+beginning and end of the address, 
+which would be expressed in
+.I acme 's
+input language as 
+.BI # m ,# n \fR.
 Thus a regular expression may be evaluated by writing it to
 .B addr
 and reading it back.

+ 0 - 1
sys/src/9/port/devcons.c

@@ -397,7 +397,6 @@ void
 echo(char *buf, int n)
 {
 	static int ctrlt, pid;
-	extern ulong etext;
 	int x;
 	char *e, *p;
 

+ 0 - 157
sys/src/9/port/systab.h

@@ -1,157 +0,0 @@
-#include "/sys/src/libc/9syscall/sys.h"
-
-typedef long Syscall(ulong*);
-
-Syscall sysr1;
-Syscall sys_errstr;
-Syscall sysbind;
-Syscall syschdir;
-Syscall sysclose;
-Syscall sysdup;
-Syscall sysalarm;
-Syscall sysexec;
-Syscall sysexits;
-Syscall sys_fsession;
-Syscall sysfauth;
-Syscall sys_fstat;
-Syscall syssegbrk;
-Syscall sys_mount;
-Syscall sysopen;
-Syscall sys_read;
-Syscall sysoseek;
-Syscall syssleep;
-Syscall sys_stat;
-Syscall sysrfork;
-Syscall sys_write;
-Syscall syspipe;
-Syscall syscreate;
-Syscall sysfd2path;
-Syscall sysbrk_;
-Syscall sysremove;
-Syscall sys_wstat;
-Syscall sys_fwstat;
-Syscall sysnotify;
-Syscall sysnoted;
-Syscall syssegattach;
-Syscall syssegdetach;
-Syscall syssegfree;
-Syscall syssegflush;
-Syscall sysrendezvous;
-Syscall sysunmount;
-Syscall sys_wait;
-Syscall sysseek;
-Syscall sysfversion;
-Syscall syserrstr;
-Syscall sysstat;
-Syscall sysfstat;
-Syscall syswstat;
-Syscall sysfwstat;
-Syscall sysmount;
-Syscall sysawait;
-Syscall syspread;
-Syscall syspwrite;
-Syscall	sysdeath;
-
-Syscall *systab[]={
-	[SYSR1]		sysr1,
-	[_ERRSTR]	sys_errstr,
-	[BIND]		sysbind,
-	[CHDIR]		syschdir,
-	[CLOSE]		sysclose,
-	[DUP]		sysdup,
-	[ALARM]		sysalarm,
-	[EXEC]		sysexec,
-	[EXITS]		sysexits,
-	[_FSESSION]	sys_fsession,
-	[FAUTH]		sysfauth,
-	[_FSTAT]	sys_fstat,
-	[SEGBRK]	syssegbrk,
-	[_MOUNT]	sys_mount,
-	[OPEN]		sysopen,
-	[_READ]		sys_read,
-	[OSEEK]		sysoseek,
-	[SLEEP]		syssleep,
-	[_STAT]		sys_stat,
-	[RFORK]		sysrfork,
-	[_WRITE]	sys_write,
-	[PIPE]		syspipe,
-	[CREATE]	syscreate,
-	[FD2PATH]	sysfd2path,
-	[BRK_]		sysbrk_,
-	[REMOVE]	sysremove,
-	[_WSTAT]	sys_wstat,
-	[_FWSTAT]	sys_fwstat,
-	[NOTIFY]	sysnotify,
-	[NOTED]		sysnoted,
-	[SEGATTACH]	syssegattach,
-	[SEGDETACH]	syssegdetach,
-	[SEGFREE]	syssegfree,
-	[SEGFLUSH]	syssegflush,
-	[RENDEZVOUS]	sysrendezvous,
-	[UNMOUNT]	sysunmount,
-	[_WAIT]		sys_wait,
-	[SEEK]		sysseek,
-	[FVERSION]	sysfversion,
-	[ERRSTR]	syserrstr,
-	[STAT]		sysstat,
-	[FSTAT]		sysfstat,
-	[WSTAT]		syswstat,
-	[FWSTAT]	sysfwstat,
-	[MOUNT]		sysmount,
-	[AWAIT]		sysawait,
-	[PREAD]		syspread,
-	[PWRITE]	syspwrite,
-};
-
-char *sysctab[]={
-	[SYSR1]		"Running",
-	[_ERRSTR]	"_errstr",
-	[BIND]		"Bind",
-	[CHDIR]		"Chdir",
-	[CLOSE]		"Close",
-	[DUP]		"Dup",
-	[ALARM]		"Alarm",
-	[EXEC]		"Exec",
-	[EXITS]		"Exits",
-	[_FSESSION]	"_fsession",
-	[FAUTH]		"Fauth",
-	[_FSTAT]	"_fstat",
-	[SEGBRK]	"Segbrk",
-	[_MOUNT]	"_mount",
-	[OPEN]		"Open",
-	[_READ]		"_read",
-	[OSEEK]		"Oseek",
-	[SLEEP]		"Sleep",
-	[_STAT]		"_stat",
-	[RFORK]		"Rfork",
-	[_WRITE]	"_write",
-	[PIPE]		"Pipe",
-	[CREATE]	"Create",
-	[FD2PATH]	"Fd2path",
-	[BRK_]		"Brk",
-	[REMOVE]	"Remove",
-	[_WSTAT]	"_wstat",
-	[_FWSTAT]	"_fwstat",
-	[NOTIFY]	"Notify",
-	[NOTED]		"Noted",
-	[SEGATTACH]	"Segattach",
-	[SEGDETACH]	"Segdetach",
-	[SEGFREE]	"Segfree",
-	[SEGFLUSH]	"Segflush",
-	[RENDEZVOUS]	"Rendez",
-	[UNMOUNT]	"Unmount",
-	[_WAIT]		"_wait",
-	[SEEK]		"Seek",
-	[FVERSION]	"Fversion",
-	[ERRSTR]	"Errstr",
-	[STAT]		"Stat",
-	[FSTAT]		"Fstat",
-	[WSTAT]		"Wstat",
-	[FWSTAT]	"Fwstat",
-	[MOUNT]		"Mount",
-	[AWAIT]		"Await",
-	[PREAD]		"Pread",
-	[PWRITE]	"Pwrite",
-};
-
-int nsyscall = (sizeof systab/sizeof systab[0]);

+ 1 - 1
sys/src/9/ppc/etherfcc.c

@@ -684,7 +684,7 @@ reset(Ether* ether)
 		return -1;
 	}
 
-	if(!(ether->port >= 0 && ether->port < 3)){
+	if(ether->port > 3){
 		print("%s ether: no FCC port %ld\n", ether->type, ether->port);
 		return -1;
 	}

+ 0 - 1895
sys/src/cmd/cc/y.tab.c

@@ -1,1895 +0,0 @@
-
-#line	2	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-#include "cc.h"
-
-#line	4	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-typedef union 	{
-	Node*	node;
-	Sym*	sym;
-	Type*	type;
-	struct
-	{
-		Type*	t;
-		char	c;
-	} tycl;
-	struct
-	{
-		Type*	t1;
-		Type*	t2;
-	} tyty;
-	struct
-	{
-		char*	s;
-		long	l;
-	} sval;
-	long	lval;
-	double	dval;
-	vlong	vval;
-} YYSTYPE;
-extern	int	yyerrflag;
-#ifndef	YYMAXDEPTH
-#define	YYMAXDEPTH	150
-#endif
-YYSTYPE	yylval;
-YYSTYPE	yyval;
-#define	LPE	57346
-#define	LME	57347
-#define	LMLE	57348
-#define	LDVE	57349
-#define	LMDE	57350
-#define	LRSHE	57351
-#define	LLSHE	57352
-#define	LANDE	57353
-#define	LXORE	57354
-#define	LORE	57355
-#define	LOROR	57356
-#define	LANDAND	57357
-#define	LEQ	57358
-#define	LNE	57359
-#define	LLE	57360
-#define	LGE	57361
-#define	LLSH	57362
-#define	LRSH	57363
-#define	LMM	57364
-#define	LPP	57365
-#define	LMG	57366
-#define	LNAME	57367
-#define	LTYPE	57368
-#define	LFCONST	57369
-#define	LDCONST	57370
-#define	LCONST	57371
-#define	LLCONST	57372
-#define	LUCONST	57373
-#define	LULCONST	57374
-#define	LVLCONST	57375
-#define	LUVLCONST	57376
-#define	LSTRING	57377
-#define	LLSTRING	57378
-#define	LAUTO	57379
-#define	LBREAK	57380
-#define	LCASE	57381
-#define	LCHAR	57382
-#define	LCONTINUE	57383
-#define	LDEFAULT	57384
-#define	LDO	57385
-#define	LDOUBLE	57386
-#define	LELSE	57387
-#define	LEXTERN	57388
-#define	LFLOAT	57389
-#define	LFOR	57390
-#define	LGOTO	57391
-#define	LIF	57392
-#define	LINT	57393
-#define	LLONG	57394
-#define	LREGISTER	57395
-#define	LRETURN	57396
-#define	LSHORT	57397
-#define	LSIZEOF	57398
-#define	LUSED	57399
-#define	LSTATIC	57400
-#define	LSTRUCT	57401
-#define	LSWITCH	57402
-#define	LTYPEDEF	57403
-#define	LTYPESTR	57404
-#define	LUNION	57405
-#define	LUNSIGNED	57406
-#define	LWHILE	57407
-#define	LVOID	57408
-#define	LENUM	57409
-#define	LSIGNED	57410
-#define	LCONSTNT	57411
-#define	LVOLATILE	57412
-#define	LSET	57413
-#define	LSIGNOF	57414
-#define YYEOFCODE 1
-#define YYERRCODE 2
-
-#line	1158	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-
-short	yyexca[] =
-{-1, 1,
-	1, -1,
-	-2, 178,
--1, 35,
-	4, 8,
-	5, 8,
-	6, 9,
-	-2, 5,
--1, 52,
-	93, 191,
-	-2, 190,
--1, 55,
-	93, 195,
-	-2, 194,
--1, 57,
-	93, 199,
-	-2, 198,
--1, 76,
-	6, 9,
-	-2, 8,
--1, 305,
-	4, 96,
-	93, 82,
-	-2, 0,
--1, 322,
-	6, 22,
-	-2, 21,
--1, 327,
-	93, 82,
-	-2, 96,
--1, 333,
-	4, 96,
-	93, 82,
-	-2, 0,
--1, 383,
-	4, 96,
-	93, 82,
-	-2, 0,
--1, 385,
-	4, 96,
-	93, 82,
-	-2, 0,
--1, 387,
-	4, 96,
-	93, 82,
-	-2, 0,
--1, 397,
-	4, 96,
-	93, 82,
-	-2, 0,
--1, 403,
-	4, 96,
-	93, 82,
-	-2, 0,
-};
-#define	YYNPROD	241
-#define	YYPRIVATE 57344
-#define	YYLAST	1206
-short	yyact[] =
-{
- 175, 324, 256, 328, 209, 321, 203,  40, 207, 326,
-  87, 341,  38, 342, 266,  23, 205,  52,  55,  57,
-  89, 257,  46,  46,  85,   4,   5, 265,  79, 103,
- 210, 124,  90, 201, 133, 136, 201, 135,  86,  41,
-  42,  65, 140, 138,  41,  42, 268,  80,  41,  42,
-  35, 369, 277, 252, 204, 254, 123,  54, 310,  46,
- 140, 253, 308, 288,  46,  88,  46, 142, 403, 389,
- 252, 388, 316, 315, 309, 293, 290, 140, 253, 129,
- 287, 117, 131, 128, 117,  46,  66, 375, 118,  58,
- 397,  68, 217,  81, 195, 254, 254, 194,  54,  25,
-  26, 125,   5, 127, 254, 174, 254,  76, 254, 386,
- 217, 365, 116, 364, 182, 183, 184, 185, 186, 187,
- 188, 189, 303,  25,  26, 200,  82, 360,  34, 134,
- 136, 129,  41,  42, 190, 192, 357, 140, 138,  41,
-  42,  88, 295, 368, 221, 222, 223, 224, 225, 226,
- 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
- 237, 238,  81, 240, 241, 242, 243, 244, 245, 246,
- 247, 248, 249, 250, 206, 239, 218, 258, 214, 219,
- 213, 399, 387,  25,  26,  66, 260, 261,  44,  75,
- 385, 259, 383,  53, 255, 216, 215, 356, 121,  64,
-  63, 355,  43, 273,  56, 174,  37, 174, 251, 129,
-  48, 269,  88, 278,  39,  41,  42,  88, 173, 136,
- 283, 220, 282, 141, 270, 254, 140, 138,  41,  42,
- 117, 271,  67, 272,   7, 320, 367,  67, 289, 279,
-  37,  45,  45,  50, 285,  81, 371, 196,  39,  41,
-  42, 301, 284,  69,   6, 286, 347, 348,  67,  25,
-  26, 116, 252,  49, 119,  37, 122,  22, 292, 140,
- 253,  88, 281,  39,  41,  42,  51, 269,  45,  37,
- 202, 302,  78,  45, 254,  45, 307,  39,  41,  42,
- 311, 218, 298, 306, 291, 258, 300, 296, 297,   5,
- 304, 402,  88, 294,  45, 275, 276, 117,  59,  60,
-  33, 312, 319, 269, 129, 318, 314, 280, 262, 132,
- 263, 398, 346, 206, 396, 395,  24,  74, 384, 284,
- 143, 144, 145,  47,  47, 358, 354, 352, 359, 351,
-  37, 378, 376, 362, 366, 199, 363, 361,  39,  41,
-  42, 322, 353, 350, 370, 146, 147, 143, 144, 145,
- 373, 317, 299,  73,  72, 258, 258, 379, 380, 372,
-  47, 374, 129,  70, 377,  47, 382,  47, 181, 180,
- 178, 179, 177, 176,  71, 390, 329, 392, 391, 394,
- 264, 198, 120, 349,  62, 322,  47,  94, 126, 400,
- 393,  77, 401,  61,   3, 404,  95,  96,  93,   2,
-   1, 100,  99, 139, 137, 208,  91,  84,  12, 109,
- 108, 104, 105, 106, 107, 110, 111, 114, 115,  27,
- 267, 327,  13,  36, 113, 112,  20, 305,  29,  19,
- 274,  92, 325,  15,  16,  32,   8,  14, 101,   0,
-  28,   9,   0,  30,  31,  10,  18,   0,  21,  11,
-  17,  25,  26,  94, 102,   0,   0,   0,   0,  97,
-  98,   0,  95,  96,  93,   0,   0, 100,  99,   0,
-   0,   0,  91, 345,   0, 109, 108, 104, 105, 106,
- 107, 110, 111, 114, 115,   0, 336, 343,   0, 337,
- 344, 333,   0,   0,   0,   0, 331, 338, 330,   0,
- 325,   0, 334,   0, 101, 339,   0,   0, 335,   0,
-   0,   0,   0, 332,   0,   0,   0,   0,   0, 340,
- 102,  94,   0,   0, 323,  97,  98,   0,   0,   0,
-  95,  96,  93,   0,   0, 100,  99,   0,   0,   0,
-  91, 345,   0, 109, 108, 104, 105, 106, 107, 110,
- 111, 114, 115,   0, 336, 343,   0, 337, 344, 333,
-   0,   0,   0,   0, 331, 338, 330,   0,   0,   0,
- 334,   0, 101, 339,   0,   0, 335,   0,   0,   0,
-   0, 332,   0,   0,   0,   0,  94, 340, 102,   0,
-   0,   0,   0,  97,  98,  95,  96,  93,   0,   0,
- 100,  99,   0,   0,   0,  91, 345,   0, 109, 108,
- 104, 105, 106, 107, 110, 111, 114, 115,   0, 336,
- 343,   0, 337, 344, 333,   0,   0,   0,   0, 331,
- 338, 330,   0,   0,   0, 334,   0, 101, 339,   0,
-   0, 335,   0,   0,   0,   0, 332,   0,   0,   0,
-   0,  94, 340, 102,   0,   0,   0,   0,  97,  98,
-  95,  96,  93,   0,   0, 100,  99,   0, 212, 211,
-  91,  84,   0, 109, 108, 104, 105, 106, 107, 110,
- 111, 114, 115,   0,  94, 149, 148, 146, 147, 143,
- 144, 145,   0,  95,  96,  93,   0,   0, 100,  99,
-   0,   0, 101,  91,  84,   0, 109, 108, 104, 105,
- 106, 107, 110, 111, 114, 115,   0,  94, 102,   0,
-   0, 130,   0,  97,  98,   0,  95,  96,  93,   0,
-   0, 100,  99,   0,   0, 101,  91,  84,   0, 109,
- 108, 104, 105, 106, 107, 110, 111, 114, 115,   0,
-  94, 102,   0,   0, 130,   0,  97,  98,   0,  95,
-  96,  93,   0,   0, 100,  99,   0,   0, 101,  91,
-  84,   0, 109, 108, 104, 105, 106, 107, 110, 111,
- 114, 115,   0,  94, 102,   0,   0, 313,   0,  97,
-  98,   0,  95,  96,  93,   0,   0, 100,  99,   0,
-   0, 101, 193,  84,   0, 109, 108, 104, 105, 106,
- 107, 110, 111, 114, 115,   0,  94, 102,   0,   0,
-   0,   0,  97,  98,   0,  95,  96,  93,   0,   0,
- 100,  99,   0,   0, 101, 191,  84,   0, 109, 108,
- 104, 105, 106, 107, 110, 111, 114, 115,   0,   0,
- 102,   0,   0,   0,   0,  97,  98,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  12, 101,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  27,   0,   0,
-  13,   0,   0, 102,  20,   0,  29,  19,  97,  98,
-   0,  15,  16,  32,   0,  14,   0,   0,  28,   9,
-   0,  30,  31,  10,  18,   0,  21,  11,  17,  25,
-  26,  83,   0,   0,  84,  12, 197,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  27,   0,   0,  13,
-   0,   0,   0,  20,   0,  29,  19,   0,   0,   0,
-  15,  16,  32,   0,  14,   0,   0,  28,   9,  12,
-  30,  31,  10,  18,   0,  21,  11,  17,  25,  26,
-  27,   0,   0,  13,   0,   0,   0,  20,   0,  29,
-  19,   0,   0,   0,  15,  16,  32,   0,  14,   0,
-   0,  28,   9,   0,  30,  31,  10,  18,   0,  21,
-  11,  17,  25,  26,  27,   0,   0,  13,   0,   0,
-   0,  20,   0,  29,  19,   0,   0,   0,  15,  16,
-  32,   0,  14,   0,   0,  28,   0,   0,  30,  31,
-   0,  18,   0,  21,   0,  17,  25,  26, 162, 163,
- 164, 165, 166, 167, 169, 168, 170, 171, 172, 161,
- 381, 160, 159, 158, 157, 156, 154, 155, 150, 151,
- 152, 153, 149, 148, 146, 147, 143, 144, 145, 162,
- 163, 164, 165, 166, 167, 169, 168, 170, 171, 172,
- 161,   0, 160, 159, 158, 157, 156, 154, 155, 150,
- 151, 152, 153, 149, 148, 146, 147, 143, 144, 145,
- 161,   0, 160, 159, 158, 157, 156, 154, 155, 150,
- 151, 152, 153, 149, 148, 146, 147, 143, 144, 145,
- 159, 158, 157, 156, 154, 155, 150, 151, 152, 153,
- 149, 148, 146, 147, 143, 144, 145, 158, 157, 156,
- 154, 155, 150, 151, 152, 153, 149, 148, 146, 147,
- 143, 144, 145, 157, 156, 154, 155, 150, 151, 152,
- 153, 149, 148, 146, 147, 143, 144, 145, 156, 154,
- 155, 150, 151, 152, 153, 149, 148, 146, 147, 143,
- 144, 145, 154, 155, 150, 151, 152, 153, 149, 148,
- 146, 147, 143, 144, 145, 150, 151, 152, 153, 149,
- 148, 146, 147, 143, 144, 145
-};
-short	yypact[] =
-{
--1000, 915,-1000, 306,-1000,-1000, 949, 949, 915,   5,
-   5,  -4,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
--1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
--1000,-1000,-1000,-1000, 304,-1000, 158,-1000,-1000, 245,
--1000,-1000,-1000, 949,-1000,-1000,-1000,-1000, 949,-1000,
- 949,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
- 245,-1000, 276, 881, 737, 172,  -3,-1000,  12, 949,
- -36, 915, -36, -37,  58,-1000,-1000, 915, 671,  -9,
- 314,-1000, 185, 183,-1000,-1000, -25,-1000,1063,-1000,
--1000, 374, 341, 737, 737, 737, 737, 737, 737, 737,
- 737, 803, 770,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
--1000,-1000,  44,  40,-1000,-1000,-1000,-1000,-1000,-1000,
- 832,-1000,-1000,-1000,  31, 274, -39, 245,-1000,1063,
- 638,-1000, 881,-1000,-1000,-1000,-1000, 154,   1,-1000,
- 737, 181,-1000, 737, 737, 737, 737, 737, 737, 737,
- 737, 737, 737, 737, 737, 737, 737, 737, 737, 737,
- 737, 737, 737, 737, 737, 737, 737, 737, 737, 737,
- 737, 737, 737, 228, 103,1063, 737, 737,  89,  89,
--1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
--1000, 374,-1000, 374,-1000,-1000,-1000,-1000, 206,  58,
--1000,  58, 737,-1000,-1000, 301,-1000, -42, 638, 312,
- 266, 737,  89,-1000,  96, 881, 737,-1000, -11, -29,
--1000,-1000,-1000,-1000, 296, 296, 323, 323, 665, 665,
- 665, 665,1169,1169,1158,1145,1131,1116,1100, 220,
-1063,1063,1063,1063,1063,1063,1063,1063,1063,1063,
-1063, -15,-1000,  19, 737,-1000, -16, 298,1063,  50,
--1000,-1000, 228, 228, 206, 358, 291,-1000,-1000, 233,
- 737,  28,-1000,1063, 915,-1000, 245,-1000, 281, 266,
--1000,-1000, -30,-1000,-1000, -17, -34,-1000,-1000, 737,
- 704,  36,-1000,-1000, 737,-1000, -18, -19, 357,-1000,
- 206, 737,-1000,-1000, 231, 440,-1000,-1000,-1000,-1000,
--1000,1083,-1000, 638,-1000,-1000,-1000,-1000,-1000,-1000,
--1000, 252,-1000,-1000,-1000, 349,-1000, 573, 348, -39,
- 159, 155,  94, 508, 737,  85, 343, 339,  89,  71,
-  69,-1000, 279, 737, 218, 125, -43,-1000, 245, 240,
--1000,-1000,-1000,-1000,-1000, 737, 737, 737,   4, 338,
- 737,-1000,-1000, 337, 737, 737,1032,-1000,-1000,-1000,
--1000, 671, 101, 324,  99,  67,-1000,  91,-1000, -20,
- -22,-1000,-1000, 508, 737, 508, 737, 508, 321, 320,
-  27, 317,-1000,  90,-1000,-1000,-1000, 508, 737, 297,
--1000, -23,-1000, 508,-1000
-};
-short	yypgo[] =
-{
-   0,   7, 188, 267, 326,  15, 234, 202, 446,  41,
- 126, 193, 254,  24,  28,  47,   3,  29,   6,   1,
-  13,   0,  20, 441,   2,  21, 440, 437,  32, 435,
- 434,  46, 433, 431,  11,   9,   5, 430,  12,  30,
- 415,  34,  37, 414, 413,  38,  10,   4,   8, 410,
- 409, 404, 128, 403, 401, 398, 394,  25, 393,  16,
- 392, 391,  27, 390,  14, 386, 384, 373, 364, 363,
- 345,  31, 327
-};
-short	yyr1[] =
-{
-   0,  49,  49,  50,  50,  53,  55,  50,  52,  56,
-  52,  52,  31,  31,  32,  32,  32,  32,  26,  26,
-  26,  36,  58,  36,  36,  54,  54,  59,  59,  61,
-  60,  63,  60,  62,  62,  64,  64,  37,  37,  37,
-  41,  41,  42,  42,  42,  43,  43,  43,  44,  44,
-  44,  47,  47,  39,  39,  39,  40,  40,  40,  40,
-  48,  48,  48,  14,  14,  15,  15,  15,  15,  15,
-  18,  27,  27,  33,  33,  34,  34,  34,  19,  19,
-  19,  35,  65,  35,  35,  35,  35,  35,  35,  35,
-  35,  35,  35,  35,  35,  35,  16,  16,  45,  45,
-  46,  20,  20,  21,  21,  21,  21,  21,  21,  21,
-  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,
-  21,  21,  21,  21,  21,  21,  21,  21,  21,  21,
-  21,  21,  21,  21,  22,  22,  22,  28,  28,  28,
-  28,  28,  28,  28,  28,  28,  28,  28,  23,  23,
-  23,  23,  23,  23,  23,  23,  23,  23,  23,  23,
-  23,  23,  23,  23,  23,  23,  23,  23,  29,  29,
-  30,  30,  24,  24,  25,  25,  66,  11,  51,  51,
-  13,  13,  13,  13,  13,  13,  13,  13,  10,  57,
-  12,  67,  12,  12,  12,  68,  12,  12,  12,  69,
-  70,  12,  72,  12,  12,   7,   7,   9,   9,   2,
-   2,   2,   8,   8,   3,   3,  71,  71,  71,  71,
-   6,   6,   6,   6,   6,   6,   6,   6,   6,   4,
-   4,   4,   4,   4,   4,   5,   5,  17,  38,   1,
-   1
-};
-short	yyr2[] =
-{
-   0,   0,   2,   2,   3,   0,   0,   6,   1,   0,
-   4,   3,   1,   3,   1,   3,   4,   4,   0,   3,
-   4,   1,   0,   4,   3,   0,   4,   1,   3,   0,
-   4,   0,   5,   0,   1,   1,   3,   1,   3,   2,
-   0,   1,   2,   3,   1,   1,   4,   4,   2,   3,
-   3,   1,   3,   3,   2,   2,   2,   3,   1,   2,
-   1,   1,   2,   0,   1,   1,   2,   2,   3,   3,
-   4,   0,   2,   1,   2,   3,   2,   2,   2,   1,
-   2,   2,   0,   2,   5,   7,   9,   5,   7,   3,
-   5,   2,   2,   3,   5,   5,   0,   1,   0,   1,
-   1,   1,   3,   1,   3,   3,   3,   3,   3,   3,
-   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,
-   3,   3,   5,   3,   3,   3,   3,   3,   3,   3,
-   3,   3,   3,   3,   1,   5,   7,   1,   2,   2,
-   2,   2,   2,   2,   2,   2,   2,   2,   3,   5,
-   5,   4,   4,   3,   3,   2,   2,   1,   1,   1,
-   1,   1,   1,   1,   1,   1,   1,   1,   1,   2,
-   1,   2,   0,   1,   1,   3,   0,   4,   0,   1,
-   1,   1,   1,   2,   2,   3,   2,   3,   1,   1,
-   2,   0,   4,   2,   2,   0,   4,   2,   2,   0,
-   0,   7,   0,   5,   1,   1,   2,   0,   2,   1,
-   1,   1,   1,   2,   1,   1,   1,   3,   2,   3,
-   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,
-   1
-};
-short	yychk[] =
-{
--1000, -49, -50, -51, -57, -13, -12,  -6,  -8,  77,
-  81,  85,  44,  58,  73,  69,  70,  86,  82,  65,
-  62,  84,  -3,  -5,  -4,  87,  88,  55,  76,  64,
-  79,  80,  71,   4, -52, -31, -32,  34, -38,  42,
-  -1,  43,  44,  -7,  -2,  -6,  -5,  -4,  -7, -12,
-  -6,  -3,  -1, -11,  93,  -1, -11,  -1,  93,   4,
-   5, -53, -56,  42,  41,  -9, -31,  -2,  -9,  -7,
- -67, -66, -68, -69, -72, -52, -31, -54,   6, -14,
- -15, -17, -10,  40,  43, -13, -45, -46, -21, -22,
- -28,  42, -23,  34,  23,  32,  33,  95,  96,  38,
-  37,  74,  90, -17,  47,  48,  49,  50,  46,  45,
-  51,  52, -29, -30,  53,  54, -31,  -5,  91, -11,
- -60, -10, -11,  93, -71,  43, -55, -57, -47, -21,
-  93,  91,   5, -41, -31, -42,  34, -43,  42, -44,
-  41,  40,  92,  34,  35,  36,  32,  33,  31,  30,
-  26,  27,  28,  29,  24,  25,  23,  22,  21,  20,
-  19,  17,   6,   7,   8,   9,  10,  11,  13,  12,
-  14,  15,  16, -10, -20, -21,  42,  41,  39,  40,
-  38,  37, -22, -22, -22, -22, -22, -22, -22, -22,
- -28,  42, -28,  42,  53,  54, -10,  94, -61, -70,
-  94,   5,   6, -18,  93, -59, -31, -48, -40, -47,
- -39,  41,  40, -15,  -9,  42,  41,  91, -42, -45,
-  40, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -20,
- -21, -21, -21, -21, -21, -21, -21, -21, -21, -21,
- -21, -41,  34,  42,   5,  91, -24, -25, -21, -20,
-  -1,  -1, -10, -10, -63, -62, -64, -37, -31, -38,
-  18, -71, -71, -21, -26,   4,   5,  94, -47, -39,
-   5,   6, -46,  -1, -42, -14, -45,  91,  92,  18,
-  91,  -9, -20,  91,   5,  92, -41, -41, -62,   4,
-   5,  18, -46,  94, -57, -27, -59,   5,  92,  91,
-  92, -21, -22,  93, -25,  91,  91,   4, -64, -46,
-   4, -36, -31,  94, -19,   2, -35, -33, -16, -65,
-  68,  66,  83,  61,  72,  78,  56,  59,  67,  75,
-  89, -34, -20,  57,  60,  43, -48,   4,   5, -58,
-   4, -34, -35,   4, -18,  42,  42,  42, -19, -16,
-  42,   4,   4,  -1,  42,  42, -21,  18,  18,  94,
- -36,   6, -20, -16, -20,  83,   4, -20,   4, -24,
- -24,  18, -47,  91,   4,  91,  42,  91,  91,  91,
- -19, -16, -19, -20, -19,   4,   4,  63,   4,  91,
- -19, -16,   4,  91, -19
-};
-short	yydef[] =
-{
-   1,  -2,   2,   0, 179, 189, 180, 181, 182,   0,
-   0,   0, 204, 220, 221, 222, 223, 224, 225, 226,
- 227, 228, 212, 214, 215, 235, 236, 229, 230, 231,
- 232, 233, 234,   3,   0,  -2,  12, 207,  14,   0,
- 238, 239, 240, 183, 205, 209, 210, 211, 184, 207,
- 186, 213,  -2, 193, 176,  -2, 197,  -2, 202,   4,
-   0,  25,   0,  63,  98,   0,   0, 206, 185, 187,
-   0,   0,   0,   0,   0,  11,  -2,   6,   0,   0,
-  64,  65,  40,   0, 237, 188,   0,  99, 100, 103,
- 134,   0, 137,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0, 157, 158, 159, 160, 161, 162, 163,
- 164, 165, 166, 167, 168, 170,  13, 208,  15, 192,
-   0,  29, 196, 200,   0, 216,   0,   0,  10,  51,
-   0,  16,   0,  66,  67,  41, 207,  44,   0,  45,
-  98,   0,  17,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,  40,   0, 101, 172,   0,   0,   0,
- 155, 156, 138, 139, 140, 141, 142, 143, 144, 145,
- 146,   0, 147,   0, 169, 171,  31, 177,  33,   0,
- 203, 218,   0,   7,  18,   0,  27,   0,  60,  61,
-  58,   0,   0,  69,  42,  63,  98,  48,   0,   0,
-  68, 104, 105, 106, 107, 108, 109, 110, 111, 112,
- 113, 114, 115, 116, 117, 118, 119, 120, 121,   0,
- 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
- 133,   0, 207,   0,   0, 148,   0, 173, 174,   0,
- 153, 154,  40,  40,  33,   0,  34,  35,  37,  14,
-   0,   0, 219, 217,  71,  26,   0,  52,  62,  59,
-  56,  55,   0,  54,  43,   0,   0,  50,  49,   0,
-   0,  42, 102, 151,   0, 152,   0,   0,   0,  30,
-   0,   0,  39, 201,   0,  -2,  28,  57,  53,  46,
-  47, 122, 135,   0, 175, 149, 150,  32,  36,  38,
-  19,   0,  -2,  70,  72,   0,  79,  -2,   0,   0,
-   0,   0,   0,  -2,  96,   0,   0,   0,   0,   0,
-   0,  73,  97,   0,   0, 237,   0,  20,   0,   0,
-  78,  74,  80,  81,  83,   0,  96,   0,   0,   0,
-   0,  91,  92,   0, 172, 172,   0,  76,  77, 136,
-  24,   0,   0,   0,   0,   0,  89,   0,  93,   0,
-   0,  75,  23,  -2,  96,  -2,   0,  -2,   0,   0,
-  84,   0,  87,   0,  90,  94,  95,  -2,  96,   0,
-  85,   0,  88,  -2,  86
-};
-short	yytok1[] =
-{
-   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,  95,   0,   0,   0,  36,  23,   0,
-  42,  91,  34,  32,   5,  33,  40,  35,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  18,   4,
-  26,   6,  27,  17,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,  41,   0,  92,  22,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,  93,  21,  94,  96
-};
-short	yytok2[] =
-{
-   2,   3,   7,   8,   9,  10,  11,  12,  13,  14,
-  15,  16,  19,  20,  24,  25,  28,  29,  30,  31,
-  37,  38,  39,  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
-};
-long	yytok3[] =
-{
-   0
-};
-#define YYFLAG 		-1000
-#define	yyclearin	yychar = -1
-#define	yyerrok		yyerrflag = 0
-
-#ifdef	yydebug
-#include	"y.debug"
-#else
-#define	yydebug		0
-char*	yytoknames[1];		/* for debugging */
-char*	yystates[1];		/* for debugging */
-#endif
-
-/*	parser for yacc output	*/
-
-int	yynerrs = 0;		/* number of errors */
-int	yyerrflag = 0;		/* error recovery flag */
-
-extern	int	fprint(int, char*, ...);
-extern	int	sprint(char*, char*, ...);
-
-char*
-yytokname(int yyc)
-{
-	static char x[10];
-
-	if(yyc > 0 && yyc <= sizeof(yytoknames)/sizeof(yytoknames[0]))
-	if(yytoknames[yyc-1])
-		return yytoknames[yyc-1];
-	sprint(x, "<%d>", yyc);
-	return x;
-}
-
-char*
-yystatname(int yys)
-{
-	static char x[10];
-
-	if(yys >= 0 && yys < sizeof(yystates)/sizeof(yystates[0]))
-	if(yystates[yys])
-		return yystates[yys];
-	sprint(x, "<%d>\n", yys);
-	return x;
-}
-
-long
-yylex1(void)
-{
-	long yychar;
-	long *t3p;
-	int c;
-
-	yychar = yylex();
-	if(yychar <= 0) {
-		c = yytok1[0];
-		goto out;
-	}
-	if(yychar < sizeof(yytok1)/sizeof(yytok1[0])) {
-		c = yytok1[yychar];
-		goto out;
-	}
-	if(yychar >= YYPRIVATE)
-		if(yychar < YYPRIVATE+sizeof(yytok2)/sizeof(yytok2[0])) {
-			c = yytok2[yychar-YYPRIVATE];
-			goto out;
-		}
-	for(t3p=yytok3;; t3p+=2) {
-		c = t3p[0];
-		if(c == yychar) {
-			c = t3p[1];
-			goto out;
-		}
-		if(c == 0)
-			break;
-	}
-	c = 0;
-
-out:
-	if(c == 0)
-		c = yytok2[1];	/* unknown char */
-	if(yydebug >= 3)
-		fprint(2, "lex %.4lux %s\n", yychar, yytokname(c));
-	return c;
-}
-
-int
-yyparse(void)
-{
-	struct
-	{
-		YYSTYPE	yyv;
-		int	yys;
-	} yys[YYMAXDEPTH], *yyp, *yypt;
-	short *yyxi;
-	int yyj, yym, yystate, yyn, yyg;
-	long yychar;
-	YYSTYPE save1, save2;
-	int save3, save4;
-
-	save1 = yylval;
-	save2 = yyval;
-	save3 = yynerrs;
-	save4 = yyerrflag;
-
-	yystate = 0;
-	yychar = -1;
-	yynerrs = 0;
-	yyerrflag = 0;
-	yyp = &yys[-1];
-	goto yystack;
-
-ret0:
-	yyn = 0;
-	goto ret;
-
-ret1:
-	yyn = 1;
-	goto ret;
-
-ret:
-	yylval = save1;
-	yyval = save2;
-	yynerrs = save3;
-	yyerrflag = save4;
-	return yyn;
-
-yystack:
-	/* put a state and value onto the stack */
-	if(yydebug >= 4)
-		fprint(2, "char %s in %s", yytokname(yychar), yystatname(yystate));
-
-	yyp++;
-	if(yyp >= &yys[YYMAXDEPTH]) {
-		yyerror("yacc stack overflow");
-		goto ret1;
-	}
-	yyp->yys = yystate;
-	yyp->yyv = yyval;
-
-yynewstate:
-	yyn = yypact[yystate];
-	if(yyn <= YYFLAG)
-		goto yydefault; /* simple state */
-	if(yychar < 0)
-		yychar = yylex1();
-	yyn += yychar;
-	if(yyn < 0 || yyn >= YYLAST)
-		goto yydefault;
-	yyn = yyact[yyn];
-	if(yychk[yyn] == yychar) { /* valid shift */
-		yychar = -1;
-		yyval = yylval;
-		yystate = yyn;
-		if(yyerrflag > 0)
-			yyerrflag--;
-		goto yystack;
-	}
-
-yydefault:
-	/* default state action */
-	yyn = yydef[yystate];
-	if(yyn == -2) {
-		if(yychar < 0)
-			yychar = yylex1();
-
-		/* look through exception table */
-		for(yyxi=yyexca;; yyxi+=2)
-			if(yyxi[0] == -1 && yyxi[1] == yystate)
-				break;
-		for(yyxi += 2;; yyxi += 2) {
-			yyn = yyxi[0];
-			if(yyn < 0 || yyn == yychar)
-				break;
-		}
-		yyn = yyxi[1];
-		if(yyn < 0)
-			goto ret0;
-	}
-	if(yyn == 0) {
-		/* error ... attempt to resume parsing */
-		switch(yyerrflag) {
-		case 0:   /* brand new error */
-			yyerror("syntax error");
-			yynerrs++;
-			if(yydebug >= 1) {
-				fprint(2, "%s", yystatname(yystate));
-				fprint(2, "saw %s\n", yytokname(yychar));
-			}
-
-		case 1:
-		case 2: /* incompletely recovered error ... try again */
-			yyerrflag = 3;
-
-			/* find a state where "error" is a legal shift action */
-			while(yyp >= yys) {
-				yyn = yypact[yyp->yys] + YYERRCODE;
-				if(yyn >= 0 && yyn < YYLAST) {
-					yystate = yyact[yyn];  /* simulate a shift of "error" */
-					if(yychk[yystate] == YYERRCODE)
-						goto yystack;
-				}
-
-				/* the current yyp has no shift onn "error", pop stack */
-				if(yydebug >= 2)
-					fprint(2, "error recovery pops state %d, uncovers %d\n",
-						yyp->yys, (yyp-1)->yys );
-				yyp--;
-			}
-			/* there is no state on the stack with an error shift ... abort */
-			goto ret1;
-
-		case 3:  /* no shift yet; clobber input char */
-			if(yydebug >= 2)
-				fprint(2, "error recovery discards %s\n", yytokname(yychar));
-			if(yychar == YYEOFCODE)
-				goto ret1;
-			yychar = -1;
-			goto yynewstate;   /* try again in the same state */
-		}
-	}
-
-	/* reduction by production yyn */
-	if(yydebug >= 2)
-		fprint(2, "reduce %d in:\n\t%s", yyn, yystatname(yystate));
-
-	yypt = yyp;
-	yyp -= yyr2[yyn];
-	yyval = (yyp+1)->yyv;
-	yym = yyn;
-
-	/* consult goto table to find next state */
-	yyn = yyr1[yyn];
-	yyg = yypgo[yyn];
-	yyj = yyg + yyp->yys + 1;
-
-	if(yyj >= YYLAST || yychk[yystate=yyact[yyj]] != -yyn)
-		yystate = yyact[yyg];
-	switch(yym) {
-		
-case 3:
-#line	74	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dodecl(xdecl, lastclass, lasttype, Z);
-	} break;
-case 5:
-#line	79	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		lastdcl = T;
-		firstarg = S;
-		dodecl(xdecl, lastclass, lasttype, yypt[-0].yyv.node);
-		if(lastdcl == T || lastdcl->etype != TFUNC) {
-			diag(yypt[-0].yyv.node, "not a function");
-			lastdcl = types[TFUNC];
-		}
-		thisfn = lastdcl;
-		markdcl();
-		firstdcl = dclstack;
-		argmark(yypt[-0].yyv.node, 0);
-	} break;
-case 6:
-#line	93	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		argmark(yypt[-2].yyv.node, 1);
-	} break;
-case 7:
-#line	97	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		Node *n;
-
-		n = revertdcl();
-		if(n)
-			yypt[-0].yyv.node = new(OLIST, n, yypt[-0].yyv.node);
-		if(!debug['a'] && !debug['Z'])
-			codgen(yypt[-0].yyv.node, yypt[-4].yyv.node);
-	} break;
-case 8:
-#line	109	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dodecl(xdecl, lastclass, lasttype, yypt[-0].yyv.node);
-	} break;
-case 9:
-#line	113	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yypt[-0].yyv.node = dodecl(xdecl, lastclass, lasttype, yypt[-0].yyv.node);
-	} break;
-case 10:
-#line	117	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		doinit(yypt[-3].yyv.node->sym, yypt[-3].yyv.node->type, 0L, yypt[-0].yyv.node);
-	} break;
-case 13:
-#line	125	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OIND, yypt[-0].yyv.node, Z);
-		yyval.node->garb = simpleg(yypt[-1].yyv.lval);
-	} break;
-case 15:
-#line	133	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = yypt[-1].yyv.node;
-	} break;
-case 16:
-#line	137	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OFUNC, yypt[-3].yyv.node, yypt[-1].yyv.node);
-	} break;
-case 17:
-#line	141	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OARRAY, yypt[-3].yyv.node, yypt[-1].yyv.node);
-	} break;
-case 18:
-#line	149	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = Z;
-	} break;
-case 19:
-#line	153	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = dodecl(adecl, lastclass, lasttype, Z);
-		if(yypt[-2].yyv.node != Z)
-			if(yyval.node != Z)
-				yyval.node = new(OLIST, yypt[-2].yyv.node, yyval.node);
-			else
-				yyval.node = yypt[-2].yyv.node;
-	} break;
-case 20:
-#line	162	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = yypt[-3].yyv.node;
-		if(yypt[-1].yyv.node != Z) {
-			yyval.node = yypt[-1].yyv.node;
-			if(yypt[-3].yyv.node != Z)
-				yyval.node = new(OLIST, yypt[-3].yyv.node, yypt[-1].yyv.node);
-		}
-	} break;
-case 21:
-#line	173	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dodecl(adecl, lastclass, lasttype, yypt[-0].yyv.node);
-		yyval.node = Z;
-	} break;
-case 22:
-#line	178	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yypt[-0].yyv.node = dodecl(adecl, lastclass, lasttype, yypt[-0].yyv.node);
-	} break;
-case 23:
-#line	182	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		long w;
-
-		w = yypt[-3].yyv.node->sym->type->width;
-		yyval.node = doinit(yypt[-3].yyv.node->sym, yypt[-3].yyv.node->type, 0L, yypt[-0].yyv.node);
-		yyval.node = contig(yypt[-3].yyv.node->sym, yyval.node, w);
-	} break;
-case 24:
-#line	190	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = yypt[-2].yyv.node;
-		if(yypt[-0].yyv.node != Z) {
-			yyval.node = yypt[-0].yyv.node;
-			if(yypt[-2].yyv.node != Z)
-				yyval.node = new(OLIST, yypt[-2].yyv.node, yypt[-0].yyv.node);
-		}
-	} break;
-case 27:
-#line	207	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dodecl(pdecl, lastclass, lasttype, yypt[-0].yyv.node);
-	} break;
-case 29:
-#line	217	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		lasttype = yypt[-0].yyv.type;
-	} break;
-case 31:
-#line	222	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		lasttype = yypt[-0].yyv.type;
-	} break;
-case 33:
-#line	228	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		lastfield = 0;
-		edecl(CXXX, lasttype, S);
-	} break;
-case 35:
-#line	236	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dodecl(edecl, CXXX, lasttype, yypt[-0].yyv.node);
-	} break;
-case 37:
-#line	243	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		lastbit = 0;
-		firstbit = 1;
-	} break;
-case 38:
-#line	248	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OBIT, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 39:
-#line	252	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OBIT, Z, yypt[-0].yyv.node);
-	} break;
-case 40:
-#line	260	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = (Z);
-	} break;
-case 42:
-#line	267	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OIND, (Z), Z);
-		yyval.node->garb = simpleg(yypt[-0].yyv.lval);
-	} break;
-case 43:
-#line	272	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OIND, yypt[-0].yyv.node, Z);
-		yyval.node->garb = simpleg(yypt[-1].yyv.lval);
-	} break;
-case 46:
-#line	281	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OFUNC, yypt[-3].yyv.node, yypt[-1].yyv.node);
-	} break;
-case 47:
-#line	285	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OARRAY, yypt[-3].yyv.node, yypt[-1].yyv.node);
-	} break;
-case 48:
-#line	291	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OFUNC, (Z), Z);
-	} break;
-case 49:
-#line	295	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OARRAY, (Z), yypt[-1].yyv.node);
-	} break;
-case 50:
-#line	299	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = yypt[-1].yyv.node;
-	} break;
-case 52:
-#line	306	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OINIT, invert(yypt[-1].yyv.node), Z);
-	} break;
-case 53:
-#line	312	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OARRAY, yypt[-1].yyv.node, Z);
-	} break;
-case 54:
-#line	316	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OELEM, Z, Z);
-		yyval.node->sym = yypt[-0].yyv.sym;
-	} break;
-case 57:
-#line	325	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-2].yyv.node, yypt[-1].yyv.node);
-	} break;
-case 59:
-#line	330	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-1].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 62:
-#line	338	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-1].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 63:
-#line	343	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = Z;
-	} break;
-case 64:
-#line	347	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = invert(yypt[-0].yyv.node);
-	} break;
-case 66:
-#line	355	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OPROTO, yypt[-0].yyv.node, Z);
-		yyval.node->type = yypt[-1].yyv.type;
-	} break;
-case 67:
-#line	360	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OPROTO, yypt[-0].yyv.node, Z);
-		yyval.node->type = yypt[-1].yyv.type;
-	} break;
-case 68:
-#line	365	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ODOTDOT, Z, Z);
-	} break;
-case 69:
-#line	369	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 70:
-#line	375	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = invert(yypt[-1].yyv.node);
-		if(yypt[-2].yyv.node != Z)
-			yyval.node = new(OLIST, yypt[-2].yyv.node, yyval.node);
-		if(yyval.node == Z)
-			yyval.node = new(OLIST, Z, Z);
-	} break;
-case 71:
-#line	384	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = Z;
-	} break;
-case 72:
-#line	388	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-1].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 74:
-#line	395	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-1].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 75:
-#line	401	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCASE, yypt[-1].yyv.node, Z);
-	} break;
-case 76:
-#line	405	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCASE, Z, Z);
-	} break;
-case 77:
-#line	409	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLABEL, dcllabel(yypt[-1].yyv.sym, 1), Z);
-	} break;
-case 78:
-#line	415	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = Z;
-	} break;
-case 80:
-#line	420	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-1].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 82:
-#line	426	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		markdcl();
-	} break;
-case 83:
-#line	430	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = revertdcl();
-		if(yyval.node)
-			yyval.node = new(OLIST, yyval.node, yypt[-0].yyv.node);
-		else
-			yyval.node = yypt[-0].yyv.node;
-	} break;
-case 84:
-#line	438	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OIF, yypt[-2].yyv.node, new(OLIST, yypt[-0].yyv.node, Z));
-		if(yypt[-0].yyv.node == Z)
-			warn(yypt[-2].yyv.node, "empty if body");
-	} break;
-case 85:
-#line	444	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OIF, yypt[-4].yyv.node, new(OLIST, yypt[-2].yyv.node, yypt[-0].yyv.node));
-		if(yypt[-2].yyv.node == Z)
-			warn(yypt[-4].yyv.node, "empty if body");
-		if(yypt[-0].yyv.node == Z)
-			warn(yypt[-4].yyv.node, "empty else body");
-	} break;
-case 86:
-#line	452	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OFOR, new(OLIST, yypt[-4].yyv.node, new(OLIST, yypt[-6].yyv.node, yypt[-2].yyv.node)), yypt[-0].yyv.node);
-	} break;
-case 87:
-#line	456	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OWHILE, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 88:
-#line	460	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ODWHILE, yypt[-2].yyv.node, yypt[-5].yyv.node);
-	} break;
-case 89:
-#line	464	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ORETURN, yypt[-1].yyv.node, Z);
-		yyval.node->type = thisfn->link;
-	} break;
-case 90:
-#line	469	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->vconst = 0;
-		yyval.node->type = types[TINT];
-		yypt[-2].yyv.node = new(OSUB, yyval.node, yypt[-2].yyv.node);
-
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->vconst = 0;
-		yyval.node->type = types[TINT];
-		yypt[-2].yyv.node = new(OSUB, yyval.node, yypt[-2].yyv.node);
-
-		yyval.node = new(OSWITCH, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 91:
-#line	483	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OBREAK, Z, Z);
-	} break;
-case 92:
-#line	487	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONTINUE, Z, Z);
-	} break;
-case 93:
-#line	491	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OGOTO, dcllabel(yypt[-1].yyv.sym, 0), Z);
-	} break;
-case 94:
-#line	495	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OUSED, yypt[-2].yyv.node, Z);
-	} break;
-case 95:
-#line	499	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSET, yypt[-2].yyv.node, Z);
-	} break;
-case 96:
-#line	504	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = Z;
-	} break;
-case 98:
-#line	510	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = Z;
-	} break;
-case 100:
-#line	517	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCAST, yypt[-0].yyv.node, Z);
-		yyval.node->type = types[TLONG];
-	} break;
-case 102:
-#line	525	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCOMMA, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 104:
-#line	532	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OMUL, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 105:
-#line	536	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ODIV, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 106:
-#line	540	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OMOD, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 107:
-#line	544	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OADD, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 108:
-#line	548	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSUB, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 109:
-#line	552	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASHR, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 110:
-#line	556	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASHL, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 111:
-#line	560	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLT, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 112:
-#line	564	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OGT, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 113:
-#line	568	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLE, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 114:
-#line	572	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OGE, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 115:
-#line	576	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OEQ, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 116:
-#line	580	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ONE, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 117:
-#line	584	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OAND, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 118:
-#line	588	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OXOR, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 119:
-#line	592	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OOR, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 120:
-#line	596	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OANDAND, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 121:
-#line	600	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OOROR, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 122:
-#line	604	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCOND, yypt[-4].yyv.node, new(OLIST, yypt[-2].yyv.node, yypt[-0].yyv.node));
-	} break;
-case 123:
-#line	608	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OAS, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 124:
-#line	612	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASADD, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 125:
-#line	616	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASSUB, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 126:
-#line	620	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASMUL, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 127:
-#line	624	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASDIV, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 128:
-#line	628	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASMOD, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 129:
-#line	632	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASASHL, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 130:
-#line	636	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASASHR, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 131:
-#line	640	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASAND, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 132:
-#line	644	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASXOR, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 133:
-#line	648	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OASOR, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 135:
-#line	655	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCAST, yypt[-0].yyv.node, Z);
-		dodecl(NODECL, CXXX, yypt[-3].yyv.type, yypt[-2].yyv.node);
-		yyval.node->type = lastdcl;
-	} break;
-case 136:
-#line	661	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSTRUCT, yypt[-1].yyv.node, Z);
-		dodecl(NODECL, CXXX, yypt[-5].yyv.type, yypt[-4].yyv.node);
-		yyval.node->type = lastdcl;
-	} break;
-case 138:
-#line	670	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OIND, yypt[-0].yyv.node, Z);
-	} break;
-case 139:
-#line	674	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OADDR, yypt[-0].yyv.node, Z);
-	} break;
-case 140:
-#line	678	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OPOS, yypt[-0].yyv.node, Z);
-	} break;
-case 141:
-#line	682	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ONEG, yypt[-0].yyv.node, Z);
-	} break;
-case 142:
-#line	686	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ONOT, yypt[-0].yyv.node, Z);
-	} break;
-case 143:
-#line	690	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCOM, yypt[-0].yyv.node, Z);
-	} break;
-case 144:
-#line	694	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OPREINC, yypt[-0].yyv.node, Z);
-	} break;
-case 145:
-#line	698	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OPREDEC, yypt[-0].yyv.node, Z);
-	} break;
-case 146:
-#line	702	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSIZE, yypt[-0].yyv.node, Z);
-	} break;
-case 147:
-#line	706	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSIGN, yypt[-0].yyv.node, Z);
-	} break;
-case 148:
-#line	712	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = yypt[-1].yyv.node;
-	} break;
-case 149:
-#line	716	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSIZE, Z, Z);
-		dodecl(NODECL, CXXX, yypt[-2].yyv.type, yypt[-1].yyv.node);
-		yyval.node->type = lastdcl;
-	} break;
-case 150:
-#line	722	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSIGN, Z, Z);
-		dodecl(NODECL, CXXX, yypt[-2].yyv.type, yypt[-1].yyv.node);
-		yyval.node->type = lastdcl;
-	} break;
-case 151:
-#line	728	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OFUNC, yypt[-3].yyv.node, Z);
-		if(yypt[-3].yyv.node->op == ONAME)
-		if(yypt[-3].yyv.node->type == T)
-			dodecl(xdecl, CXXX, types[TINT], yyval.node);
-		yyval.node->right = invert(yypt[-1].yyv.node);
-	} break;
-case 152:
-#line	736	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OIND, new(OADD, yypt[-3].yyv.node, yypt[-1].yyv.node), Z);
-	} break;
-case 153:
-#line	740	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ODOT, new(OIND, yypt[-2].yyv.node, Z), Z);
-		yyval.node->sym = yypt[-0].yyv.sym;
-	} break;
-case 154:
-#line	745	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ODOT, yypt[-2].yyv.node, Z);
-		yyval.node->sym = yypt[-0].yyv.sym;
-	} break;
-case 155:
-#line	750	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OPOSTINC, yypt[-1].yyv.node, Z);
-	} break;
-case 156:
-#line	754	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OPOSTDEC, yypt[-1].yyv.node, Z);
-	} break;
-case 158:
-#line	759	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TINT];
-		yyval.node->vconst = yypt[-0].yyv.vval;
-	} break;
-case 159:
-#line	765	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TLONG];
-		yyval.node->vconst = yypt[-0].yyv.vval;
-	} break;
-case 160:
-#line	771	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TUINT];
-		yyval.node->vconst = yypt[-0].yyv.vval;
-	} break;
-case 161:
-#line	777	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TULONG];
-		yyval.node->vconst = yypt[-0].yyv.vval;
-	} break;
-case 162:
-#line	783	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TDOUBLE];
-		yyval.node->fconst = yypt[-0].yyv.dval;
-	} break;
-case 163:
-#line	789	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TFLOAT];
-		yyval.node->fconst = yypt[-0].yyv.dval;
-	} break;
-case 164:
-#line	795	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TVLONG];
-		yyval.node->vconst = yypt[-0].yyv.vval;
-	} break;
-case 165:
-#line	801	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OCONST, Z, Z);
-		yyval.node->type = types[TUVLONG];
-		yyval.node->vconst = yypt[-0].yyv.vval;
-	} break;
-case 168:
-#line	811	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OSTRING, Z, Z);
-		yyval.node->type = typ(TARRAY, types[TCHAR]);
-		yyval.node->type->width = yypt[-0].yyv.sval.l + 1;
-		yyval.node->cstring = yypt[-0].yyv.sval.s;
-		yyval.node->sym = symstring;
-		yyval.node->etype = TARRAY;
-		yyval.node->class = CSTATIC;
-	} break;
-case 169:
-#line	821	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		char *s;
-		int n;
-
-		n = yypt[-1].yyv.node->type->width - 1;
-		s = alloc(n+yypt[-0].yyv.sval.l+MAXALIGN);
-
-		memcpy(s, yypt[-1].yyv.node->cstring, n);
-		memcpy(s+n, yypt[-0].yyv.sval.s, yypt[-0].yyv.sval.l);
-		s[n+yypt[-0].yyv.sval.l] = 0;
-
-		yyval.node = yypt[-1].yyv.node;
-		yyval.node->type->width += yypt[-0].yyv.sval.l;
-		yyval.node->cstring = s;
-	} break;
-case 170:
-#line	839	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLSTRING, Z, Z);
-		yyval.node->type = typ(TARRAY, types[TUSHORT]);
-		yyval.node->type->width = yypt[-0].yyv.sval.l + sizeof(ushort);
-		yyval.node->rstring = (ushort*)yypt[-0].yyv.sval.s;
-		yyval.node->sym = symstring;
-		yyval.node->etype = TARRAY;
-		yyval.node->class = CSTATIC;
-	} break;
-case 171:
-#line	849	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		char *s;
-		int n;
-
-		n = yypt[-1].yyv.node->type->width - sizeof(ushort);
-		s = alloc(n+yypt[-0].yyv.sval.l+MAXALIGN);
-
-		memcpy(s, yypt[-1].yyv.node->rstring, n);
-		memcpy(s+n, yypt[-0].yyv.sval.s, yypt[-0].yyv.sval.l);
-		*(ushort*)(s+n+yypt[-0].yyv.sval.l) = 0;
-
-		yyval.node = yypt[-1].yyv.node;
-		yyval.node->type->width += yypt[-0].yyv.sval.l;
-		yyval.node->rstring = (ushort*)s;
-	} break;
-case 172:
-#line	866	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = Z;
-	} break;
-case 175:
-#line	874	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(OLIST, yypt[-2].yyv.node, yypt[-0].yyv.node);
-	} break;
-case 176:
-#line	880	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tyty.t1 = strf;
-		yyval.tyty.t2 = strl;
-		strf = T;
-		strl = T;
-		lastbit = 0;
-		firstbit = 1;
-	} break;
-case 177:
-#line	889	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.type = strf;
-		strf = yypt[-2].yyv.tyty.t1;
-		strl = yypt[-2].yyv.tyty.t2;
-	} break;
-case 178:
-#line	896	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		lastclass = CXXX;
-		lasttype = types[TINT];
-	} break;
-case 180:
-#line	904	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = yypt[-0].yyv.type;
-		yyval.tycl.c = CXXX;
-	} break;
-case 181:
-#line	909	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = simplet(yypt[-0].yyv.lval);
-		yyval.tycl.c = CXXX;
-	} break;
-case 182:
-#line	914	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = simplet(yypt[-0].yyv.lval);
-		yyval.tycl.c = simplec(yypt[-0].yyv.lval);
-		yyval.tycl.t = garbt(yyval.tycl.t, yypt[-0].yyv.lval);
-	} break;
-case 183:
-#line	920	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = yypt[-1].yyv.type;
-		yyval.tycl.c = simplec(yypt[-0].yyv.lval);
-		yyval.tycl.t = garbt(yyval.tycl.t, yypt[-0].yyv.lval);
-		if(yypt[-0].yyv.lval & ~BCLASS & ~BGARB)
-			diag(Z, "duplicate types given: %T and %Q", yypt[-1].yyv.type, yypt[-0].yyv.lval);
-	} break;
-case 184:
-#line	928	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = simplet(typebitor(yypt[-1].yyv.lval, yypt[-0].yyv.lval));
-		yyval.tycl.c = simplec(yypt[-0].yyv.lval);
-		yyval.tycl.t = garbt(yyval.tycl.t, yypt[-0].yyv.lval);
-	} break;
-case 185:
-#line	934	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = yypt[-1].yyv.type;
-		yyval.tycl.c = simplec(yypt[-2].yyv.lval);
-		yyval.tycl.t = garbt(yyval.tycl.t, yypt[-2].yyv.lval|yypt[-0].yyv.lval);
-	} break;
-case 186:
-#line	940	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = simplet(yypt[-0].yyv.lval);
-		yyval.tycl.c = simplec(yypt[-1].yyv.lval);
-		yyval.tycl.t = garbt(yyval.tycl.t, yypt[-1].yyv.lval);
-	} break;
-case 187:
-#line	946	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.tycl.t = simplet(typebitor(yypt[-1].yyv.lval, yypt[-0].yyv.lval));
-		yyval.tycl.c = simplec(yypt[-2].yyv.lval|yypt[-0].yyv.lval);
-		yyval.tycl.t = garbt(yyval.tycl.t, yypt[-2].yyv.lval|yypt[-0].yyv.lval);
-	} break;
-case 188:
-#line	954	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.type = yypt[-0].yyv.tycl.t;
-		if(yypt[-0].yyv.tycl.c != CXXX)
-			diag(Z, "illegal combination of class 4: %s", cnames[yypt[-0].yyv.tycl.c]);
-	} break;
-case 189:
-#line	962	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		lasttype = yypt[-0].yyv.tycl.t;
-		lastclass = yypt[-0].yyv.tycl.c;
-	} break;
-case 190:
-#line	969	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dotag(yypt[-0].yyv.sym, TSTRUCT, 0);
-		yyval.type = yypt[-0].yyv.sym->suetag;
-	} break;
-case 191:
-#line	974	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dotag(yypt[-0].yyv.sym, TSTRUCT, autobn);
-	} break;
-case 192:
-#line	978	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.type = yypt[-2].yyv.sym->suetag;
-		if(yyval.type->link != T)
-			diag(Z, "redeclare tag: %s", yypt[-2].yyv.sym->name);
-		yyval.type->link = yypt[-0].yyv.type;
-		suallign(yyval.type);
-	} break;
-case 193:
-#line	986	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		taggen++;
-		sprint(symb, "_%d_", taggen);
-		yyval.type = dotag(lookup(), TSTRUCT, autobn);
-		yyval.type->link = yypt[-0].yyv.type;
-		suallign(yyval.type);
-	} break;
-case 194:
-#line	994	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dotag(yypt[-0].yyv.sym, TUNION, 0);
-		yyval.type = yypt[-0].yyv.sym->suetag;
-	} break;
-case 195:
-#line	999	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dotag(yypt[-0].yyv.sym, TUNION, autobn);
-	} break;
-case 196:
-#line	1003	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.type = yypt[-2].yyv.sym->suetag;
-		if(yyval.type->link != T)
-			diag(Z, "redeclare tag: %s", yypt[-2].yyv.sym->name);
-		yyval.type->link = yypt[-0].yyv.type;
-		suallign(yyval.type);
-	} break;
-case 197:
-#line	1011	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		taggen++;
-		sprint(symb, "_%d_", taggen);
-		yyval.type = dotag(lookup(), TUNION, autobn);
-		yyval.type->link = yypt[-0].yyv.type;
-		suallign(yyval.type);
-	} break;
-case 198:
-#line	1019	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dotag(yypt[-0].yyv.sym, TENUM, 0);
-		yyval.type = yypt[-0].yyv.sym->suetag;
-		if(yyval.type->link == T)
-			yyval.type->link = types[TINT];
-		yyval.type = yyval.type->link;
-	} break;
-case 199:
-#line	1027	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		dotag(yypt[-0].yyv.sym, TENUM, autobn);
-	} break;
-case 200:
-#line	1031	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		en.tenum = T;
-		en.cenum = T;
-	} break;
-case 201:
-#line	1036	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.type = yypt[-5].yyv.sym->suetag;
-		if(yyval.type->link != T)
-			diag(Z, "redeclare tag: %s", yypt[-5].yyv.sym->name);
-		if(en.tenum == T) {
-			diag(Z, "enum type ambiguous: %s", yypt[-5].yyv.sym->name);
-			en.tenum = types[TINT];
-		}
-		yyval.type->link = en.tenum;
-		yyval.type = en.tenum;
-	} break;
-case 202:
-#line	1048	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		en.tenum = T;
-		en.cenum = T;
-	} break;
-case 203:
-#line	1053	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.type = en.tenum;
-	} break;
-case 204:
-#line	1057	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.type = tcopy(yypt[-0].yyv.sym->type);
-	} break;
-case 206:
-#line	1064	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.lval = typebitor(yypt[-1].yyv.lval, yypt[-0].yyv.lval);
-	} break;
-case 207:
-#line	1069	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.lval = 0;
-	} break;
-case 208:
-#line	1073	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.lval = typebitor(yypt[-1].yyv.lval, yypt[-0].yyv.lval);
-	} break;
-case 213:
-#line	1085	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.lval = typebitor(yypt[-1].yyv.lval, yypt[-0].yyv.lval);
-	} break;
-case 216:
-#line	1095	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		doenum(yypt[-0].yyv.sym, Z);
-	} break;
-case 217:
-#line	1099	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		doenum(yypt[-2].yyv.sym, yypt[-0].yyv.node);
-	} break;
-case 220:
-#line	1106	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BCHAR; } break;
-case 221:
-#line	1107	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BSHORT; } break;
-case 222:
-#line	1108	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BINT; } break;
-case 223:
-#line	1109	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BLONG; } break;
-case 224:
-#line	1110	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BSIGNED; } break;
-case 225:
-#line	1111	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BUNSIGNED; } break;
-case 226:
-#line	1112	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BFLOAT; } break;
-case 227:
-#line	1113	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BDOUBLE; } break;
-case 228:
-#line	1114	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BVOID; } break;
-case 229:
-#line	1117	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BAUTO; } break;
-case 230:
-#line	1118	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BSTATIC; } break;
-case 231:
-#line	1119	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BEXTERN; } break;
-case 232:
-#line	1120	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BTYPEDEF; } break;
-case 233:
-#line	1121	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BTYPESTR; } break;
-case 234:
-#line	1122	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BREGISTER; } break;
-case 235:
-#line	1125	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BCONSTNT; } break;
-case 236:
-#line	1126	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{ yyval.lval = BVOLATILE; } break;
-case 237:
-#line	1130	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ONAME, Z, Z);
-		if(yypt[-0].yyv.sym->class == CLOCAL)
-			yypt[-0].yyv.sym = mkstatic(yypt[-0].yyv.sym);
-		yyval.node->sym = yypt[-0].yyv.sym;
-		yyval.node->type = yypt[-0].yyv.sym->type;
-		yyval.node->etype = TVOID;
-		if(yyval.node->type != T)
-			yyval.node->etype = yyval.node->type->etype;
-		yyval.node->xoffset = yypt[-0].yyv.sym->offset;
-		yyval.node->class = yypt[-0].yyv.sym->class;
-		yypt[-0].yyv.sym->aused = 1;
-	} break;
-case 238:
-#line	1145	"/n/sources/plan9/sys/src/cmd/cc/cc.y"
-{
-		yyval.node = new(ONAME, Z, Z);
-		yyval.node->sym = yypt[-0].yyv.sym;
-		yyval.node->type = yypt[-0].yyv.sym->type;
-		yyval.node->etype = TVOID;
-		if(yyval.node->type != T)
-			yyval.node->etype = yyval.node->type->etype;
-		yyval.node->xoffset = yypt[-0].yyv.sym->offset;
-		yyval.node->class = yypt[-0].yyv.sym->class;
-	} break;
-	}
-	goto yystack;  /* stack new state and value */
-}

+ 49 - 20
sys/src/cmd/ip/httpd/httpd.c

@@ -109,6 +109,7 @@ main(int argc, char **argv)
 	syslog(0, HTTPLOG, nil);
 	logall[0] = open("/sys/log/httpd/0", OWRITE);
 	logall[1] = open("/sys/log/httpd/1", OWRITE);
+	logall[2] = open("/sys/log/httpd/clf", OWRITE);
 	redirectinit();
 	contentinit();
 	urlinit();
@@ -275,21 +276,59 @@ doreq(HConnect *c)
 {
 	HSPriv *hp;
 	Strings ss;
-	char *magic, *uri, *origuri, *newpath, *hb;
+	char *magic, *uri, *newuri, *origuri, *newpath, *hb;
 	char virtualhost[100], logfd0[10], logfd1[10], vers[16];
-	int n;
+	int n, nredirect;
 
 	/*
 	 * munge uri for magic
 	 */
 	uri = c->req.uri;
+	nredirect = 0;
+top:
+	if(++nredirect > 10){
+		if(hparseheaders(c, 15*60*1000) < 0)
+			exits("failed");
+		return hfail(c, HNotFound, uri);
+	}
 	ss = stripmagic(c, uri);
 	uri = ss.s1;
+	origuri = uri;
 	magic = ss.s2;
+	if(magic)
+		goto magic;
+
+	/*
+	 * Apply redirects.  Do this before reading headers
+	 * (if possible) so that we can redirect to magic invisibly.
+	 */
+	if(origuri[0]=='/' && origuri[1]=='~'){
+		n = strlen(origuri) + 4 + UTFmax;
+		newpath = halloc(c, n);
+		snprint(newpath, n, "/who/%s", origuri+2);
+		c->req.uri = newpath;
+		newuri = newpath;
+	}else if(origuri[0]=='/' && origuri[1]==0){
+		/* can't redirect / until we read the headers */
+		newuri = nil;
+	}else
+		newuri = redirect(c, origuri);
+	
+	if(newuri != nil){
+		if(newuri[0] == '@'){
+			c->req.uri = newuri+1;
+			uri = newuri+1;
+			goto top;
+		}
+		if(hparseheaders(c, 15*60*1000) < 0)
+			exits("failed");
+		return hmoved(c, newuri);
+	}
 
 	/*
 	 * for magic we exec a new program and serve no more requests
 	 */
+magic:
 	if(magic != nil && strcmp(magic, "httpd") != 0){
 		snprint(c->xferbuf, HBufSize, "/bin/ip/httpd/%s", magic);
 		snprint(logfd0, sizeof(logfd0), "%d", logall[0]);
@@ -312,28 +351,18 @@ doreq(HConnect *c)
 	/*
 	 * normal case is just file transfer
 	 */
-	origuri = uri;
 	if(hparseheaders(c, 15*60*1000) < 0)
 		exits("failed");
+	if(origuri[0] == '/' && origuri[1] == 0){	
+		snprint(virtualhost, sizeof virtualhost, "http://%s/", c->head.host);
+		newuri = redirect(c, virtualhost);
+		if(newuri == nil)
+			newuri = redirect(c, origuri);
+		if(newuri)
+			return hmoved(c, newuri);
+	}
 	if(!http11(c) && !c->head.persist)
 		c->head.closeit = 1;
-
-	if(origuri[0]=='/' && origuri[1]=='~'){
-		n = strlen(origuri) + 4 + UTFmax;
-		newpath = halloc(c, n);
-		snprint(newpath, n, "/who/%s", origuri+2);
-		c->req.uri = newpath;
-		uri = newpath;
-	}else if(origuri[0]=='/' && origuri[1]==0){
-		snprint(virtualhost, sizeof virtualhost, "http://%s/", c->head.host);
-		uri = redirect(c, virtualhost);
-		if(uri == nil)
-			uri = redirect(c, origuri);
-	}else
-		uri = redirect(c, origuri);
-
-	if(uri != nil)
-		return hmoved(c, uri);
 	return send(c);
 }
 

+ 1 - 1
sys/src/cmd/ip/httpd/httpsrv.h

@@ -11,7 +11,7 @@ struct HSPriv
 	char		*remoteserv;
 };
 
-extern	int		logall[2];
+extern	int		logall[3];
 extern	char*		HTTPLOG;
 extern	char*		webroot;
 extern	char*		netdir;

+ 64 - 19
sys/src/cmd/ip/httpd/log.c

@@ -3,7 +3,13 @@
 #include "httpd.h"
 #include "httpsrv.h"
 
-int		logall[2];
+int		logall[3];  /* logall[2] is in "Common Log Format" */
+
+static char *
+monname[12] =
+{
+	"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+};
 
 void
 logit(HConnect *c, char *fmt, ...)
@@ -29,30 +35,69 @@ writelog(HConnect *c, char *fmt, ...)
 {
 	HSPriv *p;
 	char buf[HBufSize+500], *bufp, *bufe;
+	char statuscode[4];
+	vlong objectsize;
 	ulong now, today;
 	int logfd;
 	va_list arg;
+	Tm *tm;
 
+	if(c == nil)
+		return;
 	bufe = buf + sizeof(buf);
 	now = time(nil);
+	tm = gmtime(now);
 	today = now / (24*60*60);
+
+	/* verbose logfile, for research on web traffic */
 	logfd = logall[today & 1];
-	if(c == nil || logfd <= 0)
-		return;
-	p = c->private;
-	if(c->hstop == c->header || c->hstop[-1] != '\n')
-		*c->hstop = '\n';
-	*c->hstop = '\0';
-	bufp = seprint(buf, bufe, "==========\n");
-	bufp = seprint(bufp, bufe, "LogTime:  %D\n", now);
-	bufp = seprint(bufp, bufe, "ConnTime: %D\n", c->reqtime);
-	bufp = seprint(bufp, bufe, "RemoteIP: %s\n", p->remotesys);
-	bufp = seprint(bufp, bufe, "Port: %s\n", p->remoteserv);
-	va_start(arg, fmt);
-	bufp = vseprint(bufp, bufe, fmt, arg);
-	va_end(arg);
-	if(c->req.uri != nil && c->req.uri[0] != 0)
-		bufp = seprint(bufp, bufe, "FinalURI: %s\n", c->req.uri);
-	bufp = seprint(bufp, bufe, "----------\n%s\n", (char*)c->header);
-	write(logfd, buf, bufp-buf);   /* append-only file */
+	if(logfd > 0){
+		p = c->private;
+		if(c->hstop == c->header || c->hstop[-1] != '\n')
+			*c->hstop = '\n';
+		*c->hstop = '\0';
+		bufp = seprint(buf, bufe, "==========\n");
+		bufp = seprint(bufp, bufe, "LogTime:  %D\n", now);
+		bufp = seprint(bufp, bufe, "ConnTime: %D\n", c->reqtime);
+		bufp = seprint(bufp, bufe, "RemoteIP: %s\n", p->remotesys);
+		bufp = seprint(bufp, bufe, "Port: %s\n", p->remoteserv);
+		va_start(arg, fmt);
+		bufp = vseprint(bufp, bufe, fmt, arg);
+		va_end(arg);
+		if(c->req.uri != nil && c->req.uri[0] != 0)
+			bufp = seprint(bufp, bufe, "FinalURI: %s\n", c->req.uri);
+		bufp = seprint(bufp, bufe, "----------\n%s\n", (char*)c->header);
+		write(logfd, buf, bufp-buf);   /* append-only file */
+	}
+
+	/* another log, with less information but formatted for common analysis tools */
+	if(logall[2] > 0 && strncmp(fmt, "Reply: ", 7) == 0){
+		objectsize = 0;
+		strecpy(statuscode, statuscode+4, fmt+7);
+		if( fmt[7] == '%'){
+			va_start(arg, fmt);
+			vseprint(statuscode, statuscode+4, fmt+7, arg);
+			va_end(arg);
+		}else if(
+			strcmp(fmt+7, "200 file %lld %lld\n") == 0 ||
+			strcmp(fmt+7, "206 partial content %lld %lld\n") == 0 ||
+			strcmp(fmt+7, "206 partial content, early termination %lld %lld\n") == 0){
+			va_start(arg, fmt);
+			objectsize = va_arg(arg, vlong); /* length in sendfd.c */
+			objectsize = va_arg(arg, vlong); /* wrote in sendfd.c */
+			va_end(arg);
+		}
+		bufp = seprint(buf, bufe, "%s - -", p->remotesys);
+		bufp = seprint(bufp, bufe, " [%.2d/%s/%d:%.2d:%.2d:%.2d +0000]", tm->mday, monname[tm->mon], tm->year+1900, tm->hour, tm->min, tm->sec);
+		if(c->req.uri == nil || c->req.uri[0] == 0){
+			bufp = seprint(bufp, bufe, " \"%.*s\"",
+				(int)utfnlen((char*)c->header, strcspn((char*)c->header, "\r\n")),
+				(char*)c->header);
+		}else{
+			/* use more canonical form of URI, if available */
+			bufp = seprint(bufp, bufe, " \"%s %s HTTP/%d.%d\"", c->req.meth, c->req.uri, c->req.vermaj,  c->req.vermin);
+		}
+		bufp = seprint(bufp, bufe, " %s %lld\n", statuscode, objectsize);
+		write(logall[2], buf, bufp-buf);   /* append-only file */
+	}
 }

+ 1 - 1
sys/src/cmd/rc/lex.c

@@ -149,7 +149,7 @@ addtok(char *p, int val)
 {
 	if(p==0)
 		return 0;
-	if(p==&tok[NTOK]){
+	if(p==&tok[NTOK-1]){
 		*p = 0;
 		yyerror("token buffer too short");
 		return 0;

+ 6 - 3
sys/src/cmd/tar.c

@@ -1027,9 +1027,12 @@ extract1(int ar, Hdr *hp, char *fname)
 
 			nulldir(&nd);
 			nd.mtime = mtime;
-			if (isustar(hp))
-				nd.gid = hp->gname;
 			dirfwstat(fd, &nd);
+			if (isustar(hp)) {
+				nulldir(&nd);
+				nd.gid = hp->gname;
+				dirfwstat(fd, &nd);
+			}
 		}
 		close(fd);
 	}
@@ -1168,4 +1171,4 @@ main(int argc, char *argv[])
 		break;
 	}
 	exits(ret);
-}
+}

+ 1 - 0
sys/src/cmd/unix/drawterm/Make.config

@@ -1 +1,2 @@
+AUDIO=none
 include $(ROOT)/Make.$(CONF)

+ 2 - 0
sys/src/cmd/unix/drawterm/Make.unix

@@ -13,6 +13,8 @@ GUI=x11
 LDADD=-L$(X11)/lib -lX11 -ggdb
 LDFLAGS=$(PTHREAD)
 TARG=drawterm
+# AUDIO=none
+AUDIO=unix
 
 all: default
 

+ 2 - 0
sys/src/cmd/unix/drawterm/kern/Makefile

@@ -8,6 +8,8 @@ OFILES=\
 	chan.$O\
 	data.$O\
 	dev.$O\
+	devaudio.$O\
+	devaudio-$(AUDIO).$O\
 	devcons.$O\
 	devdraw.$O\
 	devfs-$(OS).$O\

+ 35 - 0
sys/src/cmd/unix/drawterm/kern/devaudio-none.c

@@ -0,0 +1,35 @@
+/*
+ * Linux and BSD
+ */
+#include	"u.h"
+#include	"lib.h"
+#include	"dat.h"
+#include	"fns.h"
+#include	"error.h"
+#include	"devaudio.h"
+
+/* maybe this should return -1 instead of sysfatal */
+void
+audiodevopen(void)
+{
+	error("no audio support");
+}
+
+void
+audiodevclose(void)
+{
+	error("no audio support");
+}
+
+void
+audiodevsetvol(int what, int left, int right)
+{
+	error("no audio support");
+}
+
+void
+audiodevgetvol(int what, int *left, int *right)
+{
+	error("no audio support");
+}
+

+ 182 - 0
sys/src/cmd/unix/drawterm/kern/devaudio-unix.c

@@ -0,0 +1,182 @@
+/*
+ * Linux and BSD
+ */
+#include <sys/ioctl.h>
+#ifdef __linux__
+#include <linux/soundcard.h>
+#else
+#include <sys/soundcard.h>
+#endif
+#include	"u.h"
+#include	"lib.h"
+#include	"dat.h"
+#include	"fns.h"
+#include	"error.h"
+#include	"devaudio.h"
+
+enum
+{
+	Channels = 2,
+	Rate = 44100,
+	Bits = 16,
+	Bigendian = 1,
+};
+
+static int afd = -1;
+static int cfd= -1;
+static int speed;
+
+/* maybe this should return -1 instead of sysfatal */
+void
+audiodevopen(void)
+{
+	int t;
+	ulong ul;
+
+	afd = -1;
+	cfd = -1;
+	if((afd = open("/dev/dsp", OWRITE)) < 0)
+		goto err;
+	if((cfd = open("/dev/mixer", ORDWR)) < 0)
+		goto err;
+	
+	t = Bits;
+	if(ioctl(afd, SNDCTL_DSP_SAMPLESIZE, &t) < 0)
+		goto err;
+	
+	t = Channels-1;
+	if(ioctl(afd, SNDCTL_DSP_STEREO, &t) < 0)
+		goto err;
+	
+	speed = Rate;
+	ul = Rate;
+	if(ioctl(afd, SNDCTL_DSP_SPEED, &ul) < 0)
+		goto err;
+
+	return;
+
+err:
+	if(afd >= 0)
+		close(afd);
+	afd = -1;
+	oserror();
+}
+
+void
+audiodevclose(void)
+{
+	close(afd);
+	close(cfd);
+	afd = -1;
+	cfd = -1;
+}
+
+static struct {
+	int id9;
+	int id;
+} names[] = {
+	Vaudio,	SOUND_MIXER_VOLUME,
+	Vbass, 		SOUND_MIXER_BASS,
+	Vtreb, 		SOUND_MIXER_TREBLE,
+	Vline, 		SOUND_MIXER_LINE,
+	Vpcm, 		SOUND_MIXER_PCM,
+	Vsynth, 		SOUND_MIXER_SYNTH,
+	Vcd, 		SOUND_MIXER_CD,
+	Vmic, 		SOUND_MIXER_MIC,
+//	"record", 		SOUND_MIXER_RECLEV,
+//	"mix",		SOUND_MIXER_IMIX,
+//	"pcm2",		SOUND_MIXER_ALTPCM,
+	Vspeaker,	SOUND_MIXER_SPEAKER
+//	"line1",		SOUND_MIXER_LINE1,
+//	"line2",		SOUND_MIXER_LINE2,
+//	"line3",		SOUND_MIXER_LINE3,
+//	"digital1",	SOUND_MIXER_DIGITAL1,
+//	"digital2",	SOUND_MIXER_DIGITAL2,
+//	"digital3",	SOUND_MIXER_DIGITAL3,
+//	"phonein",		SOUND_MIXER_PHONEIN,
+//	"phoneout",		SOUND_MIXER_PHONEOUT,
+//	"radio",		SOUND_MIXER_RADIO,
+//	"video",		SOUND_MIXER_VIDEO,
+//	"monitor",	SOUND_MIXER_MONITOR,
+//	"igain",		SOUND_MIXER_IGAIN,
+//	"ogain",		SOUND_MIXER_OGAIN,
+};
+
+static int
+lookname(int id9)
+{
+	int i;
+	
+	for(i=0; i<nelem(names); i++)
+		if(names[i].id9 == id9)
+			return names[i].id;
+	return -1;
+}
+
+void
+audiodevsetvol(int what, int left, int right)
+{
+	int id;
+	ulong x;
+	int can, v;
+	
+	if(cfd < 0)
+		error("audio device not open");
+	if(what == Vspeed){
+		x = left;
+		if(ioctl(afd, SNDCTL_DSP_SPEED, &x) < 0)
+			oserror();
+		speed = x;
+		return;
+	}
+	if((id = lookname(what)) < 0)
+		return;
+	if(ioctl(cfd, SOUND_MIXER_READ_DEVMASK, &can) < 0)
+		can = ~0;
+	if(!(can & (1<<id)))
+		return;
+	v = left | (right<<8);
+	if(ioctl(cfd, MIXER_WRITE(id), &v) < 0)
+		oserror();
+}
+
+void
+audiodevgetvol(int what, int *left, int *right)
+{
+	int id;
+	int can, v;
+	
+	if(cfd < 0)
+		error("audio device not open");
+	if(what == Vspeed){
+		*left = *right = speed;
+		return;
+	}
+	if((id = lookname(what)) < 0)
+		return;
+	if(ioctl(cfd, SOUND_MIXER_READ_DEVMASK, &can) < 0)
+		can = ~0;
+	if(!(can & (1<<id)))
+		return;
+	if(ioctl(cfd, MIXER_READ(id), &v) < 0)
+		oserror();
+	*left = v&0xFF;
+	*right = (v>>8)&0xFF;
+}
+
+int
+audiodevwrite(void *v, int n)
+{
+	int m, tot;
+	
+	for(tot=0; tot<n; tot+=m)
+		if((m = write(afd, (uchar*)v+tot, n-tot)) <= 0)
+			oserror();
+	return tot;
+}
+
+int
+audiodevread(void *v, int n)
+{
+	error("no reading");
+}

+ 372 - 0
sys/src/cmd/unix/drawterm/kern/devaudio.c

@@ -0,0 +1,372 @@
+#include	"u.h"
+#include	"lib.h"
+#include	"dat.h"
+#include	"fns.h"
+#include	"error.h"
+#include	"devaudio.h"
+
+enum
+{
+	Qdir		= 0,
+	Qaudio,
+	Qvolume,
+
+	Aclosed		= 0,
+	Aread,
+	Awrite,
+
+	Speed		= 44100,
+	Ncmd		= 50,		/* max volume command words */
+};
+
+Dirtab
+audiodir[] =
+{
+	".",	{Qdir, 0, QTDIR},		0,	DMDIR|0555,
+	"audio",	{Qaudio},		0,	0666,
+	"volume",	{Qvolume},		0,	0666,
+};
+
+static	struct
+{
+	QLock	lk;
+	Rendez	vous;
+	int	amode;		/* Aclosed/Aread/Awrite for /audio */
+} audio;
+
+#define aqlock(a) qlock(&(a)->lk)
+#define aqunlock(a) qunlock(&(a)->lk)
+
+static	struct
+{
+	char*	name;
+	int	flag;
+	int	ilval;		/* initial values */
+	int	irval;
+} volumes[] =
+{
+[Vaudio]		"audio",	Fout, 		50,	50,
+[Vsynth]		"synth",	Fin|Fout,	0,	0,
+[Vcd]		"cd",		Fin|Fout,	0,	0,
+[Vline]		"line",	Fin|Fout,	0,	0,
+[Vmic]		"mic",	Fin|Fout|Fmono,	0,	0,
+[Vspeaker]	"speaker",	Fout|Fmono,	0,	0,
+
+[Vtreb]		"treb",		Fout, 		50,	50,
+[Vbass]		"bass",		Fout, 		50,	50,
+
+[Vspeed]	"speed",	Fin|Fout|Fmono,	Speed,	Speed,
+		0
+};
+
+static	char	Emode[]		= "illegal open mode";
+static	char	Evolume[]	= "illegal volume specifier";
+
+static	void
+resetlevel(void)
+{
+	int i;
+
+	for(i=0; volumes[i].name; i++)
+		audiodevsetvol(i, volumes[i].ilval, volumes[i].irval);
+}
+
+static void
+audioinit(void)
+{
+}
+
+static Chan*
+audioattach(char *param)
+{
+	return devattach('A', param);
+}
+
+static Walkqid*
+audiowalk(Chan *c, Chan *nc, char **name, int nname)
+{
+	return devwalk(c, nc, name, nname, audiodir, nelem(audiodir), devgen);
+}
+
+static int
+audiostat(Chan *c, uchar *db, int n)
+{
+	return devstat(c, db, n, audiodir, nelem(audiodir), devgen);
+}
+
+static Chan*
+audioopen(Chan *c, int omode)
+{
+	int amode;
+
+	switch((ulong)c->qid.path) {
+	default:
+		error(Eperm);
+		break;
+
+	case Qvolume:
+	case Qdir:
+		break;
+
+	case Qaudio:
+		amode = Awrite;
+		if((omode&7) == OREAD)
+			amode = Aread;
+		aqlock(&audio);
+		if(waserror()){
+			aqunlock(&audio);
+			nexterror();
+		}
+		if(audio.amode != Aclosed)
+			error(Einuse);
+		audiodevopen();
+		audio.amode = amode;
+		poperror();
+		aqunlock(&audio);
+		break;
+	}
+	c = devopen(c, omode, audiodir, nelem(audiodir), devgen);
+	c->mode = openmode(omode);
+	c->flag |= COPEN;
+	c->offset = 0;
+
+	return c;
+}
+
+static void
+audioclose(Chan *c)
+{
+	switch((ulong)c->qid.path) {
+	default:
+		error(Eperm);
+		break;
+
+	case Qdir:
+	case Qvolume:
+		break;
+
+	case Qaudio:
+		if(c->flag & COPEN) {
+			aqlock(&audio);
+			audiodevclose();
+			audio.amode = Aclosed;
+			aqunlock(&audio);
+		}
+		break;
+	}
+}
+
+static long
+audioread(Chan *c, void *v, long n, vlong off)
+{
+	int liv, riv, lov, rov;
+	long m;
+	char buf[300];
+	int j;
+	ulong offset = off;
+	char *a;
+
+	a = v;
+	switch((ulong)c->qid.path) {
+	default:
+		error(Eperm);
+		break;
+
+	case Qdir:
+		return devdirread(c, a, n, audiodir, nelem(audiodir), devgen);
+
+	case Qaudio:
+		if(audio.amode != Aread)
+			error(Emode);
+		aqlock(&audio);
+		if(waserror()){
+			aqunlock(&audio);
+			nexterror();
+		}
+		n = audiodevread(v, n);
+		poperror();
+		aqunlock(&audio);
+		break;
+
+	case Qvolume:
+		j = 0;
+		buf[0] = 0;
+		for(m=0; volumes[m].name; m++){
+			audiodevgetvol(m, &lov, &rov);
+			liv = lov;
+			riv = rov;
+			j += snprint(buf+j, sizeof(buf)-j, "%s", volumes[m].name);
+			if((volumes[m].flag & Fmono) || (liv==riv && lov==rov)){
+				if((volumes[m].flag&(Fin|Fout))==(Fin|Fout) && liv==lov)
+					j += snprint(buf+j, sizeof(buf)-j, " %d", liv);
+				else{
+					if(volumes[m].flag & Fin)
+						j += snprint(buf+j, sizeof(buf)-j,
+							" in %d", liv);
+					if(volumes[m].flag & Fout)
+						j += snprint(buf+j, sizeof(buf)-j,
+							" out %d", lov);
+				}
+			}else{
+				if((volumes[m].flag&(Fin|Fout))==(Fin|Fout) &&
+				    liv==lov && riv==rov)
+					j += snprint(buf+j, sizeof(buf)-j,
+						" left %d right %d",
+						liv, riv);
+				else{
+					if(volumes[m].flag & Fin)
+						j += snprint(buf+j, sizeof(buf)-j,
+							" in left %d right %d",
+							liv, riv);
+					if(volumes[m].flag & Fout)
+						j += snprint(buf+j, sizeof(buf)-j,
+							" out left %d right %d",
+							lov, rov);
+				}
+			}
+			j += snprint(buf+j, sizeof(buf)-j, "\n");
+		}
+		return readstr(offset, a, n, buf);
+	}
+	return n;
+}
+
+static long
+audiowrite(Chan *c, void *vp, long n, vlong off)
+{
+	long m;
+	int i, v, left, right, in, out;
+	Cmdbuf *cb;
+	char *a;
+
+	USED(off);
+	a = vp;
+	switch((ulong)c->qid.path) {
+	default:
+		error(Eperm);
+		break;
+
+	case Qvolume:
+		v = Vaudio;
+		left = 1;
+		right = 1;
+		in = 1;
+		out = 1;
+		cb = parsecmd(vp, n);
+		if(waserror()){
+			free(cb);
+			nexterror();
+		}
+
+		for(i = 0; i < cb->nf; i++){
+			/*
+			 * a number is volume
+			 */
+			if(cb->f[i][0] >= '0' && cb->f[i][0] <= '9') {
+				m = strtoul(cb->f[i], 0, 10);
+				if(!out)
+					goto cont0;
+				if(left && right)
+					audiodevsetvol(v, m, m);
+				else if(left)
+					audiodevsetvol(v, m, -1);
+				else if(right)
+					audiodevsetvol(v, -1, m);
+				goto cont0;
+			}
+
+			for(m=0; volumes[m].name; m++) {
+				if(strcmp(cb->f[i], volumes[m].name) == 0) {
+					v = m;
+					in = 1;
+					out = 1;
+					left = 1;
+					right = 1;
+					goto cont0;
+				}
+			}
+
+			if(strcmp(cb->f[i], "reset") == 0) {
+				resetlevel();
+				goto cont0;
+			}
+			if(strcmp(cb->f[i], "in") == 0) {
+				in = 1;
+				out = 0;
+				goto cont0;
+			}
+			if(strcmp(cb->f[i], "out") == 0) {
+				in = 0;
+				out = 1;
+				goto cont0;
+			}
+			if(strcmp(cb->f[i], "left") == 0) {
+				left = 1;
+				right = 0;
+				goto cont0;
+			}
+			if(strcmp(cb->f[i], "right") == 0) {
+				left = 0;
+				right = 1;
+				goto cont0;
+			}
+			error(Evolume);
+			break;
+		cont0:;
+		}
+		free(cb);
+		poperror();
+		break;
+
+	case Qaudio:
+		if(audio.amode != Awrite)
+			error(Emode);
+		aqlock(&audio);
+		if(waserror()){
+			aqunlock(&audio);
+			nexterror();
+		}
+		n = audiodevwrite(vp, n);
+		poperror();
+		aqunlock(&audio);
+		break;
+	}
+	return n;
+}
+
+void
+audioswab(uchar *a, uint n)
+{
+	ulong *p, *ep, b;
+
+	p = (ulong*)a;
+	ep = p + (n>>2);
+	while(p < ep) {
+		b = *p;
+		b = (b>>24) | (b<<24) |
+			((b&0xff0000) >> 8) |
+			((b&0x00ff00) << 8);
+		*p++ = b;
+	}
+}
+
+Dev audiodevtab = {
+	'A',
+	"audio",
+
+	devreset,
+	audioinit,
+	devshutdown,
+	audioattach,
+	audiowalk,
+	audiostat,
+	audioopen,
+	devcreate,
+	audioclose,
+	audioread,
+	devbread,
+	audiowrite,
+	devbwrite,
+	devremove,
+	devwstat,
+};

+ 25 - 0
sys/src/cmd/unix/drawterm/kern/devaudio.h

@@ -0,0 +1,25 @@
+enum
+{
+	Fmono		= 1,
+	Fin		= 2,
+	Fout		= 4,
+
+	Vaudio		= 0,
+	Vsynth,
+	Vcd,
+	Vline,
+	Vmic,
+	Vspeaker,
+	Vtreb,
+	Vbass,
+	Vspeed,
+	Vpcm,
+	Nvol,
+};
+
+void	audiodevopen(void);
+void	audiodevclose(void);
+int	audiodevread(void*, int);
+int	audiodevwrite(void*, int);
+void	audiodevgetvol(int, int*, int*);
+void	audiodevsetvol(int, int, int);

+ 2 - 0
sys/src/cmd/unix/drawterm/kern/devtab.c

@@ -14,6 +14,7 @@ extern Dev ipdevtab;
 extern Dev fsdevtab;
 extern Dev mntdevtab;
 extern Dev lfddevtab;
+extern Dev audiodevtab;
 
 Dev *devtab[] = {
 	&rootdevtab,
@@ -26,6 +27,7 @@ Dev *devtab[] = {
 	&fsdevtab,
 	&mntdevtab,
 	&lfddevtab,
+	&audiodevtab,
 	0
 };
 

+ 1 - 0
sys/src/cmd/unix/drawterm/main.c

@@ -56,6 +56,7 @@ main(int argc, char **argv)
 		panic("bind #I: %r");
 	if(bind("#U", "/", MAFTER) < 0)
 		panic("bind #U: %r");
+	bind("#A", "/dev", MAFTER);
 
 	if(open("/dev/cons", OREAD) != 0)
 		panic("open0: %r");

+ 3 - 0
sys/src/cmd/upas/smtp/smtp.c

@@ -740,6 +740,8 @@ getreply(void)
 	reply = s_reset(reply);
 	for(;;){
 		line = getcrnl(reply);
+		if(debug)
+			Bflush(&berr);
 		if(line == 0)
 			return -1;
 		if(!isdigit(line[0]) || !isdigit(line[1]) || !isdigit(line[2]))
@@ -985,6 +987,7 @@ getcrnl(String *s)
 		case '\r':
 			c = Bgetc(&bin);
 			if(c == '\n'){
+		case '\n':
 				s_putc(s, c);
 				if(debug)
 					Bputc(&berr, c);