]> err.no Git - systemd/commitdiff
libbudev-private: rename udev_list_entry_get_flag()
authorKay Sievers <kay.sievers@vrfy.org>
Wed, 10 Mar 2010 13:52:42 +0000 (14:52 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Wed, 10 Mar 2010 13:52:42 +0000 (14:52 +0100)
libudev/libudev-device-private.c
libudev/libudev-device.c
libudev/libudev-list.c
libudev/libudev-private.h
udev/udev-event.c
udev/udev-node.c
udev/udev-rules.c

index 07249c3885fe973bb0ef9cba922534e69ae66d31..1bcf441237868c34296d3e7b4cf778436a62a650 100644 (file)
@@ -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),
index b841745991effca0a32ac69ee7b1d70c36129d3f..aec5fb57fe01eda57e502585a5e274c15e66fcac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libudev - interface to udev device information
  *
- * Copyright (C) 2008-2009 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
  *
  * 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;
 }
 
index f6637fc92d9950bbe1553908c12e31a464b7f788..b5e96458cc26657d3333b39b5ef2734f65531ae4 100644 (file)
@@ -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;
 }
index e0c51dca055a531849ddf9b1475fa00a201da581..5ee0c58be8b541c4ef97ff48cdab3dced8e34672 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * libudev - interface to udev device information
  *
- * Copyright (C) 2008-2009 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2008-2010 Kay Sievers <kay.sievers@vrfy.org>
  *
  * 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; \
index 4e1773ffeaf156807385d625f7499d62da12da0d..986c119fbbccaceef117d0ec62064d5cf3fe54be 100644 (file)
@@ -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;
                        }
                }
index 307a76b2712c2cf9f8849e4f2f7ef1f4eab20c88..23bfade28c572a2c9b2b1ee79338360068b613cb 100644 (file)
@@ -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
index 3da2033d51d61334b9c305247029cc368755446e..60daad520afdf55e4fb8193e420512034b9caba4 100644 (file)
@@ -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: