Created
January 20, 2019 01:01
-
-
Save rbtylee/c2cdc917120eb5c27ca9cafa7174542d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef WEATHER_H | |
#define WEATHER_H | |
// Stuff I won't need latter | |
#include <Eina.h> | |
#define ENABLE_DEBUG 0 | |
#define DBG(f, ...) if (ENABLE_DEBUG) \ | |
printf("[forecasts] "f "\n", __VA_ARGS__) | |
#define E_NEW(s, n) (s *)calloc(n, sizeof(s)) | |
#define E_FREE(p) do { free(p); p = NULL; } while (0) | |
#define MBS_TO_KM_HR 3.6 | |
// End stuff | |
typedef struct _Weather Weather; | |
typedef struct _Weather_Data Weather_Data; | |
struct _Weather | |
{ | |
const char *location; | |
const char *city; | |
const char *country; | |
//const char *geo_id; | |
const char *geobase; | |
int geobaseid; | |
int altitude; | |
double latitude; | |
double longitude; | |
struct tm sunrise; | |
struct tm sunset; | |
Eina_List *datas; | |
}; | |
struct _Weather_Data | |
{ | |
struct tm time_start; | |
struct tm time_end; | |
int time_period; | |
const char *state; | |
const char *state_name; | |
struct | |
{ | |
double value; | |
double value_min; | |
double value_max; | |
const char *unit; | |
} temperature; | |
struct | |
{ | |
const char *type; | |
double value; | |
} precipitation; | |
struct | |
{ | |
const char *name; | |
const char *direction_name; | |
const char *direction; | |
double direction_value; | |
double speed; | |
const char *units; | |
} wind; | |
struct | |
{ | |
const char *name; | |
int value; | |
const char *unit; | |
} cloud; | |
struct | |
{ | |
int value; | |
const char *unit; | |
} humidity; | |
struct | |
{ | |
double value; | |
const char *unit; | |
} pressure; | |
Eina_Bool updated; | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment