diff options
author | Erich Eckner <git@eckner.net> | 2020-02-07 14:42:40 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-02-07 14:42:40 +0100 |
commit | 4f52dda6e8795ff98ee6cb579f754219f66f41be (patch) | |
tree | 0e028501f4df77fcdd312dd0ae93d1ba16302de9 /input_gadgets.h | |
parent | 1f40d334b2c39feb6dcc02ae31ae1a74fc4bc322 (diff) | |
download | anzeige-4f52dda6e8795ff98ee6cb579f754219f66f41be.tar.xz |
fully threaded, now
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 |