Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-05-08 17:59:19 +0400
committerFelix Fietkau <nbd@openwrt.org>2012-05-08 17:59:19 +0400
commitf8d3e57b45170a612fc4209d86ffbd410994ccac (patch)
treea68f6a67e48abee20788e29e9bb0b14658f169d1 /blobmsg.h
parentb1ea9afd605f867409913e10a1bb6d95390dd25b (diff)
add blobmsg_add_blob() to copy over an existing blobmsg attribute
Diffstat (limited to 'blobmsg.h')
-rw-r--r--blobmsg.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/blobmsg.h b/blobmsg.h
index 2813576..c47f469 100644
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -117,6 +117,13 @@ blobmsg_add_string(struct blob_buf *buf, const char *name, const char *string)
return blobmsg_add_field(buf, BLOBMSG_TYPE_STRING, name, string, strlen(string) + 1);
}
+static inline int
+blobmsg_add_blob(struct blob_buf *buf, struct blob_attr *attr)
+{
+ return blobmsg_add_field(buf, blobmsg_type(attr), blobmsg_name(attr),
+ blobmsg_data(attr), blobmsg_data_len(attr));
+}
+
void *blobmsg_open_nested(struct blob_buf *buf, const char *name, bool array);
static inline void *