summaryrefslogtreecommitdiff
path: root/legacy/eeze/src/lib/udev/E_Udev.h
blob: 0c3ea23efd4b331fab1b26b8d78bc971704c20df (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef E_UDEV_H
#define E_UDEV_H

#include <Ecore.h>
#include <libudev.h>

#ifdef EAPI
#undef EAPI
#endif
#ifdef _MSC_VER
#error "This will not run on windows!"
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif

/**
 * @defgroup Subsystem_Types Subsystem_Types
 *
 * ac97
 * acpi
 * bdi
 * block
 * bsg
 * dmi
 * graphics
 * hid
 * hwmon
 * i2c
 * input
 * mem
 * misc
 * net
 * pci
 * pci_bus
 * pci_express
 * platform
 * pnp
 * rtc
 * scsi
 * scsi_device
 * scsi_disk
 * scsi_generic
 * scsi_host
 * serio
 * sound
 * thermal
 * tty
 * usb
 * usb_device
 * vc
 * vtconsole
 *
 * @ingroup udev
 */

/**
 * @defgroup Device_Types Device_Types
 * 
 * atapi
 * audio
 * block
 * cd
 * char
 * disk
 * floppy
 * generic
 * hid
 * hub
 * media
 * optical
 * printer
 * rbc
 * scsi
 * storage
 * tape
 * video
 *
 * @ingroup udev
 */

/*FIXME: these probably need to be bitmasks with categories*/
typedef enum
{
	  EUDEV_TYPE_NONE,
   EUDEV_TYPE_KEYBOARD,
   EUDEV_TYPE_MOUSE,
   EUDEV_TYPE_TOUCHPAD,
   EUDEV_TYPE_DRIVE_MOUNTABLE,
   EUDEV_TYPE_DRIVE_INTERNAL,
   EUDEV_TYPE_DRIVE_REMOVABLE,
   EUDEV_TYPE_DRIVE_CDROM,
   EUDEV_TYPE_POWER_AC,
   EUDEV_TYPE_POWER_BAT
/*   EUDEV_TYPE_ANDROID */
} Eudev_Type;

struct Eudev_Watch;
typedef struct Eudev_Watch Eudev_Watch;

#ifdef __cplusplus
extern "C" {
#endif

   EAPI int             e_udev_init(void);
   EAPI int             e_udev_shutdown(void);

   EAPI Eina_List       *e_udev_find_by_type(const Eudev_Type type, const char *name);
   EAPI Eina_List       *e_udev_find_by_filter(const char *subsystem, const char *type, const char *name);
   
   EAPI const char      *e_udev_syspath_rootdev_get(const char *syspath);
   EAPI const char      *e_udev_syspath_get_devpath(const char *syspath);
   EAPI const char      *e_udev_syspath_get_subsystem(const char *syspath);
   EAPI const char      *e_udev_syspath_get_property(const char *syspath, const char *property);
   
   EAPI const char      *e_udev_devpath_get_syspath(const char *devpath);
   EAPI const char      *e_udev_devpath_get_subsystem(const char *devpath);
   
   EAPI Eina_Bool       e_udev_syspath_is_mouse(const char *syspath);
   EAPI Eina_Bool       e_udev_syspath_is_kbd(const char *syspath);
   EAPI Eina_Bool       e_udev_syspath_is_touchpad(const char *syspath);

   EAPI Eudev_Watch     *e_udev_watch_add(Eudev_Type type, void(*func)(const char *, void *, Eudev_Watch *), void *user_data);
   EAPI void            *e_udev_watch_del(Eudev_Watch *watch);

#ifdef __cplusplus
}
#endif

#endif