ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/meta/mtext.c
(Generate patch)

Comparing ray/src/meta/mtext.c (file contents):
Revision 1.5 by schorsch, Fri Aug 1 14:14:24 2003 UTC vs.
Revision 1.6 by schorsch, Sat Nov 15 02:13:37 2003 UTC

# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12   #include <string.h>
13  
14   #include  "meta.h"
15 + #include  "plot.h"
16  
17   #define  MAXLINE  1024
18  
# Line 33 | Line 34 | static int  cwidth = CWIDTH,
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      
# Line 109 | Line 114 | return(0);
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;
# Line 132 | Line 135 | FILE  *fp;
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')
# Line 156 | Line 159 | FILE  *fp;
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;
# Line 194 | Line 195 | int  maxlen;
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;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines