-
Notifications
You must be signed in to change notification settings - Fork 1
/
udev.h
56 lines (48 loc) · 1.59 KB
/
udev.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef __PVRINPUT_UDEV_H
#define __PVRINPUT_UDEV_H
#include <libudev.h>
#include <vdr/tools.h>
#include <vdr/thread.h>
namespace pvrinput {
class cUdevListEntry {
private:
struct udev_list_entry *listEntry;
public:
cUdevListEntry(struct udev_list_entry *ListEntry);
virtual ~cUdevListEntry(void);
cUdevListEntry *GetNext(void) const;
const char *GetName(void) const;
const char *GetValue(void) const;
};
class cUdevDevice : public cListObject {
private:
struct udev_device *device;
bool doUnref;
public:
cUdevDevice(udev_device *Device, bool DoUnref = true);
virtual ~cUdevDevice(void);
virtual int Compare(const cListObject &ListObject) const;
const char *GetAction(void) const;
cUdevListEntry *GetDevlinksList(void) const;
const char *GetDevnode(void) const;
const char *GetDevpath(void) const;
cUdevDevice *GetParent(void) const;
const char *GetPropertyValue(const char *Key) const;
const char *GetSubsystem(void) const;
const char *GetSysname(void) const;
const char *GetSyspath(void) const;
};
class cUdev {
private:
static cMutex udev_mutex;
static int udev_refcount; // newer libudev does this on its own
static struct udev *udev;
public:
static struct udev *Init(void);
static void Free(void);
static cUdevDevice *GetDeviceFromDevName(const char *DevName);
static cUdevDevice *GetDeviceFromSysPath(const char *SysPath);
static cList<cUdevDevice> *EnumDevices(const char *Subsystem, const char *Property, const char *Value);
};
}
#endif // __PVRINPUT_UDEV_H