| 12 |
|
#include <string.h> |
| 13 |
|
|
| 14 |
|
#include "meta.h" |
| 15 |
+ |
#include "plot.h" |
| 16 |
|
|
| 17 |
|
#define MAXLINE 1024 |
| 18 |
|
|
| 34 |
|
|
| 35 |
|
char *progname; |
| 36 |
|
|
| 37 |
+ |
static void execute(FILE *fp); |
| 38 |
+ |
static void sectout(char **sect, int nlines, int maxlen); |
| 39 |
+ |
static void plotstr(int lino, char *s); |
| 40 |
|
|
| 41 |
|
|
| 38 |
– |
main(argc, argv) |
| 42 |
|
|
| 43 |
< |
int argc; |
| 44 |
< |
char **argv; |
| 45 |
< |
|
| 43 |
> |
int |
| 44 |
> |
main( |
| 45 |
> |
int argc, |
| 46 |
> |
char **argv |
| 47 |
> |
) |
| 48 |
|
{ |
| 49 |
|
FILE *fp; |
| 50 |
|
|
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
|
| 117 |
< |
|
| 118 |
< |
|
| 119 |
< |
execute(fp) /* execute a file */ |
| 120 |
< |
|
| 116 |
< |
FILE *fp; |
| 117 |
< |
|
| 117 |
> |
void |
| 118 |
> |
execute( /* execute a file */ |
| 119 |
> |
FILE *fp |
| 120 |
> |
) |
| 121 |
|
{ |
| 122 |
|
static char linbuf[MAXLINE]; |
| 123 |
|
int nlines; |
| 124 |
|
char **section; |
| 125 |
|
int maxlen; |
| 126 |
|
int done; |
| 127 |
< |
int i, j, k; |
| 127 |
> |
int j, k; |
| 128 |
|
|
| 129 |
|
nlines = XYSIZE/cheight; |
| 130 |
|
done = FALSE; |
| 135 |
|
while (!done) { |
| 136 |
|
maxlen = 0; |
| 137 |
|
for (j = 0; j < nlines; j++) { |
| 138 |
< |
if (done = fgets(linbuf, MAXLINE, fp) == NULL) |
| 138 |
> |
if ((done = fgets(linbuf, MAXLINE, fp) == NULL)) |
| 139 |
|
break; |
| 140 |
|
k = strlen(linbuf); |
| 141 |
|
if (linbuf[k-1] == '\n') |
| 159 |
|
} |
| 160 |
|
|
| 161 |
|
|
| 162 |
< |
|
| 163 |
< |
|
| 164 |
< |
sectout(sect, nlines, maxlen) /* write out a section */ |
| 165 |
< |
|
| 166 |
< |
char **sect; |
| 167 |
< |
int nlines; |
| 165 |
< |
int maxlen; |
| 166 |
< |
|
| 162 |
> |
void |
| 163 |
> |
sectout( /* write out a section */ |
| 164 |
> |
char **sect, |
| 165 |
> |
int nlines, |
| 166 |
> |
int maxlen |
| 167 |
> |
) |
| 168 |
|
{ |
| 169 |
|
int linwidt; |
| 170 |
|
char *slin; |
| 195 |
|
} |
| 196 |
|
|
| 197 |
|
|
| 198 |
< |
|
| 199 |
< |
plotstr(lino, s) /* plot string on line lino */ |
| 200 |
< |
|
| 201 |
< |
int lino; |
| 202 |
< |
char *s; |
| 202 |
< |
|
| 198 |
> |
void |
| 199 |
> |
plotstr( /* plot string on line lino */ |
| 200 |
> |
int lino, |
| 201 |
> |
char *s |
| 202 |
> |
) |
| 203 |
|
{ |
| 204 |
|
int a0; |
| 205 |
|
register int bottom, right; |