X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=libudev%2Flibudev-private.h;h=7132357ac2b85a79cbca9fa9ef02dbc61d820927;hp=285b9d48c13a1e8b31f737ad19d0ae17f2ce7599;hb=2793f4e34bdf4f1a46d0263f7dbdb8fcffe78e32;hpb=6c29f2b942358d4dd9d3e7c65c13c3612dded3cc diff --git a/libudev/libudev-private.h b/libudev/libudev-private.h index 285b9d48c..7132357ac 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 @@ -14,6 +14,8 @@ #include #include +#include +#include #include "libudev.h" #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) @@ -26,7 +28,7 @@ udev_log_null(struct udev *udev, const char *format, ...) {} #define udev_log_cond(udev, prio, arg...) \ do { \ if (udev_get_log_priority(udev) >= prio) \ - udev_log(udev, LOG_ERR, __FILE__, __LINE__, __FUNCTION__, ## arg); \ + udev_log(udev, prio, __FILE__, __LINE__, __FUNCTION__, ## arg); \ } while (0) #ifdef ENABLE_LOGGING @@ -59,7 +61,6 @@ void udev_log(struct udev *udev, const char *format, ...) __attribute__((format(printf, 6, 7))); const char *udev_get_rules_path(struct udev *udev); -int udev_get_run(struct udev *udev); struct udev_list_entry *udev_add_property(struct udev *udev, const char *key, const char *value); struct udev_list_entry *udev_get_properties_list_entry(struct udev *udev); @@ -72,7 +73,8 @@ int udev_device_set_devnode(struct udev_device *udev_device, const char *devnode int udev_device_add_devlink(struct udev_device *udev_device, const char *devlink, int unique); void udev_device_cleanup_devlinks_list(struct udev_device *udev_device); struct udev_list_entry *udev_device_add_property(struct udev_device *udev_device, const char *key, const char *value); -struct udev_list_entry *udev_device_add_property_from_string(struct udev_device *udev_device, const char *property); +void udev_device_add_property_from_string_parse(struct udev_device *udev_device, const char *property); +int udev_device_add_property_from_string_parse_finish(struct udev_device *udev_device); char **udev_device_get_properties_envp(struct udev_device *udev_device); ssize_t udev_device_get_properties_monitor_buf(struct udev_device *udev_device, const char **buf); int udev_device_read_db(struct udev_device *udev_device); @@ -83,6 +85,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); +void udev_device_cleanup_tags_list(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); @@ -90,12 +95,8 @@ int udev_device_get_event_timeout(struct udev_device *udev_device); int udev_device_set_event_timeout(struct udev_device *udev_device, int event_timeout); int udev_device_set_devnum(struct udev_device *udev_device, dev_t devnum); int udev_device_set_seqnum(struct udev_device *udev_device, unsigned long long int seqnum); -int udev_device_get_num_fake_partitions(struct udev_device *udev_device); -int udev_device_set_num_fake_partitions(struct udev_device *udev_device, int num); int udev_device_get_devlink_priority(struct udev_device *udev_device); int udev_device_set_devlink_priority(struct udev_device *udev_device, int prio); -int udev_device_get_ignore_remove(struct udev_device *udev_device); -int udev_device_set_ignore_remove(struct udev_device *udev_device, int ignore); int udev_device_get_watch_handle(struct udev_device *udev_device); int udev_device_set_watch_handle(struct udev_device *udev_device, int handle); void udev_device_set_info_loaded(struct udev_device *device); @@ -104,13 +105,13 @@ void udev_device_set_info_loaded(struct udev_device *device); int udev_device_update_db(struct udev_device *udev_device); int udev_device_delete_db(struct udev_device *udev_device); int udev_device_rename_db(struct udev_device *udev_device); +int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old, bool add); /* libudev-monitor.c - netlink/unix socket communication */ int udev_monitor_disconnect(struct udev_monitor *udev_monitor); int udev_monitor_allow_unicast_sender(struct udev_monitor *udev_monitor, struct udev_monitor *sender); int udev_monitor_send_device(struct udev_monitor *udev_monitor, struct udev_monitor *destination, struct udev_device *udev_device); -int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size); /* libudev-ctrl.c - daemon runtime setup */ struct udev_ctrl; @@ -165,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; \ @@ -189,7 +190,7 @@ int udev_queue_export_device_failed(struct udev_queue_export *udev_queue_export, /* libudev-util.c */ #define UTIL_PATH_SIZE 1024 #define UTIL_NAME_SIZE 512 -#define UTIL_LINE_SIZE 2048 +#define UTIL_LINE_SIZE 16384 #define UDEV_ALLOWED_CHARS_INPUT "/ $%?," ssize_t util_get_sys_subsystem(struct udev *udev, const char *syspath, char *subsystem, size_t size); ssize_t util_get_sys_driver(struct udev *udev, const char *syspath, char *driver, size_t size); @@ -205,8 +206,8 @@ size_t util_strscpyl(char *dest, size_t size, const char *src, ...) __attribute_ int udev_util_replace_whitespace(const char *str, char *to, size_t len); int udev_util_replace_chars(char *str, const char *white); int udev_util_encode_string(const char *str, char *str_enc, size_t len); -void util_set_fd_cloexec(int fd); -unsigned int util_string_hash32(const char *str); +unsigned int util_string_hash32(const char *key); +uint64_t util_string_bloom64(const char *str); /* libudev-util-private.c */ int util_create_path(struct udev *udev, const char *path);