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;
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),
/*
* 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
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;
}
struct udev_list_node *list;
char *name;
char *value;
- int flag;
+ unsigned int flags;
};
/* list head point to itself if empty */
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;
}
/*
* 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
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);
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; \
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;
}
}
/* 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
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;
}
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;
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);
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);
}
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: