-
Notifications
You must be signed in to change notification settings - Fork 0
/
wtl.h
50 lines (31 loc) · 890 Bytes
/
wtl.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
typedef struct {
int hour; int minute;
} wtl_time;
typedef struct {
wtl_time* time;
wtl_time* span;
char *config_file;
} wtl_args;
typedef struct {
wtl_time *sun, *mon, *tue, *wed, *thu, *fri, *sat;
} workday_hours;
typedef struct {
workday_hours* hours;
wtl_time* start_time;
int wday;
} wtl_config;
wtl_config* read_config(char*);
void write_config(char*, wtl_config*);
void print_usage(void);
char* default_cfg_file(void);
wtl_time* hours_for(workday_hours*, time_t);
int read_kv(const char*, char**, char**);
wtl_args* parse_args(int argc, char** argv);
wtl_time* parse_ftime(const char*);
char* time_to_string(wtl_time*);
wtl_time* add_time(const wtl_time*, int, int);
char* str_time(const wtl_time*);
char* strsub(const char*, int, int);
int valid_time_format(const char*);
int strpos(const char*, const char);
void log_hours(const workday_hours*);