Make udev_event a generic event
[petitboot] / discover / device-handler.h
1 #ifndef _DEVICE_HANDLER_H
2 #define _DEVICE_HANDLER_H
3
4 #include <list/list.h>
5
6 struct device_handler;
7 struct discover_server;
8 struct event;
9 struct device;
10
11 struct discover_context {
12         char *id;
13         char *device_path;
14         char *mount_path;
15         struct event *event;
16         struct device *device;
17         char **links;
18         int n_links;
19
20         struct list_item list;
21 };
22
23 struct device_handler *device_handler_init(struct discover_server *server);
24
25 void device_handler_destroy(struct device_handler *devices);
26
27 int device_handler_get_device_count(const struct device_handler *handler);
28 const struct device *device_handler_get_device(
29         const struct device_handler *handler, unsigned int index);
30
31 int device_handler_event(struct device_handler *handler, struct event *event);
32
33 #endif /* _DEVICE_HANDLER_H */