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

Comparing ray/src/rt/rvmain.c (file contents):
Revision 2.1 by greg, Sat Feb 22 02:07:29 2003 UTC vs.
Revision 2.4 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   *  rvmain.c - main for rview interactive viewer
6   */
7  
8 < /* ====================================================================
9 < * The Radiance Software License, Version 1.0
10 < *
11 < * Copyright (c) 1990 - 2002 The Regents of the University of California,
12 < * through Lawrence Berkeley National Laboratory.   All rights reserved.
13 < *
14 < * Redistribution and use in source and binary forms, with or without
15 < * modification, are permitted provided that the following conditions
16 < * are met:
17 < *
18 < * 1. Redistributions of source code must retain the above copyright
19 < *         notice, this list of conditions and the following disclaimer.
20 < *
21 < * 2. Redistributions in binary form must reproduce the above copyright
22 < *       notice, this list of conditions and the following disclaimer in
23 < *       the documentation and/or other materials provided with the
24 < *       distribution.
25 < *
26 < * 3. The end-user documentation included with the redistribution,
27 < *           if any, must include the following acknowledgment:
28 < *             "This product includes Radiance software
29 < *                 (http://radsite.lbl.gov/)
30 < *                 developed by the Lawrence Berkeley National Laboratory
31 < *               (http://www.lbl.gov/)."
32 < *       Alternately, this acknowledgment may appear in the software itself,
33 < *       if and wherever such third-party acknowledgments normally appear.
34 < *
35 < * 4. The names "Radiance," "Lawrence Berkeley National Laboratory"
36 < *       and "The Regents of the University of California" must
37 < *       not be used to endorse or promote products derived from this
38 < *       software without prior written permission. For written
39 < *       permission, please contact [email protected].
40 < *
41 < * 5. Products derived from this software may not be called "Radiance",
42 < *       nor may "Radiance" appear in their name, without prior written
43 < *       permission of Lawrence Berkeley National Laboratory.
44 < *
45 < * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
46 < * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
47 < * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
48 < * DISCLAIMED.   IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
49 < * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50 < * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
51 < * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
52 < * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
53 < * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
54 < * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
55 < * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56 < * SUCH DAMAGE.
57 < * ====================================================================
58 < *
59 < * This software consists of voluntary contributions made by many
60 < * individuals on behalf of Lawrence Berkeley National Laboratory.   For more
61 < * information on Lawrence Berkeley National Laboratory, please see
62 < * <http://www.lbl.gov/>.
63 < */
8 > #include "copyright.h"
9  
10 < #include  "ray.h"
10 > #include  <signal.h>
11  
12 + #include  "platform.h"
13 + #include  "ray.h"
14   #include  "source.h"
68
15   #include  "ambient.h"
16 <
16 > #include  "rpaint.h"
17   #include  "random.h"
72
18   #include  "paths.h"
74
75 #include  <signal.h>
76
19   #include  "view.h"
20  
21   char  *progname;                        /* argv[0] */
# Line 100 | Line 42 | extern int  vresolu;                   /* vertical resolution */
42   extern int  psample;                    /* pixel sample size */
43   extern double  maxdiff;                 /* max. sample difference */
44  
45 < void    onsig();
46 < void    sigdie();
47 < void    printdefaults();
45 > static void onsig(int  signo);
46 > static void sigdie(int  signo, char  *msg);
47 > static void printdefaults(void);
48  
49  
50   int
51 < main(argc, argv)
110 < int  argc;
111 < char  *argv[];
51 > main(int  argc, char  *argv[])
52   {
53   #define  check(ol,al)           if (argv[i][ol] || \
54                                  badarg(argc-i-1,argv+i+1,al)) \
# Line 262 | Line 202 | char  *argv[];
202          if (octname == NULL)
203                  error(USER, "missing octree argument");
204                                          /* set up output */
205 < #ifdef  MSDOS
266 <        setmode(fileno(stdout), O_BINARY);
267 < #endif
205 >        SET_FILE_BINARY(stdout);
206          readoct(octname, ~(IO_FILES|IO_INFO), &thescene, NULL);
207          nsceneobjs = nobjects;
208  
# Line 281 | Line 219 | char  *argv[];
219   badopt:
220          sprintf(errmsg, "command line error at '%s'", argv[i]);
221          error(USER, errmsg);
222 +        return 1; /* pro forma return */
223  
224   #undef  check
225   #undef  bool
# Line 288 | Line 227 | badopt:
227  
228  
229   void
230 < wputs(s)                                /* warning output function */
231 < char    *s;
230 > wputs(                          /* warning output function */
231 >        char    *s
232 > )
233   {
234          int  lasterrno = errno;
235          eputs(s);
# Line 298 | Line 238 | char   *s;
238  
239  
240   void
241 < eputs(s)                                /* put string to stderr */
242 < register char  *s;
241 > eputs(                          /* put string to stderr */
242 >        register char  *s
243 > )
244   {
245          static int  midline = 0;
246  
# Line 317 | Line 258 | register char  *s;
258   }
259  
260  
261 < void
262 < onsig(signo)                            /* fatal signal */
263 < int  signo;
261 > static void
262 > onsig(                          /* fatal signal */
263 >        int  signo
264 > )
265   {
266          static int  gotsig = 0;
267  
# Line 335 | Line 277 | int  signo;
277   }
278  
279  
280 < void
281 < sigdie(signo, msg)                      /* set fatal signal */
282 < int  signo;
283 < char  *msg;
280 > static void
281 > sigdie(                 /* set fatal signal */
282 >        int  signo,
283 >        char  *msg
284 > )
285   {
286          if (signal(signo, onsig) == SIG_IGN)
287                  signal(signo, SIG_IGN);
# Line 346 | Line 289 | char  *msg;
289   }
290  
291  
292 < void
293 < printdefaults()                 /* print default values to stdout */
292 > static void
293 > printdefaults(void)                     /* print default values to stdout */
294   {
352        register char  *cp;
353
295          printf(greyscale ? "-b+\t\t\t\t# greyscale on\n" :
296                          "-b-\t\t\t\t# greyscale off\n");
297          printf("-vt%c\t\t\t\t# view type %s\n", ourview.type,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines