Browse Source

Plan 9 from Bell Labs 2005-04-12

David du Colombier 16 years ago
parent
commit
d03a445a18

+ 1 - 1
acme/bin/source/win/win.c

@@ -183,7 +183,7 @@ winread(Window *w, uint q0, uint q1, char *data)
 		if(write(w->addr, buf, n) != n)
 			error("error writing addr: %r");
 		n = read(w->data, buf, sizeof buf);
-		if(n <= 0)
+		if(n < 0)
 			error("reading data: %r");
 		nr = nrunes(buf, n);
 		while(m+nr >q1){

+ 10 - 10
dist/replica/_plan9.db

@@ -683,7 +683,7 @@ acme/bin/source/win/main.c - 664 sys sys 1104430370 12508
 acme/bin/source/win/mkfile - 664 sys sys 1046654934 309
 acme/bin/source/win/pipe.c - 664 sys sys 1104430371 2802
 acme/bin/source/win/util.c - 664 sys sys 1017679346 1169
-acme/bin/source/win/win.c - 664 sys sys 1015011255 4240
+acme/bin/source/win/win.c - 664 sys sys 1113252156 4239
 acme/bin/unind - 755 sys sys 1015011256 27
 acme/bin/wnew - 775 sys sys 1046184422 84
 acme/mail - 20000000775 sys sys 1015011265 0
@@ -3598,7 +3598,7 @@ sys/lib/dist/pc/glenda/lib/profile - 664 sys sys 1032883600 327
 sys/lib/dist/pc/glenda/tmp - 20000000775 sys sys 1018469723 0
 sys/lib/dist/pc/inst - 20000000775 sys sys 1018721419 0
 sys/lib/dist/pc/inst/bootfloppy - 775 sys sys 1112361036 903
-sys/lib/dist/pc/inst/bootplan9 - 775 sys sys 1019534696 1584
+sys/lib/dist/pc/inst/bootplan9 - 775 sys sys 1113252317 1574
 sys/lib/dist/pc/inst/bootsetup - 775 sys sys 1112361037 3688
 sys/lib/dist/pc/inst/bootwin9x - 775 sys sys 1112361037 2527
 sys/lib/dist/pc/inst/bootwinnt - 775 sys sys 1019240165 1041
@@ -4822,7 +4822,7 @@ sys/man/1/vnc - 664 sys sys 1045501432 4186
 sys/man/1/vt - 664 sys sys 1018386774 2210
 sys/man/1/wc - 664 sys sys 944959675 908
 sys/man/1/who - 664 sys sys 944959674 332
-sys/man/1/winwatch - 664 sys sys 1112362775 470
+sys/man/1/winwatch - 664 sys sys 1113252108 723
 sys/man/1/xd - 664 sys sys 944959674 1517
 sys/man/1/yacc - 664 sys sys 944959676 3273
 sys/man/1/yesterday - 664 sys sys 1070288431 2348
@@ -10614,10 +10614,7 @@ sys/src/cmd/unix/drawterm/authaux.c - 664 sys sys 954098602 11934
 sys/src/cmd/unix/drawterm/authdial.c - 664 sys sys 954098603 145
 sys/src/cmd/unix/drawterm/authlocal.h - 664 sys sys 954098603 162
 sys/src/cmd/unix/drawterm/bin - 20000000775 sys sys 959090509 0
-sys/src/cmd/unix/drawterm/bin/drawterm-freebsd.gz - 775 sys sys 1022046828 259893
-sys/src/cmd/unix/drawterm/bin/drawterm-linux - 775 sys sys 1020313487 875368
-sys/src/cmd/unix/drawterm/bin/drawterm-macosx.gz - 775 sys sys 1022046829 330048
-sys/src/cmd/unix/drawterm/bin/drawterm-win.exe - 775 sys sys 1040673060 307270
+sys/src/cmd/unix/drawterm/bin/README - 664 sys sys 1113252460 106
 sys/src/cmd/unix/drawterm/canlock-power-gcc.c - 664 sys sys 1019839861 985
 sys/src/cmd/unix/drawterm/canlock-x86-gcc.c - 664 sys sys 1020313486 308
 sys/src/cmd/unix/drawterm/canlock.c - 644 sys sys 954098604 92
@@ -11184,16 +11181,16 @@ sys/src/cmd/wikifs/io.c - 664 sys sys 1084469671 11572
 sys/src/cmd/wikifs/lookup.c - 664 sys sys 1018211093 182
 sys/src/cmd/wikifs/map.c - 664 sys sys 1018211093 109
 sys/src/cmd/wikifs/mkfile - 664 sys sys 1045503591 468
-sys/src/cmd/wikifs/parse.c - 664 sys sys 1079969446 4989
+sys/src/cmd/wikifs/parse.c - 664 sys sys 1113252120 5245
 sys/src/cmd/wikifs/parsehist.c - 664 sys sys 1018211093 1906
 sys/src/cmd/wikifs/testwrite.c - 664 sys sys 1018211093 818
-sys/src/cmd/wikifs/tohtml.c - 664 sys sys 1079380577 13998
+sys/src/cmd/wikifs/tohtml.c - 664 sys sys 1113252121 14301
 sys/src/cmd/wikifs/util.c - 664 sys sys 1018211093 1807
 sys/src/cmd/wikifs/wdir.c - 664 sys sys 1018211094 876
 sys/src/cmd/wikifs/wiki.h - 664 sys sys 1018323492 1891
 sys/src/cmd/wikifs/wiki2html.c - 664 sys sys 1018211094 815
 sys/src/cmd/wikifs/wiki2text.c - 664 sys sys 1018211094 779
-sys/src/cmd/winwatch.c - 664 sys sys 1112362775 4614
+sys/src/cmd/winwatch.c - 664 sys sys 1113252107 4853
 sys/src/cmd/xd.c - 664 sys sys 944961355 5735
 sys/src/cmd/yacc.c - 664 sys sys 984717754 57876
 sys/src/fs - 20000000775 sys sys 1015110109 0
@@ -12480,3 +12477,6 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+386/bin/winwatch - 775 sys sys 1113275271 153740
+acme/bin/386/win - 775 sys sys 1113275271 178845
+sys/src/cmd/wikifs/wiki.h - 664 sys sys 1113275619 1897

+ 10 - 13
dist/replica/plan9.db

@@ -502,7 +502,7 @@
 386/bin/webfs - 775 sys sys 1109132011 349163
 386/bin/webfsget - 775 sys sys 1104122092 39143
 386/bin/wikifs - 775 sys sys 1108354569 201169
-386/bin/winwatch - 775 sys sys 1112414831 143405
+386/bin/winwatch - 775 sys sys 1113275271 153740
 386/bin/xd - 775 sys sys 1104122093 64039
 386/bin/xmr - 775 sys sys 1104122093 40157
 386/bin/xms - 775 sys sys 1104122093 40735
@@ -627,7 +627,7 @@ acme/bin/386/acd - 775 sys sys 1032232412 137068
 acme/bin/386/adict - 775 sys sys 1015011247 99806
 acme/bin/386/mkwnew - 775 sys sys 1104122115 38959
 acme/bin/386/spout - 775 sys sys 1104122116 61617
-acme/bin/386/win - 775 sys sys 1108354570 178845
+acme/bin/386/win - 775 sys sys 1113275271 178845
 acme/bin/Battery - 775 sys sys 1017457907 451
 acme/bin/Isspam - 775 sys sys 1063951165 235
 acme/bin/Perl - 775 sys sys 1015011260 230
@@ -683,7 +683,7 @@ acme/bin/source/win/main.c - 664 sys sys 1104430370 12508
 acme/bin/source/win/mkfile - 664 sys sys 1046654934 309
 acme/bin/source/win/pipe.c - 664 sys sys 1104430371 2802
 acme/bin/source/win/util.c - 664 sys sys 1017679346 1169
-acme/bin/source/win/win.c - 664 sys sys 1015011255 4240
+acme/bin/source/win/win.c - 664 sys sys 1113252156 4239
 acme/bin/unind - 755 sys sys 1015011256 27
 acme/bin/wnew - 775 sys sys 1046184422 84
 acme/mail - 20000000775 sys sys 1015011265 0
@@ -3598,7 +3598,7 @@ sys/lib/dist/pc/glenda/lib/profile - 664 sys sys 1032883600 327
 sys/lib/dist/pc/glenda/tmp - 20000000775 sys sys 1018469723 0
 sys/lib/dist/pc/inst - 20000000775 sys sys 1018721419 0
 sys/lib/dist/pc/inst/bootfloppy - 775 sys sys 1112361036 903
-sys/lib/dist/pc/inst/bootplan9 - 775 sys sys 1019534696 1584
+sys/lib/dist/pc/inst/bootplan9 - 775 sys sys 1113252317 1574
 sys/lib/dist/pc/inst/bootsetup - 775 sys sys 1112361037 3688
 sys/lib/dist/pc/inst/bootwin9x - 775 sys sys 1112361037 2527
 sys/lib/dist/pc/inst/bootwinnt - 775 sys sys 1019240165 1041
@@ -4822,7 +4822,7 @@ sys/man/1/vnc - 664 sys sys 1045501432 4186
 sys/man/1/vt - 664 sys sys 1018386774 2210
 sys/man/1/wc - 664 sys sys 944959675 908
 sys/man/1/who - 664 sys sys 944959674 332
-sys/man/1/winwatch - 664 sys sys 1112362775 470
+sys/man/1/winwatch - 664 sys sys 1113252108 723
 sys/man/1/xd - 664 sys sys 944959674 1517
 sys/man/1/yacc - 664 sys sys 944959676 3273
 sys/man/1/yesterday - 664 sys sys 1070288431 2348
@@ -10614,10 +10614,7 @@ sys/src/cmd/unix/drawterm/authaux.c - 664 sys sys 954098602 11934
 sys/src/cmd/unix/drawterm/authdial.c - 664 sys sys 954098603 145
 sys/src/cmd/unix/drawterm/authlocal.h - 664 sys sys 954098603 162
 sys/src/cmd/unix/drawterm/bin - 20000000775 sys sys 959090509 0
-sys/src/cmd/unix/drawterm/bin/drawterm-freebsd.gz - 775 sys sys 1022046828 259893
-sys/src/cmd/unix/drawterm/bin/drawterm-linux - 775 sys sys 1020313487 875368
-sys/src/cmd/unix/drawterm/bin/drawterm-macosx.gz - 775 sys sys 1022046829 330048
-sys/src/cmd/unix/drawterm/bin/drawterm-win.exe - 775 sys sys 1040673060 307270
+sys/src/cmd/unix/drawterm/bin/README - 664 sys sys 1113252460 106
 sys/src/cmd/unix/drawterm/canlock-power-gcc.c - 664 sys sys 1019839861 985
 sys/src/cmd/unix/drawterm/canlock-x86-gcc.c - 664 sys sys 1020313486 308
 sys/src/cmd/unix/drawterm/canlock.c - 644 sys sys 954098604 92
@@ -11184,16 +11181,16 @@ sys/src/cmd/wikifs/io.c - 664 sys sys 1084469671 11572
 sys/src/cmd/wikifs/lookup.c - 664 sys sys 1018211093 182
 sys/src/cmd/wikifs/map.c - 664 sys sys 1018211093 109
 sys/src/cmd/wikifs/mkfile - 664 sys sys 1045503591 468
-sys/src/cmd/wikifs/parse.c - 664 sys sys 1079969446 4989
+sys/src/cmd/wikifs/parse.c - 664 sys sys 1113252120 5245
 sys/src/cmd/wikifs/parsehist.c - 664 sys sys 1018211093 1906
 sys/src/cmd/wikifs/testwrite.c - 664 sys sys 1018211093 818
-sys/src/cmd/wikifs/tohtml.c - 664 sys sys 1079380577 13998
+sys/src/cmd/wikifs/tohtml.c - 664 sys sys 1113252121 14301
 sys/src/cmd/wikifs/util.c - 664 sys sys 1018211093 1807
 sys/src/cmd/wikifs/wdir.c - 664 sys sys 1018211094 876
-sys/src/cmd/wikifs/wiki.h - 664 sys sys 1018323492 1891
+sys/src/cmd/wikifs/wiki.h - 664 sys sys 1113275619 1897
 sys/src/cmd/wikifs/wiki2html.c - 664 sys sys 1018211094 815
 sys/src/cmd/wikifs/wiki2text.c - 664 sys sys 1018211094 779
-sys/src/cmd/winwatch.c - 664 sys sys 1112362775 4614
+sys/src/cmd/winwatch.c - 664 sys sys 1113252107 4853
 sys/src/cmd/xd.c - 664 sys sys 944961355 5735
 sys/src/cmd/yacc.c - 664 sys sys 984717754 57876
 sys/src/fs - 20000000775 sys sys 1015110109 0

+ 14 - 0
dist/replica/plan9.log

@@ -14114,3 +14114,17 @@
 1113017510 0 c 386/bin/file - 775 sys sys 1113016150 112820
 1113053517 0 c acme/mail/src/mesg.c - 664 sys sys 1113051860 26298
 1113103866 0 c acme/mail/386/Mail - 775 sys sys 1113102525 179147
+1113253296 0 c acme/bin/source/win/win.c - 664 sys sys 1113252156 4239
+1113253296 1 c sys/lib/dist/pc/inst/bootplan9 - 775 sys sys 1113252317 1574
+1113253296 2 c sys/man/1/winwatch - 664 sys sys 1113252108 723
+1113253296 3 a sys/src/cmd/unix/drawterm/bin/README - 664 sys sys 1113252460 106
+1113253296 4 c sys/src/cmd/wikifs/parse.c - 664 sys sys 1113252120 5245
+1113253296 5 c sys/src/cmd/wikifs/tohtml.c - 664 sys sys 1113252121 14301
+1113253296 6 c sys/src/cmd/winwatch.c - 664 sys sys 1113252107 4853
+1113253296 7 d sys/src/cmd/unix/drawterm/bin/drawterm-win.exe - 775 sys sys 1040673060 0
+1113253296 8 d sys/src/cmd/unix/drawterm/bin/drawterm-macosx.gz - 775 sys sys 1022046829 0
+1113253296 9 d sys/src/cmd/unix/drawterm/bin/drawterm-linux - 775 sys sys 1020313487 0
+1113253296 10 d sys/src/cmd/unix/drawterm/bin/drawterm-freebsd.gz - 775 sys sys 1022046828 0
+1113276701 0 c 386/bin/winwatch - 775 sys sys 1113275271 153740
+1113276701 1 c acme/bin/386/win - 775 sys sys 1113275271 178845
+1113276701 2 c sys/src/cmd/wikifs/wiki.h - 664 sys sys 1113275619 1897

+ 13 - 12
sys/lib/dist/pc/inst/bootplan9

@@ -22,18 +22,19 @@ if(test $p9offset -gt 4128695) {	# 65536 * 63 - 10
 	echo 'You can install the Plan 9 master boot record, which can load'
 	echo 'partitions far into the disk.'
 	echo 
-	echo 'If you use the Windows NT/2000/XP master boot record'
-	echo 'or a master boot record from a Unix clone (e.g., LILO or'
-	echo 'FreeBSD bootmgr, it is probably safe to continue using'
-	echo 'that boot record rather than install the Plan 9 boot record.'
-	echo
-	prompt 'Install the Plan 9 master boot record' y n 
-	switch($rd) {
-	case n
-		;
-	case y
-		disk/mbr -m /386/mbr /dev/$disk/data
-	}
+}
+
+echo 'If you use the Windows NT/2000/XP master boot record'
+echo 'or a master boot record from a Unix clone (e.g., LILO or'
+echo 'FreeBSD bootmgr), it is probably safe to continue using'
+echo 'that boot record rather than install the Plan 9 boot record.'
+echo
+prompt 'Install the Plan 9 master boot record' y n 
+switch($rd) {
+case n
+	;
+case y
+	disk/mbr -m /386/mbr /dev/$disk/data
 }
 
 log Setting Plan 9 partition active.

+ 19 - 1
sys/man/1/winwatch

@@ -4,6 +4,9 @@ winwatch \- monitor rio windows
 .SH SYNOPSIS
 .B winwatch
 [
+.B -e
+.I exclude
+] [
 .B -f
 .I font
 ]
@@ -19,6 +22,20 @@ or
 DEL
 quits
 .IR winwatch .
+.PP
+If the
+.B -e
+flag
+is given,
+windows matching the regular expression
+.I exclude
+are not shown.
+.SH EXAMPLE
+Excluding winwatch, stats and faces from being showed.
+.IP
+.EX
+% winwatch -e '^(winwatch|stats|faces)'
+.EE
 .SH FILES
 .B /dev/wsys/*/label
 .SH SOURCE
@@ -26,4 +43,5 @@ quits
 .SH SEE ALSO
 .IR rio (1),
 .IR window (1),
-.IR rio (4).
+.IR rio (4),
+.IR regexp(6).

+ 4 - 0
sys/src/cmd/unix/drawterm/bin/README

@@ -0,0 +1,4 @@
+Please see Andrey Mirtchovski's page for drawterm binaries.
+
+http://pages.cpsc.ucalgary.ca/~mirtchov/p9/
+

BIN
sys/src/cmd/unix/drawterm/bin/drawterm-freebsd.gz


BIN
sys/src/cmd/unix/drawterm/bin/drawterm-linux


BIN
sys/src/cmd/unix/drawterm/bin/drawterm-macosx.gz


BIN
sys/src/cmd/unix/drawterm/bin/drawterm-win.exe


+ 18 - 1
sys/src/cmd/wikifs/parse.c

@@ -227,7 +227,7 @@ static int isheading(char *p) {
 Wpage*
 Brdpage(char *(*rdline)(void*,int), void *b)
 {
-	char *p;
+	char *p, *c;
 	int waspara;
 	Wpage *w, **pw;
 
@@ -257,6 +257,20 @@ Brdpage(char *(*rdline)(void*,int), void *b)
 			*pw = mkwtxt(Wpre, estrdup(p[1]==' '?p+2:p+1));
 			pw = &(*pw)->next;
 			break;
+		case '-':
+			for(c = p; *c != '\0'; c++) {
+				if(*c != '-') {
+					c = p;
+					break;
+				}
+			}
+
+			if( (c-p) > 4) {
+				*pw = mkwtxt(Whr, nil);
+				pw = &(*pw)->next;
+				break;
+			}
+			/* else fall thru */
 		default:
 			if(isheading(p)){
 				*pw = mkwtxt(Wheading, estrdup(p));
@@ -302,6 +316,9 @@ printpage(Wpage *w)
 		case Wplain:
 			print("plain '%s'\n", w->text);
 			break;
+		case Whr:
+			print("hr\n");
+			break;
 		case Wpre:
 			print("pre '%s'\n", w->text);
 			break;

+ 14 - 2
sys/src/cmd/wikifs/tohtml.c

@@ -151,6 +151,8 @@ mkurl(char *s, int ty)
 	char *p, *q;
 
 	if(strncmp(s, "http:", 5)==0
+	|| strncmp(s, "https:", 6)==0
+	|| strncmp(s, "#", 1)==0
 	|| strncmp(s, "ftp:", 4)==0
 	|| strncmp(s, "mailto:", 7)==0
 	|| strncmp(s, "telnet:", 7)==0
@@ -189,11 +191,13 @@ pagehtml(String *s, Wpage *wtxt, int ty)
 	for(w=wtxt; w; w=w->next){
 		switch(w->type){
 		case Wheading:
+			/*
 			if(!inpara){
 				inpara = 1;
 				s = s_append(s, "\n<p>\n");
-			}
-			s = s_appendlist(s, "<b>", w->text, "</b>\n<p>\n", nil);
+			}			
+			*/
+			s = s_appendlist(s, "<br />\n<a name=\"",w->text,"\" /><h3>", w->text, "</h3>\n", nil);
 			break;
 
 		case Wpara:
@@ -265,6 +269,10 @@ pagehtml(String *s, Wpage *wtxt, int ty)
 			s = s_escappend(s, w->text, 1);
 			s = s_append(s, "\n");
 			break;
+		
+		case Whr:
+			s = s_append(s, "<hr />");
+			break;
 
 		case Wplain:
 			if(inpre){
@@ -685,6 +693,10 @@ pagetext(String *s, Wpage *page, int dosharp)
 			s_endline(s, dosharp);
 			s = s_appendlist(s, "! ", w->text, "\n", sharp, nil);
 			break;
+		case Whr:
+			s_endline(s, dosharp);
+			s = s_appendlist(s, "------------------------------------------------------ \n", sharp, nil);
+			break;
 
 		case Wplain:
 			if(inpara)

+ 1 - 0
sys/src/cmd/wikifs/wiki.h

@@ -18,6 +18,7 @@ enum {
 	Wman,
 	Wplain,
 	Wpre,
+	Whr,
 	Nwtxt,
 };
 

+ 15 - 1
sys/src/cmd/winwatch.c

@@ -2,6 +2,7 @@
 #include <libc.h>
 #include <draw.h>
 #include <event.h>
+#include <regexp.h>
 
 typedef struct Win Win;
 struct Win {
@@ -11,6 +12,9 @@ struct Win {
 	Rectangle r;
 };
 
+
+
+Reprog  *exclude  = nil;
 Win *win;
 int nwin;
 int mwin;
@@ -60,6 +64,7 @@ estrdup(char *s)
 	return t;
 }
 
+
 void
 refreshwin(void)
 {
@@ -83,6 +88,9 @@ refreshwin(void)
 			if(m < 0)
 				continue;
 			label[m] = '\0';
+			if(exclude != nil && regexec(exclude,label,nil,0))
+				continue;
+
 			if(nw < nwin && win[nw].n == n && strcmp(win[nw].label, label)==0){
 				nw++;
 				continue;
@@ -92,6 +100,7 @@ refreshwin(void)
 				free(win[nw].label);
 				win[nw].label = nil;
 			}
+			
 			if(nw >= mwin){
 				mwin += 8;
 				win = erealloc(win, mwin*sizeof(win[0]));
@@ -227,7 +236,7 @@ click(Mouse m)
 void
 usage(void)
 {
-	fprint(2, "usage: winwatch [-f font]\n");
+	fprint(2, "usage: winwatch [-e exclude] [-f font]\n");
 	exits("usage");
 }
 
@@ -243,6 +252,11 @@ main(int argc, char **argv)
 	case 'f':
 		fontname = EARGF(usage());
 		break;
+	case 'e':
+		exclude = regcomp(EARGF(usage()));
+		if(exclude == nil)
+			sysfatal("Bad regexp");
+		break;
 	default:
 		usage();
 	}ARGEND