1 #ifndef FORECAST_H 2 #define FORECAST_H 3 4 /* functions to manage the 'current forecast' */ 5 struct forecast *current_forecast_get(void); 6 void current_forecast_next(int dir); 7 8 struct forecast { 9 char ID[4]; /* Forecast type ("AVN", "MRF", etc) */ 10 char *station; /* station name */ 11 time_t last_update; /* last updated time */ 12 signed char month; /* 0, 1 - 12 */ 13 signed char day; /* -1, 1 - 31 */ 14 short year; /* -1, number */ 15 signed char wday; /* -1, 0-6 */ 16 signed char hour; /* -1, 0 - 23 (local) */ 17 short low; /* 999, -210 - 390 (degrees F) */ 18 short high; /* 999, -210 - 390 (degrees F) */ 19 short temp; /* 999, -210 - 390 (degrees F) */ 20 short dewpt; /* 999, -210 - 390 (degrees F) */ 21 signed char rh; /* -1, 0 - 100 (%) */ 22 short winddir; /* -1, 0 - 16 (direction) */ 23 short windspeed; /* -1, 0 - MAX */ 24 short heatindex; /* 999, -99 - 199 (degrees F) */ 25 short windchill; /* 999, -99 - 199 (degrees F) */ 26 short precipamt; /* -1, 0 - 7 (amount code) */ 27 short snowamt; /* -1, 0 - 8 (amount code) */ 28 signed char sky; /* -1, 0-4 (condition) */ 29 signed char vis; /* 7, 1-7 (status code) */ 30 signed char obs; /* 0, 0-3 (type) */ 31 signed char pcp_total; /* 0, 0-100 (percent chance) */ 32 signed char frz; /* 0, 0-100 (percent chance) */ 33 signed char snow; /* 0, 0-100 (percent chance) */ 34 signed char rain; /* 0, 0-100 (percent chance) */ 35 signed char tstorm; /* 0, 0-100 (percent chance) */ 36 signed char svtstorm; /* 0, 0-100 (percent chance) */ 37 double moon; /* NAN, -1 - 1 (percent and wax/wane) */ 38 time_t time; /* -1, time_t value */ 39 }; 40 41 void add_forecast(struct forecast *f, char *ID, char *station); 42 time_t forecast_time(struct forecast *f); 43 time_t parse_time_string(char *s); 44 time_t find_next_time(char *file, char *pat, int minutes); 45 void reset_forecast(struct forecast *f); 46 47 #endif 48