jshn: support using characters in elements that do not conform to shell variable...
[project/libubox.git] / blobmsg.h
index e9a0b69..0b4565f 100644 (file)
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -31,7 +31,8 @@ enum blobmsg_type {
        BLOBMSG_TYPE_INT16,
        BLOBMSG_TYPE_INT8,
        __BLOBMSG_TYPE_LAST,
-       BLOBMSG_TYPE_LAST = __BLOBMSG_TYPE_LAST - 1
+       BLOBMSG_TYPE_LAST = __BLOBMSG_TYPE_LAST - 1,
+       BLOBMSG_TYPE_BOOL = BLOBMSG_TYPE_INT8,
 };
 
 struct blobmsg_hdr {
@@ -144,6 +145,11 @@ static inline uint8_t blobmsg_get_u8(struct blob_attr *attr)
        return *(uint8_t *) blobmsg_data(attr);
 }
 
+static inline bool blobmsg_get_bool(struct blob_attr *attr)
+{
+       return *(uint8_t *) blobmsg_data(attr);
+}
+
 static inline uint16_t blobmsg_get_u16(struct blob_attr *attr)
 {
        return *(uint16_t *) blobmsg_data(attr);