1 /* -*- Mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
3 * Copyright (C) 2008 David Zeuthen <davidz@redhat.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
21 #error "Only <gudev/gudev.h> can be included directly, this file may disappear or change contents."
24 #ifndef __G_UDEV_DEVICE_H__
25 #define __G_UDEV_DEVICE_H__
27 #include <gudev/gudevtypes.h>
31 #define G_UDEV_TYPE_DEVICE (g_udev_device_get_type ())
32 #define G_UDEV_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_UDEV_TYPE_DEVICE, GUdevDevice))
33 #define G_UDEV_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_UDEV_TYPE_DEVICE, GUdevDeviceClass))
34 #define G_UDEV_IS_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_UDEV_TYPE_DEVICE))
35 #define G_UDEV_IS_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_UDEV_TYPE_DEVICE))
36 #define G_UDEV_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_UDEV_TYPE_DEVICE, GUdevDeviceClass))
38 typedef struct _GUdevDeviceClass GUdevDeviceClass
;
39 typedef struct _GUdevDevicePrivate GUdevDevicePrivate
;
44 * The #GUdevDevice struct is opaque and should not be accessed directly.
51 GUdevDevicePrivate
*priv
;
56 * @parent_class: Parent class.
58 * Class structure for #GUdevDevice.
60 struct _GUdevDeviceClass
62 GObjectClass parent_class
;
65 /* Padding for future expansion */
66 void (*reserved1
) (void);
67 void (*reserved2
) (void);
68 void (*reserved3
) (void);
69 void (*reserved4
) (void);
70 void (*reserved5
) (void);
71 void (*reserved6
) (void);
72 void (*reserved7
) (void);
73 void (*reserved8
) (void);
76 GType
g_udev_device_get_type (void) G_GNUC_CONST
;
77 gboolean
g_udev_device_get_is_initialized (GUdevDevice
*device
);
78 guint64
g_udev_device_get_usec_since_initialized (GUdevDevice
*device
);
79 const gchar
*g_udev_device_get_subsystem (GUdevDevice
*device
);
80 const gchar
*g_udev_device_get_devtype (GUdevDevice
*device
);
81 const gchar
*g_udev_device_get_name (GUdevDevice
*device
);
82 const gchar
*g_udev_device_get_number (GUdevDevice
*device
);
83 const gchar
*g_udev_device_get_sysfs_path (GUdevDevice
*device
);
84 const gchar
*g_udev_device_get_driver (GUdevDevice
*device
);
85 const gchar
*g_udev_device_get_action (GUdevDevice
*device
);
86 guint64
g_udev_device_get_seqnum (GUdevDevice
*device
);
87 GUdevDeviceType
g_udev_device_get_device_type (GUdevDevice
*device
);
88 GUdevDeviceNumber
g_udev_device_get_device_number (GUdevDevice
*device
);
89 const gchar
*g_udev_device_get_device_file (GUdevDevice
*device
);
90 const gchar
* const *g_udev_device_get_device_file_symlinks (GUdevDevice
*device
);
91 GUdevDevice
*g_udev_device_get_parent (GUdevDevice
*device
);
92 GUdevDevice
*g_udev_device_get_parent_with_subsystem (GUdevDevice
*device
,
93 const gchar
*subsystem
,
94 const gchar
*devtype
);
95 const gchar
* const *g_udev_device_get_property_keys (GUdevDevice
*device
);
96 gboolean
g_udev_device_has_property (GUdevDevice
*device
,
98 const gchar
*g_udev_device_get_property (GUdevDevice
*device
,
100 gint
g_udev_device_get_property_as_int (GUdevDevice
*device
,
102 guint64
g_udev_device_get_property_as_uint64 (GUdevDevice
*device
,
104 gdouble
g_udev_device_get_property_as_double (GUdevDevice
*device
,
106 gboolean
g_udev_device_get_property_as_boolean (GUdevDevice
*device
,
108 const gchar
* const *g_udev_device_get_property_as_strv (GUdevDevice
*device
,
111 const gchar
* const *g_udev_device_get_sysfs_attr_keys (GUdevDevice
*device
);
112 gboolean
g_udev_device_has_sysfs_attr (GUdevDevice
*device
,
114 const gchar
*g_udev_device_get_sysfs_attr (GUdevDevice
*device
,
116 gint
g_udev_device_get_sysfs_attr_as_int (GUdevDevice
*device
,
118 guint64
g_udev_device_get_sysfs_attr_as_uint64 (GUdevDevice
*device
,
120 gdouble
g_udev_device_get_sysfs_attr_as_double (GUdevDevice
*device
,
122 gboolean
g_udev_device_get_sysfs_attr_as_boolean (GUdevDevice
*device
,
124 const gchar
* const *g_udev_device_get_sysfs_attr_as_strv (GUdevDevice
*device
,
126 const gchar
* const *g_udev_device_get_tags (GUdevDevice
*device
);
130 #endif /* __G_UDEV_DEVICE_H__ */