15 |
|
#include <string.h> |
16 |
|
#include <math.h> |
17 |
|
#include <ctype.h> |
18 |
< |
|
18 |
> |
#include "sun.h" |
19 |
|
#include "color.h" |
20 |
|
|
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 |
– |
|
21 |
|
#ifndef PI |
22 |
|
#define PI 3.14159265358979323846 |
23 |
|
#endif |
32 |
|
#define overcast ((skytype==S_OVER)|(skytype==S_UNIF)) |
33 |
|
|
34 |
|
double normsc(); |
41 |
– |
/* sun calculation constants */ |
42 |
– |
extern double s_latitude; |
43 |
– |
extern double s_longitude; |
44 |
– |
extern double s_meridian; |
35 |
|
|
36 |
|
#undef toupper |
37 |
|
#define toupper(c) ((c) & ~0x20) /* ASCII trick to convert case */ |
86 |
|
void userror(char *msg); |
87 |
|
double normsc(void); |
88 |
|
int cvthour(char *hs); |
89 |
< |
void printhead(register int ac, register char **av); |
89 |
> |
void printhead(int ac, char **av); |
90 |
|
|
91 |
|
|
92 |
|
int |
93 |
< |
main(argc, argv) |
94 |
< |
int argc; |
95 |
< |
char *argv[]; |
93 |
> |
main( |
94 |
> |
int argc, |
95 |
> |
char *argv[] |
96 |
> |
) |
97 |
|
{ |
98 |
|
int got_meridian = 0; |
99 |
|
int i; |
352 |
|
/* intermediate sky approx. */ |
353 |
|
{3.5556, -2.7152, -1.3081, 1.0660, 0.60227}, |
354 |
|
}; |
355 |
< |
register double *nf; |
355 |
> |
double *nf; |
356 |
|
double x, nsc; |
357 |
< |
register int i; |
357 |
> |
int i; |
358 |
|
/* polynomial approximation */ |
359 |
|
nf = nfc[skytype==S_INTER]; |
360 |
|
x = (altitude - PI/4.0)/(PI/4.0); |
371 |
|
char *hs |
372 |
|
) |
373 |
|
{ |
374 |
< |
register char *cp = hs; |
375 |
< |
register int i, j; |
374 |
> |
char *cp = hs; |
375 |
> |
int i, j; |
376 |
|
|
377 |
|
if ( (tsolar = *cp == '+') ) cp++; /* solar time? */ |
378 |
|
while (isdigit(*cp)) cp++; |
411 |
|
|
412 |
|
void |
413 |
|
printhead( /* print command header */ |
414 |
< |
register int ac, |
415 |
< |
register char **av |
414 |
> |
int ac, |
415 |
> |
char **av |
416 |
|
) |
417 |
|
{ |
418 |
|
putchar('#'); |