]> mj.ucw.cz Git - osdd.git/blob - util.h
Python: Cleaned up the Python library
[osdd.git] / util.h
1 /*
2  *      On-screen Display Daemon -- Utility Functions
3  *
4  *      (c) 2010--2013 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 void *xrealloc(void *ptr, int size);
26
27 timestamp_t get_current_time(void);