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>2014-07-21 03:24:01 +0400
committerFelix Fietkau <nbd@openwrt.org>2014-07-21 03:24:01 +0400
commitf3977836afc82ce32c203173bd393789e05a123e (patch)
tree62ccf4e3189987cb8e07cdc0833befbf53675c22 /blobmsg.h
parentbd388d2b6c2c151bf513c1e449417d18ce02d10b (diff)
blobmsg: add a helper function to reset the name of a blobmsg attribute
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'blobmsg.h')
-rw-r--r--blobmsg.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/blobmsg.h b/blobmsg.h
index 082980a..7041aca 100644
--- a/blobmsg.h
+++ b/blobmsg.h
@@ -51,6 +51,12 @@ static inline int blobmsg_hdrlen(unsigned int namelen)
return BLOBMSG_PADDING(sizeof(struct blobmsg_hdr) + namelen + 1);
}
+static inline void blobmsg_clear_name(struct blob_attr *attr)
+{
+ struct blobmsg_hdr *hdr = (struct blobmsg_hdr *) blob_data(attr);
+ hdr->name[0] = 0;
+}
+
static inline const char *blobmsg_name(const struct blob_attr *attr)
{
struct blobmsg_hdr *hdr = (struct blobmsg_hdr *) blob_data(attr);