2 * On-screen Display Daemon -- Utility Functions
4 * (c) 2010 Martin Mares <mj@ucw.cz>
15 void __attribute__((noreturn)) __attribute__((format(printf,1,2)))
20 fputs("osdd: ", stderr);
21 vfprintf(stderr, fmt, args);
29 void *p = malloc(size);
31 die("Failed to allocate %d bytes of memory", size);
36 xrealloc(void *ptr, int size)
38 void *p = realloc(ptr, size);
40 die("Failed to re-allocate %d bytes of memory", size);
45 get_current_time(void)
48 gettimeofday(&tv, NULL);
49 return (timestamp_t) tv.tv_sec * 1000 + tv.tv_usec / 1000;