From: Kay Sievers Date: Wed, 10 Mar 2010 13:52:42 +0000 (+0100) Subject: libbudev-private: rename udev_list_entry_get_flag() X-Git-Tag: 174~597 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbb31cd6e10fe66d2da781db0ba9a8d671a4c6aa;p=systemd libbudev-private: rename udev_list_entry_get_flag() --- diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c index 07249c38..1bcf4412 100644 --- a/libudev/libudev-device-private.c +++ b/libudev/libudev-device-private.c @@ -39,7 +39,7 @@ int udev_device_update_db(struct udev_device *udev_device) util_strscpyl(filename_tmp, sizeof(filename_tmp), filename, ".tmp", NULL); udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) - if (udev_list_entry_get_flag(list_entry)) + if (udev_list_entry_get_flags(list_entry)) goto file; if (udev_device_get_num_fake_partitions(udev_device) != 0) goto file; @@ -102,7 +102,7 @@ file: if (udev_device_get_watch_handle(udev_device) >= 0) fprintf(f, "W:%i\n", udev_device_get_watch_handle(udev_device)); udev_list_entry_foreach(list_entry, udev_device_get_properties_list_entry(udev_device)) { - if (!udev_list_entry_get_flag(list_entry)) + if (!udev_list_entry_get_flags(list_entry)) continue; fprintf(f, "E:%s=%s\n", udev_list_entry_get_name(list_entry), diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c index b8417459..aec5fb57 100644 --- a/libudev/libudev-device.c +++ b/libudev/libudev-device.c @@ -1,7 +1,7 @@ /* * libudev - interface to udev device information * - * Copyright (C) 2008-2009 Kay Sievers + * Copyright (C) 2008-2010 Kay Sievers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1068,7 +1068,7 @@ int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink if (list_entry == NULL) return -ENOMEM; if (unique) - udev_list_entry_set_flag(list_entry, 1); + udev_list_entry_set_flags(list_entry, 1); return 0; } diff --git a/libudev/libudev-list.c b/libudev/libudev-list.c index f6637fc9..b5e96458 100644 --- a/libudev/libudev-list.c +++ b/libudev/libudev-list.c @@ -38,7 +38,7 @@ struct udev_list_entry { struct udev_list_node *list; char *name; char *value; - int flag; + unsigned int flags; }; /* list head point to itself if empty */ @@ -258,16 +258,16 @@ const char *udev_list_entry_get_value(struct udev_list_entry *list_entry) return list_entry->value; } -int udev_list_entry_get_flag(struct udev_list_entry *list_entry) +unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry) { if (list_entry == NULL) return -EINVAL; - return list_entry->flag; + return list_entry->flags; } -void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag) +void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags) { if (list_entry == NULL) return; - list_entry->flag = flag; + list_entry->flags = flags; } diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h index e0c51dca..5ee0c58b 100644 --- a/libudev/libudev-private.h +++ b/libudev/libudev-private.h @@ -1,7 +1,7 @@ /* * libudev - interface to udev device information * - * Copyright (C) 2008-2009 Kay Sievers + * Copyright (C) 2008-2010 Kay Sievers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -82,6 +82,9 @@ const char *udev_device_get_devpath_old(struct udev_device *udev_device); const char *udev_device_get_sysname_old(struct udev_device *udev_device); int udev_device_set_devpath_old(struct udev_device *udev_device, const char *devpath_old); const char *udev_device_get_knodename(struct udev_device *udev_device); +int udev_device_add_tag(struct udev_device *udev_device, const char *tag); +struct udev_list_entry *udev_device_get_tag_list_entry(struct udev_device *udev_device); +int udev_device_has_tag(struct udev_device *udev_device, const char *tag); int udev_device_set_knodename(struct udev_device *udev_device, const char *knodename); int udev_device_get_timeout(struct udev_device *udev_device); int udev_device_set_timeout(struct udev_device *udev_device, int timeout); @@ -163,8 +166,8 @@ void udev_list_entry_insert_before(struct udev_list_entry *new, struct udev_list void udev_list_entry_append(struct udev_list_entry *new, struct udev_list_node *list); void udev_list_cleanup_entries(struct udev *udev, struct udev_list_node *name_list); struct udev_list_entry *udev_list_get_entry(struct udev_list_node *list); -int udev_list_entry_get_flag(struct udev_list_entry *list_entry); -void udev_list_entry_set_flag(struct udev_list_entry *list_entry, int flag); +unsigned int udev_list_entry_get_flags(struct udev_list_entry *list_entry); +void udev_list_entry_set_flags(struct udev_list_entry *list_entry, unsigned int flags); #define udev_list_entry_foreach_safe(entry, tmp, first) \ for (entry = first, tmp = udev_list_entry_get_next(entry); \ entry != NULL; \ diff --git a/udev/udev-event.c b/udev/udev-event.c index 4e1773ff..986c119f 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -729,7 +729,7 @@ int udev_event_execute_run(struct udev_event *event, const sigset_t *sigmask) udev_event_apply_format(event, cmd, program, sizeof(program)); envp = udev_device_get_properties_envp(event->dev); if (util_run_program(event->udev, program, envp, NULL, 0, NULL, sigmask) != 0) { - if (udev_list_entry_get_flag(list_entry)) + if (udev_list_entry_get_flags(list_entry)) err = -1; } } diff --git a/udev/udev-node.c b/udev/udev-node.c index 307a76b2..23bfade2 100644 --- a/udev/udev-node.c +++ b/udev/udev-node.c @@ -405,7 +405,7 @@ int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid) /* create/update symlinks, add symlinks to name index */ udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev)) { - if (udev_list_entry_get_flag(list_entry)) + if (udev_list_entry_get_flags(list_entry)) /* simple unmanaged link name */ node_symlink(udev, udev_device_get_devnode(dev), udev_list_entry_get_name(list_entry)); else diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 3da2033d..60daad52 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -717,7 +717,7 @@ static int import_property_from_string(struct udev_device *dev, char *line) entry = udev_device_add_property(dev, key, val); /* store in db, skip private keys */ if (key[0] != '.') - udev_list_entry_set_flag(entry, 1); + udev_list_entry_set_flags(entry, 1); } return 0; } @@ -785,7 +785,7 @@ static int import_parent_into_properties(struct udev_device *dev, const char *fi entry = udev_device_add_property(dev, key, val); /* store in db, skip private keys */ if (key[0] != '.') - udev_list_entry_set_flag(entry, 1); + udev_list_entry_set_flags(entry, 1); } } return 0; @@ -1831,13 +1831,13 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) filename_off = add_string(rules, filename); /* the offset in the rule is limited to unsigned short */ if (filename_off < USHRT_MAX) - udev_list_entry_set_flag(file_loop, filename_off); + udev_list_entry_set_flags(file_loop, filename_off); } /* parse list of files */ udev_list_entry_foreach_safe(file_loop, file_tmp, udev_list_get_entry(&file_list)) { const char *filename = udev_list_entry_get_name(file_loop); - unsigned int filename_off = udev_list_entry_get_flag(file_loop); + unsigned int filename_off = udev_list_entry_get_flags(file_loop); if (stat(filename, &statbuf) == 0 && statbuf.st_size > 0) parse_file(rules, filename, filename_off); @@ -2420,7 +2420,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event entry = udev_device_add_property(event->dev, name, temp_value); /* store in db, skip private keys */ if (name[0] != '.') - udev_list_entry_set_flag(entry, 1); + udev_list_entry_set_flags(entry, 1); } else { udev_device_add_property(event->dev, name, NULL); } @@ -2542,7 +2542,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event list_entry = udev_list_entry_add(event->udev, &event->run_list, &rules->buf[cur->key.value_off], NULL, 1, 0); if (cur->key.fail_on_error) - udev_list_entry_set_flag(list_entry, 1); + udev_list_entry_set_flags(list_entry, 1); break; } case TK_A_GOTO: