]> mj.ucw.cz Git - osdd.git/blob - osd.h
Merge branch 'master' of ssh://git.ucw.cz/home/mj/GIT/osdd
[osdd.git] / osd.h
1 /*
2  *      On-screen Display Daemon -- Utility Functions
3  *
4  *      (c) 2010 Martin Mares <mj@ucw.cz>
5  */
6
7 #include <inttypes.h>
8
9 #define NONRET __attribute__((noreturn))
10 #define FORMAT_CHECK(func,i,j) __attribute__((format(func,i,j)))
11
12 typedef uint64_t timestamp_t;
13
14 /* util.c */
15
16 void NONRET FORMAT_CHECK(printf,1,2) die(char *fmt, ...);
17
18 #ifdef DEBUG
19 #define DBG(f...) printf(f)
20 #else
21 #define DBG(f...) do { } while(0)
22 #endif
23
24 void *xmalloc(int size);
25
26 timestamp_t get_current_time(void);
27
28 /* client.c */
29
30 void osd_init(void);
31
32 struct osd_msg;
33 struct osd_msg *osd_new_msg(void);
34 void osd_add_line(struct osd_msg *msg, char *key, char *val);
35 void osd_send(struct osd_msg *msg);
36
37 void osd_fork(void);
38 void osd_wait(int seconds);