Browse Source

Adding proof

Signed-off-by: Álvaro Jurado <elbingmiss@gmail.com>
Álvaro Jurado 6 years ago
parent
commit
7577ea6609

+ 1 - 0
sys/src/cmd/build.json

@@ -57,6 +57,7 @@
 			"plot/build.json",
 			"plumb/plumb.json",
 			"plumb/plumber.json",
+			"proof/build.json",
 			"rc/rc.json",
 			"rio/rio.json",
 			"sam/build.json",

+ 1 - 2
sys/src/cmd/proof/font.c

@@ -19,7 +19,6 @@ char lastload[NFONT][20];	/* last file name prefix loaded for this font */
 Font	*fonttab[NFONT][NSIZE];	/* pointers to fonts */
 int	fmap[NFONT];		/* what map to use with this font */
 
-static void	bufchar(Point, Subfont *, uint8_t *);
 static void	loadfont(int, int);
 static void	fontlookup(int, char *);
 static void	buildxheight(Biobuf*);
@@ -192,7 +191,7 @@ loadfontname(int n, char *s)
 	}
 	fontlookup(n, s);
 	for (i = 0; i < NSIZE; i++)
-		if (f = fonttab[n][i]){
+		if ((f = fonttab[n][i])){
 			if (f != g) {
 				freefont(f);
 				g = f;

+ 2 - 21
sys/src/cmd/proof/htroff.c

@@ -53,7 +53,6 @@ static void	eatline(void);
 static int	getn(void);
 static int	botpage(int);
 static void	getstr(char *);
-static void	getutf(char *);
 
 #define Do screen->r.min
 #define Dc screen->r.max
@@ -461,24 +460,6 @@ getstr(char *is)
 	*s = 0;
 }
 
-static void
-getutf(char *s)		/* get next utf char, as bytes */
-{
-	int c, i;
-
-	for (i=0;;) {
-		c = getc();
-		if (c < 0)
-			return;
-		s[i++] = c;
-
-		if (fullrune(s, i)) {
-			s[i] = 0;
-			return;
-		}
-	}
-}
-
 static void
 eatline(void)
 {
@@ -493,7 +474,7 @@ getn(void)
 {
 	int n, c, sign;
 
-	while (c = getc())
+	while ((c = getc()))
 		if (!isspace(c))
 			break;
 	if(c == '-'){
@@ -515,7 +496,7 @@ botpage(int np)	/* called at bottom of page np-1 == top of page np */
 	char *p;
 	int n;
 
-	while (p = getcmdstr()) {
+	while ((p = getcmdstr())) {
 		if (*p == '\0')
 			return 0;
 		if (*p == 'q')

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

@@ -14,7 +14,7 @@
 #include	<bio.h>
 #include	"proof.h"
 
-Rectangle rpage = { 0, 0, 850, 1150 };
+Rectangle rpage = { {0, 0}, {850, 1150} };
 char devname[64];
 double mag = DEFMAG;
 int dbg = 0;

+ 1 - 9
sys/src/cmd/proof/screen.c

@@ -16,7 +16,6 @@
 #include "proof.h"
 
 static	int	checkmouse(void);
-static	int	buttondown(void);
 static	char	*getmousestr(void);
 static	char	*getkbdstr(int);
 
@@ -132,14 +131,6 @@ getkbdstr(int c0)
 
 #define	butcvt(b)	(1 << ((b) - 1))
 
-static int buttondown(void)	/* report state of buttons, if any */
-{
-	if (!ecanmouse())	/* no event pending */
-		return 0;
-	mouse = emouse();	/* something, but it could be motion */
-	return mouse.buttons & 7;
-}
-
 int waitdown(void)	/* wait until some button is down */
 {
 	while (!(mouse.buttons & 7))
@@ -307,6 +298,7 @@ Cursor skull ={
 	  0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }
 };
 
+int
 confirm(int but)	/* ask for confirmation if menu item ends with '?' */
 {
 	int c;