]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/util.h
only LOG() the DPI when it changes, DLOG() it otherwise (Thanks lkraav)
[i3/i3] / i3bar / include / util.h
index 43c56c58d3e93794d6f56becc86ae128a73d84bb..468eff3eec59c955107629535e9a70f4558ed95e 100644 (file)
@@ -16,6 +16,8 @@
 #undef MIN
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
 
+#define STARTS_WITH(string, len, needle) ((len >= strlen(needle)) && strncasecmp(string, needle, strlen(needle)) == 0)
+
 /* Securely free p */
 #define FREE(p) do { \
     if (p != NULL) { \
@@ -46,6 +48,9 @@
     } \
 } while (0)
 
+#if defined(DLOG)
+#undef DLOG
+#endif
 /* Use cool logging-macros */
 #define DLOG(fmt, ...) do { \
     if (config.verbose) { \