update .gitignore
[project/procd.git] / procd.h
diff --git a/procd.h b/procd.h
index 4009afc..66a08e2 100644 (file)
--- a/procd.h
+++ b/procd.h
@@ -2,6 +2,7 @@
 #define __PROCD_H
 
 #include <libubox/uloop.h>
+#include <libubox/utils.h>
 #include <libubus.h>
 #include <stdio.h>
 
                fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \
        } while (0)
 
+#define DEBUG(level, fmt, ...) do { \
+       if (debug >= level) \
+               fprintf(stderr, "DEBUG %s(%d): " fmt, __func__, __LINE__, ## __VA_ARGS__); \
+       } while (0)
+
 extern int debug;
 extern char *ubus_socket;
 void procd_connect_ubus(void);