2024-10-25 21:38:47 +02:00

62 lines
1.4 KiB
C

#include "time.h"
struct node {
struct node *next;
int e;
};
struct Hashtable {
unsigned Tablesize;
struct node *Cells;
};
struct dailyforecast_prev{
float min;
float max;
char desc[25];
char icon[9];
};
struct forecast_prev{
float value;
char desc[25];
char icon[9];
};
struct meteodailyforecast_data{
time_t datetime;
bool isValid;
struct dailyforecast_prev previsions;
};
struct meteoforecast_data{
time_t datetime;
bool isValid;
struct forecast_prev previsions;
};
typedef void (*weather_data_callback)(struct meteodailyforecast_data *datas, struct meteoforecast_data *datasf);
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 printdftemp(struct dailyforecast_prev *tmp);
void printftemp(struct forecast_prev *tmp);
void printfdf(struct meteodailyforecast_data *tmp);
void dtToString(time_t, char *buffer);
void dtHToString(time_t, char *buffer);
void printff(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);