Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / sysutils / hal / files / hald-netbsd / hotplug.h
blobfc9f92ec1c59a4bb3beecf0787be50904b0d8827
1 /***************************************************************************
3 * hotplug.h : definitions for HAL-internal hotplug events
5 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
6 * Use is subject to license terms.
8 * Licensed under the Academic Free License version 2.1
10 **************************************************************************/
12 #ifndef HOTPLUG_H
13 #define HOTPLUG_H
15 #include <glib.h>
17 #include "../device.h"
18 #include "../util.h"
20 #include "devinfo.h"
22 typedef enum {
23 HOTPLUG_ACTION_ADD,
24 HOTPLUG_ACTION_REMOVE,
25 } HotplugActionType;
27 typedef enum {
28 HOTPLUG_EVENT_DEVFS = 0,
29 } HotplugEventType;
31 /** Data structure representing a hotplug event; also used for
32 * coldplugging.
34 typedef struct
36 HotplugActionType action; /**< Whether the event is add or remove */
37 HotplugEventType type; /**< Type of hotplug event */
39 HalDevice *d;
41 union {
42 struct {
43 char devfs_path[HAL_PATH_MAX];
44 DevinfoDevHandler *handler;
45 } devfs;
46 } un;
48 } HotplugEvent;
50 void hotplug_event_enqueue (HotplugEvent *event, int front);
52 void hotplug_event_process_queue (void);
54 void hotplug_event_end (void *end_token);
56 void hotplug_queue_now_empty (void);
58 #endif /* HOTPLUG_H */