summaryrefslogtreecommitdiff
path: root/input_gadgets.h
blob: 6f220569609b2f281e8b0ed8b79299215bbd4831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#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;
} MemoryStruct;

typedef struct {
  int is_update;
  int category; // 0: Met; 1: Health
  char *event;
  char *headline;
  int severity;
  time_t onset, expires;
} warning_t;

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