45 lines
1013 B
C
45 lines
1013 B
C
|
|
|
|
struct node {
|
|
struct node *next;
|
|
int e;
|
|
};
|
|
|
|
struct Hashtable {
|
|
unsigned Tablesize;
|
|
struct node *Cells;
|
|
};
|
|
|
|
struct forecast_temp{
|
|
float min;
|
|
float max;
|
|
char desc[25];
|
|
char icon[8];
|
|
};
|
|
|
|
struct meteoforecast_data{
|
|
time_t datetime;
|
|
bool isValid;
|
|
struct forecast_temp previsions;
|
|
};
|
|
|
|
typedef void (*weather_data_callback)(struct meteoforecast_data *datas);
|
|
typedef void (*weather_data_start_callback)();
|
|
|
|
typedef struct {
|
|
unsigned int humidity;
|
|
float temperature;
|
|
float pressure;
|
|
unsigned long retreival_period;
|
|
weather_data_callback data_retreived_cb;
|
|
weather_data_start_callback data_retreived_cb_start;
|
|
} weather_data;
|
|
|
|
void printftemp(struct forecast_temp *tmp);
|
|
void printffd(struct meteoforecast_data *tmp);
|
|
|
|
void on_weather_data_retrieval(weather_data_callback data_retreived_cb);
|
|
void on_weather_data_retrieval_start(weather_data_callback data_retreived_cb);
|
|
void initialise_weather_data_retrieval(unsigned long retreival_period);
|
|
|