-
Notifications
You must be signed in to change notification settings - Fork 2
/
tts.h
78 lines (60 loc) · 1.44 KB
/
tts.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* TTS - track your time.
* Copyright (c) 2012-2014 Felicity Tarnell.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely. This software is provided 'as-is', without any express or implied
* warranty.
*/
#ifndef TTS_H
#define TTS_H
#include <signal.h>
#include "wide.h"
#include "tailq.h"
#include "entry.h"
extern char const *tts_version;
extern time_t laststatus;
/*
* Configuration options.
*/
extern int show_billable;
extern int delete_advance;
extern int mark_advance;
extern int bill_advance;
extern int bill_increment;
extern wchar_t *auto_nonbillable;
/*
* Global state.
*/
extern entry_t *curent;
extern volatile sig_atomic_t doexit;
extern int pagestart;
extern time_t itime;
int load(void);
int save(void);
/*
* Command history.
*/
#define NHIST 50
typedef struct histent {
wchar_t *he_text;
TTS_TAILQ_ENTRY(histent) he_entries;
} histent_t;
typedef TTS_TAILQ_HEAD(hentlist, histent) hentlist_t;
typedef struct history {
int hi_nents;
hentlist_t hi_ents;
} history_t;
history_t *hist_new(void);
void hist_add(history_t *, wchar_t const *);
extern history_t *searchhist;
extern history_t *prompthist;
#ifndef HAVE_WCSLCPY
size_t wcslcat(wchar_t *s1, const wchar_t *s2, size_t n);
#endif
#ifndef HAVE_WCSLCAT
size_t wcslcpy(wchar_t *s1, const wchar_t *s2, size_t n);
#endif
extern int time_format;
#endif /* !TTS_H */