summaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils.h b/utils.h
index b5ae7e0..2866280 100644
--- a/utils.h
+++ b/utils.h
@@ -3,6 +3,15 @@
#include <libubox/list.h>
#include <libubox/avl.h>
+#include <libubox/blobmsg.h>
+
+static inline bool blobmsg_get_bool_default(struct blob_attr *attr, bool val)
+{
+ if (!attr)
+ return val;
+
+ return blobmsg_get_bool(attr);
+}
#define __init __attribute__((constructor))