From df1dcc09efb80d2fbc15790bd5237fad364408a0 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 11 Oct 2008 18:40:04 +0200 Subject: [PATCH] libudev: list - add flag --- udev/lib/libudev-list.c | 15 +++++++++++++++ udev/lib/libudev-private.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/udev/lib/libudev-list.c b/udev/lib/libudev-list.c index 4849d469..85458350 100644 --- a/udev/lib/libudev-list.c +++ b/udev/lib/libudev-list.c @@ -33,6 +33,7 @@ struct udev_list_entry { struct udev_list_node *list; char *name; char *value; + int flag; }; /* list head point to itself if empty */ @@ -215,3 +216,17 @@ const char *udev_list_entry_get_value(struct udev_list_entry *list_entry) return NULL; return list_entry->value; } + +extern int udev_list_entry_get_flag(struct udev_list_entry *list_entry) +{ + if (list_entry == NULL) + return -EINVAL; + return list_entry->flag; +} + +extern void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag) +{ + if (list_entry == NULL) + return; + list_entry->flag = flag; +} diff --git a/udev/lib/libudev-private.h b/udev/lib/libudev-private.h index 9969b372..6e419dff 100644 --- a/udev/lib/libudev-private.h +++ b/udev/lib/libudev-private.h @@ -117,6 +117,8 @@ extern struct udev_list_entry *udev_list_entry_add(struct udev *udev, struct ude extern void udev_list_entry_remove(struct udev_list_entry *entry); extern struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list); extern void udev_list_entry_move_to_end(struct udev_list_entry *list_entry); +extern int udev_list_entry_get_flag(struct udev_list_entry *list_entry); +extern void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag); #define list_entry_foreach_safe(entry, tmp, first) \ for (entry = first, \ tmp = udev_list_entry_get_next(entry); \ -- 2.39.5