1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* gensky.c - program to generate sky functions. |
6 |
|
* Our zenith is along the Z-axis, the X-axis |
12 |
|
|
13 |
|
#include <stdio.h> |
14 |
|
|
15 |
+ |
#include <stdlib.h> |
16 |
+ |
|
17 |
+ |
#include <string.h> |
18 |
+ |
|
19 |
|
#include <math.h> |
20 |
|
|
21 |
|
#include <ctype.h> |
22 |
|
|
23 |
|
#include "color.h" |
24 |
|
|
24 |
– |
extern char *strcpy(), *strcat(), *malloc(); |
25 |
|
extern double stadj(), sdec(), sazi(), salt(), tz2mer(); |
26 |
|
|
27 |
|
#ifndef PI |
35 |
|
#define S_UNIF 3 |
36 |
|
#define S_INTER 4 |
37 |
|
|
38 |
< |
#define overcast (skytype==S_OVER|skytype==S_UNIF) |
38 |
> |
#define overcast ((skytype==S_OVER)|(skytype==S_UNIF)) |
39 |
|
|
40 |
|
double normsc(); |
41 |
|
/* sun calculation constants */ |
362 |
|
register char *cp = hs; |
363 |
|
register int i, j; |
364 |
|
|
365 |
< |
if (tsolar = *cp == '+') cp++; /* solar time? */ |
365 |
> |
if ( (tsolar = *cp == '+') ) cp++; /* solar time? */ |
366 |
|
while (isdigit(*cp)) cp++; |
367 |
|
if (*cp == ':') |
368 |
|
hour = atoi(hs) + atoi(++cp)/60.0; |