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

Comparing ray/src/gen/gensky.c (file contents):
Revision 2.21 by schorsch, Sun Jul 27 22:12:02 2003 UTC vs.
Revision 2.22 by schorsch, Sun Nov 16 10:29:38 2003 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11   */
12  
13   #include  <stdio.h>
14
14   #include  <stdlib.h>
16
15   #include  <string.h>
18
16   #include  <math.h>
20
17   #include  <ctype.h>
18  
19   #include  "color.h"
20  
21 < extern double  stadj(), sdec(), sazi(), salt(), tz2mer();
21 > extern int jdate(int month, int day);
22 > extern double stadj(int  jd);
23 > extern double sdec(int  jd);
24 > extern double salt(double sd, double st);
25 > extern double sazi(double sd, double st);
26  
27   #ifndef  PI
28   #define  PI             3.14159265358979323846
# Line 51 | Line 51 | struct {
51          char    zname[8];       /* time zone name (all caps) */
52          float   zmer;           /* standard meridian */
53   } tzone[] = {
54 <        "YST", 135, "YDT", 120,
55 <        "PST", 120, "PDT", 105,
56 <        "MST", 105, "MDT", 90,
57 <        "CST", 90, "CDT", 75,
58 <        "EST", 75, "EDT", 60,
59 <        "AST", 60, "ADT", 45,
60 <        "NST", 52.5, "NDT", 37.5,
61 <        "GMT", 0, "BST", -15,
62 <        "CET", -15, "CEST", -30,
63 <        "EET", -30, "EEST", -45,
64 <        "AST", -45, "ADT", -60,
65 <        "GST", -60, "GDT", -75,
66 <        "IST", -82.5, "IDT", -97.5,
67 <        "JST", -135, "NDT", -150,
68 <        "NZST", -180, "NZDT", -195,
69 <        "", 0
54 >        {"YST", 135}, {"YDT", 120},
55 >        {"PST", 120}, {"PDT", 105},
56 >        {"MST", 105}, {"MDT", 90},
57 >        {"CST", 90}, {"CDT", 75},
58 >        {"EST", 75}, {"EDT", 60},
59 >        {"AST", 60}, {"ADT", 45},
60 >        {"NST", 52.5}, {"NDT", 37.5},
61 >        {"GMT", 0}, {"BST", -15},
62 >        {"CET", -15}, {"CEST", -30},
63 >        {"EET", -30}, {"EEST", -45},
64 >        {"AST", -45}, {"ADT", -60},
65 >        {"GST", -60}, {"GDT", -75},
66 >        {"IST", -82.5}, {"IDT", -97.5},
67 >        {"JST", -135}, {"NDT", -150},
68 >        {"NZST", -180}, {"NZDT", -195},
69 >        {"", 0}
70   };
71                                          /* required values */
72   int  month, day;                                /* date */
# Line 90 | Line 90 | int    u_solar = 0;                            /* -1=irradiance, 1=radiance */
90   char  *progname;
91   char  errmsg[128];
92  
93 + void computesky(void);
94 + void printsky(void);
95 + void printdefaults(void);
96 + void userror(char  *msg);
97 + double normsc(void);
98 + void cvthour(char  *hs);
99 + void printhead(register int  ac, register char  **av);
100  
101 +
102 + int
103   main(argc, argv)
104   int  argc;
105   char  *argv[];
# Line 180 | Line 189 | char  *argv[];
189   }
190  
191  
192 < computesky()                    /* compute sky parameters */
192 > void
193 > computesky(void)                        /* compute sky parameters */
194   {
195          double  normfactor;
196                                          /* compute solar direction */
# Line 265 | Line 275 | computesky()                   /* compute sky parameters */
275   }
276  
277  
278 < printsky()                      /* print out sky */
278 > void
279 > printsky(void)                  /* print out sky */
280   {
281          if (dosun) {
282                  printf("\nvoid light solar\n");
# Line 288 | Line 299 | printsky()                     /* print out sky */
299   }
300  
301  
302 < printdefaults()                 /* print default values */
302 > void
303 > printdefaults(void)                     /* print default values */
304   {
305          switch (skytype) {
306          case S_OVER:
# Line 321 | Line 333 | printdefaults()                        /* print default values */
333   }
334  
335  
336 < userror(msg)                    /* print usage error and quit */
337 < char  *msg;
336 > void
337 > userror(                        /* print usage error and quit */
338 >        char  *msg
339 > )
340   {
341          if (msg != NULL)
342                  fprintf(stderr, "%s: Use error - %s\n", progname, msg);
# Line 334 | Line 348 | char  *msg;
348  
349  
350   double
351 < normsc()                        /* compute normalization factor (E0*F2/L0) */
351 > normsc(void)                    /* compute normalization factor (E0*F2/L0) */
352   {
353          static double  nfc[2][5] = {
354                                  /* clear sky approx. */
# Line 356 | Line 370 | normsc()                       /* compute normalization factor (E0*F2/L0)
370   }
371  
372  
373 < cvthour(hs)                     /* convert hour string */
374 < char  *hs;
373 > void
374 > cvthour(                        /* convert hour string */
375 >        char  *hs
376 > )
377   {
378          register char  *cp = hs;
379          register int    i, j;
# Line 397 | Line 413 | char  *hs;
413   }
414  
415  
416 < printhead(ac, av)               /* print command header */
417 < register int  ac;
418 < register char  **av;
416 > void
417 > printhead(              /* print command header */
418 >        register int  ac,
419 >        register char  **av
420 > )
421   {
422          putchar('#');
423          while (ac--) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines