-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsunrise_sunset.h
48 lines (41 loc) · 1.12 KB
/
sunrise_sunset.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __SUNRISE_SUNSET_H__
#define __SUNRISE_SUNSET_H__
#include <time.h>
const char day_length_keyword[] = "day_length";
const char *date_keywords[] = {
"sunrise" ,
"sunset" ,
"solar_noon" ,
"civil_twilight_begin" ,
"civil_twilight_end" ,
"nautical_twilight_begin" ,
"nautical_twilight_end" ,
"astronomical_twilight_begin",
"astronomical_twilight_end"
};
typedef enum keywords {
SUNRISE ,
SUNSET ,
SOLAR_NOON ,
CIVIL_TWILIGHT_BEGIN ,
CIVIL_TWILIGHT_END ,
NAUTICAL_TWILIGHT_BEGIN ,
NAUTICAL_TWILIGHT_END ,
ASTRONOMICAL_TWILIGHT_BEGIN,
ASTRONOMICAL_TWILIGHT_END
} keywords_e;
typedef struct sunrise_sunset {
int day_length;
time_t times[sizeof(date_keywords)/sizeof(date_keywords[0])];
} sunrise_sunset_t;
typedef struct ss_options {
double latitude;
double longitude;
char *date;
} sunrise_sunset_options_t;
extern int
sunrise_sunset_get(
sunrise_sunset_t *sun,
sunrise_sunset_options_t *options
);
#endif //__SUNRISE_SUNSET_H__