diff options
Diffstat (limited to 'input_gadgets.h')
-rw-r--r-- | input_gadgets.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/input_gadgets.h b/input_gadgets.h index b3e3644..6f22056 100644 --- a/input_gadgets.h +++ b/input_gadgets.h @@ -1,6 +1,11 @@ #ifndef INPUT_GADGETS_H #define INPUT_GADGETS_H +#include <pthread.h> +#include <stdint.h> + +#define MAX_TEXT_OUTPUT_LEN 256 + typedef struct { char *memory; size_t size; @@ -15,9 +20,17 @@ typedef struct { time_t onset, expires; } warning_t; -char *gadgets_retrieve_current_temperature(char *output, int max_len, double *temperature, double *humidity); -char *gadgets_retrieve_weather_forecast(char *output, int max_len); -char *gadgets_retrieve_weather_warnings(char *output, int max_len); -char *gadgets_retrieve_humidity(char *output, int max_len, double fh_temperature, double fh_humidity); +typedef struct { + pthread_t thread_id; + char *text_output; + double *double_output; + int output_ready, force_update, keep_running; +} t_input_thread; + +void *gadgets_watch_current_temperature(void *param); +void *gadgets_watch_weather_forecast(void *param); +void *gadgets_watch_weather_warnings(void *param); +void *gadgets_watch_humidity(void *param); +char *gadgets_calculate_humidity_level(char *output, int max_len, double outside_temperature, double outside_humidity, double inside_temperature, double inside_humidity); #endif // INPUT_GADGETS_H |