X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=blobmsg.h;h=f2fc0d0ad107010a982f29d991f10b1a9757b4c8;hb=refs%2Fheads%2Fmaster;hp=5feaffe5e54f3341b0615b4e960f20244e1e8aba;hpb=d2223ef9da7172a84d1508733dc58840e1381e3c;p=project%2Flibubox.git diff --git a/blobmsg.h b/blobmsg.h index 5feaffe..f2fc0d0 100644 --- a/blobmsg.h +++ b/blobmsg.h @@ -178,6 +178,20 @@ int blobmsg_parse_array(const struct blobmsg_policy *policy, int policy_len, int blobmsg_add_field(struct blob_buf *buf, int type, const char *name, const void *data, unsigned int len); +static inline int +blobmsg_parse_attr(const struct blobmsg_policy *policy, int policy_len, + struct blob_attr **tb, struct blob_attr *data) +{ + return blobmsg_parse(policy, policy_len, tb, blobmsg_data(data), blobmsg_len(data)); +} + +static inline int +blobmsg_parse_array_attr(const struct blobmsg_policy *policy, int policy_len, + struct blob_attr **tb, struct blob_attr *data) +{ + return blobmsg_parse_array(policy, policy_len, tb, blobmsg_data(data), blobmsg_len(data)); +} + static inline int blobmsg_add_double(struct blob_buf *buf, const char *name, double val) {