2 * On-screen Display Daemon -- Utility Functions
4 * (c) 2010 Martin Mares <mj@ucw.cz>
14 void __attribute__((noreturn)) __attribute__((format(printf,1,2)))
19 fputs("osdd: ", stderr);
20 vfprintf(stderr, fmt, args);
28 void *p = malloc(size);
30 die("Failed to allocate %d bytes of memory", size);
35 xrealloc(void *ptr, int size)
37 void *p = realloc(ptr, size);
39 die("Failed to re-allocate %d bytes of memory", size);
44 get_current_time(void)
47 gettimeofday(&tv, NULL);
48 return (timestamp_t) tv.tv_sec * 1000 + tv.tv_usec / 1000;