summaryrefslogtreecommitdiff
path: root/udev.h
diff options
context:
space:
mode:
Diffstat (limited to 'udev.h')
-rw-r--r--udev.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/udev.h b/udev.h
new file mode 100644
index 0000000..23f8f5b
--- /dev/null
+++ b/udev.h
@@ -0,0 +1,51 @@
+#ifndef __PVRINPUT_UDEV_H
+#define __PVRINPUT_UDEV_H
+
+#include <libudev.h>
+
+#include <vdr/tools.h>
+
+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 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