From: Martin Mares Date: Sat, 12 Oct 2013 20:49:31 +0000 (+0200) Subject: Split osd.h and util.h X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=187ecee422adceb1d8d5a3dae0f466f86f8daaf5;p=osdd.git Split osd.h and util.h --- diff --git a/client.c b/client.c index b55a630..331c201 100644 --- a/client.c +++ b/client.c @@ -13,6 +13,7 @@ #include #undef DEBUG +#include "util.h" #include "osd.h" static Display *dpy; diff --git a/osd-alsa.c b/osd-alsa.c index 3d7bc27..0a6429d 100644 --- a/osd-alsa.c +++ b/osd-alsa.c @@ -12,6 +12,7 @@ #include #include +#include "util.h" #include "osd.h" static char *alsa_device = "default"; diff --git a/osd-batt.c b/osd-batt.c index 33ec721..2d36aa0 100644 --- a/osd-batt.c +++ b/osd-batt.c @@ -14,6 +14,7 @@ #include #include +#include "util.h" #include "osd.h" static int check_mode; diff --git a/osd.h b/osd.h index 3c7c5b7..ead489f 100644 --- a/osd.h +++ b/osd.h @@ -1,31 +1,9 @@ /* - * On-screen Display Daemon -- Utility Functions + * On-screen Display Daemon -- Client Interface * * (c) 2010 Martin Mares */ -#include - -#define NONRET __attribute__((noreturn)) -#define FORMAT_CHECK(func,i,j) __attribute__((format(func,i,j))) - -typedef uint64_t timestamp_t; - -/* util.c */ - -void NONRET FORMAT_CHECK(printf,1,2) die(char *fmt, ...); - -#ifdef DEBUG -#define DBG(f...) printf(f) -#else -#define DBG(f...) do { } while(0) -#endif - -void *xmalloc(int size); -void *xrealloc(void *ptr, int size); - -timestamp_t get_current_time(void); - /* client.c */ void osd_init(void); diff --git a/osdc.c b/osdc.c index f3251d0..8979de3 100644 --- a/osdc.c +++ b/osdc.c @@ -11,6 +11,7 @@ #include #include +#include "util.h" #include "osd.h" static struct osd_msg *msg; diff --git a/osdd.c b/osdd.c index ba279b2..f37efde 100644 --- a/osdd.c +++ b/osdd.c @@ -16,7 +16,8 @@ #include #undef DEBUG -#include "osd.h" +#include "util.h" +#include "display.h" static xosd *osd; diff --git a/util.h b/util.h new file mode 100644 index 0000000..f1674ac --- /dev/null +++ b/util.h @@ -0,0 +1,27 @@ +/* + * On-screen Display Daemon -- Utility Functions + * + * (c) 2010--2013 Martin Mares + */ + +#include + +#define NONRET __attribute__((noreturn)) +#define FORMAT_CHECK(func,i,j) __attribute__((format(func,i,j))) + +typedef uint64_t timestamp_t; + +/* util.c */ + +void NONRET FORMAT_CHECK(printf,1,2) die(char *fmt, ...); + +#ifdef DEBUG +#define DBG(f...) printf(f) +#else +#define DBG(f...) do { } while(0) +#endif + +void *xmalloc(int size); +void *xrealloc(void *ptr, int size); + +timestamp_t get_current_time(void);