summaryrefslogtreecommitdiff
path: root/usr/src/ucbcmd/plot/plottoa.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/ucbcmd/plot/plottoa.c')
-rw-r--r--usr/src/ucbcmd/plot/plottoa.c103
1 files changed, 59 insertions, 44 deletions
diff --git a/usr/src/ucbcmd/plot/plottoa.c b/usr/src/ucbcmd/plot/plottoa.c
index 9f74001372..d66db8ca12 100644
--- a/usr/src/ucbcmd/plot/plottoa.c
+++ b/usr/src/ucbcmd/plot/plottoa.c
@@ -1,21 +1,18 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */
-
-
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
-/*
- * Copyright (c) 1983, 1984 1985, 1986, 1987, 1988, Sun Microsystems, Inc.
- * All Rights Reserved.
- */
-
+#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Convert the standard plot input into a readable form for debugging.
@@ -26,8 +23,25 @@
float deltx;
float delty;
-main(argc, argv)
-char **argv;
+static void arc(int, int, int, int, int, int);
+static void circle(int, int, int);
+static void closepl(void);
+static void cont(int, int);
+static void dot(int, int, int, int, char *);
+static void erase(void);
+static void fplt(FILE *);
+static int getsi(FILE *);
+static void getstr(char *, FILE *);
+static void label(char *);
+static void line(int, int, int, int);
+static void linemod(char *);
+static void move(int, int);
+static void openpl(void);
+static void point(int, int);
+static void space(int, int, int, int);
+
+int
+main(int argc, char **argv)
{
int std=1;
FILE *fin;
@@ -55,12 +69,12 @@ char **argv;
}
if (std)
fplt( stdin );
- exit(0);
+ return (0);
}
-fplt(fin)
-FILE *fin;
+static void
+fplt(FILE *fin)
{
int c;
char s[256];
@@ -131,7 +145,7 @@ FILE *fin;
dx = getsi(fin);
n = getsi(fin);
for(i=0; i<n; i++)pat[i] = getsi(fin);
- dot(xi,yi,dx,n,pat);
+ dot(xi, yi, dx, n, (char *)pat);
break;
}
}
@@ -139,8 +153,8 @@ FILE *fin;
}
/* get an integer stored in 2 ascii bytes. */
-getsi(fin)
-FILE *fin;
+static int
+getsi(FILE *fin)
{
short a, b;
if((b = getc(fin)) == EOF)
@@ -151,9 +165,8 @@ FILE *fin;
return(a|b);
}
-getstr(s,fin)
-char *s;
-FILE *fin;
+static void
+getstr(char *s, FILE *fin)
{
for( ; *s = getc(fin); s++)
if(*s == '\n')
@@ -163,78 +176,80 @@ FILE *fin;
/* Print out the arguments to plot routines. */
-space(x0,y0,x1,y1)
-int x0,y0,x1,y1;
+static void
+space(int x0, int y0, int x1, int y1)
{
printf( "s %d %d %d %d\n", x0, y0, x1, y1 );
}
-openpl()
+static void
+openpl(void)
{
}
-closepl()
+static void
+closepl(void)
{
}
-erase()
+static void
+erase(void)
{
printf( "e\n" );
}
-move(xi,yi)
-int xi,yi;
+static void
+move(int xi, int yi)
{
printf( "m %d %d\n", xi, yi );
}
-cont(xi,yi)
-int xi,yi;
+static void
+cont(int xi, int yi)
{
printf( "n %d %d\n", xi, yi );
}
-line(x0,y0,x1,y1)
-int x0,y0,x1,y1;
+static void
+line(int x0, int y0, int x1, int y1)
{
printf( "l %d %d %d %d\n", x0, y0, x1, y1 );
}
-point(xi,yi)
-int xi,yi;
+static void
+point(int xi, int yi)
{
printf( "p %d %d\n", xi, yi );
}
-label(s)
-char *s;
+static void
+label(char *s)
{
printf( "t%s\n\n", s );
}
-arc(xcent,ycent,xbeg,ybeg,xend,yend)
-int xcent,ycent,xbeg,ybeg,xend,yend;
+static void
+arc(int xcent, int ycent, int xbeg, int ybeg, int xend, int yend)
{
printf( "a %d %d %d %d %d %d\n", xcent, ycent, xbeg, ybeg, xend, yend );
}
-circle (xc,yc,r)
-int xc,yc,r;
+static void
+circle(int xc, int yc, int r)
{
printf( "c %d %d %d\n", xc, yc, r );
}
-linemod( line )
-char *line;
+static void
+linemod(char *line)
{
printf( "f%s\n\n", line );
}
/* don't know what this should do */
-dot(xi,yi,dx,n,pat)
-int xi,yi,dx,n;
-char *pat;
+static void
+dot(int xi, int yi, int dx, int n, char *pat)
{
printf("d %d %d %d %d %s\n\n", xi, yi, dx, n, pat);
}