Browse Source

A few more classic stuff

Elbing 8 years ago
parent
commit
4092e65f91
69 changed files with 843 additions and 2382 deletions
  1. 2 0
      sys/src/cmd/aux/aux.json
  2. 17 0
      sys/src/cmd/aux/gps/gps.json
  3. 14 0
      sys/src/cmd/aux/gps/gpsevermore.json
  4. 6 6
      sys/src/cmd/aux/gps/gpsfs.c
  5. 0 21
      sys/src/cmd/aux/gps/mkfile
  6. 1 1
      sys/src/cmd/aux/vga/mach64xx.c
  7. 0 79
      sys/src/cmd/aux/vga/mkfile
  8. 4 4
      sys/src/cmd/aux/vga/vesa.c
  9. 71 0
      sys/src/cmd/aux/vga/vga.json
  10. 9 4
      sys/src/cmd/awk/awk.json
  11. 0 1629
      sys/src/cmd/awk/awkgram.c
  12. 1 1
      sys/src/cmd/bzip2/bunzip2.c
  13. 1 1
      sys/src/cmd/bzip2/bzip2.c
  14. 28 0
      sys/src/cmd/bzip2/bzip2.json
  15. 30 0
      sys/src/cmd/bzip2/lib/libbzip2.json
  16. 1 1
      sys/src/cmd/bzip2/lib/plan9.h
  17. 14 0
      sys/src/cmd/cb/cb.json
  18. 0 18
      sys/src/cmd/cb/mkfile
  19. 16 0
      sys/src/cmd/cdfs/cdfs.json
  20. 22 22
      sys/src/cmd/cdfs/dat.h
  21. 5 5
      sys/src/cmd/cdfs/fns.h
  22. 1 1
      sys/src/cmd/cdfs/main.c
  23. 0 17
      sys/src/cmd/cdfs/mkfile
  24. 50 50
      sys/src/cmd/cdfs/mmc.c
  25. 1 1
      sys/src/cmd/cdfs/scsi.c
  26. 1 1
      sys/src/cmd/cifs/auth.c
  27. 41 41
      sys/src/cmd/cifs/cifs.h
  28. 29 0
      sys/src/cmd/cifs/cifs.json
  29. 1 1
      sys/src/cmd/cifs/main.c
  30. 0 20
      sys/src/cmd/cifs/mkfile
  31. 10 0
      sys/src/cmd/cmds.json
  32. 24 0
      sys/src/cmd/con/con.json
  33. 0 18
      sys/src/cmd/con/mkfile
  34. 2 2
      sys/src/cmd/con/xmr.c
  35. 5 5
      sys/src/cmd/con/xms.c
  36. 24 0
      sys/src/cmd/dial/dial.json
  37. 1 1
      sys/src/cmd/dial/drain.c
  38. 1 1
      sys/src/cmd/dial/expect.c
  39. 0 20
      sys/src/cmd/dial/mkfile
  40. 1 1
      sys/src/cmd/dial/pass.c
  41. 16 0
      sys/src/cmd/diff/diff.json
  42. 0 13
      sys/src/cmd/diff/mkfile
  43. 27 0
      sys/src/cmd/disk/9660/9660.json
  44. 10 10
      sys/src/cmd/disk/9660/dump9660.c
  45. 71 71
      sys/src/cmd/disk/9660/iso9660.h
  46. 0 43
      sys/src/cmd/disk/9660/mkfile
  47. 1 1
      sys/src/cmd/disk/9660/plan9.c
  48. 33 0
      sys/src/cmd/disk/disk.json
  49. 7 7
      sys/src/cmd/disk/exsort.c
  50. 1 1
      sys/src/cmd/disk/format.c
  51. 2 2
      sys/src/cmd/disk/mbr.c
  52. 3 3
      sys/src/cmd/disk/mkext.c
  53. 0 48
      sys/src/cmd/disk/mkfile
  54. 2 2
      sys/src/cmd/disk/partfs.c
  55. 5 5
      sys/src/cmd/disk/prep/edit.c
  56. 10 10
      sys/src/cmd/disk/prep/edit.h
  57. 3 3
      sys/src/cmd/disk/prep/fdisk.c
  58. 17 0
      sys/src/cmd/disk/prep/fdisk.json
  59. 2 2
      sys/src/cmd/disk/prep/prep.c
  60. 18 0
      sys/src/cmd/disk/prep/prep.json
  61. 82 82
      sys/src/cmd/dossrv/dat.h
  62. 1 1
      sys/src/cmd/dossrv/dosfs.h
  63. 20 0
      sys/src/cmd/dossrv/dossrv.json
  64. 1 1
      sys/src/cmd/dossrv/dossubs.c
  65. 15 15
      sys/src/cmd/dossrv/fns.h
  66. 9 9
      sys/src/cmd/dossrv/iotrack.h
  67. 0 29
      sys/src/cmd/dossrv/mkfile
  68. 2 1
      sys/src/cmd/rc/rc.json
  69. 51 51
      sys/src/cmd/scuzz/scsireq.h

+ 2 - 0
sys/src/cmd/aux/aux.json

@@ -40,6 +40,8 @@
 	"Projects": [
 	"mnihongo/mnihongo.json",
 	"flashfs/flashfs.json",
+	"gps/gps.json",
+	"vga/vga.json"
 	],
 	"Include": ["../cmd.json"],
 	"Pre": [

+ 17 - 0
sys/src/cmd/aux/gps/gps.json

@@ -0,0 +1,17 @@
+{
+    "Name": "gpsfs",
+    "Include": ["../../cmd.json"],
+    "Program": "gpsfs",
+    "Projects": [
+    "gpsevermore.json"
+    ],
+    "Pre": [
+	],
+    "SourceFiles": [
+    "util.c",
+    "gpsfs.c"
+	],
+	"Post": [
+    "mv gpsfs $HARVEY/amd64/bin/aux/"
+	]
+}

+ 14 - 0
sys/src/cmd/aux/gps/gpsevermore.json

@@ -0,0 +1,14 @@
+{
+    "Name": "gpsevermore",
+    "Include": ["../../cmd.json"],
+    "Program": "gpsevermore",
+    "Pre": [
+	],
+    "SourceFiles": [
+    "util.c",
+    "gpsevermore.c"
+	],
+	"Post": [
+    "mv gpsevermore $HARVEY/amd64/bin/aux/"
+	]
+}

+ 6 - 6
sys/src/cmd/aux/gps/gpsfs.c

@@ -51,8 +51,8 @@ struct Fix {
 	double		zulu;
 	int		date;
 	char		valid;
-	uchar		quality;
-	ushort		satellites;
+	unsigned char		quality;
+	uint16_t		satellites;
 	double		pdop;
 	double		hdop;
 	double		vdop;
@@ -177,7 +177,7 @@ File *root;
 File *gpsdir;
 
 void
-rend(Srv *)
+rend(Srv *s)
 {
 	sysfatal("gpsfs demised");
 }
@@ -259,7 +259,7 @@ threadmain(int argc, char*argv[])
 }
 
 static void
-gpstrack(void *)
+gpstrack(void *v)
 {
 	Fix fix;
 	static char buf[256], *t[32];
@@ -763,7 +763,7 @@ getsea(char *s1, char *s2, Fix *f){
 int
 getlat(char *s1, char *s2, Fix *f){
 	double lat;
-	static count;
+	static int count;
 
 	if(*s1 == 0 || !isdigit(*s1) || strlen(s1) <= 5){
 		badlat++;
@@ -803,7 +803,7 @@ getlat(char *s1, char *s2, Fix *f){
 int
 getlon(char *s1, char *s2, Fix *f){
 	double lon;
-	static count;
+	static int count;
 
 	if(*s1 == 0 || ! isdigit(*s1) || strlen(s1) <= 5){
 		badlon++;

+ 0 - 21
sys/src/cmd/aux/gps/mkfile

@@ -1,21 +0,0 @@
-</$objtype/mkfile
-
-TARG=\
-	gpsfs\
-	gpsevermore\
-	
-OFILES=\
-	util.$O
-
-BIN=/$objtype/bin/aux
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-	${TARG:%=%.c}\
-
-</sys/src/cmd/mkmany
-
-update:V:
-	update $UPDATEFLAGS $UPDATE

+ 1 - 1
sys/src/cmd/aux/vga/mach64xx.c

@@ -158,7 +158,7 @@ static char* lcdname[Nlcd] = {
 enum {
 	IOREG = 0x10000,
 };
-static uint16_t ioregs[Nreg] = {
+static uint64_t ioregs[Nreg] = {
  [HTotalDisp]		IOREG|0x0000,
  [HSyncStrtWid]	IOREG|0x0100,
  [VTotalDisp]		IOREG|0x0200,

+ 0 - 79
sys/src/cmd/aux/vga/mkfile

@@ -1,79 +0,0 @@
-< /$objtype/mkfile
-BIN=/$objtype/bin/aux
-
-TARG=vga
-OFILES=\
-	3dfx.$O\
-	ark2000pv.$O\
-	att20c49x.$O\
-	att21c498.$O\
-	bt485.$O\
-	ch9294.$O\
-	clgd542x.$O\
-	clgd546x.$O\
-	ct65540.$O\
-	cyber938x.$O\
-	data.$O\
-	db.$O\
-	error.$O\
-	et4000.$O\
-	et4000hwgc.$O\
-	hiqvideo.$O\
-	i81x.$O\
-	ibm8514.$O\
-	icd2061a.$O\
-	ics2494.$O\
-	ics534x.$O\
-	io.$O\
-	mach32.$O\
-	mach64.$O\
-	mach64xx.$O\
-	main.$O\
-	mga2164w.$O\
-	mga4xx.$O\
-	neomagic.$O\
-	nvidia.$O\
-	radeon.$O\
-	palette.$O\
-	pci.$O\
-	rgb524.$O\
-	rgb524mn.$O\
-	s3801.$O\
-	s3928.$O\
-	s3clock.$O\
-	s3generic.$O\
-	s3hwgc.$O\
-	sc15025.$O\
-	stg1702.$O\
-	t2r4.$O\
-	trio64.$O\
-	tvp3020.$O\
-	tvp3025.$O\
-	tvp3025clock.$O\
-	tvp3026.$O\
-	tvp3026clock.$O\
-	vesa.$O\
-	vesadb.$O\
-	vga.$O\
-	virge.$O\
-	vision864.$O\
-	vision964.$O\
-	vision968.$O\
-	vmware.$O\
-	w30c516.$O\
-
-HFILES=\
-	pci.h\
-	vga.h
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-	/lib/vgadb\
-	riva_tbl.h\
-
-
-</sys/src/cmd/mkone
-
-nvidia.$O:	riva_tbl.h

+ 4 - 4
sys/src/cmd/aux/vga/vesa.c

@@ -784,10 +784,10 @@ decodedtb(Mode *m, uint8_t *p)
 	vso = ((p[11] & 0x0C)<<2) | ((p[10] & 0xF0)>>4);	/* vertical sync offset */
 	vspw = ((p[11] & 0x03)<<4) | (p[10] & 0x0F);		/* vertical sync pulse width */
 
-	/* dxmm = (p[14] & 0xF0)<<4) | p[12]; 	/* horizontal image size (mm) */
-	/* dymm = (p[14] & 0x0F)<<8) | p[13];	/* vertical image size (mm) */
-	/* hbord = p[15];		/* horizontal border (pixels) */
-	/* vbord = p[16];		/* vertical border (pixels) */
+	/* dxmm = (p[14] & 0xF0)<<4) | p[12]; 	*//* horizontal image size (mm) */
+	/* dymm = (p[14] & 0x0F)<<8) | p[13];	*//* vertical image size (mm) */
+	/* hbord = p[15];		*//* horizontal border (pixels) */
+	/* vbord = p[16];		*//* vertical border (pixels) */
 
 	m->x = ha;
 	m->y = va;

+ 71 - 0
sys/src/cmd/aux/vga/vga.json

@@ -0,0 +1,71 @@
+{
+    "Name": "vga",
+    "Include": ["../../cmd.json"],
+    "Program": "vga",
+    "Pre": [
+	],
+    "SourceFiles": [
+    "3dfx.c",
+    "bt485.c",
+    "ct65540.c",
+    "error.c",
+    "i81x.c",
+    "ics534x.c",
+    "mach64xx.c",
+    "neomagic.c",
+    "radeon.c",
+    "s3928.c",
+    "sc15025.c",
+    "trio64.c",
+    "tvp3026.c",
+    "vga.c",
+    "vision968.c",
+    "ark2000pv.c",
+    "ch9294.c",
+    "cyber938x.c",
+    "et4000.c",
+    "ibm8514.c",
+    "io.c",
+    "main.c",
+    "nvidia.c",
+    "rgb524.c",
+    "s3clock.c",
+    "stg1702.c",
+    "tvp3020.c",
+    "tvp3026clock.c",
+    "virge.c",
+    "vmware.c",
+    "att20c49x.c",
+    "clgd542x.c",
+    "data.c",
+    "et4000hwgc.c",
+    "icd2061a.c",
+    "mach32.c",
+    "mga2164w.c",
+    "palette.c",
+    "rgb524mn.c",
+    "s3generic.c",
+    "t2r4.c",
+    "tvp3025.c",
+    "vesa.c",
+    "vision864.c",
+    "w30c516.c",
+    "att21c498.c",
+    "clgd546x.c",
+    "db.c",
+    "hiqvideo.c",
+    "ics2494.c",
+    "mach64.c",
+    "mga4xx.c",
+    "pci.c",
+    "s3801.c",
+    "s3hwgc.c",
+    "template.c",
+    "tvp3025clock.c",
+    "vesadb.c",
+    "vision964.c"
+	],
+	"Post": [
+    "mv vga $HARVEY/amd64/bin/aux/"
+	]
+}

+ 9 - 4
sys/src/cmd/awk/awk.json

@@ -3,7 +3,8 @@
 	"Program": "awk",
 	"Include": ["../cmd.json"],
 	"Pre": [
-	"yacc -d awkgram.y"
+	"yacc -d awkgram.y",
+	"mv $HARVEY/sys/src/cmd/awk/y.tab.c $HARVEY/sys/src/cmd/awk/awkgram.c"
 	],
     "SourceFiles": [
 	"awkgram.c",
@@ -15,10 +16,14 @@
 	"proctab.c",
 	"re.c",
 	"run.c",
-	"tran.c",
-	"y.tab.c"
+	"tran.c"
 	],
+	"Cflags": [
+	"-I/sys/include/ape",
+    "-DPLAN9"
+    ],
 	"Post": [
-	"mv awk $HARVEY/amd64/bin/"
+	"mv awk $HARVEY/amd64/bin/",
+	"rm awkgram.c"
 	]
 }

+ 0 - 1629
sys/src/cmd/awk/awkgram.c

@@ -1,1629 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-
-#line	26	"/sys/src/cmd/awk/awkgram.y"
-#include <stdio.h>
-#include <string.h>
-#include "awk.h"
-
-#define	makedfa(a,b)	compre(a)
-
-void checkdup(Node *list, Cell *item);
-int yywrap(void) { return(1); }
-
-Node	*beginloc = 0;
-Node	*endloc = 0;
-int	infunc	= 0;	/* = 1 if in arglist or body of func */
-int	inloop	= 0;	/* = 1 if in while, for, do */
-char	*curfname = 0;	/* current function name */
-Node	*arglist = 0;	/* list of args for current function */
-
-#line	43	"/sys/src/cmd/awk/awkgram.y"
-typedef union  {
-	Node	*p;
-	Cell	*cp;
-	int	i;
-	char	*s;
-} YYSTYPE;
-extern	int	yyerrflag;
-#ifndef	YYMAXDEPTH
-#define	YYMAXDEPTH	150
-#endif
-YYSTYPE	yylval;
-YYSTYPE	yyval;
-#define	FIRSTTOKEN	57346
-#define	PROGRAM	57347
-#define	PASTAT	57348
-#define	PASTAT2	57349
-#define	XBEGIN	57350
-#define	XEND	57351
-#define	NL	57352
-#define	ARRAY	57353
-#define	MATCH	57354
-#define	NOTMATCH	57355
-#define	MATCHOP	57356
-#define	FINAL	57357
-#define	DOT	57358
-#define	ALL	57359
-#define	CCL	57360
-#define	NCCL	57361
-#define	CHAR	57362
-#define	OR	57363
-#define	STAR	57364
-#define	QUEST	57365
-#define	PLUS	57366
-#define	AND	57367
-#define	BOR	57368
-#define	APPEND	57369
-#define	EQ	57370
-#define	GE	57371
-#define	GT	57372
-#define	LE	57373
-#define	LT	57374
-#define	NE	57375
-#define	IN	57376
-#define	ARG	57377
-#define	BLTIN	57378
-#define	BREAK	57379
-#define	CLOSE	57380
-#define	CONTINUE	57381
-#define	DELETE	57382
-#define	DO	57383
-#define	EXIT	57384
-#define	FOR	57385
-#define	FUNC	57386
-#define	SUB	57387
-#define	GSUB	57388
-#define	IF	57389
-#define	INDEX	57390
-#define	LSUBSTR	57391
-#define	MATCHFCN	57392
-#define	NEXT	57393
-#define	NEXTFILE	57394
-#define	ADD	57395
-#define	MINUS	57396
-#define	MULT	57397
-#define	DIVIDE	57398
-#define	MOD	57399
-#define	ASSIGN	57400
-#define	ASGNOP	57401
-#define	ADDEQ	57402
-#define	SUBEQ	57403
-#define	MULTEQ	57404
-#define	DIVEQ	57405
-#define	MODEQ	57406
-#define	POWEQ	57407
-#define	PRINT	57408
-#define	PRINTF	57409
-#define	SPRINTF	57410
-#define	ELSE	57411
-#define	INTEST	57412
-#define	CONDEXPR	57413
-#define	POSTINCR	57414
-#define	PREINCR	57415
-#define	POSTDECR	57416
-#define	PREDECR	57417
-#define	VAR	57418
-#define	IVAR	57419
-#define	VARNF	57420
-#define	CALL	57421
-#define	NUMBER	57422
-#define	STRING	57423
-#define	REGEXPR	57424
-#define	GETLINE	57425
-#define	RETURN	57426
-#define	SPLIT	57427
-#define	SUBSTR	57428
-#define	WHILE	57429
-#define	CAT	57430
-#define	NOT	57431
-#define	UMINUS	57432
-#define	POWER	57433
-#define	DECR	57434
-#define	INCR	57435
-#define	INDIRECT	57436
-#define	LASTTOKEN	57437
-#define YYEOFCODE 1
-#define YYERRCODE 2
-
-#line	447	"/sys/src/cmd/awk/awkgram.y"
-
-
-void setfname(Cell *p)
-{
-	if (isarr(p))
-		SYNTAX("%s is an array, not a function", p->nval);
-	else if (isfcn(p))
-		SYNTAX("you can't define function %s more than once", p->nval);
-	curfname = p->nval;
-}
-
-int constnode(Node *p)
-{
-	return isvalue(p) && ((Cell *) (p->narg[0]))->csub == CCON;
-}
-
-char *strnode(Node *p)
-{
-	return ((Cell *)(p->narg[0]))->sval;
-}
-
-Node *notnull(Node *n)
-{
-	switch (n->nobj) {
-	case LE: case LT: case EQ: case NE: case GT: case GE:
-	case BOR: case AND: case NOT:
-		return n;
-	default:
-		return op2(NE, n, nullnode);
-	}
-}
-
-void checkdup(Node *vl, Cell *cp)	/* check if name already in list */
-{
-	char *s = cp->nval;
-	for ( ; vl; vl = vl->nnext) {
-		if (strcmp(s, ((Cell *)(vl->narg[0]))->nval) == 0) {
-			SYNTAX("duplicate argument %s", s);
-			break;
-		}
-	}
-}
-int16_t	yyexca[] =
-{-1, 0,
-	1, 28,
-	8, 28,
-	9, 28,
-	12, 28,
-	13, 28,
-	16, 28,
-	45, 28,
-	46, 28,
-	54, 28,
-	55, 28,
-	56, 28,
-	58, 28,
-	60, 28,
-	78, 28,
-	86, 28,
-	87, 28,
-	88, 28,
-	89, 28,
-	90, 28,
-	91, 28,
-	95, 28,
-	97, 28,
-	98, 28,
-	101, 28,
-	102, 28,
-	105, 28,
-	108, 28,
-	109, 28,
-	110, 28,
-	-2, 0,
--1, 1,
-	1, -1,
-	-2, 0,
--1, 157,
-	15, 30,
-	-2, 0,
--1, 176,
-	14, 0,
-	24, 0,
-	38, 0,
-	39, 0,
-	40, 0,
-	41, 0,
-	42, 0,
-	43, 0,
-	44, 0,
-	-2, 63,
--1, 177,
-	14, 0,
-	24, 0,
-	38, 0,
-	39, 0,
-	40, 0,
-	41, 0,
-	42, 0,
-	43, 0,
-	44, 0,
-	-2, 64,
--1, 178,
-	14, 0,
-	24, 0,
-	38, 0,
-	39, 0,
-	40, 0,
-	41, 0,
-	42, 0,
-	43, 0,
-	44, 0,
-	-2, 65,
--1, 179,
-	14, 0,
-	24, 0,
-	38, 0,
-	39, 0,
-	40, 0,
-	41, 0,
-	42, 0,
-	43, 0,
-	44, 0,
-	-2, 66,
--1, 180,
-	14, 0,
-	24, 0,
-	38, 0,
-	39, 0,
-	40, 0,
-	41, 0,
-	42, 0,
-	43, 0,
-	44, 0,
-	-2, 67,
--1, 181,
-	14, 0,
-	24, 0,
-	38, 0,
-	39, 0,
-	40, 0,
-	41, 0,
-	42, 0,
-	43, 0,
-	44, 0,
-	-2, 68,
--1, 183,
-	14, 0,
-	24, 0,
-	38, 0,
-	39, 0,
-	40, 0,
-	41, 0,
-	42, 0,
-	43, 0,
-	44, 0,
-	-2, 70,
--1, 290,
-	24, 0,
-	44, 0,
-	-2, 53,
--1, 334,
-	17, 30,
-	-2, 0,
--1, 356,
-	17, 30,
-	-2, 0,
-};
-#define	YYNPROD	185
-#define	YYPRIVATE 57344
-#define	YYLAST	4170
-int16_t	yyact[] =
-{
-  17, 278, 254, 137, 244, 229, 102, 200,  53,  66,
-  24, 105,  42, 155, 103, 104, 100, 138, 112, 309,
-  54, 185, 215,  42, 100, 254, 100, 100, 100, 250,
- 224, 121, 122, 123,   9, 107,  82,  42, 315,  83,
- 162, 254, 107, 103, 104, 103, 104, 124, 253, 206,
-  42, 190, 245,  41,  22,  43, 113, 113, 279, 133,
- 317, 142,  10, 146,  41, 353,  43, 149, 150, 152,
- 153, 148, 352, 163, 136, 100,  42,  23,  41,  22,
-  43, 277, 147, 351, 132,  62, 156,  85, 168, 169,
-  11,  41,  22,  43, 322, 321,  50, 190,  79,  80,
- 100, 319,  23,  86, 182, 270, 259, 100, 100, 100,
- 100, 100, 100, 100, 134,  23, 276,  41, 233,  43,
- 108, 109, 110, 111, 332, 100, 112, 203, 205, 110,
- 111, 190, 190, 112, 140,  11, 211, 336, 325, 139,
- 212, 234, 100, 140, 235, 220, 100, 170, 311, 222,
- 190, 167, 100, 219, 136, 227, 279, 156, 190, 158,
- 190, 157, 190, 100, 285, 221, 266, 231, 261, 136,
- 130, 129, 100, 237, 100, 228, 100, 100, 100, 100,
- 100, 100, 100, 128, 100, 190, 252, 100, 100, 136,
- 136, 260, 190,   3, 100,   6, 127, 126, 188,  19,
-   7,   6, 100,  47, 313, 125,   7, 100,  48, 100,
- 100, 100, 120, 119, 100, 100,  51,  16,  16, 190,
- 217, 140, 275, 218, 143, 115, 271, 154, 272,   4,
- 144, 131, 318, 100, 100, 100, 100, 163,  49, 163,
- 163, 163, 163,  20, 274, 163, 348, 100, 294, 362,
- 239, 295, 289, 293, 365,   1, 100, 100,  72,  96,
-  39, 225,   5,  58,  67, 223, 240, 114,  61, 116,
- 117, 118, 164,  60, 301, 302, 249, 283,  81, 286,
- 287, 288, 290,   8, 100, 292, 159, 100, 100, 100,
- 310, 100, 136, 100, 156, 160, 314,   2, 100,   0,
- 100, 100,   0,   0, 100,   0, 100, 100, 100,   0,
-   0,   0,   0,   0, 335,   0, 165, 163,  96,   0,
-   0,   0,   0,   0,   0, 334,   0,   0, 342, 156,
- 343,   0,   0,   0, 100, 341,   0,   0,   0, 100,
- 347, 100,   0, 116, 231, 100, 100,   0, 349, 357,
-  96, 194, 195, 196, 197, 198, 199, 338,   0, 360,
- 356,   0, 361, 363, 156,   0, 231,   0, 207, 358,
- 136, 239,   0,   0, 239, 239, 239,   0, 239,   0,
- 239,   0,   0, 364,   0,  96, 366, 240,   0,  96,
- 240, 240, 240,   0, 240,  96, 240,   0,   0,   0,
- 258,   0,   0,   0, 339,   0, 243,   0,   0,   0,
-   0,   0,   0,   0,   0,  96,   0,  96,  21,  96,
-  96,  96,  96,  96,  96,  96, 239,  96,   0,   0,
-  96,  96,   0,   0,   0,   0, 164, 257, 164, 164,
- 164, 164, 240,   0, 164,  96,   0,   0,   0,   0,
- 262,   0,  96,  96,  96,   0,   0,  96,  96,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  96, 280, 281, 282,
- 165,   0, 165, 165, 165, 165,   0,   0, 165,   0,
-  96,   0, 166,   0,   0,   0,   0,   0,   0,  96,
-  96,   0,   0,   0,   0,  74, 189, 191,   0,   0,
-  15,   0,   0, 184,   0,   0, 164,   0,   0,   0,
-   0,   0,   0,   0, 106,   0,   0, 243,   0,   0,
- 243, 243, 243,   0, 243,   0, 243,   0,   0,   0,
-   0,  96,   0,  96,  96,   0,   0,  96,   0,  96,
-  96,  96,   0,   0,   0,  15,   0,  15,   0,   0,
- 165, 236, 141,   0,   0, 145,   0,   0,   0,   0,
-   0, 151,   0,   0,   0,   0, 230,  96,   0,   0,
-   0,   0, 243,   0,  96,   0,   0,   0,  96,  96,
- 171, 173, 175, 176, 177, 178, 179, 180, 181, 183,
-   0,   0,   0,   0,   0,   0,   0, 186, 187, 263,
- 264, 265,   0, 267, 268, 269,   0,   0,   0, 201,
-   0,   0,   0,   0,   0, 201, 201,   0,   0,   0,
-   0, 208, 209, 210, 201, 213, 214,   0, 189,   0,
-   0,   0,   0,   0,   0,   0,   0, 101,   0,   0,
- 296,   0,   0,   0,   0,   0,   0,   0, 241,   0,
-   0, 291,   0,   0, 232,   0,   0, 106,   0,  98,
-  97,   0, 298, 246,   0,   0,   0,   0, 242,  42,
-  28,   0,   0,   0, 304,   0,   0,   0,   0,  45,
-  46,   0,  33,   0,  34, 255, 312, 256,   0,   0,
-   0,   0,   0,   0,   0, 324, 327, 329, 330,   0,
-   0,   0,  37,   0,   0, 189,   0,   0,   0,   0,
-  41,  22,  43,  29,  35,  38,   0, 238, 316,  32,
-   0,  36,  40,   0, 337,  27,  26,   0,   0,  99,
-   0,   0,  30,  31,  23,   0,   0,   0,   0,   0,
-   0, 201,   0,   0,   0,   0,   0, 297,   0,   0,
-   0,   0,   0,   0, 299,   0,   0,   0,   0, 300,
- 303,   0,   0, 305, 306, 307,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
- 106,   0,   0,   0,   0,   0,  75,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  16,  18,   0,  68,
-  44,   0, 359,   0,   0,   0, 333,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
- 340,   0,   0,   0,   0,   0, 344,   0, 345,  42,
-  28,  55,  56,  57,  73,  69,  59,  70,   0,  45,
-  46,  71,  33,   0,  34,  63,  64,   0,   0,   0,
-   0,   0,   0,   0,   0,  75,   0,   0,   0,   0,
-  77,  78,  37,  52,   0,  16,  18,   0,  68,  44,
-  41,  22,  43,  29,  35,  38,   0,   0,   0,  32,
-  65,  36,  40,  76,   0,  27,  26,   0,   0,  25,
-   0,   0,  30,  31,  23,   0,   0,   0,  42,  28,
-  55,  56,  57,  73,  69,  59,  70,   0,  45,  46,
-  71,  33,   0,  34,  63,  64,   0,   0,   0,   0,
-   0,   0,  75,   0,   0,   0,   0,   0,   0,  77,
-  78,  37,  16,  18,   0,  68,  44,   0, 308,  41,
-  22,  43,  29,  35,  38,   0,   0,   0,  32,  65,
-  36,  40,  76,   0,  27,  26,   0,   0,  25,   0,
-   0,  30,  31,  23,   0,  42,  28,  55,  56,  57,
-  73,  69,  59,  70,   0,  45,  46,  71,  33,   0,
-  34,  63,  64,   0,   0,   0,   0,   0,   0,   0,
-   0,  75,   0,   0,   0,   0,  77,  78,  37, 273,
-   0,  16,  18,   0,  68,  44,  41,  22,  43,  29,
-  35,  38,   0,   0,   0,  32,  65,  36,  40,  76,
-   0,  27,  26,   0,   0,  25,   0,   0,  30,  31,
-  23,   0,   0,   0,  42,  28,  55,  56,  57,  73,
-  69,  59,  70,   0,  45,  46,  71,  33,   0,  34,
-  63,  64,   0,   0,   0,   0,   0,   0,  75,   0,
-   0,   0,   0,   0,   0,  77,  78,  37,  16,  18,
-   0,  68,  44,   0, 248,  41,  22,  43,  29,  35,
-  38,   0,   0,   0,  32,  65,  36,  40,  76,   0,
-  27,  26,   0,   0,  25,   0,   0,  30,  31,  23,
-   0,  42,  28,  55,  56,  57,  73,  69,  59,  70,
-   0,  45,  46,  71,  33,   0,  34,  63,  64,   0,
-   0,   0,   0,   0,   0,  75,   0,   0,   0,   0,
-   0,   0,  77,  78,  37,  16,  18,   0,  68,  44,
-   0, 247,  41,  22,  43,  29,  35,  38,   0,   0,
-   0,  32,  65,  36,  40,  76,   0,  27,  26,   0,
-   0,  25,   0,   0,  30,  31,  23,   0,  42,  28,
-  55,  56,  57,  73,  69,  59,  70,   0,  45,  46,
-  71,  33,   0,  34,  63,  64,   0,   0,   0,   0,
-   0,   0,  75,   0,   0,   0,   0,   0,   0,  77,
-  78,  37,  16,  18,   0,  68,  44,   0, 226,  41,
-  22,  43,  29,  35,  38,   0,   0,   0,  32,  65,
-  36,  40,  76,   0,  27,  26,   0,   0,  25,   0,
-   0,  30,  31,  23,   0,  42,  28,  55,  56,  57,
-  73,  69,  59,  70,   0,  45,  46,  71,  33,   0,
-  34,  63,  64,   0,   0,   0,   0,   0,   0,  75,
-   0,   0,   0,   0,   0,   0,  77,  78,  37,  16,
-  18,   0,  68,  44,   0, 216,  41,  22,  43,  29,
-  35,  38,   0,   0,   0,  32,  65,  36,  40,  76,
-   0,  27,  26,   0,   0,  25,   0,   0,  30,  31,
-  23,   0,  42,  28,  55,  56,  57,  73,  69,  59,
-  70,   0,  45,  46,  71,  33,   0,  34,  63,  64,
-   0,   0,   0,   0,   0,   0,  75,   0,   0,   0,
-   0,   0,   0,  77,  78,  37,  16,  18,   0,  68,
-  44,   0, 135,  41,  22,  43,  29,  35,  38,   0,
-   0,   0,  32,  65,  36,  40,  76,   0,  27,  26,
-   0,   0,  25,   0,   0,  30,  31,  23,   0,  42,
-  28,  55,  56,  57,  73,  69,  59,  70,   0,  45,
-  46,  71,  33,   0,  34,  63,  64,   0,   0,   0,
-   0,   0,   0,  75,   0,   0,   0,   0,   0,   0,
-  77,  78,  37,  16,  18,   0,  68,  44,   0,   0,
-  41,  22,  43,  29,  35,  38,   0,   0,   0,  32,
-  65,  36,  40,  76,   0,  27,  26,   0,   0,  25,
-   0,   0,  30,  31,  23,   0,  42,  28,  55,  56,
-  57,  73,  69,  59,  70,   0,  45,  46,  71,  33,
-   0,  34,  63,  64,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  77,  78,  37,
-   0,   0,   0,   0,   0,   0,   0,  41,  22,  43,
-  29,  35,  38,   0,   0,   0,  32,  65,  36,  40,
-  76,   0,  27,  26,   0,   0,  25,   0,   0,  30,
-  31,  23, 190,   0, 101,  95,   0,   0, 331,   0,
-   0,   0,   0,   0,   0,  93,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  98,  97,   0,  87,
-  88,  89,  90,  91,  92,  94,  42,  28,   0,   0,
-   0,   0,   0,   0,   0,   0,  45,  46,   0,  33,
-   0,  34,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,  37,
-   0,   0,   0,   0,   0,   0,   0,  41,  22,  43,
-  29,  35,  38,   0,  84,   0,  32,   0,  36,  40,
-   0,   0,  27,  26,   0,   0,  99,   0,   0,  30,
-  31,  23, 190,   0, 101,  95,   0,   0, 328,   0,
-   0,   0,   0,   0,   0,  93,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  98,  97,   0,  87,
-  88,  89,  90,  91,  92,  94,  42,  28,   0,   0,
-   0,   0,   0,   0,   0,   0,  45,  46,   0,  33,
-   0,  34,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,  37,
-   0,   0,   0,   0,   0,   0,   0,  41,  22,  43,
-  29,  35,  38,   0,  84,   0,  32,   0,  36,  40,
-   0,   0,  27,  26,   0,   0,  99,   0,   0,  30,
-  31,  23, 190,   0, 101,  95,   0,   0, 326,   0,
-   0,   0,   0,   0,   0,  93,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  98,  97,   0,  87,
-  88,  89,  90,  91,  92,  94,  42,  28,   0,   0,
-   0,   0,   0,   0,   0,   0,  45,  46,   0,  33,
-   0,  34,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,  37,
-   0,   0,   0,   0,   0,   0,   0,  41,  22,  43,
-  29,  35,  38,   0,  84,   0,  32,   0,  36,  40,
-   0,   0,  27,  26,   0,   0,  99,   0,   0,  30,
-  31,  23, 140,   0,   0, 101,  95, 139,   0,   0,
-   0,   0,   0,   0,   0,   0,  93,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  98,  97,   0,
-  87,  88,  89,  90,  91,  92,  94,  42,  28,   0,
-   0,   0,   0,   0,   0,   0,   0,  45,  46,   0,
-  33,   0,  34,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-  37,   0,   0,   0,   0,   0,   0,   0,  41,  22,
-  43,  29,  35,  38,   0,  84,   0,  32,   0,  36,
-  40,   0,   0,  27,  26,   0,   0,  99,   0,   0,
-  30,  31,  23, 190,   0, 101,  95,   0,   0, 192,
-   0,   0,   0,   0,   0,   0,  93,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  98,  97,   0,
-  87,  88,  89,  90,  91,  92,  94,  42,  28,   0,
-   0,   0,   0,   0,   0,   0,   0,  45,  46,   0,
-  33,   0,  34,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-  37,   0,   0,   0,   0,   0,   0,   0,  41,  22,
-  43,  29,  35,  38,   0,  84,   0,  32,   0,  36,
-  40,   0,   0,  27,  26, 101,  95,  99,   0, 355,
-  30,  31,  23,   0,   0,   0,  93,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  98,  97,   0,
-  87,  88,  89,  90,  91,  92,  94,  42,  28,   0,
-   0,   0,   0,   0,   0,   0,   0,  45,  46,   0,
-  33,   0,  34,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-  37,   0,   0,   0,   0,   0,   0,   0,  41,  22,
-  43,  29,  35,  38,   0,  84,   0,  32,   0,  36,
-  40,   0,   0,  27,  26, 101,  95,  99,   0, 354,
-  30,  31,  23,   0,   0,   0,  93,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  98,  97,   0,
-  87,  88,  89,  90,  91,  92,  94,  42,  28,   0,
-   0,   0,   0,   0,   0,   0,   0,  45,  46,   0,
-  33,   0,  34,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-  37,   0,   0,   0,   0,   0,   0,   0,  41,  22,
-  43,  29,  35,  38,   0,  84,   0,  32,   0,  36,
-  40,   0,   0,  27,  26, 101,  95,  99,   0, 350,
-  30,  31,  23,   0,   0,   0,  93,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  98,  97,   0,
-  87,  88,  89,  90,  91,  92,  94,  42,  28,   0,
-   0,   0,   0,   0,   0,   0,   0,  45,  46,   0,
-  33,   0,  34,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-  37,   0,   0,   0,   0,   0,   0,   0,  41,  22,
-  43,  29,  35,  38,   0,  84,   0,  32,   0,  36,
-  40,   0,   0,  27,  26,   0,   0,  99,   0,   0,
-  30,  31,  23, 101,  95, 346,   0,   0,   0,   0,
-   0,   0,   0,   0,  93,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,  98,  97,   0,  87,  88,
-  89,  90,  91,  92,  94,  42,  28,   0,   0,   0,
-   0,   0,   0,   0,   0,  45,  46,   0,  33,   0,
-  34,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  37,   0,
-   0,   0,   0,   0,   0,   0,  41,  22,  43,  29,
-  35,  38,   0,  84,   0,  32,   0,  36,  40,   0,
-   0,  27,  26, 101,  95,  99,   0, 323,  30,  31,
-  23,   0,   0,   0,  93,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,  98,  97,   0,  87,  88,
-  89,  90,  91,  92,  94,  42,  28,   0,   0,   0,
-   0,   0,   0,   0,   0,  45,  46,   0,  33,   0,
-  34,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  37,   0,
-   0,   0,   0,   0,   0,   0,  41,  22,  43,  29,
-  35,  38,   0,  84,   0,  32,   0,  36,  40,   0,
-   0,  27,  26, 101,  95,  99,   0, 320,  30,  31,
-  23,   0,   0,   0,  93,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,  98,  97,   0,  87,  88,
-  89,  90,  91,  92,  94,  42,  28,   0,   0,   0,
-   0,   0,   0,   0,   0,  45,  46,   0,  33,   0,
-  34,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  37,   0,
-   0,   0,   0,   0,   0,   0,  41,  22,  43,  29,
-  35,  38,   0,  84,   0,  32,   0,  36,  40,   0,
-   0,  27,  26, 101,  95,  99,   0, 279,  30,  31,
-  23,   0,   0,   0,  93,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,  98,  97,   0,  87,  88,
-  89,  90,  91,  92,  94,  42,  28,   0,   0,   0,
-   0,   0,   0,   0,   0,  45,  46,   0,  33,   0,
-  34,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  37,   0,
-   0,   0,   0,   0,   0,   0,  41,  22,  43,  29,
-  35,  38,   0,  84,   0,  32,   0,  36,  40,   0,
-   0,  27,  26,   0, 190,  99, 101,  95,  30,  31,
-  23,   0,   0,   0,   0,   0,   0,  93,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  98,  97,
-   0,  87,  88,  89,  90,  91,  92,  94,  42,  28,
-   0,   0,   0,   0,   0,   0,   0,   0,  45,  46,
-   0,  33,   0,  34,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,  37,   0,   0,   0,   0,   0,   0,   0,  41,
-  22,  43,  29,  35,  38,   0,  84,   0,  32,   0,
-  36,  40,   0,   0,  27,  26, 101,  95,  99,   0,
- 192,  30,  31,  23,   0,   0,   0,  93,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  98,  97,
-   0,  87,  88,  89,  90,  91,  92,  94,  42,  28,
-   0,   0,   0,   0,   0,   0,   0,   0,  45,  46,
-   0,  33,   0,  34,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,  37,   0,   0,   0,   0,   0,   0,   0,  41,
-  22,  43,  29,  35,  38,   0,  84,   0,  32,   0,
-  36,  40,   0,   0,  27,  26, 101,  95,  99,   0,
-   0,  30,  31,  23,   0,   0,   0,  93,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  98,  97,
-   0,  87,  88,  89,  90,  91,  92,  94,  42,  28,
-   0,   0,   0,   0,   0,   0,   0,   0,  45,  46,
-   0,  33,   0,  34,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,  37,   0,   0,   0,   0,   0,   0,   0,  41,
-  22,  43,  29,  35,  38,   0,  84, 251,  32,   0,
-  36,  40,   0,   0,  27,  26, 101,  95,  99,   0,
-   0,  30,  31,  23,   0,   0,   0,  93,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  98,  97,
-   0,  87,  88,  89,  90,  91,  92,  94,  42,  28,
-   0,   0,   0,   0,   0,   0,   0,   0,  45,  46,
-   0,  33,   0,  34,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,  37,   0,   0,   0,   0,   0,   0,   0,  41,
-  22,  43,  29,  35,  38,   0,  84,   0,  32,   0,
-  36,  40,   0,   0,  27,  26, 101,  95,  99,   0,
-   0,  30,  31,  23,   0,   0,   0,  93,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  98,   0,
-   0,  87,  88,  89,  90,  91,  92,  94,  42,  28,
-   0,   0,   0,   0,   0,   0,   0,   0,  45,  46,
-   0,  33,   0,  34,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,  37,   0,   0,   0,   0,   0,   0,   0,  41,
-  22,  43,  29,  35,  38, 101,  95,   0,  32,   0,
-  36,  40,   0,   0,  27,  26,  93,   0,  99,   0,
-   0,  30,  31,  23,   0,   0,   0,   0,   0,   0,
-  87,  88,  89,  90,  91,  92,  94,  42,  28,   0,
-   0,   0,   0,   0,   0,   0,   0,  45,  46,   0,
-  33,   0,  34,   0,   0,  75,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  18,   0,   0,  44,
-  37,   0,   0,   0,   0,   0,   0,   0,  41,  22,
-  43,  29,  35,  38,   0,   0,   0,  32,   0,  36,
-  40,   0,   0,  27,  26,   0,   0,  99,  42,  28,
-  30,  31,  23,  73,   0,   0,   0,   0,  45,  46,
-   0,  33,   0,  34,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,  77,
-  78,  37,   0,   0, 101,   0,   0,   0,   0,  41,
-  22,  43,  29,  35,  38, 241,   0,   0,  32,   0,
-  36,  40,   0,   0,  27,  26,  98,  97,  25,   0,
-   0,  30,  31,  23,   0, 242,  42,  28,   0,   0,
-   0,   0,   0,   0,   0,   0,  45,  46,   0,  33,
-   0,  34,   0,   0,   0,   0,   0,  12,  13,   0,
-   0,  16,  18,   0,   0,  44,   0,   0,   0,  37,
-   0,   0,   0,   0,   0,   0,   0,  41,  22,  43,
-  29,  35,  38,   0, 238,   0,  32,   0,  36,  40,
-   0,   0,  27,  26,  42,  28,  99,   0,   0,  30,
-  31,  23,   0,  14,  45,  46,   0,  33,   0,  34,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,  37,   0,   0,
- 101,   0,   0,   0,   0,  41,  22,  43,  29,  35,
-  38, 241,   0,   0,  32,   0,  36,  40,   0,   0,
-  27,  26,  98,   0,  25,   0,   0,  30,  31,  23,
-   0, 242,  42,  28,   0,   0,   0,   0,   0,   0,
-   0,   0,  45,  46,   0,  33,   0,  34,   0,   0,
-   0,   0,   0,   0,   0, 140,   0,   0,  18,   0,
- 139,  44,   0,   0,   0,  37,   0,   0,   0,   0,
-   0,   0,   0,  41,  22,  43,  29,  35,  38,   0,
- 254,   0,  32,  18,  36,  40,  44,   0,  27,  26,
-  42,  28,  99,   0,   0,  30,  31,  23,   0,   0,
-  45,  46,   0,  33,   0,  34,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,  42,  28,   0,   0,   0,
-   0,   0,   0,  37,   0,  45,  46,   0,  33,   0,
-  34,  41,  22,  43,  29,  35,  38,   0,   0,   0,
-  32,   0,  36,  40,   0,   0,  27,  26,  37,   0,
-  25, 101,   0,  30,  31,  23,  41,  22,  43,  29,
-  35,  38, 241,   0,   0,  32,   0,  36,  40,   0,
-   0,  27,  26,   0,   0,  25,   0,   0,  30,  31,
-  23,   0, 242,  42,  28,   0,   0,   0,   0,   0,
-   0,   0,   0,  45,  46,   0,  33,   0,  34,   0,
-   0,   0,   0,   0,   0,   0, 174,   0,   0, 284,
-   0,   0,  44,   0,   0,   0,  37,   0,   0,   0,
-   0,   0,   0,   0,  41,  22,  43,  29,  35,  38,
-   0, 172,   0,  32, 284,  36,  40,  44,   0,  27,
-  26,  42,  28,  99,   0,   0,  30,  31,  23,   0,
-   0,  45,  46,   0,  33,   0,  34,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  42,  28,   0,   0,
-   0,   0,   0,   0,  37,   0,  45,  46,   0,  33,
-   0,  34,  41,  22,  43,  29,  35,  38,   0, 254,
-   0,  32, 284,  36,  40,  44,   0,  27,  26,  37,
-   0,  25,   0,   0,  30,  31,  23,  41,  22,  43,
-  29,  35,  38,   0,   0,   0,  32,  18,  36,  40,
-  44, 204,  27,  26,  42,  28,  25,   0,   0,  30,
-  31,  23,   0,   0,  45,  46,   0,  33,   0,  34,
-   0,   0,   0,   0,   0,   0,   0,   0,   0,  42,
-  28,   0,   0,   0,   0,   0,   0,  37,   0,  45,
-  46,   0,  33,   0,  34,  41,  22,  43,  29,  35,
-  38,   0,   0,   0,  32,  18,  36,  40,  44, 202,
-  27,  26,  37,   0,  25,   0,   0,  30,  31,  23,
-  41,  22,  43,  29,  35,  38,   0, 174,   0,  32,
-  18,  36,  40,  44,   0,  27,  26,  42,  28,  25,
-   0,   0,  30,  31,  23,   0,   0,  45,  46,   0,
-  33,   0,  34,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,  42,  28,   0,   0,   0,   0,   0,   0,
-  37,   0,  45,  46,   0,  33,   0,  34,  41,  22,
-  43,  29,  35,  38,   0, 172,   0,  32,  18,  36,
-  40,  44,   0,  27,  26,  37,   0,  25,   0,   0,
-  30,  31,  23,  41,  22,  43,  29,  35,  38,   0,
-   0,   0,  32,  18,  36,  40,  44,   0,  27,  26,
-  42,  28,  25,   0,   0,  30,  31,  23,   0,   0,
-  45,  46,   0,  33,   0,  34,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,  42,  28,   0,   0,   0,
-   0,   0,   0,  37,   0,  45,  46,   0,  33,   0,
-  34,  41,  22,  43,  29,  35,  38,   0,   0,   0,
-  32, 284,  36,  40,  44,   0,  27,  26,  37,   0,
-  25,   0,   0,  30,  31,  23,  41,  22,  43,  29,
-  35,  38,   0,   0,   0,  32, 101,  36,  40,   0,
-   0,  27,  26,  42,  28,  25,   0,   0,  30,  31,
-  23,   0,   0,  45,  46,   0,  33,   0,  34,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  42,  28,
-   0,   0,   0,   0,   0,   0,  37,   0,  45,  46,
-   0,  33,   0,  34,  41,  22,  43,  29,  35,  38,
-   0,   0, 193,  32, 161,  36,  40,  44,   0,  27,
-  26,  37,   0,  25,   0,   0,  30,  31,  23,  41,
-  22,  43,  29,  35,  38,   0,   0,   0,  32, 101,
-  36,  40,  44,   0,  27,  26,  42,  28,  99,   0,
-   0,  30,  31,  23,   0,   0,  45,  46,   0,  33,
-   0,  34,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,  42,  28,   0,   0,   0,   0,   0,   0,  37,
-   0,  45,  46,   0,  33,   0,  34,  41,  22,  43,
-  29,  35,  38,   0,   0,   0,  32, 101,  36,  40,
-   0,   0,  27,  26,  37,   0,  25,   0,   0,  30,
-  31,  23,  41,  22,  43,  29,  35,  38,   0,   0,
-   0,  32, 101,  36,  40,   0,   0,  27,  26,  42,
-  28,  25,   0,   0,  30,  31,  23,   0,   0,  45,
-  46,   0,  33,   0,  34,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,  42,  28,   0,   0,   0,   0,
-   0,   0,  37,   0,  45,  46,   0,  33,   0,  34,
-  41,  22,  43,  29,  35,  38,   0,   0,   0,  32,
-   0,  36,  40,   0,   0,  27,  26,  37,   0,  99,
-   0,   0,  30,  31,  23,  41,  22,  43,  29,  35,
-  38,   0,   0,   0,   0,   0,  36,  40,   0,   0,
-  27,  26,   0,   0,  99,   0,   0,  30,  31,  23
-};
-int16_t	yypact[] =
-{
- 191,-1000,-1000,-1000,3259, 193,-1000,-1000, 185,-1000,
- 205, 863, 206, 206, -50,2903,-1000, -63,3810,-1000,
-  19,  38,-1000,4034,-1000,3976,4034,4034, 200, 199,
- -33, -33,   5, 192, 184,-1000, 183, 170,-1000, 158,
- 157,-1000,-1000,-1000,-1000,-1000,-1000,-1000,-1000,3259,
- 863,3810,-1000,1334,-1000, 124,3810, 124, 214,3385,
--1000,1401, 863, 124, 124,3385, 124,-1000, 211,-1000,
- 148, 146,3951, -22,2903,-1000, 138,-1000,-1000, 863,
- 863, 134,-1000,-1000,3810,3785,3727,3810,3810,3810,
-3810,3810,3810,3810, -22, -74,  19,-1000,-1000,4034,
- -94,3810,3810,-1000,-1000, 181,1902,3893,4034,4034,
-4034,4034,4034,3810,-1000,-1000, -89, -89, -89,3702,
-3644,-1000,-1000,   7,4034,3810,3810,3810,3810,3810,
-3810, -70,-1000,1267, 206,-1000,-1000,-1000, 213, 211,
--1000,1802,-1000,-1000,1401,1802,-1000, -49,1200,-1000,
--1000,1802,-1000,-1000,1401,-1000, 213,3133,3810, 104,
- 208,3810,3201, -65,-1000,  19,  33,3810,1133,1066,
- -57,2813,-1000,2993,-1000,3072,4059,4059,4059,4059,
-4059,4059,-1000,4059,-1000, -33,2723,2903,   4,3410,
--1000,3410,-1000,4034, -89,  26,  26, -89, -89, -89,
-  86,2903,-1000, 174,-1000, 151,4034,  19,2633,2633,
-2633, 149, 208,2633,2633,  89,-1000, 863,-1000,-1000,
--1000,-1000,-1000, 999,-1000, 212,-1000,-1000,-1000, 101,
-  37,-1000,2540,4034,4034,4034,3619, 147,3868,3561,
-3536,3868, -22,  19,3868,3810,2540,-1000,-1000, 139,
--1000,3810,-1000, -22,-1000,2903,2903,  19,3410,-1000,
--1000,-1000,  19,3410,3410,  31,-1000,3410,3410,3410,
--1000, 930, -80,-1000,-1000,-1000, 133, -22, 194,-1000,
-  19,  19,  19,3201,3810,  -6, 634,3327,3478,-1000,
-4059,-1000,3201,  40, 194, 194,  15,2903,-1000,2903,
-2450,  78,  77,2360, 121,1701,1601,1501,-1000, 111,
-3810, 211,  41,-1000, 120, -22,3868,-1000, 206,-1000,
--1000,-1000,-1000,-1000,3410,-1000,-1000,  -8,-1000,  -8,
-3410,-1000,3810,2270,3133, 194,  -6,-1000,3201, 863,
-2172,  66,  55,  48,2082,1992, 211,  41,1401, 794,
--1000,-1000,-1000,-1000,-1000, 124,3133, 194,-1000,-1000,
--1000,  41,1401, 194,-1000,1401,-1000
-};
-int16_t	yypgo[] =
-{
-   0, 297, 505,  40,  11, 295,   7, 286, 243, 199,
-  62,  34, 283,  10,   9,   5,  20,   8,   0, 418,
- 278, 276, 273, 268, 265, 264, 263,   3, 262, 229,
-  85, 261,   1, 400,  17,  13, 103,  87, 260, 258,
- 255, 254, 249, 246, 232, 231, 230, 228, 227
-};
-int16_t	yyr1[] =
-{
-   0,  40,  40,  36,  36,  37,  37,  33,  33,  26,
-  26,  24,  24,  41,  22,  42,  22,  43,  22,  20,
-  20,  23,  30,  30,  34,  34,  35,  35,  29,  29,
-  15,  15,   1,   1,  10,  11,  11,  11,  11,  11,
-  11,  11,  44,  11,  12,  12,   6,   6,   3,   3,
-   3,   3,   3,   3,   3,   3,   3,   3,   3,   2,
-   2,   2,   2,   2,   2,   2,   2,   2,   2,   2,
-   2,   2,   2,   2,   2,   2,   2,   2,   4,   4,
-   5,   5,   7,   7,   7,  39,  39,  28,  28,  28,
-  28,  31,  31,   9,   9,  45,  13,  32,  32,  14,
-  14,  14,  14,  14,  14,  14,  14,  27,  27,  16,
-  16,  16,  46,  47,  16,  16,  16,  16,  16,  16,
-  16,  16,  16,  16,  16,  16,  48,  16,  16,  17,
-  17,  38,  38,   8,   8,   8,   8,   8,   8,   8,
-   8,   8,   8,   8,   8,   8,   8,   8,   8,   8,
-   8,   8,   8,   8,   8,   8,   8,   8,   8,   8,
-   8,   8,   8,   8,   8,   8,   8,   8,   8,   8,
-   8,   8,   8,   8,  18,  18,  18,  18,  21,  21,
-  21,  19,  19,  19,  25
-};
-int16_t	yyr2[] =
-{
-   0,   1,   1,   1,   2,   1,   2,   1,   2,   1,
-   2,   1,   2,   0,  12,   0,  10,   0,   8,   1,
-   1,   4,   1,   2,   1,   2,   0,   1,   0,   1,
-   0,   1,   1,   3,   1,   1,   4,   3,   6,   3,
-   4,   4,   0,   9,   1,   3,   1,   3,   3,   5,
-   3,   3,   3,   3,   3,   5,   2,   1,   1,   3,
-   5,   3,   3,   3,   3,   3,   3,   3,   3,   3,
-   3,   3,   5,   4,   3,   2,   1,   1,   3,   3,
-   1,   3,   0,   1,   3,   1,   1,   1,   1,   2,
-   2,   1,   2,   1,   2,   0,   4,   1,   2,   4,
-   4,   4,   2,   5,   2,   1,   1,   1,   2,   2,
-   3,   2,   0,   0,   9,   3,   2,   1,   4,   2,
-   3,   2,   2,   3,   2,   2,   0,   3,   2,   1,
-   2,   1,   1,   4,   3,   3,   3,   3,   3,   3,
-   2,   2,   2,   3,   4,   1,   3,   4,   2,   2,
-   2,   2,   4,   3,   2,   1,   6,   6,   3,   6,
-   6,   1,   8,   8,   6,   4,   1,   6,   6,   8,
-   8,   8,   6,   1,   1,   4,   1,   2,   0,   1,
-   3,   1,   1,   1,   4
-};
-int16_t	yychk[] =
-{
--1000, -40,  -1,   2, -29, -28,  10,  15, -12, -11,
- -10, -30,   8,   9,  54,  -2,  12, -18,  13,  -9,
-  -8, -19,  87, 110, -13, 105, 102, 101,  46,  89,
- 108, 109,  95,  58,  60,  90,  97,  78,  91, -38,
-  98,  86,  45,  88,  16,  55,  56,  10,  15, -29,
- -30,  11,  10, -17, -16,  47,  48,  49, -26,  52,
- -22, -23, -30,  61,  62,  96, -14, -25,  15,  51,
-  53,  57, -39,  50,  -2,   2,  99,  76,  77, -30,
- -30, -20,  86,  89,  93, -37, -36,  38,  39,  40,
-  41,  42,  43,  24,  44,  14,  -8,  36,  35, 105,
- -18,  13,  69, 108, 109,  -4,  -2,  16, 101, 102,
- 103, 104, 107,  19,  -8,  -9,  -8,  -8,  -8,  13,
-  13, -18, -18, -18,  42,  13,  13,  13,  13,  13,
-  13, -45, -11, -17, -10,  18, -16, -27, -34,  15,
-  10,  -2, -27,  10, -46,  -2, -27, -16, -17, -27,
- -27,  -2, -27, -27, -48, -35, -34,  13,  13,  -7,
-  -5,  13,  -3, -18,  -9,  -8, -19,  13, -17, -17,
-  13,  -2,  10,  -2,  10,  -2,  -2,  -2,  -2,  -2,
-  -2,  -2, -13,  -2, -19,  95,  -2,  -2,  17, -33,
-  11, -33,  17,  69,  -8,  -8,  -8,  -8,  -8,  -8,
-  -6,  -2,  17,  -6,  17,  -6,  42,  -8,  -2,  -2,
-  -2,  -6, -13,  -2,  -2,  92,  18, -30,  10, -35,
- -27, -16, -27, -24,  79, -31,  18, -27, -16, -15,
- -19, -14,  -2,  14,  37,  40, -33,  -4,  93, -37,
- -36,  24,  44,  -8,  69,  19,  -2,  18,  18, -21,
-  86,  94, -18,  44,  10,  -2,  -2,  -8, -33,  20,
-  17,  17,  -8, -33, -33, -33,  17, -33, -33, -33,
-  16, -17, -47,  10, -16,  10,  15,  44, -32,  17,
-  -8,  -8,  -8,  -3,  13,  17,  -3,  -3,  -3, -13,
-  -3, -19,  -3,  -6, -32, -32, -33,  -2, -19,  -2,
-  -2, -13, -13,  -2, -19,  -2,  -2,  -2,  18,  99,
- -35,  15, -19,  10,  -4,  44,  94,  20, -44,  86,
-  17,  17,  17,  17, -33,  17,  17, -33,  17, -33,
- -33,  17,  13,  -2, -35, -32,  17, -19,  -3, -30,
-  -2, -13, -18, -18,  -2,  -2,  15, -15, -43, -17,
-  17,  17,  17,  17,  17,  17, -35, -32, -16,  18,
- -27, -15, -42, -32, -16, -41, -16
-};
-int16_t	yydef[] =
-{
-  -2,  -2,   1,   2,  32,  29,  87,  88,  28,  44,
-  35,   0,   0,   0,   0,  34,  22, 173,   0,  76,
-  77, 174, 176,   0,  93,   0,   0,   0, 145,   0,
-   0,   0, 155,   0,   0, 161,   0,   0, 166,   0,
-   0, 181, 182, 183,  95, 131, 132,  89,  90,  33,
-   0,   0,  23,   0, 129,   0,   0,   0, 112,   0,
- 117,   0,   0,   0,   0,   0,   0, 126,  26,   9,
-   0,   0,  82,   0, 105, 106,   0,  85,  86,   0,
-   0,   0,  19,  20,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,   0,   0,   0,  75,   5,   3,   0,
- 173,   0,   0, 150, 151,   0,   0,   0,   0,   0,
-   0,   0,   0,   0, 177,  94, 142, 140, 141,   0,
-   0, 148, 149, 154,   0,   0,   0,   0,   0,   0,
-   0,   0,  45,   0,  37,  39, 130, 109, 107,  26,
-  24,   0, 111,  10,   0,   0, 116, 119,   0, 121,
- 122,   0, 124, 125,   0, 128,  27,  -2,   0, 102,
-  83,   0,  80, 173,  57,  58, 104,   0,   0,   0,
- 178,   0,   6,  61,   4,  62,  -2,  -2,  -2,  -2,
-  -2,  -2,  69,  -2,  71,  74,   0,  59,   0,   0,
-   7,   0, 158,   0, 137, 134, 135, 136, 138, 139,
-   0,  46, 143,   0, 146,   0,   0, 153,   0,   0,
-   0,   0,  93,   0,   0,   0,  36,   0,  25, 108,
- 110, 113, 115,   0,  11, 120,  91, 123, 127,   0,
- 174,  31,   0,   0,   0,   0,   0,   0,   0,   0,
-   0,   0,   0,  56,   0,   0,   0,  40,  41,   0,
- 179,   0,  73,   0,   8,  79,  78, 133,   0, 175,
- 144, 147, 152,   0,   0,   0, 165,   0,   0,   0,
-  96,   0,   0,  12, 118,  92,  26,   0,  21,  97,
-  99, 100, 101,  81,   0,  84,   0,  50,  51,  52,
-  -2,  54,  48,   0, 184,  42,   0,  60,  72,  47,
-   0,  93,  93,   0,   0,   0,   0,   0,  38,   0,
-   0,  26,   0,  98,   0,   0,   0, 103,   0, 180,
- 156, 157, 159, 160,   0, 164, 167,   0, 168,   0,
-   0, 172,   0,   0,  -2,  17,   0,  55,  49,   0,
-   0,  93,   0,   0,   0,   0,  26,   0,   0,   0,
- 162, 163, 169, 170, 171,   0,  -2,  15,  18,  43,
- 114,   0,   0,  13,  16,   0,  14
-};
-int16_t	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,   0,   0,   0,   0, 104,   0,   0,
-  13,  17, 103, 101,  11, 102,   0,  16,   0,   0,
-   0,   0,   0,   0,   0,   0,   0,   0,  94,  15,
-   0,   0,   0,  93,   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,  19,   0,  20,   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,  12,  14,  18
-};
-int16_t	yytok2[] =
-{
-   2,   3,   4,   5,   6,   7,   8,   9,  10,  21,
-  22,  23,  24,  25,  26,  27,  28,  29,  30,  31,
-  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,
-  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,
-  52,  53,  54,  55,  56,  57,  58,  59,  60,  61,
-  62,  63,  64,  65,  66,  67,  68,  69,  70,  71,
-  72,  73,  74,  75,  76,  77,  78,  79,  80,  81,
-  82,  83,  84,  85,  86,  87,  88,  89,  90,  91,
-  92,  95,  96,  97,  98,  99, 100, 105, 106, 107,
- 108, 109, 110, 111
-};
-int32_t	yytok3[] =
-{
-   0
-};
-#define YYFLAG 		-1000
-#define YYERROR		goto yyerrlab
-#define YYACCEPT	return(0)
-#define YYABORT		return(1)
-#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 */
-
-char*
-yytokname(int yyc)
-{
-	static char x[16];
-
-	if(yyc > 0 && yyc <= sizeof(yytoknames)/sizeof(yytoknames[0]))
-	if(yytoknames[yyc-1])
-		return yytoknames[yyc-1];
-	sprintf(x, "<%d>", yyc);
-	return x;
-}
-
-char*
-yystatname(int yys)
-{
-	static char x[16];
-
-	if(yys >= 0 && yys < sizeof(yystates)/sizeof(yystates[0]))
-	if(yystates[yys])
-		return yystates[yys];
-	sprintf(x, "<%d>\n", yys);
-	return x;
-}
-
-int32_t
-yylex1(void)
-{
-	int32_t yychar;
-	int32_t *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)
-		printf("lex %.4lX %s\n", yychar, yytokname(c));
-	return c;
-}
-
-int
-yyparse(void)
-{
-	struct
-	{
-		YYSTYPE	yyv;
-		int	yys;
-	} yys[YYMAXDEPTH], *yyp, *yypt;
-	int16_t *yyxi;
-	int yyj, yym, yystate, yyn, yyg;
-	YYSTYPE save1, save2;
-	int save3, save4;
-	int32_t yychar;
-
-	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)
-		printf("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");
-			if(yydebug >= 1) {
-				printf("%s", yystatname(yystate));
-				printf("saw %s\n", yytokname(yychar));
-			}
-yyerrlab:
-			yynerrs++;
-
-		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)
-					printf("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 >= YYEOFCODE)
-				printf("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)
-		printf("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 1:
-#line	100	"/sys/src/cmd/awk/awkgram.y"
-{ if (errorflag==0)
-			winner = (Node *)stat3(PROGRAM, beginloc, yypt[-0].yyv.p, endloc); } break;
-case 2:
-#line	102	"/sys/src/cmd/awk/awkgram.y"
-{ yyclearin; bracecheck(); SYNTAX("bailing out"); } break;
-case 13:
-#line	126	"/sys/src/cmd/awk/awkgram.y"
-{inloop++;} break;
-case 14:
-#line	127	"/sys/src/cmd/awk/awkgram.y"
-{ --inloop; yyval.p = stat4(FOR, yypt[-9].yyv.p, notnull(yypt[-6].yyv.p), yypt[-3].yyv.p, yypt[-0].yyv.p); } break;
-case 15:
-#line	128	"/sys/src/cmd/awk/awkgram.y"
-{inloop++;} break;
-case 16:
-#line	129	"/sys/src/cmd/awk/awkgram.y"
-{ --inloop; yyval.p = stat4(FOR, yypt[-7].yyv.p, NIL, yypt[-3].yyv.p, yypt[-0].yyv.p); } break;
-case 17:
-#line	130	"/sys/src/cmd/awk/awkgram.y"
-{inloop++;} break;
-case 18:
-#line	131	"/sys/src/cmd/awk/awkgram.y"
-{ --inloop; yyval.p = stat3(IN, yypt[-5].yyv.p, makearr(yypt[-3].yyv.p), yypt[-0].yyv.p); } break;
-case 19:
-#line	135	"/sys/src/cmd/awk/awkgram.y"
-{ setfname(yypt[-0].yyv.cp); } break;
-case 20:
-#line	136	"/sys/src/cmd/awk/awkgram.y"
-{ setfname(yypt[-0].yyv.cp); } break;
-case 21:
-#line	140	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = notnull(yypt[-1].yyv.p); } break;
-case 26:
-#line	152	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.i = 0; } break;
-case 28:
-#line	157	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.i = 0; } break;
-case 30:
-#line	163	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = 0; } break;
-case 32:
-#line	168	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = 0; } break;
-case 33:
-#line	169	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = yypt[-1].yyv.p; } break;
-case 34:
-#line	173	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = notnull(yypt[-0].yyv.p); } break;
-case 35:
-#line	177	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat2(PASTAT, yypt[-0].yyv.p, stat2(PRINT, rectonode(), NIL)); } break;
-case 36:
-#line	178	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat2(PASTAT, yypt[-3].yyv.p, yypt[-1].yyv.p); } break;
-case 37:
-#line	179	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = pa2stat(yypt[-2].yyv.p, yypt[-0].yyv.p, stat2(PRINT, rectonode(), NIL)); } break;
-case 38:
-#line	180	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = pa2stat(yypt[-5].yyv.p, yypt[-3].yyv.p, yypt[-1].yyv.p); } break;
-case 39:
-#line	181	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat2(PASTAT, NIL, yypt[-1].yyv.p); } break;
-case 40:
-#line	183	"/sys/src/cmd/awk/awkgram.y"
-{ beginloc = linkum(beginloc, yypt[-1].yyv.p); yyval.p = 0; } break;
-case 41:
-#line	185	"/sys/src/cmd/awk/awkgram.y"
-{ endloc = linkum(endloc, yypt[-1].yyv.p); yyval.p = 0; } break;
-case 42:
-#line	186	"/sys/src/cmd/awk/awkgram.y"
-{infunc++;} break;
-case 43:
-#line	187	"/sys/src/cmd/awk/awkgram.y"
-{ infunc--; curfname=0; defn((Cell *)yypt[-7].yyv.p, yypt[-5].yyv.p, yypt[-1].yyv.p); yyval.p = 0; } break;
-case 45:
-#line	192	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = linkum(yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 47:
-#line	197	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = linkum(yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 48:
-#line	201	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 49:
-#line	203	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(CONDEXPR, notnull(yypt[-4].yyv.p), yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 50:
-#line	205	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(BOR, notnull(yypt[-2].yyv.p), notnull(yypt[-0].yyv.p)); } break;
-case 51:
-#line	207	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(AND, notnull(yypt[-2].yyv.p), notnull(yypt[-0].yyv.p)); } break;
-case 52:
-#line	208	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(yypt[-1].yyv.i, NIL, yypt[-2].yyv.p, (Node*)makedfa(yypt[-0].yyv.s, 0)); } break;
-case 53:
-#line	210	"/sys/src/cmd/awk/awkgram.y"
-{ if (constnode(yypt[-0].yyv.p))
-			yyval.p = op3(yypt[-1].yyv.i, NIL, yypt[-2].yyv.p, (Node*)makedfa(strnode(yypt[-0].yyv.p), 0));
-		  else
-			yyval.p = op3(yypt[-1].yyv.i, (Node *)1, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 54:
-#line	214	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(INTEST, yypt[-2].yyv.p, makearr(yypt[-0].yyv.p)); } break;
-case 55:
-#line	215	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(INTEST, yypt[-3].yyv.p, makearr(yypt[-0].yyv.p)); } break;
-case 56:
-#line	216	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(CAT, yypt[-1].yyv.p, yypt[-0].yyv.p); } break;
-case 59:
-#line	222	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 60:
-#line	224	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(CONDEXPR, notnull(yypt[-4].yyv.p), yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 61:
-#line	226	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(BOR, notnull(yypt[-2].yyv.p), notnull(yypt[-0].yyv.p)); } break;
-case 62:
-#line	228	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(AND, notnull(yypt[-2].yyv.p), notnull(yypt[-0].yyv.p)); } break;
-case 63:
-#line	229	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 64:
-#line	230	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 65:
-#line	231	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 66:
-#line	232	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 67:
-#line	233	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 68:
-#line	234	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(yypt[-1].yyv.i, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 69:
-#line	235	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(yypt[-1].yyv.i, NIL, yypt[-2].yyv.p, (Node*)makedfa(yypt[-0].yyv.s, 0)); } break;
-case 70:
-#line	237	"/sys/src/cmd/awk/awkgram.y"
-{ if (constnode(yypt[-0].yyv.p))
-			yyval.p = op3(yypt[-1].yyv.i, NIL, yypt[-2].yyv.p, (Node*)makedfa(strnode(yypt[-0].yyv.p), 0));
-		  else
-			yyval.p = op3(yypt[-1].yyv.i, (Node *)1, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 71:
-#line	241	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(INTEST, yypt[-2].yyv.p, makearr(yypt[-0].yyv.p)); } break;
-case 72:
-#line	242	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(INTEST, yypt[-3].yyv.p, makearr(yypt[-0].yyv.p)); } break;
-case 73:
-#line	243	"/sys/src/cmd/awk/awkgram.y"
-{ 
-			if (safe) SYNTAX("cmd | getline is unsafe");
-			else yyval.p = op3(GETLINE, yypt[-0].yyv.p, itonp(yypt[-2].yyv.i), yypt[-3].yyv.p); } break;
-case 74:
-#line	246	"/sys/src/cmd/awk/awkgram.y"
-{ 
-			if (safe) SYNTAX("cmd | getline is unsafe");
-			else yyval.p = op3(GETLINE, (Node*)0, itonp(yypt[-1].yyv.i), yypt[-2].yyv.p); } break;
-case 75:
-#line	249	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(CAT, yypt[-1].yyv.p, yypt[-0].yyv.p); } break;
-case 78:
-#line	255	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = linkum(yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 79:
-#line	256	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = linkum(yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 81:
-#line	261	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = linkum(yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 82:
-#line	265	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = rectonode(); } break;
-case 84:
-#line	267	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = yypt[-1].yyv.p; } break;
-case 93:
-#line	284	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(MATCH, NIL, rectonode(), (Node*)makedfa(yypt[-0].yyv.s, 0)); } break;
-case 94:
-#line	285	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(NOT, notnull(yypt[-0].yyv.p)); } break;
-case 95:
-#line	289	"/sys/src/cmd/awk/awkgram.y"
-{startreg();} break;
-case 96:
-#line	289	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.s = yypt[-1].yyv.s; } break;
-case 99:
-#line	297	"/sys/src/cmd/awk/awkgram.y"
-{ 
-			if (safe) SYNTAX("print | is unsafe");
-			else yyval.p = stat3(yypt[-3].yyv.i, yypt[-2].yyv.p, itonp(yypt[-1].yyv.i), yypt[-0].yyv.p); } break;
-case 100:
-#line	300	"/sys/src/cmd/awk/awkgram.y"
-{
-			if (safe) SYNTAX("print >> is unsafe");
-			else yyval.p = stat3(yypt[-3].yyv.i, yypt[-2].yyv.p, itonp(yypt[-1].yyv.i), yypt[-0].yyv.p); } break;
-case 101:
-#line	303	"/sys/src/cmd/awk/awkgram.y"
-{
-			if (safe) SYNTAX("print > is unsafe");
-			else yyval.p = stat3(yypt[-3].yyv.i, yypt[-2].yyv.p, itonp(yypt[-1].yyv.i), yypt[-0].yyv.p); } break;
-case 102:
-#line	306	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat3(yypt[-1].yyv.i, yypt[-0].yyv.p, NIL, NIL); } break;
-case 103:
-#line	307	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat2(DELETE, makearr(yypt[-3].yyv.p), yypt[-1].yyv.p); } break;
-case 104:
-#line	308	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat2(DELETE, makearr(yypt[-0].yyv.p), 0); } break;
-case 105:
-#line	309	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = exptostat(yypt[-0].yyv.p); } break;
-case 106:
-#line	310	"/sys/src/cmd/awk/awkgram.y"
-{ yyclearin; SYNTAX("illegal statement"); } break;
-case 109:
-#line	319	"/sys/src/cmd/awk/awkgram.y"
-{ if (!inloop) SYNTAX("break illegal outside of loops");
-				  yyval.p = stat1(BREAK, NIL); } break;
-case 110:
-#line	321	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat1(CLOSE, yypt[-1].yyv.p); } break;
-case 111:
-#line	322	"/sys/src/cmd/awk/awkgram.y"
-{  if (!inloop) SYNTAX("continue illegal outside of loops");
-				  yyval.p = stat1(CONTINUE, NIL); } break;
-case 112:
-#line	324	"/sys/src/cmd/awk/awkgram.y"
-{inloop++;} break;
-case 113:
-#line	324	"/sys/src/cmd/awk/awkgram.y"
-{--inloop;} break;
-case 114:
-#line	325	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat2(DO, yypt[-6].yyv.p, notnull(yypt[-2].yyv.p)); } break;
-case 115:
-#line	326	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat1(EXIT, yypt[-1].yyv.p); } break;
-case 116:
-#line	327	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat1(EXIT, NIL); } break;
-case 118:
-#line	329	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat3(IF, yypt[-3].yyv.p, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 119:
-#line	330	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat3(IF, yypt[-1].yyv.p, yypt[-0].yyv.p, NIL); } break;
-case 120:
-#line	331	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = yypt[-1].yyv.p; } break;
-case 121:
-#line	332	"/sys/src/cmd/awk/awkgram.y"
-{ if (infunc)
-				SYNTAX("next is illegal inside a function");
-			  yyval.p = stat1(NEXT, NIL); } break;
-case 122:
-#line	335	"/sys/src/cmd/awk/awkgram.y"
-{ if (infunc)
-				SYNTAX("nextfile is illegal inside a function");
-			  yyval.p = stat1(NEXTFILE, NIL); } break;
-case 123:
-#line	338	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat1(RETURN, yypt[-1].yyv.p); } break;
-case 124:
-#line	339	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = stat1(RETURN, NIL); } break;
-case 126:
-#line	341	"/sys/src/cmd/awk/awkgram.y"
-{inloop++;} break;
-case 127:
-#line	341	"/sys/src/cmd/awk/awkgram.y"
-{ --inloop; yyval.p = stat2(WHILE, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 128:
-#line	342	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = 0; } break;
-case 130:
-#line	347	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = linkum(yypt[-1].yyv.p, yypt[-0].yyv.p); } break;
-case 133:
-#line	355	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(DIVEQ, yypt[-3].yyv.p, yypt[-0].yyv.p); } break;
-case 134:
-#line	356	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(ADD, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 135:
-#line	357	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(MINUS, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 136:
-#line	358	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(MULT, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 137:
-#line	359	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(DIVIDE, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 138:
-#line	360	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(MOD, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 139:
-#line	361	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(POWER, yypt[-2].yyv.p, yypt[-0].yyv.p); } break;
-case 140:
-#line	362	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(UMINUS, yypt[-0].yyv.p); } break;
-case 141:
-#line	363	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = yypt[-0].yyv.p; } break;
-case 142:
-#line	364	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(NOT, notnull(yypt[-0].yyv.p)); } break;
-case 143:
-#line	365	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(BLTIN, itonp(yypt[-2].yyv.i), rectonode()); } break;
-case 144:
-#line	366	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(BLTIN, itonp(yypt[-3].yyv.i), yypt[-1].yyv.p); } break;
-case 145:
-#line	367	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(BLTIN, itonp(yypt[-0].yyv.i), rectonode()); } break;
-case 146:
-#line	368	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(CALL, celltonode(yypt[-2].yyv.cp,CVAR), NIL); } break;
-case 147:
-#line	369	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(CALL, celltonode(yypt[-3].yyv.cp,CVAR), yypt[-1].yyv.p); } break;
-case 148:
-#line	370	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(PREDECR, yypt[-0].yyv.p); } break;
-case 149:
-#line	371	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(PREINCR, yypt[-0].yyv.p); } break;
-case 150:
-#line	372	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(POSTDECR, yypt[-1].yyv.p); } break;
-case 151:
-#line	373	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(POSTINCR, yypt[-1].yyv.p); } break;
-case 152:
-#line	374	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(GETLINE, yypt[-2].yyv.p, itonp(yypt[-1].yyv.i), yypt[-0].yyv.p); } break;
-case 153:
-#line	375	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(GETLINE, NIL, itonp(yypt[-1].yyv.i), yypt[-0].yyv.p); } break;
-case 154:
-#line	376	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(GETLINE, yypt[-0].yyv.p, NIL, NIL); } break;
-case 155:
-#line	377	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(GETLINE, NIL, NIL, NIL); } break;
-case 156:
-#line	379	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(INDEX, yypt[-3].yyv.p, yypt[-1].yyv.p); } break;
-case 157:
-#line	381	"/sys/src/cmd/awk/awkgram.y"
-{ SYNTAX("index() doesn't permit regular expressions");
-		  yyval.p = op2(INDEX, yypt[-3].yyv.p, (Node*)yypt[-1].yyv.s); } break;
-case 158:
-#line	383	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = yypt[-1].yyv.p; } break;
-case 159:
-#line	385	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(MATCHFCN, NIL, yypt[-3].yyv.p, (Node*)makedfa(yypt[-1].yyv.s, 1)); } break;
-case 160:
-#line	387	"/sys/src/cmd/awk/awkgram.y"
-{ if (constnode(yypt[-1].yyv.p))
-			yyval.p = op3(MATCHFCN, NIL, yypt[-3].yyv.p, (Node*)makedfa(strnode(yypt[-1].yyv.p), 1));
-		  else
-			yyval.p = op3(MATCHFCN, (Node *)1, yypt[-3].yyv.p, yypt[-1].yyv.p); } break;
-case 161:
-#line	391	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = celltonode(yypt[-0].yyv.cp, CCON); } break;
-case 162:
-#line	393	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op4(SPLIT, yypt[-5].yyv.p, makearr(yypt[-3].yyv.p), yypt[-1].yyv.p, (Node*)STRING); } break;
-case 163:
-#line	395	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op4(SPLIT, yypt[-5].yyv.p, makearr(yypt[-3].yyv.p), (Node*)makedfa(yypt[-1].yyv.s, 1), (Node *)REGEXPR); } break;
-case 164:
-#line	397	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op4(SPLIT, yypt[-3].yyv.p, makearr(yypt[-1].yyv.p), NIL, (Node*)STRING); } break;
-case 165:
-#line	398	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(yypt[-3].yyv.i, yypt[-1].yyv.p); } break;
-case 166:
-#line	399	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = celltonode(yypt[-0].yyv.cp, CCON); } break;
-case 167:
-#line	401	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op4(yypt[-5].yyv.i, NIL, (Node*)makedfa(yypt[-3].yyv.s, 1), yypt[-1].yyv.p, rectonode()); } break;
-case 168:
-#line	403	"/sys/src/cmd/awk/awkgram.y"
-{ if (constnode(yypt[-3].yyv.p))
-			yyval.p = op4(yypt[-5].yyv.i, NIL, (Node*)makedfa(strnode(yypt[-3].yyv.p), 1), yypt[-1].yyv.p, rectonode());
-		  else
-			yyval.p = op4(yypt[-5].yyv.i, (Node *)1, yypt[-3].yyv.p, yypt[-1].yyv.p, rectonode()); } break;
-case 169:
-#line	408	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op4(yypt[-7].yyv.i, NIL, (Node*)makedfa(yypt[-5].yyv.s, 1), yypt[-3].yyv.p, yypt[-1].yyv.p); } break;
-case 170:
-#line	410	"/sys/src/cmd/awk/awkgram.y"
-{ if (constnode(yypt[-5].yyv.p))
-			yyval.p = op4(yypt[-7].yyv.i, NIL, (Node*)makedfa(strnode(yypt[-5].yyv.p), 1), yypt[-3].yyv.p, yypt[-1].yyv.p);
-		  else
-			yyval.p = op4(yypt[-7].yyv.i, (Node *)1, yypt[-5].yyv.p, yypt[-3].yyv.p, yypt[-1].yyv.p); } break;
-case 171:
-#line	415	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(SUBSTR, yypt[-5].yyv.p, yypt[-3].yyv.p, yypt[-1].yyv.p); } break;
-case 172:
-#line	417	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op3(SUBSTR, yypt[-3].yyv.p, yypt[-1].yyv.p, NIL); } break;
-case 175:
-#line	423	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op2(ARRAY, makearr(yypt[-3].yyv.p), yypt[-1].yyv.p); } break;
-case 176:
-#line	424	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(INDIRECT, celltonode(yypt[-0].yyv.cp, CVAR)); } break;
-case 177:
-#line	425	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(INDIRECT, yypt[-0].yyv.p); } break;
-case 178:
-#line	429	"/sys/src/cmd/awk/awkgram.y"
-{ arglist = yyval.p = 0; } break;
-case 179:
-#line	430	"/sys/src/cmd/awk/awkgram.y"
-{ arglist = yyval.p = celltonode(yypt[-0].yyv.cp,CVAR); } break;
-case 180:
-#line	431	"/sys/src/cmd/awk/awkgram.y"
-{
-			checkdup(yypt[-2].yyv.p, yypt[-0].yyv.cp);
-			arglist = yyval.p = linkum(yypt[-2].yyv.p,celltonode(yypt[-0].yyv.cp,CVAR)); } break;
-case 181:
-#line	437	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = celltonode(yypt[-0].yyv.cp, CVAR); } break;
-case 182:
-#line	438	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(ARG, itonp(yypt[-0].yyv.i)); } break;
-case 183:
-#line	439	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = op1(VARNF, (Node *) yypt[-0].yyv.cp); } break;
-case 184:
-#line	444	"/sys/src/cmd/awk/awkgram.y"
-{ yyval.p = notnull(yypt[-1].yyv.p); } break;
-	}
-	goto yystack;  /* stack new state and value */
-}

+ 1 - 1
sys/src/cmd/bzip2/bunzip2.c

@@ -10,7 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include "bzlib.h"
+#include "lib/bzlib.h"
 
 static	Biobuf	bin;
 static	int	debug;

+ 1 - 1
sys/src/cmd/bzip2/bzip2.c

@@ -10,7 +10,7 @@
 #include <u.h>
 #include <libc.h>
 #include <bio.h>
-#include "bzlib.h"
+#include "lib/bzlib.h"
 
 static	int	bzipf(char*, int);
 static	int	bzip(char*, int32_t, int, Biobuf*);

+ 28 - 0
sys/src/cmd/bzip2/bzip2.json

@@ -0,0 +1,28 @@
+{
+    "Name": "bzip2",
+    "Programs": [
+    "bunzip2",
+    "bzip2"
+    ],
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "Projects": [
+    "lib/libbzip2.json"
+    ],
+    "SourceFilesCmd": [
+    "bunzip2.c",
+    "bzip2.c"
+	],
+    "Libs": [
+    "lib/libbzip2.a"
+    ],
+    "Cflags": [
+    "-DPLAN9"
+    ],
+	"Post": [
+    "mv bunzip2 $HARVEY/amd64/bin/",
+    "mv bzip2 $HARVEY/amd64/bin/",
+    "rm $HARVEY/sys/src/cmd/bzip2/lib/libbzip2.a"
+	]
+}

+ 30 - 0
sys/src/cmd/bzip2/lib/libbzip2.json

@@ -0,0 +1,30 @@
+{
+	"Name": "libbzip2",
+	"Library": "libbzip2.a",
+	"Include": ["../../../lib.json"],
+	"Pre": [
+	],
+    "SourceFiles": [
+	"blocksort.c",
+	"bzassert.c",
+	"bzcompress.c",
+	"bzdecompress.c",
+	"bzfeof.c",
+	"bzlib.c",
+	"bzread.c",
+	"bzversion.c",
+	"bzwrite.c",
+	"bzzlib.c",
+	"compress.c",
+	"crctable.c",
+	"decompress.c",
+	"huffman.c",
+	"randtable.c"
+	],
+	"Cflags": [
+    "-DPLAN9"
+    ],
+	"Post": [
+	"ar rv $HARVEY/sys/src/cmd/bzip2/lib/libbzip2.a *.o"
+	]
+}

+ 1 - 1
sys/src/cmd/bzip2/lib/plan9.h

@@ -12,4 +12,4 @@
 #include <ctype.h>
 
 #define exit(x) exits((x) ? "whoops" : nil)
-#define size_t ulong
+//#define size_t ulong

+ 14 - 0
sys/src/cmd/cb/cb.json

@@ -0,0 +1,14 @@
+{
+    "Name": "cb",
+    "Program": "cb",
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "SourceFiles": [
+	"cb.c",
+	"cbtype.c"
+	],
+	"Post": [
+	"mv cb $HARVEY/amd64/bin/"
+	]
+}

+ 0 - 18
sys/src/cmd/cb/mkfile

@@ -1,18 +0,0 @@
-</$objtype/mkfile
-
-TARG=cb
-OFILES=\
-	cb.$O\
-	cbtype.$O\
-
-HFILES=cb.h\
-	cbtype.h\
-
-BIN=/$objtype/bin
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-
-< /sys/src/cmd/mkone

+ 16 - 0
sys/src/cmd/cdfs/cdfs.json

@@ -0,0 +1,16 @@
+{
+    "Name": "cdfs",
+    "Program": "cdfs",
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "SourceFiles": [
+	"buf.c",
+	"main.c",
+	"mmc.c",
+	"scsi.c"
+	],
+	"Post": [
+	"mv cdfs $HARVEY/amd64/bin/"
+	]
+}

+ 22 - 22
sys/src/cmd/cdfs/dat.h

@@ -72,7 +72,7 @@ enum {
 	Wptrkmode,			/* track mode */
 	Wpdatblktype,
 	Wpsessfmt	= 8,
-	Wppktsz		= 10,		/* BE ulong: # user data blks/fixed pkt */
+	Wppktsz		= 10,		/* BE uint32_t: # user data blks/fixed pkt */
 
 	/* Pagwrparams bits */
 	Bufe	= 1<<6,	/* Wpwrtype: buffer under-run free recording enable */
@@ -157,7 +157,7 @@ typedef struct Drive Drive;
 typedef struct Msf Msf;		/* minute, second, frame */
 typedef struct Otrack Otrack;
 typedef struct Track Track;
-typedef schar Tristate;
+typedef uint8_t Tristate;
 
 struct Msf {
 	int	m;
@@ -168,8 +168,8 @@ struct Msf {
 struct Track
 {
 	/* initialized while obtaining the toc (gettoc) */
-	vlong	size;		/* total size in bytes */
-	long	bs;		/* block size in bytes */
+	int64_t	size;		/* total size in bytes */
+	int32_t	bs;		/* block size in bytes */
 	uint32_t	beg;		/* beginning block number */
 	uint32_t	end;		/* ending block number */
 	int	type;
@@ -184,11 +184,11 @@ struct Track
 
 struct DTrack			/* not used */
 {
-	uchar	name[32];
-	uchar	beg[4];		/* msf value; only used for audio */
-	uchar	end[4];		/* msf value; only used for audio */
-	uchar	size[8];
-	uchar	magic[4];
+	unsigned char	name[32];
+	unsigned char	beg[4];		/* msf value; only used for audio */
+	unsigned char	end[4];		/* msf value; only used for audio */
+	unsigned char	size[8];
+	unsigned char	magic[4];
 };
 
 struct Otrack
@@ -206,8 +206,8 @@ struct Dev
 {
 	Otrack*	(*openrd)(Drive *d, int trackno);
 	Otrack*	(*create)(Drive *d, int bs);
-	long	(*read)(Otrack *t, void *v, long n, vlong off);
-	long	(*write)(Otrack *t, void *v, long n);
+	int32_t	(*read)(Otrack *t, void *v, int32_t n, int64_t off);
+	int32_t	(*write)(Otrack *t, void *v, int32_t n);
 	void	(*close)(Otrack *t);
 	int	(*gettoc)(Drive*);
 	int	(*fixate)(Drive *d);
@@ -217,8 +217,8 @@ struct Dev
 
 struct Drive
 {
-	QLock;
-	Scsi;
+	QLock qlock;
+	Scsi scsi;
 
 	int	type;			/* scsi peripheral device type: Type?? */
 
@@ -230,7 +230,7 @@ struct Drive
 	int	invistrack;
 	int	ntrack;
 	int	nchange;		/* compare with the members in Scsi */
-	ulong	changetime;		/* " */
+	uint32_t	changetime;		/* " */
 	int	relearn;		/* need to re-learn the disc? */
 	int	nameok;
 	int	writeok;		/* writable disc? */
@@ -242,9 +242,9 @@ struct Drive
 	Tristate erasable;		/* writable after erasing? */
 
 	Track	track[Ntrack];
-	ulong	end;			/* # of blks on current disc */
-	ulong	cap;			/* drive capabilities */
-	uchar	blkbuf[BScdda];
+	uint32_t	end;			/* # of blks on current disc */
+	uint32_t	cap;			/* drive capabilities */
+	unsigned char	blkbuf[BScdda];
 
 	int	maxreadspeed;
 	int	maxwritespeed;
@@ -252,20 +252,20 @@ struct Drive
 	int	writespeed;
 	Dev;
 
-	uchar	features[Maxfeatures/8];
+	unsigned char	features[Maxfeatures/8];
 
 	void *aux;		/* kept by driver */
 };
 
 struct Buf
 {
-	uchar	*data;		/* buffer */
-	vlong	off;		/* data[0] at offset off in file */
+	unsigned char	*data;		/* buffer */
+	int64_t	off;		/* data[0] at offset off in file */
 	int	bs;		/* block size */
-	long	ndata;		/* no. valid bytes in data */
+	int32_t	ndata;		/* no. valid bytes in data */
 	int	nblock;		/* total buffer size in blocks */
 	int	omode;		/* OREAD, OWRITE */
-	long	(*fn)(Buf*, void*, long, uint32_t); /* read, write */
+	int32_t	(*fn)(Buf*, void*, int32_t, uint32_t); /* read, write */
 
 	/* used only by client */
 	Otrack	*otrack;

+ 5 - 5
sys/src/cmd/cdfs/fns.h

@@ -7,12 +7,12 @@
  * in the LICENSE file.
  */
 
-Buf*	bopen(long (*)(Buf*, void*, long, uint32_t), int, int, int);
-long	bread(Buf*, void*, long, vlong);
+Buf*	bopen(int32_t (*)(Buf*, void*, int32_t, uint32_t), int, int, int);
+int32_t	bread(Buf*, void*, int32_t, int64_t);
 void	bterm(Buf*);
-long	bufread(Otrack*, void*, long, vlong);
-long	bufwrite(Otrack*, void*, long);
-long	bwrite(Buf*, void*, long);
+int32_t	bufread(Otrack*, void*, int32_t, int64_t);
+int32_t	bufwrite(Otrack*, void*, int32_t);
+int32_t	bwrite(Buf*, void*, int32_t);
 char*	disctype(Drive *drive);
 void	*emalloc(uint32_t);
 char*	geterrstr(void);

+ 1 - 1
sys/src/cmd/cdfs/main.c

@@ -383,7 +383,7 @@ readctl(Req *r)
 	p = seprint(p, e, "maxspeed read %d write %d\n",
 		drive->maxreadspeed, drive->maxwritespeed);
 
-	if (drive->Scsi.changetime != 0 && drive->ntrack != 0) { /* have disc? */
+	if (drive->scsi.changetime != 0 && drive->ntrack != 0) { /* have disc? */
 		ty = disctype(drive);
 		p = seprint(p, e, "%s", ty);
 		free(ty);

+ 0 - 17
sys/src/cmd/cdfs/mkfile

@@ -1,17 +0,0 @@
-</$objtype/mkfile
-
-TARG=cdfs
-
-OFILES=\
-	buf.$O\
-	main.$O\
-	mmc.$O\
-	scsi.$O\
-
-HFILES=\
-	dat.h\
-	fns.h\
-	../scuzz/scsireq.h\
-
-BIN=/$objtype/bin
-</sys/src/cmd/mkone

+ 50 - 50
sys/src/cmd/cdfs/mmc.c

@@ -176,21 +176,21 @@ initcdb(uint8_t *cdb, int len, int cmd)
  *
  * The format of the mode parameter (10) header is:
  *	ushort	mode_data_length;		// of following bytes
- *	uchar	medium_type;
- *	uchar	device_specific;
- *	uchar	reserved[2];
+ *	unsigned char	medium_type;
+ *	unsigned char	device_specific;
+ *	unsigned char	reserved[2];
  *	ushort	block_descriptor_length;	// zero
  *
  * The format of the mode parameter (6) header is:
- *	uchar	mode_data_length;		// of following bytes
- *	uchar	medium_type;
- *	uchar	device_specific;
- *	uchar	block_descriptor_length;	// zero
+ *	unsigned char	mode_data_length;		// of following bytes
+ *	unsigned char	medium_type;
+ *	unsigned char	device_specific;
+ *	unsigned char	block_descriptor_length;	// zero
  *
  * The format of the mode pages is:
- *	uchar	page_code_and_PS;
- *	uchar	page_len;			// of following bytes
- *	uchar	parameter[page_len];
+ *	unsigned char	page_code_and_PS;
+ *	unsigned char	page_len;			// of following bytes
+ *	unsigned char	parameter[page_len];
  *
  * see SPC-3 §4.3.4.6 for allocation length and §7.4 for mode parameter lists.
  */
@@ -210,7 +210,7 @@ mmcgetpage10(Drive *drive, int page, void *v)
 	initcdb(cmd, sizeof cmd, ScmdMsense10);
 	cmd[2] = page;
 	cmd[8] = 255;			/* allocation length: buffer size */
-	n = scsi(drive, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
 	if(n < Mode10parmhdrlen)
 		return -1;
 
@@ -236,7 +236,7 @@ mmcgetpage6(Drive *drive, int page, void *v)
 	cmd[2] = page;
 	cmd[4] = 255;			/* allocation length */
 
-	n = scsi(drive, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
 	if(n < Mode6parmhdrlen)
 		return -1;
 
@@ -278,7 +278,7 @@ mmcsetpage10(Drive *drive, int page, void *v)
 //	print("page\n");
 //	hexdump(p + Mode10parmhdrlen, len - Mode10parmhdrlen);
 
-	n = scsi(drive, cmd, sizeof(cmd), p, len, Swrite);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), p, len, Swrite);
 
 //	print("set: got cmd\n");
 //	hexdump(cmd, 10);
@@ -307,7 +307,7 @@ mmcsetpage6(Drive *drive, int page, void *v)
 	cmd[1] = 0x10;			/* format not vendor-specific */
 	cmd[4] = len;
 
-	n = scsi(drive, cmd, sizeof(cmd), p, len, Swrite);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), p, len, Swrite);
 	free(p);
 	if(n < len)
 		return -1;
@@ -354,7 +354,7 @@ mmcstatus(Drive *drive)
 	uint8_t cmd[12];
 
 	initcdb(cmd, sizeof cmd, ScmdCDstatus);		/* mechanism status */
-	return scsi(drive, cmd, sizeof(cmd), nil, 0, Sread);
+	return scsi(&drive->scsi, cmd, sizeof(cmd), nil, 0, Sread);
 }
 
 void
@@ -393,7 +393,7 @@ getdevtype(Drive *drive)
 	initcdb(cmd, sizeof cmd, ScmdInq);
 	cmd[3] = sizeof resp >> 8;
 	cmd[4] = sizeof resp;
-	n = scsi(drive, cmd, sizeof(cmd), resp, sizeof resp, Sread);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, sizeof resp, Sread);
 	if (n < 8)
 		return -1;
 	return resp[0] & 037;
@@ -406,7 +406,7 @@ start(Drive *drive, int code)
 
 	initcdb(cmd, sizeof cmd, ScmdStart);
 	cmd[4] = code;
-	return scsi(drive, cmd, sizeof(cmd), cmd, 0, Snone);
+	return scsi(&drive->scsi, cmd, sizeof(cmd), cmd, 0, Snone);
 }
 
 static int
@@ -449,7 +449,7 @@ mmcprobe(Scsi *scsi)
 		print("mmcprobe: inquiry: %s\n", scsi->inquire);
 
 	drive = emalloc(sizeof(Drive));
-	drive->Scsi = *scsi;
+	drive->scsi = *scsi;
 	drive->Dev = mmcdev;
 	drive->invistrack = -1;
 	getinvistrack(drive);
@@ -457,7 +457,7 @@ mmcprobe(Scsi *scsi)
 	aux = emalloc(sizeof(Mmcaux));
 	drive->aux = aux;
 
-	scsiready(drive);
+	scsiready(&drive->scsi);
 	drive->type = getdevtype(drive);
 	if (drive->type != TypeCD) {
 		werrstr("not an mmc device");
@@ -613,7 +613,7 @@ mmctrackinfo(Drive *drive, int t, int i)
 	cmd[5] = t;
 	cmd[7] = sizeof(resp)>>8;
 	cmd[8] = sizeof(resp);
-	n = scsi(drive, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
 	if(n < 28) {
 		if(vflag)
 			print("trackinfo %d fails n=%d: %r\n", t, n);
@@ -663,11 +663,11 @@ mmcreadtoc(Drive *drive, int type, int track, void *data, int nbytes)
 	cmd[8] = nbytes;
 
 	/*
-	 * printing iounit(drive->Scsi.rawfd) here yields
+	 * printing iounit(drive->scsi.rawfd) here yields
 	 *	iounit(3) = 0;		# for local access
 	 *	iounit(3) = 65512;	# for remote access via /mnt/term
 	 */
-	return scsi(drive, cmd, sizeof(cmd), data, nbytes, Sread);
+	return scsi(&drive->scsi, cmd, sizeof(cmd), data, nbytes, Sread);
 }
 
 static Msf
@@ -690,7 +690,7 @@ getdiscinfo(Drive *drive, uint8_t resp[], int resplen)
 	initcdb(cmd, sizeof cmd, ScmdRdiscinfo);
 	cmd[7] = resplen>>8;
 	cmd[8] = resplen;
-	n = scsi(drive, cmd, sizeof(cmd), resp, resplen, Sread);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, resplen, Sread);
 	if(n < 24) {
 		if(n >= 0)
 			werrstr("rdiscinfo returns %d", n);
@@ -863,7 +863,7 @@ getconfcmd(Drive *drive, uint8_t *resp, int respsz)
 	cmd[3] = 0;			/* start with profile list feature */
 	cmd[7] = respsz >> 8;
 	cmd[8] = respsz;
-	n = scsi(drive, cmd, sizeof cmd, resp, respsz, Sread);
+	n = scsi(&drive->scsi, cmd, sizeof cmd, resp, respsz, Sread);
 	if (n < 0) {
 		if(vflag)
 			fprint(2, "get config cmd failed\n");
@@ -897,7 +897,7 @@ getconf(Drive *drive)
 	 * 0xffff whacko.
 	 *
 	 * this is followed by multiple feature descriptors:
-	 * ushort code, uchar bits, uchar addnl_len, addnl_len bytes.
+	 * ushort code, unsigned char bits, unsigned char addnl_len, addnl_len bytes.
 	 */
 	prof = resp[6]<<8 | resp[7];
 	if (prof2mmctype(drive, prof) < 0)
@@ -936,7 +936,7 @@ getdvdstruct(Drive *drive)
 	cmd[7] = 0;			/* format code: physical format */
 	cmd[8] = sizeof resp >> 8;	/* allocation length */
 	cmd[9] = sizeof resp;
-	n = scsi(drive, cmd, sizeof(cmd), resp, sizeof resp, Sread);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, sizeof resp, Sread);
 	if (n < 7) {
 		if(vflag)
 			fprint(2, "read disc structure (dvd) cmd failed\n");
@@ -972,7 +972,7 @@ static int
 bdguess(Drive *drive)
 {
 	if (drive->mmctype == Mmcnone) {
-		if (strstr(drive->Scsi.inquire, "BD") == nil)
+		if (strstr(drive->scsi.inquire, "BD") == nil)
 			return -1;
 		if (vflag)
 			fprint(2, "drive probably a BD (from inquiry string)\n");
@@ -984,7 +984,7 @@ bdguess(Drive *drive)
 		return -1;
 
 	drive->recordable = drive->writeok = No;
-	if (strstr(drive->Scsi.inquire, "RW") != nil) {
+	if (strstr(drive->scsi.inquire, "RW") != nil) {
 		if (vflag)
 			fprint(2, "drive probably a burner (from inquiry string)\n");
 		drive->recordable = drive->writeok = Yes;
@@ -1014,8 +1014,8 @@ getbdstruct(Drive *drive)
 	/* cmd[6] is layer #, 0 is first */
 	cmd[7] = 0;			/* format code: disc info */
 	cmd[8] = sizeof resp >> 8;	/* allocation length */
-	cmd[9] = sizeof resp;
-	n = scsi(drive, cmd, sizeof(cmd), resp, sizeof resp, Sread);
+	cmd[9] = (int8_t)sizeof resp;
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, sizeof resp, Sread);
 	if(n < 0) {
 		if(vflag)
 			fprint(2, "read disc structure (bd) cmd failed\n");
@@ -1129,8 +1129,8 @@ initdrive(Drive *drive)
 
 	drive->ntrack = 0;
 	drive->nameok = 0;
-	drive->nchange = drive->Scsi.nchange;
-	drive->changetime = drive->Scsi.changetime;
+	drive->nchange = drive->scsi.nchange;
+	drive->changetime = drive->scsi.changetime;
 	drive->writeok = No;
 	drive->erasable = drive->recordable = Unset;
 	drive->laysfx = nil;
@@ -1242,11 +1242,11 @@ alltrackinfo(Drive *drive, int first, int last)
 		/* allow for lower apparent capacity due to reserved spares */
 		cap = (int64_t)track->end * track->bs;
 		osfx = drive->laysfx;
-		if (cap >= 101*GB)
+		if (cap >= (int64_t)101*GB)
 			drive->laysfx = "-ql";		/* 128GB nominal */
-		else if (cap >= 51*GB)
+		else if (cap >= (int64_t)51*GB)
 			drive->laysfx = "-tl";		/* 100GB nominal */
-		else if (cap >= 26*GB)
+		else if (cap >= (int64_t)26*GB)
 			drive->laysfx = "-dl";		/* 50GB nominal */
 		else
 			drive->laysfx = "";		/* 25GB nominal */
@@ -1357,7 +1357,7 @@ mmcgettoc(Drive *drive)
 	 * will set nchange and changetime in the scsi device.
 	 */
 	mmcreadtoc(drive, 0, 0, resp, sizeof(resp));
-	if(drive->Scsi.changetime == 0) {	/* no media present */
+	if(drive->scsi.changetime == 0) {	/* no media present */
 		drive->mmctype = Mmcnone;
 		drive->ntrack = 0;
 		return 0;
@@ -1366,7 +1366,7 @@ mmcgettoc(Drive *drive)
 	 * if the disc doesn't appear to be have been changed, and there
 	 * is a disc in this drive, there's nothing to do (the common case).
 	 */
-	if(drive->nchange == drive->Scsi.nchange && drive->changetime != 0 &&
+	if(drive->nchange == drive->scsi.nchange && drive->changetime != 0 &&
 	    !drive->relearn)
 		return 0;
 	drive->relearn = 0;
@@ -1376,7 +1376,7 @@ mmcgettoc(Drive *drive)
 	 * so rescan it and relearn all about it.
 	 */
 	if (vflag &&
-	    (drive->nchange != drive->Scsi.nchange || drive->changetime == 0))
+	    (drive->nchange != drive->scsi.nchange || drive->changetime == 0))
 		fprint(2, "\nnew disc in drive\n");
 	initdrive(drive);
 
@@ -1554,7 +1554,7 @@ mmcread(Buf *buf, void *v, int32_t nblock, uint32_t off)
 		return -1;
 
 	n = nblock*bs;
-	nn = scsi(drive, cmd, sizeof(cmd), v, n, Sread);
+	nn = scsi(&drive->scsi, cmd, sizeof(cmd), v, n, Sread);
 	if(nn != n) {
 		if(nn != -1)
 			werrstr("short read %ld/%ld", nn, n);
@@ -1653,7 +1653,7 @@ format(Drive *drive)
 	case Mmcdvdplus:
 		/* format type 0 is optional but equiv to format type 0x26 */
 		fmtdesc[4] = 0x26 << 2;
-		nblks = ~0ul;
+		nblks = (int64_t)~0ul;
 		blksize = 0;
 		break;
 	case Mmcbd:
@@ -1675,7 +1675,7 @@ format(Drive *drive)
 
 	if(vflag)
 		print("%lld ns: format\n", nsec());
-	return scsi(drive, cmd, sizeof(cmd), parms, sizeof parms, Swrite);
+	return scsi(&drive->scsi, cmd, sizeof(cmd), parms, sizeof parms, Swrite);
 }
 
 static int
@@ -1701,7 +1701,7 @@ mmcxwrite(Otrack *o, void *v, int32_t nblk)
 	bs = o->track->bs;
 	drive = o->drive;
 	aux = drive->aux;
-	if (aux->mmcnwa == -1 && scsiready(drive) < 0) {
+	if (aux->mmcnwa == -1 && scsiready(&drive->scsi) < 0) {
 		werrstr("device not ready to write");
 		return -1;
 	}
@@ -1740,7 +1740,7 @@ mmcxwrite(Otrack *o, void *v, int32_t nblk)
 	 * but explicit attempts to rewrite a given sector on write-once
 	 * media are guaranteed to fail.
 	 */
-	r = scsi(drive, cmd, sizeof(cmd), v, nblk * bs, Swrite);
+	r = scsi(&drive->scsi, cmd, sizeof(cmd), v, nblk * bs, Swrite);
 	if (r < 0)
 		fprint(2, "%s: write+verify error at blk offset %,ld = "
 			"offset %,lld / bs %ld: %r\n",
@@ -1751,7 +1751,7 @@ mmcxwrite(Otrack *o, void *v, int32_t nblk)
 }
 
 static int32_t
-mmcwrite(Buf *buf, void *v, int32_t nblk, uint32_t)
+mmcwrite(Buf *buf, void *v, int32_t nblk, uint32_t i)
 {
 	return mmcxwrite(buf->otrack, v, nblk);
 }
@@ -1786,7 +1786,7 @@ reserve(Drive *drive, int track)
 	PUTBELONG(cmd + 2 + 3, sz);
 	if (vflag)
 		fprint(2, "reserving %ld sectors\n", sz);
-	return scsi(drive, cmd, sizeof cmd, cmd, 0, Snone);
+	return scsi(&drive->scsi, cmd, sizeof cmd, cmd, 0, Snone);
 }
 
 static int
@@ -1800,7 +1800,7 @@ getinvistrack(Drive *drive)
 	PUTBELONG(cmd + 2, 1);		/* find first open track */
 	cmd[7] = sizeof(resp)>>8;
 	cmd[8] = sizeof(resp);
-	n = scsi(drive, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
+	n = scsi(&drive->scsi, cmd, sizeof(cmd), resp, sizeof(resp), Sread);
 	if(n < 4) {
 		if(vflag)
 			print("trackinfo for invis track fails n=%d: %r\n", n);
@@ -1910,7 +1910,7 @@ mmcxclose(Drive *drive, int clf, int trackno)
 	cmd[2] = clf;				/* close function */
 	if(clf == Closetrack)
 		cmd[5] = trackno;
-	return scsi(drive, cmd, sizeof(cmd), cmd, 0, Snone);
+	return scsi(&drive->scsi, cmd, sizeof(cmd), cmd, 0, Snone);
 }
 
 /* flush drive cache, close current track */
@@ -1933,7 +1933,7 @@ mmcsynccache(Drive *drive)
 				"will be slow");
 		fprint(2, "\n");
 	}
-	scsi(drive, cmd, sizeof(cmd), cmd, 0, Snone);
+	scsi(&drive->scsi, cmd, sizeof(cmd), cmd, 0, Snone);
 	if(vflag) {
 		aux = drive->aux;
 		print("mmcsynccache: bytes = %lld blocks = %ld, mmcnwa %#luX\n",
@@ -2044,7 +2044,7 @@ mmcblank(Drive *drive, int quick)
 	/* cmd[1] = 0 means blank the whole disc; = 1 just the header */
 	cmd[1] = quick ? 0x01 : 0x00;
 
-	return scsi(drive, cmd, sizeof(cmd), cmd, 0, Snone);
+	return scsi(&drive->scsi, cmd, sizeof(cmd), cmd, 0, Snone);
 }
 
 static char*
@@ -2087,7 +2087,7 @@ mmcsetspeed(Drive *drive, int r, int w)
 	cmd[3] = r;
 	cmd[4] = w>>8;
 	cmd[5] = w;
-	rv = e(scsi(drive, cmd, sizeof(cmd), nil, 0, Snone));
+	rv = e(scsi(&drive->scsi, cmd, sizeof(cmd), nil, 0, Snone));
 	mmcgetspeed(drive);
 	return rv;
 }

+ 1 - 1
sys/src/cmd/cdfs/scsi.c

@@ -248,7 +248,7 @@ scsi(Scsi *s, uint8_t *cmd, int ccount, void *v, int dcount, int io)
 	char *p;
 
 	data = v;
-	SET(key, code);
+	SET(key); SET(code);
 	qlock(s);
 	for(tries=0; tries<2; tries++) {
 		n = _scsicmd(s, cmd, ccount, data, dcount, io, 0);

+ 1 - 1
sys/src/cmd/cifs/auth.c

@@ -55,7 +55,7 @@ auth_plain(char *windom, char *keyp, uint8_t *chal, int len)
 	UserPasswd *up;
 	static Auth *ap;
 
-	USED(chal, len);
+	USED(chal); USED(len);
 
 	up = auth_getuserpasswd(auth_getkey, "windom=%s proto=pass service=cifs %s",
 		windom, keyp);

+ 41 - 41
sys/src/cmd/cifs/cifs.h

@@ -349,7 +349,7 @@ typedef struct {
 	char	*windom;	/* remote server's domain name */
 	char	*resp[2];	/* ASCII/Unicode or LM/NTLM keys */
 	int	len[2];		/* length of above */
-	uchar	*mackey[2];	/* Message Authentication key */
+	unsigned char	*mackey[2];	/* Message Authentication key */
 } Auth;
 
 typedef struct {
@@ -371,10 +371,10 @@ typedef struct {
 	int	isguest;	/* logged in as guest */
 	int	secmode;	/* security mode  */
 	int	macidx;		/* which MAC is in use, -1 is none */
-	uchar	chal[0xff +1];	/* server's challange for authentication  */
+	unsigned char	chal[0xff +1];	/* server's challange for authentication  */
 	int	challen;	/* length of challange */
-	long	slip;		/* time difference between the server and us */
-	uvlong	lastfind;	/* nsec when last find peformed */
+	int32_t	slip;		/* time difference between the server and us */
+	uint64_t	lastfind;	/* nsec when last find peformed */
 	QLock	seqlock;	/* sequence number increment */
 	QLock	rpclock;	/* actual remote procedure call */
 	char	*cname;		/* remote hosts called name (for info) */
@@ -388,17 +388,17 @@ typedef struct {
 	int tid;		/* tree ID received from server */
 	int seq;		/* sequence number expected in reply */
 
-	uchar *seqbase; 	/* cifs: pos of sequence number in packet */
-	uchar *wordbase; 	/* cifs: base of words section of data  */
-	uchar *bytebase; 	/* cifs: base of bytes section of data  */
-	uchar *tbase;		/* transactions: start of trans packet */
-	uchar *tsetup;		/* transactions: start of setup section */
-	uchar *tparam; 		/* transactions: start of params section */
-	uchar *tdata; 		/* transactions: start of data section */
-
-	uchar *eop;		/* received end of packet */
-	uchar *pos;		/* current pos in packet  */
-	uchar *buf;		/* packet buffer, must be last entry in struct  */
+	unsigned char *seqbase; 	/* cifs: pos of sequence number in packet */
+	unsigned char *wordbase; 	/* cifs: base of words section of data  */
+	unsigned char *bytebase; 	/* cifs: base of bytes section of data  */
+	unsigned char *tbase;		/* transactions: start of trans packet */
+	unsigned char *tsetup;		/* transactions: start of setup section */
+	unsigned char *tparam; 		/* transactions: start of params section */
+	unsigned char *tdata; 		/* transactions: start of data section */
+
+	unsigned char *eop;		/* received end of packet */
+	unsigned char *pos;		/* current pos in packet  */
+	unsigned char *buf;		/* packet buffer, must be last entry in struct  */
 } Pkt;
 
 typedef struct {
@@ -408,20 +408,20 @@ typedef struct {
 } Share;
 
 typedef struct {
-	long	created;	/* last access time */
-	long	accessed;	/* last access time */
-	long	written;	/* last written time */
-	long	changed;	/* change time */
-	uvlong	size;		/* file size */
-	long	attribs;	/* attributes */
+	int32_t	created;	/* last access time */
+	int32_t	accessed;	/* last access time */
+	int32_t	written;	/* last written time */
+	int32_t	changed;	/* change time */
+	uint64_t	size;		/* file size */
+	int32_t	attribs;	/* attributes */
 	char	name[CIFS_FNAME_MAX +1]; /* name */
 } FInfo;
 
 typedef struct {
 	char	*wrkstn;
 	char	*user;
-	long	sesstime;
-	long	idletime;
+	int32_t	sesstime;
+	int32_t	idletime;
 } Sessinfo;
 
 typedef struct {
@@ -493,10 +493,10 @@ extern Share Shares[MAX_SHARES];
 extern int Nshares;
 
 /* main.c */
-Qid	mkqid(char *, int, long, int, long);
+Qid	mkqid(char *, int, int32_t, int, int32_t);
 
 /* auth.c */
-Auth	*getauth(char *, char *, char *, int, uchar *, int);
+Auth	*getauth(char *, char *, char *, int, unsigned char *, int);
 void	autherr(void);
 int	macsign(Pkt *, int);
 
@@ -506,7 +506,7 @@ void	cifsclose(Session *);
 Pkt	*cifshdr(Session *, Share *, int);
 void	pbytes(Pkt *);
 int	cifsrpc(Pkt *);
-int	CIFSnegotiate(Session *, long *, char *, int, char *, int);
+int	CIFSnegotiate(Session *, int32_t *, char *, int, char *, int);
 int	CIFSsession(Session *);
 int	CIFStreeconnect(Session *, char *, char *, Share *);
 int	CIFSlogoff(Session *);
@@ -517,14 +517,14 @@ int	CIFScreatedirectory(Session *, Share *, char *);
 int	CIFSrename(Session *, Share *, char *, char *);
 int	CIFS_NT_opencreate(Session *, Share *, char *, int, int, int, int, int, int, int *, FInfo *);
 int	CIFS_SMB_opencreate(Session *, Share *, char *, int, int, int, int *);
-vlong	CIFSwrite(Session *, Share *, int, uvlong, void *, vlong);
-vlong	CIFSread(Session *, Share *, int, uvlong, void *, vlong, vlong);
+int64_t	CIFSwrite(Session *, Share *, int, uint64_t, void *, int64_t);
+int64_t	CIFSread(Session *, Share *, int, uint64_t, void *, int64_t, int64_t);
 int	CIFSflush(Session *, Share *, int);
 int	CIFSclose(Session *, Share *, int);
 int	CIFSfindclose2(Session *, Share *, int);
 int	CIFSecho(Session *);
 int	CIFSsetinfo(Session *, Share *, char *, FInfo *);
-void	goff(Pkt *, uchar *, char *, int);
+void	goff(Pkt *, unsigned char *, char *, int);
 
 /* dfs.c */
 char	*mapfile(char *);
@@ -567,7 +567,7 @@ char	*strupr(char *);
 char	*strlwr(char *);
 
 /* netbios.c */
-void	Gmem(uchar **, void *, int);
+void	Gmem(unsigned char **, void *, int);
 int	calledname(char *, char *);
 int	nbtdial(char *, char *, char *);
 void	nbthdr(Pkt *);
@@ -582,27 +582,27 @@ void	*pmem(Pkt *, void *, int);
 void	*ppath(Pkt *, char *);
 void	*pstr(Pkt *, char *);
 void	*pascii(Pkt *, char *);
-void	*pl64(Pkt *, uvlong);
+void	*pl64(Pkt *, uint64_t);
 void	*pb32(Pkt *, uint);
 void	*pl32(Pkt *, uint);
 void	*pb16(Pkt *, uint);
 void	*pl16(Pkt *, uint);
 void	*p8(Pkt *, uint);
 void	*pname(Pkt *, char *, char);
-void	*pvtime(Pkt *, uvlong);
-void	*pdatetime(Pkt *, long);
+void	*pvtime(Pkt *, uint64_t);
+void	*pdatetime(Pkt *, int32_t);
 void	gmem(Pkt *, void *, int);
 void	gstr(Pkt *, char *, int);
 void	gascii(Pkt *, char *, int);
-uvlong	gl64(Pkt *);
-uvlong	gb48(Pkt *);
+uint64_t	gl64(Pkt *);
+uint64_t	gb48(Pkt *);
 uint	gb32(Pkt *);
 uint	gl32(Pkt *);
 uint	gb16(Pkt *);
 uint	gl16(Pkt *);
 uint	g8(Pkt *);
-long	gdatetime(Pkt *);
-long	gvtime(Pkt *);
+int32_t	gdatetime(Pkt *);
+int32_t	gvtime(Pkt *);
 void	gconv(Pkt *, int, char *, int);
 
 /* raperrstr.c */
@@ -630,14 +630,14 @@ int	RAPServerenum3(Session *, Share *, char *, int, int, Serverinfo *);
 int	RAPFileenum2(Session *, Share *, char *, char *, Fileinfo **);
 
 /* trans2.c */
-int	T2findfirst(Session *, Share *, int, char *, int *, long *, FInfo *);
-int	T2findnext(Session *, Share *, int, char *, int *, long *, FInfo *, int);
+int	T2findfirst(Session *, Share *, int, char *, int *, int32_t *, FInfo *);
+int	T2findnext(Session *, Share *, int, char *, int *, int32_t *, FInfo *, int);
 int	T2queryall(Session *, Share *, char *, FInfo *);
 int	T2querystandard(Session *, Share *, char *, FInfo *);
 int	T2setpathinfo(Session *, Share *, char *, FInfo *);
 int	T2setfilelength(Session *, Share *, int, FInfo *);
-int	T2fsvolumeinfo(Session *, Share *, long *, long *, char *, int);
-int	T2fssizeinfo(Session *, Share *, uvlong *, uvlong *);
+int	T2fsvolumeinfo(Session *, Share *, int32_t *, int32_t *, char *, int);
+int	T2fssizeinfo(Session *, Share *, uint64_t *, uint64_t *);
 int	T2getdfsreferral(Session *, Share *, char *, int *, int *, Refer *, int);
 
 /* transnt.c */

+ 29 - 0
sys/src/cmd/cifs/cifs.json

@@ -0,0 +1,29 @@
+{
+    "Name": "cifs",
+    "Program": "cifs",
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "SourceFiles": [
+	"main.c",
+	"transnt.c",
+	"trans2.c",
+	"trans.c",
+	"cifs.c",
+	"netbios.c",
+	"pack.c",
+	"info.c",
+	"fs.c",
+	"sid2name.c",
+	"misc.c",
+	"nterrstr.c",
+	"doserrstr.c",
+	"raperrstr.c",
+	"auth.c",
+	"dfs.c",
+	"ping.c"
+	],
+	"Post": [
+	"mv cifs $HARVEY/amd64/bin/"
+	]
+}

+ 1 - 1
sys/src/cmd/cifs/main.c

@@ -1148,7 +1148,7 @@ void
 main(int argc, char **argv)
 {
 	int i, n;
-	long svrtime;
+	int32_t svrtime;
 	char windom[64], cname[64];
 	char *method, *sysname, *keyp, *mtpt, *svs;
 	static char *sh[1024];

+ 0 - 20
sys/src/cmd/cifs/mkfile

@@ -1,20 +0,0 @@
-</$objtype/mkfile
-
-# CFLAGS=$CFLAGS -DDEBUG_MAC
-
-TARG=cifs
-HFILES=cifs.h
-BIN=/$objtype/bin
-OFILES= main.$O transnt.$O trans2.$O trans.$O cifs.$O 	\
-	netbios.$O pack.$O info.$O fs.$O sid2name.$O	\
-	misc.$O nterrstr.$O doserrstr.$O raperrstr.$O 	\
-	auth.$O dfs.$O ping.$O
-
-</sys/src/cmd/mkone
-
-install:V:
-	# cp $TARG.man /sys/man/4/$TARG
-
-
-test:V: 8.out
-	8.out se-00 root && ls /n/se-00/root/eng/design/conversion/* && p /n/se-00/Shares

+ 10 - 0
sys/src/cmd/cmds.json

@@ -126,6 +126,16 @@
 	"9660srv/9660srv.json",
 	"9nfs/9nfs.json",
 	"astro/astro.json"
+	"aux/aux.json",
+	"bzip2/bzip2.json",
+	"cb/cb.json",
+	"cdfs/cdfs.json",
+	"cifs/cifs.json",
+	"con/con.json",
+	"dial/dial.json",
+	"diff/diff.json",
+	"disk/disk.json",
+	"dossrv/dossrv.json"
 	],
 	"Include": ["cmd.json"],
 	"Pre": [

+ 24 - 0
sys/src/cmd/con/con.json

@@ -0,0 +1,24 @@
+{
+    "Name": "con",
+    "Programs": [
+    "con",
+    "xms",
+    "xmr",
+    "hayes"
+    ],
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "SourceFilesCmd": [
+    "con.c",
+    "xms.c",
+    "xmr.c",
+    "hayes.c"
+	],
+	"Post": [
+    "mv con $HARVEY/amd64/bin/",
+    "mv xms $HARVEY/amd64/bin/",
+    "mv xmr $HARVEY/amd64/bin/",
+    "mv hayes $HARVEY/amd64/bin/"
+	]
+}

+ 0 - 18
sys/src/cmd/con/mkfile

@@ -1,18 +0,0 @@
-</$objtype/mkfile
-
-TARG=con\
-	xms\
-	xmr\
-	hayes\
-
-BIN=/$objtype/bin
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${TARG:%=%.c}\
-	/sys/man/1/con\
-
-</sys/src/cmd/mkmany
-
-

+ 2 - 2
sys/src/cmd/con/xmr.c

@@ -29,8 +29,8 @@ void
 main(int argc, char **argv)
 {
 	int fd;
-	uchar seqno;
-	ulong bytes;
+	unsigned char seqno;
+	uint32_t bytes;
 
 	ARGBEGIN {
 	case 'd':

+ 5 - 5
sys/src/cmd/con/xms.c

@@ -59,13 +59,13 @@ updcrc(int c, uint16_t crc)
 void
 main(int argc, char **argv)
 {
-	uchar c;
-	uchar buf[1024+5];
-	uchar seqno;
+	unsigned char c;
+	unsigned char buf[1024+5];
+	unsigned char seqno;
 	int fd, ctl;
-	long n;
+	int32_t n;
 	int sum;
-	uchar *p;
+	unsigned char *p;
 	int bytes;
 	int crcmode;
 

+ 24 - 0
sys/src/cmd/dial/dial.json

@@ -0,0 +1,24 @@
+{
+    "Name": "dial",
+    "Programs": [
+    "at",
+    "drain",
+    "expect",
+    "pass"
+    ],
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "SourceFilesCmd": [
+    "at.c",
+    "drain.c",
+    "expect.c",
+    "pass.c"
+	],
+	"Post": [
+    "mv at $HARVEY/amd64/bin/",
+    "mv drain $HARVEY/amd64/bin/",
+    "mv expect $HARVEY/amd64/bin/",
+    "mv pass $HARVEY/amd64/bin/"
+	]
+}

+ 1 - 1
sys/src/cmd/dial/drain.c

@@ -11,7 +11,7 @@
 #include <libc.h>
 
 void
-ding(void*, char *s)
+ding(void *v, char *s)
 {
 	if(strstr(s, "alarm"))
 		noted(NCONT);

+ 1 - 1
sys/src/cmd/dial/expect.c

@@ -18,7 +18,7 @@ usage(void)
 }
 
 void
-catch(void*, char *s)
+catch(void *v, char *s)
 {
 	exits(s);
 }

+ 0 - 20
sys/src/cmd/dial/mkfile

@@ -1,20 +0,0 @@
-</$objtype/mkfile
-
-TARG=expect\
-	pass\
-	drain\
-	at\
-
-OFILES=
-
-BIN=/$objtype/bin/dial
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-	${TARG:%=%.c}\
-	/sys/man/1/con\
-
-</sys/src/cmd/mkmany
-

+ 1 - 1
sys/src/cmd/dial/pass.c

@@ -21,7 +21,7 @@ usage(void)
 }
 
 void
-ding(void*, char *s)
+ding(void *v, char *s)
 {
 	if(strstr(s, "alarm")){
 		alarmed = 1;

+ 16 - 0
sys/src/cmd/diff/diff.json

@@ -0,0 +1,16 @@
+{
+    "Name": "diff",
+    "Program": "diff",
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "SourceFiles": [
+	"diffdir.c",
+	"diffio.c",
+	"diffreg.c",
+	"main.c"
+	],
+	"Post": [
+	"mv diff $HARVEY/amd64/bin/"
+	]
+}

+ 0 - 13
sys/src/cmd/diff/mkfile

@@ -1,13 +0,0 @@
-< /$objtype/mkfile
-
-TARG=diff
-OFILES=\
-	diffdir.$O\
-	diffio.$O\
-	diffreg.$O\
-	main.$O\
-
-HFILES=diff.h
-
-BIN=/$objtype/bin
-</sys/src/cmd/mkone

+ 27 - 0
sys/src/cmd/disk/9660/9660.json

@@ -0,0 +1,27 @@
+{
+    "Name": "dump9660",
+    "Program": "dump9660",
+    "Include": ["../../cmd.json"],
+    "Pre": [
+	],
+    "SourceFiles": [
+	"boot.c",
+	"cdrdwr.c",
+	"conform.c",
+	"direc.c",
+	"dump.c",
+	"dump9660.c",
+	"ichar.c",
+	"jchar.c",
+	"path.c",
+	"plan9.c",
+	"rune.c",
+	"sysuse.c",
+	"util.c",
+	"write.c"
+	],
+	"Post": [
+	"mv dump9660 $HARVEY/amd64/bin/",
+	"cp mk9660.rc $HARVEY/amd64/bin/mk9660"
+	]
+}

+ 10 - 10
sys/src/cmd/disk/9660/dump9660.c

@@ -46,9 +46,9 @@ void
 main(int argc, char **argv)
 {
 	int fix;
-	ulong block, newnull, cblock;
-	vlong maxsize;
-	uvlong length, clength;
+	uint32_t block, newnull, cblock;
+	int64_t maxsize;
+	uint64_t length, clength;
 	char buf[256], *dumpname, *proto, *s, *src, *status;
 	Cdimg *cd;
 	Cdinfo info;
@@ -151,7 +151,7 @@ main(int argc, char **argv)
 		usage();
 
 	if(now == 0)
-		now = (ulong)time(0);
+		now = (uint32_t)time(0);
 	if(mk9660){
 		if((cd = createcd(argv[0], info)) == nil)
 			sysfatal("cannot create '%s': %r", argv[0]);
@@ -199,7 +199,7 @@ main(int argc, char **argv)
 			dumpname = nil;
 			cd->nextblock = cd->nulldump+1;
 			cd->nulldump = 0;
-			Cwseek(cd, (vlong)cd->nextblock * Blocksize);
+			Cwseek(cd, (int64_t)cd->nextblock * Blocksize);
 			goto Dofix;
 		}
 	
@@ -219,9 +219,9 @@ main(int argc, char **argv)
  	 * Must be done before creation of the Joliet tree so that
  	 * blocks and lengths are correct.
 	 */
-	if(dataoffset > (vlong)cd->nextblock * Blocksize)
+	if(dataoffset > (int64_t)cd->nextblock * Blocksize)
 		cd->nextblock = (dataoffset+Blocksize-1)/Blocksize;
-	Cwseek(cd, (vlong)cd->nextblock * Blocksize);
+	Cwseek(cd, (int64_t)cd->nextblock * Blocksize);
 	writefiles(dump, cd, &iroot);
 
 	if(cd->bootimage){
@@ -387,7 +387,7 @@ Dofix:
 	
 			cd->nextblock = cd->nulldump+1;
 			cd->nulldump = 0;
-			Cwseek(cd, (vlong)cd->nextblock * Blocksize);
+			Cwseek(cd, (int64_t)cd->nextblock * Blocksize);
 			goto Dofix;
 		}
 	
@@ -395,7 +395,7 @@ Dofix:
 		 * Write old null header block; this commits all our changes.
 		 */
 		if(cd->nulldump){
-			Cwseek(cd, (vlong)cd->nulldump * Blocksize);
+			Cwseek(cd, (int64_t)cd->nulldump * Blocksize);
 			sprint(buf, "plan 9 dump cd\n");
 			sprint(buf+strlen(buf), "%s %lud %lud %lud %llud %lud %lud",
 				dumpname, now, newnull, cblock, clength,
@@ -409,7 +409,7 @@ Dofix:
 			Cwflush(cd);
 		}
 	}
-	fdtruncate(cd->fd, (vlong)cd->nextblock * Blocksize);
+	fdtruncate(cd->fd, (int64_t)cd->nextblock * Blocksize);
 	exits(status);
 }
 

+ 71 - 71
sys/src/cmd/disk/9660/iso9660.h

@@ -13,8 +13,8 @@
  * Routines and data structures to support reading and writing ISO 9660 CD images.
  * See the ISO 9660 or ECMA 119 standards.
  *
- * Also supports Rock Ridge extensions for long file names and Unix stuff.
- * Also supports Microsoft's Joliet extensions for Unicode and long file names.
+ * Also supports Rock Ridge extensions for int32_t file names and Unix stuff.
+ * Also supports Microsoft's Joliet extensions for Unicode and int32_t file names.
  * Also supports El Torito bootable CD spec.
  */
 
@@ -43,7 +43,7 @@ struct XDir {
 	uint32_t	mtime;
 	uint32_t   ctime;
 
-        vlong   length;
+        int64_t   length;
 };
 
 /*
@@ -63,9 +63,9 @@ struct Direc {
 	char *gid;
 	char *symlink;
 	uint32_t mode;
-	long atime;
-	long ctime;
-	long mtime;
+	int32_t atime;
+	int32_t ctime;
+	int32_t mtime;
 
 	uint32_t uidno;
 	uint32_t gidno;
@@ -117,12 +117,12 @@ struct Cdimg {
 	uint32_t iso9660pvd;
 	uint32_t jolietsvd;
 	uint32_t pathblock;
-	uvlong rrcontin;	/* rock ridge continuation offset */
+	uint64_t rrcontin;	/* rock ridge continuation offset */
 	uint32_t nulldump;		/* next dump block */
 	uint32_t nconform;		/* number of conform entries written already */
-	uvlong bootcatptr;
+	uint64_t bootcatptr;
 	uint32_t bootcatblock;
-	uvlong bootimageptr;
+	uint64_t bootimageptr;
 	Direc *loaderdirec;
 	Direc *bootdirec;
 	char *bootimage;
@@ -188,7 +188,7 @@ struct Dump {
 
 struct Dumpdir {
 	char *name;
-	uchar md5[MD5dlen];
+	unsigned char md5[MD5dlen];
 	uint32_t block;
 	uint32_t length;
 	Dumpdir *md5left;
@@ -214,57 +214,57 @@ typedef struct Cvoldesc Cvoldesc;
 
 /* a volume descriptor block */
 struct Cvoldesc {
-	uchar	magic[8];	/* 0x01, "CD001", 0x01, 0x00 */
-	uchar	systemid[32];	/* system identifier */
-	uchar	volumeid[32];	/* volume identifier */
-	uchar	unused[8];	/* character set in secondary desc */
-	uchar	volsize[8];	/* volume size */
-	uchar	charset[32];
-	uchar	volsetsize[4];	/* volume set size = 1 */
-	uchar	volseqnum[4];	/* volume sequence number = 1 */
-	uchar	blocksize[4];	/* logical block size */
-	uchar	pathsize[8];	/* path table size */
-	uchar	lpathloc[4];	/* Lpath */
-	uchar	olpathloc[4];	/* optional Lpath */
-	uchar	mpathloc[4];	/* Mpath */
-	uchar	ompathloc[4];	/* optional Mpath */
-	uchar	rootdir[34];	/* directory entry for root */
-	uchar	volumeset[128];	/* volume set identifier */
-	uchar	publisher[128];
-	uchar	preparer[128];	/* data preparer identifier */
-	uchar	application[128];	/* application identifier */
-	uchar	notice[37];	/* copyright notice file */
-	uchar	abstract[37];	/* abstract file */
-	uchar	biblio[37];	/* bibliographic file */
-	uchar	cdate[17];	/* creation date */
-	uchar	mdate[17];	/* modification date */
-	uchar	xdate[17];	/* expiration date */
-	uchar	edate[17];	/* effective date */
-	uchar	fsvers;		/* file system version = 1 */
+	unsigned char	magic[8];	/* 0x01, "CD001", 0x01, 0x00 */
+	unsigned char	systemid[32];	/* system identifier */
+	unsigned char	volumeid[32];	/* volume identifier */
+	unsigned char	unused[8];	/* character set in secondary desc */
+	unsigned char	volsize[8];	/* volume size */
+	unsigned char	charset[32];
+	unsigned char	volsetsize[4];	/* volume set size = 1 */
+	unsigned char	volseqnum[4];	/* volume sequence number = 1 */
+	unsigned char	blocksize[4];	/* logical block size */
+	unsigned char	pathsize[8];	/* path table size */
+	unsigned char	lpathloc[4];	/* Lpath */
+	unsigned char	olpathloc[4];	/* optional Lpath */
+	unsigned char	mpathloc[4];	/* Mpath */
+	unsigned char	ompathloc[4];	/* optional Mpath */
+	unsigned char	rootdir[34];	/* directory entry for root */
+	unsigned char	volumeset[128];	/* volume set identifier */
+	unsigned char	publisher[128];
+	unsigned char	preparer[128];	/* data preparer identifier */
+	unsigned char	application[128];	/* application identifier */
+	unsigned char	notice[37];	/* copyright notice file */
+	unsigned char	abstract[37];	/* abstract file */
+	unsigned char	biblio[37];	/* bibliographic file */
+	unsigned char	cdate[17];	/* creation date */
+	unsigned char	mdate[17];	/* modification date */
+	unsigned char	xdate[17];	/* expiration date */
+	unsigned char	edate[17];	/* effective date */
+	unsigned char	fsvers;		/* file system version = 1 */
 };
 
 /* a directory entry */
 struct Cdir {
-	uchar	len;
-	uchar	xlen;
-	uchar	dloc[8];
-	uchar	dlen[8];
-	uchar	date[7];
-	uchar	flags;
-	uchar	unitsize;
-	uchar	gapsize;
-	uchar	volseqnum[4];
-	uchar	namelen;
-	uchar	name[1];	/* chumminess */
+	unsigned char	len;
+	unsigned char	xlen;
+	unsigned char	dloc[8];
+	unsigned char	dlen[8];
+	unsigned char	date[7];
+	unsigned char	flags;
+	unsigned char	unitsize;
+	unsigned char	gapsize;
+	unsigned char	volseqnum[4];
+	unsigned char	namelen;
+	unsigned char	name[1];	/* chumminess */
 };
 
 /* a path table entry */
 struct Cpath {
-	uchar   namelen;
-	uchar   xlen;
-	uchar   dloc[4];
-	uchar   parent[2];
-	uchar   name[1];        /* chumminess */
+	unsigned char   namelen;
+	unsigned char   xlen;
+	unsigned char   dloc[4];
+	unsigned char   parent[2];
+	unsigned char   name[1];        /* chumminess */
 };
 
 enum { /* Rockridge flags */
@@ -313,14 +313,14 @@ Cdimg *opencd(char*, Cdinfo);
 void Creadblock(Cdimg*, void*, uint32_t, uint32_t);
 uint32_t big(void*, int);
 uint32_t little(void*, int);
-int parsedir(Cdimg*, Direc*, uchar*, int, char *(*)(uchar*, int));
+int parsedir(Cdimg*, Direc*, unsigned char*, int, char *(*)(unsigned char*, int));
 void setroot(Cdimg*, uint32_t, uint32_t, uint32_t);
-void setvolsize(Cdimg*, uvlong, uint32_t);
+void setvolsize(Cdimg*, uint64_t, uint32_t);
 void setpathtable(Cdimg*, uint32_t, uint32_t, uint32_t, uint32_t);
 void Cputc(Cdimg*, int);
-void Cputnl(Cdimg*, uvlong, int);
-void Cputnm(Cdimg*, uvlong, int);
-void Cputn(Cdimg*, uvlong, int);
+void Cputnl(Cdimg*, uint64_t, int);
+void Cputnm(Cdimg*, uint64_t, int);
+void Cputn(Cdimg*, uint64_t, int);
 void Crepeat(Cdimg*, int, int);
 void Cputs(Cdimg*, char*, int);
 void Cwrite(Cdimg*, void*, int);
@@ -333,18 +333,18 @@ void Cputdate(Cdimg*, uint32_t);
 void Cputdate1(Cdimg*, uint32_t);
 void Cread(Cdimg*, void*, int);
 void Cwflush(Cdimg*);
-void Cwseek(Cdimg*, vlong);
-uvlong Cwoffset(Cdimg*);
-uvlong Croffset(Cdimg*);
+void Cwseek(Cdimg*, int64_t);
+uint64_t Cwoffset(Cdimg*);
+uint64_t Croffset(Cdimg*);
 int Cgetc(Cdimg*);
-void Crseek(Cdimg*, vlong);
+void Crseek(Cdimg*, int64_t);
 char *Crdline(Cdimg*, int);
 int Clinelen(Cdimg*);
 
 /* conform.c */
 void rdconform(Cdimg*);
 char *conform(char*, int);
-void wrconform(Cdimg*, int, uint32_t*, uvlong*);
+void wrconform(Cdimg*, int, uint32_t*, uint64_t*);
 
 /* direc.c */
 void mkdirec(Direc*, XDir*);
@@ -360,27 +360,27 @@ void setparents(Direc*);
 uint32_t Cputdumpblock(Cdimg*);
 int hasdump(Cdimg*);
 Dump *dumpcd(Cdimg*, Direc*);
-Dumpdir *lookupmd5(Dump*, uchar*);
-void insertmd5(Dump*, char*, uchar*, uint32_t, uint32_t);
+Dumpdir *lookupmd5(Dump*, unsigned char*);
+void insertmd5(Dump*, char*, unsigned char*, uint32_t, uint32_t);
 
-Direc readdumpdirs(Cdimg*, XDir*, char*(*)(uchar*,int));
+Direc readdumpdirs(Cdimg*, XDir*, char*(*)(unsigned char*,int));
 char *adddumpdir(Direc*, uint32_t, XDir*);
 void copybutname(Direc*, Direc*);
 
-void readkids(Cdimg*, Direc*, char*(*)(uchar*,int));
+void readkids(Cdimg*, Direc*, char*(*)(unsigned char*,int));
 void freekids(Direc*);
 void readdumpconform(Cdimg*);
 void rmdumpdir(Direc*, char*);
 
 /* ichar.c */
-char *isostring(uchar*, int);
+char *isostring(unsigned char*, int);
 int isbadiso9660(char*);
 int isocmp(const void*, const void*);
 int isisofrog(char);
 void Cputisopvd(Cdimg*, Cdinfo);
 
 /* jchar.c */
-char *jolietstring(uchar*, int);
+char *jolietstring(unsigned char*, int);
 int isbadjoliet(char*);
 int jolietcmp(const void*, const void*);
 int isjolietfrog(Rune);
@@ -399,8 +399,8 @@ int chat(char*, ...);
 /* unix.c, plan9.c */
 void dirtoxdir(XDir*, Dir*);
 void fdtruncate(int, uint32_t);
-long uidno(char*);
-long gidno(char*);
+int32_t uidno(char*);
+int32_t gidno(char*);
 
 /* rune.c */
 Rune *strtorune(Rune*, char*);

+ 0 - 43
sys/src/cmd/disk/9660/mkfile

@@ -1,43 +0,0 @@
-</$objtype/mkfile
-
-TARG=dump9660 mk9660
-
-OFILES=
-
-DFILES=\
-	boot.$O\
-	cdrdwr.$O\
-	conform.$O\
-	direc.$O\
-	dump.$O\
-	dump9660.$O\
-	ichar.$O\
-	jchar.$O\
-	path.$O\
-	plan9.$O\
-	rune.$O\
-	sysuse.$O\
-	util.$O\
-	write.$O\
-
-HFILES=iso9660.h
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-	${DFILES:%.$O=%.c}\
-	dump9660.c\
-	mk9660.rc\
-	${TARG:%=/386/bin/disk/%}\
-
-BIN=/$objtype/bin/disk
-</sys/src/cmd/mkmany
-
-$O.dump9660: $DFILES
-
-mk9660.$O:V:
-	# nothing
-
-$O.mk9660: mk9660.rc
-	cp mk9660.rc $target

+ 1 - 1
sys/src/cmd/disk/9660/plan9.c

@@ -32,5 +32,5 @@ dirtoxdir(XDir *xd, Dir *d)
 void
 fdtruncate(int fd, uint32_t size)
 {
-	USED(fd, size);
+	USED(fd); USED(size);
 }

+ 33 - 0
sys/src/cmd/disk/disk.json

@@ -0,0 +1,33 @@
+{
+    "Name": "disk",
+    "Programs": [
+    "exsort",
+    "format",
+    "mbr",
+    "mkext",
+    "mkfs",
+    "partfs"
+    ],
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "Projects": [
+    "9660/9660.json"
+    ],
+    "SourceFilesCmd": [
+    "exsort.c",
+    "format.c",
+    "mbr.c",
+    "mkext.c",
+    "mkfs.c",
+    "partfs.c"
+	],
+	"Post": [
+    "mv exsort $HARVEY/amd64/bin/",
+    "mv format $HARVEY/amd64/bin/",
+    "mv mbr $HARVEY/amd64/bin/",
+    "mv mkext $HARVEY/amd64/bin/",
+    "mv mkfs $HARVEY/amd64/bin/",
+    "mv partfs $HARVEY/amd64/bin/"
+	]
+}

+ 7 - 7
sys/src/cmd/disk/exsort.c

@@ -22,10 +22,10 @@ int	wflag;
 void
 main(int argc, char *argv[])
 {
-	long i, l, x, lobits, hibits, tot;
+	int32_t i, l, x, lobits, hibits, tot;
 	int f, j;
 	char *file;
-	ulong *b, a, lo, hi;
+	uint32_t *b, a, lo, hi;
 
 	ARGBEGIN {
 	default:
@@ -48,15 +48,15 @@ main(int argc, char *argv[])
 		print("cant open %s: %r\n", file);
 		exits("open");
 	}
-	l = seek(f, 0, 2) / sizeof(long);
+	l = seek(f, 0, 2) / sizeof(int32_t);
 
-	b = malloc(l*sizeof(long));
+	b = malloc(l*sizeof(int32_t));
 	if(b == 0) {
 		print("cant malloc %s: %r\n", file);
 		exits("malloc");
 	}
 	seek(f, 0, 0);
-	if(read(f, b, l*sizeof(long)) != l*sizeof(long)) {
+	if(read(f, b, l*sizeof(int32_t)) != l*sizeof(int32_t)) {
 		print("short read %s: %r\n", file);
 		exits("read");
 	}
@@ -79,7 +79,7 @@ main(int argc, char *argv[])
 		swapem(b, l);
 	}
 
-	qsort(b, l, sizeof(ulong), ulcmp);
+	qsort(b, l, sizeof(uint32_t), ulcmp);
 
 	tot = 0;
 	for(j=0; j<100; j++) {
@@ -104,7 +104,7 @@ main(int argc, char *argv[])
 		if(hibits > lobits)
 			swapem(b, l);
 		seek(f, 0, 0);
-		if(write(f, b, l*sizeof(long)) != l*sizeof(long)) {
+		if(write(f, b, l*sizeof(int32_t)) != l*sizeof(int32_t)) {
 			print("short write %s\n", file);
 			exits("write");
 		}

+ 1 - 1
sys/src/cmd/disk/format.c

@@ -90,7 +90,7 @@ struct Dosdir
  *  the boot program for the boot sector.
  */
 int nbootprog = 188;	/* no. of bytes of boot program, including the first 0x3E */
-uchar bootprog[512] =
+unsigned char bootprog[512] =
 {
 [0x000]	0xEB, 0x3C, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+ 2 - 2
sys/src/cmd/disk/mbr.c

@@ -128,9 +128,9 @@ main(int argc, char **argv)
 {
 	Disk *disk;
 	Tentry *tp;
-	uchar *mbr, *buf;
+	unsigned char *mbr, *buf;
 	char *mbrfile;
-	ulong secsize;
+	uint32_t secsize;
 	int flag9, sysfd, nmbr;
 
 	flag9 = 0;

+ 3 - 3
sys/src/cmd/disk/mkext.c

@@ -29,7 +29,7 @@ void	usage(void);
 #pragma varargck argpos error 1
 
 Biobufhdr bin;
-uchar	binbuf[2*LEN];
+unsigned char	binbuf[2*LEN];
 int8_t	linebuf[LEN];
 int	uflag;
 int	hflag;
@@ -42,8 +42,8 @@ main(int argc, char **argv)
 	Biobuf bout;
 	char *fields[NFLDS], name[2*LEN], *p, *namep;
 	char *uid, *gid;
-	ulong mode, mtime;
-	uvlong bytes;
+	uint32_t mode, mtime;
+	uint64_t bytes;
 
 	quotefmtinstall();
 	namep = name;

+ 0 - 48
sys/src/cmd/disk/mkfile

@@ -1,48 +0,0 @@
-</$objtype/mkfile
-
-TARG=exsort\
-	format\
-	kfscmd\
-	mbr\
-	mkext\
-	mkfs\
-	partfs\
-
-DIRS=\
-	9660\
-	kfs\
-	prep\
-
-OFILES=
-
-BIN=/$objtype/bin/disk
-
-UPDATE=\
-	mkfile\
-	${TARG:%=%.c}\
-	/sys/man/8/prep\
-	/sys/man/8/mkfs\
-	${TARG:%=/386/bin/disk/%}\
-
-</sys/src/cmd/mkmany
-
-all:V:	all-kfs
-
-install:V:	install-kfs ksync
-
-clean:V:	clean-kfs
-
-nuke:V:		nuke-kfs
-
-installall:V:	installall-kfs
-
-%-kfs:V:
-	for(i in $DIRS) @{
-		cd $i
-		mk $MKFLAGS $stem
-	}
-
-ksync:
-	touch $BIN/ksync
-
-$O.format: /$objtype/lib/libdisk.a

+ 2 - 2
sys/src/cmd/disk/partfs.c

@@ -226,7 +226,7 @@ ctlwrite(Req *r)
 }
 
 int
-rootgen(int off, Dir *d, void*)
+rootgen(int off, Dir *d, void *v)
 {
 	memset(d, 0, sizeof *d);
 	d->atime = time0;
@@ -245,7 +245,7 @@ rootgen(int off, Dir *d, void*)
 }
 
 int
-dirgen(int off, Dir *d, void*)
+dirgen(int off, Dir *d, void *v)
 {
 	int n;
 	Part *p;

+ 5 - 5
sys/src/cmd/disk/prep/edit.c

@@ -234,7 +234,7 @@ static char *helptext =
 	"q - quit\n";
 
 static char*
-edithelp(Edit *edit, int, char**)
+edithelp(Edit *edit, int i, char **c)
 {
 	print("%s", helptext);
 	if(edit->help)
@@ -243,7 +243,7 @@ edithelp(Edit *edit, int, char**)
 }
 
 static char*
-editprint(Edit *edit, int argc, char**)
+editprint(Edit *edit, int argc, char **c)
 {
 	int64_t lastend;
 	int i;
@@ -266,7 +266,7 @@ editprint(Edit *edit, int argc, char**)
 }
 
 char*
-editwrite(Edit *edit, int argc, char**)
+editwrite(Edit *edit, int argc, char **c)
 {
 	int i;
 	char *err;
@@ -287,7 +287,7 @@ editwrite(Edit *edit, int argc, char**)
 }
 
 static char*
-editquit(Edit *edit, int argc, char**)
+editquit(Edit *edit, int argc, char **c)
 {
 	static int warned;
 
@@ -306,7 +306,7 @@ editquit(Edit *edit, int argc, char**)
 }
 
 char*
-editctlprint(Edit *edit, int argc, char **)
+editctlprint(Edit *edit, int argc, char **c)
 {
 	if(argc != 1)
 		return "args";

+ 10 - 10
sys/src/cmd/disk/prep/edit.h

@@ -11,10 +11,10 @@ typedef struct Part Part;
 struct Part {
 	char *name;
 	char *ctlname;
-	vlong start;
-	vlong end;
-	vlong ctlstart;
-	vlong ctlend;
+	int64_t start;
+	int64_t end;
+	int64_t ctlstart;
+	int64_t ctlend;
 	int changed;
 };
 
@@ -32,19 +32,19 @@ struct Edit {
 	Part *part[Maxpart];
 	int npart;
 
-	char *(*add)(Edit*, char*, vlong, vlong);
+	char *(*add)(Edit*, char*, int64_t, int64_t);
 	char *(*del)(Edit*, Part*);
 	char *(*ext)(Edit*, int, char**);
 	char *(*help)(Edit*);
 	char *(*okname)(Edit*, char*);
-	void (*sum)(Edit*, Part*, vlong, vlong);
+	void (*sum)(Edit*, Part*, int64_t, int64_t);
 	char *(*write)(Edit*);
 	void (*printctl)(Edit*, int);
 
 	char *unit;
 	void *aux;
-	vlong dot;
-	vlong end;
+	int64_t dot;
+	int64_t end;
 
 	/* do not use fields below this line */
 	int changed;
@@ -57,7 +57,7 @@ void	runcmd(Edit*, char*);
 Part	*findpart(Edit*, char*);
 char	*addpart(Edit*, Part*);
 char	*delpart(Edit*, Part*);
-char *parseexpr(char *s, vlong xdot, vlong xdollar, vlong xsize, vlong *result);
+char *parseexpr(char *s, int64_t xdot, int64_t xdollar, int64_t xsize, int64_t *result);
 int	ctldiff(Edit *edit, int ctlfd);
-void *emalloc(ulong);
+void *emalloc(uint32_t);
 char *estrdup(char*);

+ 3 - 3
sys/src/cmd/disk/prep/fdisk.c

@@ -106,7 +106,7 @@ usage(void)
 void
 main(int argc, char **argv)
 {
-	vlong secsize;
+	int64_t secsize;
 
 	secsize = 0;
 	ARGBEGIN{
@@ -749,7 +749,7 @@ cmdprintctl(Edit *edit, int ctlfd)
 }
 
 static char*
-cmdokname(Edit*, char *name)
+cmdokname(Edit *e, char *name)
 {
 	char *q;
 
@@ -851,7 +851,7 @@ static char *help =
 	"t name [type] - set partition type\n";
 
 static char*
-cmdhelp(Edit*)
+cmdhelp(Edit *e)
 {
 	print("%s\n", help);
 	return nil;

+ 17 - 0
sys/src/cmd/disk/prep/fdisk.json

@@ -0,0 +1,17 @@
+{
+    "Name": "fdisk",
+    "Program": "fdisk",
+    "Include": ["../../cmd.json"],
+    "Pre": [
+    "yacc -d calc.y"
+    ],
+    "SourceFiles": [
+    "fdisk.c",
+    "edit.c",
+    "y.tab.c"
+	],
+	"Post": [
+    "mv fdisk $HARVEY/amd64/bin/",
+    "rm y.tab*"
+	]
+}

+ 2 - 2
sys/src/cmd/disk/prep/prep.c

@@ -104,7 +104,7 @@ main(int argc, char **argv)
 	int i;
 	char *p;
 	Disk *disk;
-	vlong secsize;
+	int64_t secsize;
 
 	secsize = 0;
 	ARGBEGIN{
@@ -276,7 +276,7 @@ static char isfrog[256]={
 };
 
 static char*
-cmdokname(Edit*, char *elem)
+cmdokname(Edit *e, char *elem)
 {
 	for(; *elem; elem++)
 		if(isfrog[*(uint8_t*)elem])

+ 18 - 0
sys/src/cmd/disk/prep/prep.json

@@ -0,0 +1,18 @@
+{
+    "Name": "prep",
+    "Program": "prep",
+    "Include": ["../../cmd.json"],
+    "Pre": [
+    "yacc -d calc.y"
+	],
+    "Projects": [
+    "fdisk.json"
+    ],
+    "SourceFiles": [
+    "prep.c",
+    "edit.c"
+	],
+	"Post": [
+    "mv prep $HARVEY/amd64/bin/"
+	]
+}

+ 82 - 82
sys/src/cmd/dossrv/dat.h

@@ -18,14 +18,14 @@ typedef struct Xfs		Xfs;
 typedef struct Xfile		Xfile;
 
 struct Dospart{
-	uchar	active;
-	uchar	hstart;
-	uchar	cylstart[2];
-	uchar	type;
-	uchar	hend;
-	uchar	cylend[2];
-	uchar	start[4];
-	uchar	length[4];
+	unsigned char	active;
+	unsigned char	hstart;
+	unsigned char	cylstart[2];
+	unsigned char	type;
+	unsigned char	hend;
+	unsigned char	cylend[2];
+	unsigned char	start[4];
+	unsigned char	length[4];
 };
 
 enum
@@ -48,26 +48,26 @@ enum
  * dos boot sector, the start of every dos partition
  */
 struct Dosboot{
-	uchar	magic[3];
-	uchar	version[8];
-	uchar	sectsize[2];
-	uchar	clustsize;
-	uchar	nresrv[2];
-	uchar	nfats;
-	uchar	rootsize[2];
-	uchar	volsize[2];
-	uchar	mediadesc;
-	uchar	fatsize[2];
-	uchar	trksize[2];
-	uchar	nheads[2];
-	uchar	nhidden[4];
-	uchar	bigvolsize[4];		/* same as Dosboot32 up to here */
-	uchar	driveno;
-	uchar	reserved0;
-	uchar	bootsig;
-	uchar	volid[4];
-	uchar	label[11];
-	uchar	reserved1[8];
+	unsigned char	magic[3];
+	unsigned char	version[8];
+	unsigned char	sectsize[2];
+	unsigned char	clustsize;
+	unsigned char	nresrv[2];
+	unsigned char	nfats;
+	unsigned char	rootsize[2];
+	unsigned char	volsize[2];
+	unsigned char	mediadesc;
+	unsigned char	fatsize[2];
+	unsigned char	trksize[2];
+	unsigned char	nheads[2];
+	unsigned char	nhidden[4];
+	unsigned char	bigvolsize[4];		/* same as Dosboot32 up to here */
+	unsigned char	driveno;
+	unsigned char	reserved0;
+	unsigned char	bootsig;
+	unsigned char	volid[4];
+	unsigned char	label[11];
+	unsigned char	reserved1[8];
 };
 
 /*
@@ -80,27 +80,27 @@ enum
 };
 
 struct Dosboot32{
-	uchar	magic[3];
-	uchar	version[8];
-	uchar	sectsize[2];
-	uchar	clustsize;
-	uchar	nresrv[2];
-	uchar	nfats;
-	uchar	rootsize[2];
-	uchar	volsize[2];
-	uchar	mediadesc;
-	uchar	fatsize[2];
-	uchar	trksize[2];
-	uchar	nheads[2];
-	uchar	nhidden[4];
-	uchar	bigvolsize[4];		/* same as Dosboot up to here */
-	uchar	fatsize32[4];		/* sectors per fat */
-	uchar	extflags[2];		/* active fat flags */
-	uchar	version1[2];		/* fat32 version; major & minor bytes */
-	uchar	rootstart[4];		/* starting cluster of root dir */
-	uchar	infospec[2];		/* fat allocation info sector */
-	uchar	backupboot[2];		/* backup boot sector */
-	uchar	reserved[12];
+	unsigned char	magic[3];
+	unsigned char	version[8];
+	unsigned char	sectsize[2];
+	unsigned char	clustsize;
+	unsigned char	nresrv[2];
+	unsigned char	nfats;
+	unsigned char	rootsize[2];
+	unsigned char	volsize[2];
+	unsigned char	mediadesc;
+	unsigned char	fatsize[2];
+	unsigned char	trksize[2];
+	unsigned char	nheads[2];
+	unsigned char	nhidden[4];
+	unsigned char	bigvolsize[4];		/* same as Dosboot up to here */
+	unsigned char	fatsize32[4];		/* sectors per fat */
+	unsigned char	extflags[2];		/* active fat flags */
+	unsigned char	version1[2];		/* fat32 version; major & minor bytes */
+	unsigned char	rootstart[4];		/* starting cluster of root dir */
+	unsigned char	infospec[2];		/* fat allocation info sector */
+	unsigned char	backupboot[2];		/* backup boot sector */
+	unsigned char	reserved[12];
 };
 
 /*
@@ -114,12 +114,12 @@ enum
 
 struct Fatinfo
 {
-	uchar	sig1[4];
-	uchar	pad[480];
-	uchar	sig[4];
-	uchar	freeclust[4];	/* num frre clusters; -1 is unknown */
-	uchar	nextfree[4];	/* most recently allocated cluster */
-	uchar	resrv[4*3];
+	unsigned char	sig1[4];
+	unsigned char	pad[480];
+	unsigned char	sig[4];
+	unsigned char	freeclust[4];	/* num frre clusters; -1 is unknown */
+	unsigned char	nextfree[4];	/* most recently allocated cluster */
+	unsigned char	resrv[4*3];
 };
 
 /*
@@ -132,17 +132,17 @@ struct Dosbpb{
 	int	nresrv;			/* sectors */
 	int	nfats;			/* usually 2; modified to 1 if fat mirroring disabled */
 	int	rootsize;		/* number of entries, for fat12 and fat16 */
-	long	volsize;		/* in sectors */
+	int32_t	volsize;		/* in sectors */
 	int	mediadesc;
-	long	fatsize;		/* in sectors */
+	int32_t	fatsize;		/* in sectors */
 	int	fatclusters;
 	int	fatbits;		/* 12, 16, or 32 */
-	long	fataddr;		/* sector number of first valid fat entry */
-	long	rootaddr;		/* for fat16 or fat12, sector of root dir */
-	long	rootstart;		/* for fat32, cluster of root dir */
-	long	dataaddr;		/* initial sector of data clusters */
-	long	freeptr;		/* next free cluster candidate */
-	long	freeclusters;		/* count of free clusters, for fat32 */
+	int32_t	fataddr;		/* sector number of first valid fat entry */
+	int32_t	rootaddr;		/* for fat16 or fat12, sector of root dir */
+	int32_t	rootstart;		/* for fat32, cluster of root dir */
+	int32_t	dataaddr;		/* initial sector of data clusters */
+	int32_t	freeptr;		/* next free cluster candidate */
+	int32_t	freeclusters;		/* count of free clusters, for fat32 */
 	int	fatinfo;		/* fat info sector location; 0 => none */
 };
 
@@ -150,23 +150,23 @@ enum
 {
 	DOSDIRSIZE	= 32,
 	DOSEMPTY	= 0xe5,			/* first char in name if entry is unused */
-	DOSRUNE		= 13,			/* runes per dosdir in a long file name */
+	DOSRUNE		= 13,			/* runes per dosdir in a int32_t file name */
 	DOSNAMELEN	= 261			/* max dos file name length */
 };
 
 struct Dosdir{
-	uchar	name[8];
-	uchar	ext[3];
-	uchar	attr;
-	uchar	reserved[1];
-	uchar	ctime[3];		/* creation time */
-	uchar	cdate[2];		/* creation date */
-	uchar	adate[2];		/* last access date */
-	uchar	hstart[2];		/* high bits of start for fat32 */
-	uchar	time[2];		/* last modified time */
-	uchar	date[2];		/* last modified date */
-	uchar	start[2];
-	uchar	length[4];
+	unsigned char	name[8];
+	unsigned char	ext[3];
+	unsigned char	attr;
+	unsigned char	reserved[1];
+	unsigned char	ctime[3];		/* creation time */
+	unsigned char	cdate[2];		/* creation date */
+	unsigned char	adate[2];		/* last access date */
+	unsigned char	hstart[2];		/* high bits of start for fat32 */
+	unsigned char	time[2];		/* last modified time */
+	unsigned char	date[2];		/* last modified date */
+	unsigned char	start[2];
+	unsigned char	length[4];
 };
 
 enum
@@ -180,7 +180,7 @@ enum
 };
 
 #define	GSHORT(p)	(((p)[0])|(p)[1]<<8)
-#define	GLONG(p)	(((long)(p)[0])|(p)[1]<<8|(p)[2]<<16|(p)[3]<<24)
+#define	GLONG(p)	(((int32_t)(p)[0])|(p)[1]<<8|(p)[2]<<16|(p)[3]<<24)
 #define PSHORT(p,v)	((p)[0]=(v),(p)[1]=(v)>>8)
 #define PLONG(p,v)	((p)[0]=(v),(p)[1]=(v)>>8,(p)[2]=(v)>>16,(p)[3]=(v)>>24)
 
@@ -205,18 +205,18 @@ struct Xfs{
 	int omode;		/* of file containing external fs */
 	char	*name;		/* of file containing external f.s. */
 	Qid	qid;		/* of file containing external f.s. */
-	long	ref;		/* attach count */
+	int32_t	ref;		/* attach count */
 	Qid	rootqid;	/* of plan9 constructed root directory */
-	uchar	isfat32;	/* is a fat 32 file system? */
+	unsigned char	isfat32;	/* is a fat 32 file system? */
 	short	dev;
 	short	fmt;
-	long	offset;
+	int32_t	offset;
 	void	*ptr;
 };
 
 struct Xfile{
 	Xfile	*next;		/* in hash bucket */
-	long	fid;
+	int32_t	fid;
 	uint32_t	flags;
 	Qid	qid;
 	Xfs	*xf;
@@ -261,4 +261,4 @@ extern int	chatty;
 extern int	errno;
 extern int	readonly;
 extern char	*deffile;
-extern int trspaces;
+extern int trspaces;

+ 1 - 1
sys/src/cmd/dossrv/dosfs.h

@@ -16,4 +16,4 @@ enum
 extern Fcall	*req;
 extern Fcall	*rep;
 extern char	repdata[Maxfdata];
-extern uchar	statbuf[STATMAX];
+extern unsigned char	statbuf[STATMAX];

+ 20 - 0
sys/src/cmd/dossrv/dossrv.json

@@ -0,0 +1,20 @@
+{
+    "Name": "dossrv",
+    "Program": "dossrv",
+    "Include": ["../cmd.json"],
+    "Pre": [
+	],
+    "SourceFiles": [
+	"xfssrv.c",
+	"xfile.c",
+	"dosfs.c",
+	"dossubs.c",
+	"iotrack.c",
+	"lock.c",
+	"chat.c",
+	"devio.c"
+	],
+	"Post": [
+	"mv dossrv $HARVEY/amd64/bin/"
+	]
+}

+ 1 - 1
sys/src/cmd/dossrv/dossubs.c

@@ -65,7 +65,7 @@ dosfs(Xfs *xf)
 			isdos[i] = 1;
 		isdos['$'] = 1;
 		isdos['%'] = 1;
-		isdos['''] = 1;
+		isdos['\''] = 1;
 		isdos['-'] = 1;
 		isdos['_'] = 1;
 		isdos['@'] = 1;

+ 15 - 15
sys/src/cmd/dossrv/fns.h

@@ -17,24 +17,24 @@ void	chat(char*, ...);
 int	cistrcmp(char*, char*);
 int	classifyname(char*);
 Xfile	*clean(Xfile*);
-long	clust2sect(Dosbpb*, long);
+int32_t	clust2sect(Dosbpb*, int32_t);
 void	dirdump(void*);
 int	dosfs(Xfs*);
 void	dosptrreloc(Xfile *f, Dosptr *dp, uint32_t addr, uint32_t offset);
 int	emptydir(Xfile*);
 int	eqqid(Qid, Qid);
 int	falloc(Xfs*);
-void	ffree(Xfs *xf, long start);
-long	fileaddr(Xfile*, long, int);
+void	ffree(Xfs *xf, int32_t start);
+int32_t	fileaddr(Xfile*, int32_t, int);
 void	fixname(char*);
 void	getdir(Xfs*, Dir*, Dosdir*, int, int);
-long	getfat(Xfs*, int);
+int32_t	getfat(Xfs*, int);
 int	getfile(Xfile*);
 void	getname(char*, Dosdir*);
-char	*getnamesect(char*, char*, uchar*, int*, int*, int);
-long	getstart(Xfs *xf, Dosdir *d);
+char	*getnamesect(char*, char*, unsigned char*, int*, int*, int);
+int32_t	getstart(Xfs *xf, Dosdir *d);
 Xfs	*getxfs(char*, char*);
-long	gtime(Dosdir *d);
+int32_t	gtime(Dosdir *d);
 void	io(int srvfd);
 int	iscontig(Xfs *xf, Dosdir *d);
 int	isroot(uint32_t addr);
@@ -46,17 +46,17 @@ void	panic(char*, ...);
 void	putdir(Dosdir*, Dir*);
 void	putfat(Xfs*, int, uint32_t);
 void	putfile(Xfile*);
-int	putlongname(Xfs *f, Dosptr *ndp, char *name, char sname[13]);
+int	putint32_tname(Xfs *f, Dosptr *ndp, char *name, char sname[13]);
 void	putname(char*, Dosdir*);
-void	putstart(Xfs *xf, Dosdir *d, long start);
-void	puttime(Dosdir*, long);
+void	putstart(Xfs *xf, Dosdir *d, int32_t start);
+void	puttime(Dosdir*, int32_t);
 void	rattach(void);
 void	rauth(void);
 void	rclone(void);
 void	rclunk(void);
 void	rcreate(void);
-long	readdir(Xfile*, void*, long, long);
-long	readfile(Xfile*, void*, long, long);
+int32_t	readdir(Xfile*, void*, int32_t, int32_t);
+int32_t	readfile(Xfile*, void*, int32_t, int32_t);
 void	refxfs(Xfs*, int);
 void	rflush(void);
 void	rootfile(Xfile*);
@@ -69,11 +69,11 @@ void	rwrite(void);
 void	rwstat(void);
 void	rversion(void);
 int	searchdir(Xfile*, char*, Dosptr*, int, int);
-long	sect2clust(Dosbpb*, long);
-int	truncfile(Xfile*, long length);
+int32_t	sect2clust(Dosbpb*, int32_t);
+int	truncfile(Xfile*, int32_t length);
 int	utftorunes(Rune*, char*, int);
 int	walkup(Xfile*, Dosptr*);
-long	writefile(Xfile*, void*, long, long);
+int32_t	writefile(Xfile*, void*, int32_t, int32_t);
 char	*xerrstr(int);
 Xfile	*xfile(int, int);
 int	xfspurge(void);

+ 9 - 9
sys/src/cmd/dossrv/iotrack.h

@@ -24,14 +24,14 @@ struct Iosect
 	short	flags;
 	MLock	lock;
 	Iotrack *t;
-	uchar *	iobuf;
+	unsigned char *	iobuf;
 };
 
 struct Iotrack
 {
 	short	flags;
 	Xfs *	xf;
-	long	addr;
+	int32_t	addr;
 	Iotrack	*next;		/* in lru list */
 	Iotrack	*prev;
 	Iotrack	*hnext;		/* in hash list */
@@ -50,22 +50,22 @@ enum{
 struct Track
 {
 	Iosect *p[Sect2trk];
-	uchar	buf[Sect2trk][Sectorsize];
+	unsigned char	buf[Sect2trk][Sectorsize];
 };
 
 #define	BMOD		(1<<0)
 #define	BIMM		(1<<1)
 #define	BSTALE		(1<<2)
 
-Iosect*	getiosect(Xfs*, long, int);
-Iosect*	getosect(Xfs*, long);
-Iosect*	getsect(Xfs*, long);
+Iosect*	getiosect(Xfs*, int32_t, int);
+Iosect*	getosect(Xfs*, int32_t);
+Iosect*	getsect(Xfs*, int32_t);
 Iosect*	newsect(void);
-Iotrack*	getiotrack(Xfs*, long);
+Iotrack*	getiotrack(Xfs*, int32_t);
 int	canmlock(MLock*);
 int	devcheck(Xfs*);
-int	devread(Xfs*, long, void*, long);
-int	devwrite(Xfs*, long, void*, long);
+int	devread(Xfs*, int32_t, void*, int32_t);
+int	devwrite(Xfs*, int32_t, void*, int32_t);
 int	tread(Iotrack*);
 int	twrite(Iotrack*);
 void	freesect(Iosect*);

+ 0 - 29
sys/src/cmd/dossrv/mkfile

@@ -1,29 +0,0 @@
-</$objtype/mkfile
-
-TARG=dossrv
-OFILES=\
-	xfssrv.$O\
-	xfile.$O\
-	dosfs.$O\
-	dossubs.$O\
-	iotrack.$O\
-	lock.$O\
-	chat.$O\
-	devio.$O\
-
-HFILES=dat.h\
-	dosfs.h\
-	fns.h\
-	iotrack.h\
-
-BIN=/$objtype/bin
-
-UPDATE=\
-	mkfile\
-	$HFILES\
-	${OFILES:%.$O=%.c}\
-	${TARG:%=/386/bin/%}\
-
-</sys/src/cmd/mkone
-
-xfssrv.$O:	errstr.h

+ 2 - 1
sys/src/cmd/rc/rc.json

@@ -26,6 +26,7 @@
 	"y.tab.c"
 	],
 	"Post":[
-	"mv rc $HARVEY/amd64/bin/"
+	"mv rc $HARVEY/amd64/bin/",
+	"rm y.tab* x.tab*"
 	]
 }

+ 51 - 51
sys/src/cmd/scuzz/scsireq.h

@@ -19,9 +19,9 @@ enum {					/* fundamental constants/defaults */
 };
 
 typedef struct {
-	uchar	*p;
-	long	count;
-	uchar	write;
+	unsigned char	*p;
+	int32_t	count;
+	unsigned char	write;
 } ScsiPtr;
 
 typedef struct {
@@ -35,8 +35,8 @@ typedef struct {
 	ScsiPtr	cmd;
 	ScsiPtr	data;
 	int	status;			/* returned status */
-	uchar	sense[MaxDirData];	/* returned sense data */
-	uchar	inquiry[MaxDirData];	/* returned inquiry data */
+	unsigned char	sense[MaxDirData];	/* returned sense data */
+	unsigned char	inquiry[MaxDirData];	/* returned inquiry data */
 	int	readblock;		/* flag: read a block since open */
 } ScsiReq;
 
@@ -98,63 +98,63 @@ enum {
 	Allmodepages = 0x3F,
 };
 
-/* p arguments should be of type uchar* */
+/* p arguments should be of type unsigned char* */
 #define GETBELONG(p) ((uint32_t)(p)[0]<<24 | (uint32_t)(p)[1]<<16 | (p)[2]<<8 | (p)[3])
 #define PUTBELONG(p, ul) ((p)[0] = (ul)>>24, (p)[1] = (ul)>>16, \
 			  (p)[2] = (ul)>>8,  (p)[3] = (ul))
 #define GETBE24(p)	((uint32_t)(p)[0]<<16 | (p)[1]<<8 | (p)[2])
 #define PUTBE24(p, ul)	((p)[0] = (ul)>>16, (p)[1] = (ul)>>8, (p)[2] = (ul))
 
-extern long maxiosize;
-
-long	SRready(ScsiReq*);
-long	SRrewind(ScsiReq*);
-long	SRreqsense(ScsiReq*);
-long	SRformat(ScsiReq*);
-long	SRrblimits(ScsiReq*, uchar*);
-long	SRread(ScsiReq*, void*, long);
-long	SRwrite(ScsiReq*, void*, long);
-long	SRseek(ScsiReq*, long, int);
-long	SRfilemark(ScsiReq*, uint32_t);
-long	SRspace(ScsiReq*, uchar, long);
-long	SRinquiry(ScsiReq*);
-long	SRmodeselect6(ScsiReq*, uchar*, long);
-long	SRmodeselect10(ScsiReq*, uchar*, long);
-long	SRmodesense6(ScsiReq*, uchar, uchar*, long);
-long	SRmodesense10(ScsiReq*, uchar, uchar*, long);
-long	SRstart(ScsiReq*, uchar);
-long	SRrcapacity(ScsiReq*, uchar*);
-
-long	SRblank(ScsiReq*, uchar, uchar);	/* MMC CD-R/CD-RW commands */
-long	SRsynccache(ScsiReq*);
-long	SRTOC(ScsiReq*, void*, int, uchar, uchar);
-long	SRrdiscinfo(ScsiReq*, void*, int);
-long	SRrtrackinfo(ScsiReq*, void*, int, int);
-
-long	SRcdpause(ScsiReq*, int);		/* MMC CD audio commands */
-long	SRcdstop(ScsiReq*);
-long	SRcdload(ScsiReq*, int, int);
-long	SRcdplay(ScsiReq*, int, long, long);
-long	SRcdstatus(ScsiReq*, uchar*, int);
-long	SRgetconf(ScsiReq*, uchar*, int);
+extern int32_t maxiosize;
+
+int32_t	SRready(ScsiReq*);
+int32_t	SRrewind(ScsiReq*);
+int32_t	SRreqsense(ScsiReq*);
+int32_t	SRformat(ScsiReq*);
+int32_t	SRrblimits(ScsiReq*, unsigned char*);
+int32_t	SRread(ScsiReq*, void*, int32_t);
+int32_t	SRwrite(ScsiReq*, void*, int32_t);
+int32_t	SRseek(ScsiReq*, int32_t, int);
+int32_t	SRfilemark(ScsiReq*, uint32_t);
+int32_t	SRspace(ScsiReq*, unsigned char, int32_t);
+int32_t	SRinquiry(ScsiReq*);
+int32_t	SRmodeselect6(ScsiReq*, unsigned char*, int32_t);
+int32_t	SRmodeselect10(ScsiReq*, unsigned char*, int32_t);
+int32_t	SRmodesense6(ScsiReq*, unsigned char, unsigned char*, int32_t);
+int32_t	SRmodesense10(ScsiReq*, unsigned char, unsigned char*, int32_t);
+int32_t	SRstart(ScsiReq*, unsigned char);
+int32_t	SRrcapacity(ScsiReq*, unsigned char*);
+
+int32_t	SRblank(ScsiReq*, unsigned char, unsigned char);	/* MMC CD-R/CD-RW commands */
+int32_t	SRsynccache(ScsiReq*);
+int32_t	SRTOC(ScsiReq*, void*, int, unsigned char, unsigned char);
+int32_t	SRrdiscinfo(ScsiReq*, void*, int);
+int32_t	SRrtrackinfo(ScsiReq*, void*, int, int);
+
+int32_t	SRcdpause(ScsiReq*, int);		/* MMC CD audio commands */
+int32_t	SRcdstop(ScsiReq*);
+int32_t	SRcdload(ScsiReq*, int, int);
+int32_t	SRcdplay(ScsiReq*, int, int32_t, int32_t);
+int32_t	SRcdstatus(ScsiReq*, unsigned char*, int);
+int32_t	SRgetconf(ScsiReq*, unsigned char*, int);
 
 /*	old CD-R/CD-RW commands */
-long	SRfwaddr(ScsiReq*, uchar, uchar, uchar, uchar*);
-long	SRtreserve(ScsiReq*, long);
-long	SRtinfo(ScsiReq*, uchar, uchar*);
-long	SRwtrack(ScsiReq*, void*, long, uchar, uchar);
-long	SRmload(ScsiReq*, uchar);
-long	SRfixation(ScsiReq*, uchar);
-
-long	SReinitialise(ScsiReq*);		/* CHANGER commands */
-long	SRestatus(ScsiReq*, uchar, uchar*, int);
-long	SRmmove(ScsiReq*, int, int, int, int);
-
-long	SRrequest(ScsiReq*);
+int32_t	SRfwaddr(ScsiReq*, unsigned char, unsigned char, unsigned char, unsigned char*);
+int32_t	SRtreserve(ScsiReq*, int32_t);
+int32_t	SRtinfo(ScsiReq*, unsigned char, unsigned char*);
+int32_t	SRwtrack(ScsiReq*, void*, int32_t, unsigned char, unsigned char);
+int32_t	SRmload(ScsiReq*, unsigned char);
+int32_t	SRfixation(ScsiReq*, unsigned char);
+
+int32_t	SReinitialise(ScsiReq*);		/* CHANGER commands */
+int32_t	SRestatus(ScsiReq*, unsigned char, unsigned char*, int);
+int32_t	SRmmove(ScsiReq*, int, int, int, int);
+
+int32_t	SRrequest(ScsiReq*);
 int	SRclose(ScsiReq*);
 int	SRopenraw(ScsiReq*, char*);
 int	SRopen(ScsiReq*, char*);
 
 void	makesense(ScsiReq*);
 
-long	umsrequest(struct Umsc*, ScsiPtr*, ScsiPtr*, int*);
+int32_t	umsrequest(struct Umsc*, ScsiPtr*, ScsiPtr*, int*);