chiark / gitweb /
udev.conf - do not set any value by default
[elogind.git] / src / extras / gudev / gudevdevice.h
1 /* -*- Mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
2  *
3  * Copyright (C) 2008 David Zeuthen <davidz@redhat.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser 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.
9  *
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  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
22 #error "Only <gudev/gudev.h> can be included directly, this file may disappear or change contents."
23 #endif
24
25 #ifndef __G_UDEV_DEVICE_H__
26 #define __G_UDEV_DEVICE_H__
27
28 #include <gudev/gudevtypes.h>
29
30 G_BEGIN_DECLS
31
32 #define G_UDEV_TYPE_DEVICE         (g_udev_device_get_type ())
33 #define G_UDEV_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_UDEV_TYPE_DEVICE, GUdevDevice))
34 #define G_UDEV_DEVICE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_UDEV_TYPE_DEVICE, GUdevDeviceClass))
35 #define G_UDEV_IS_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_UDEV_TYPE_DEVICE))
36 #define G_UDEV_IS_DEVICE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_UDEV_TYPE_DEVICE))
37 #define G_UDEV_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_UDEV_TYPE_DEVICE, GUdevDeviceClass))
38
39 typedef struct _GUdevDeviceClass   GUdevDeviceClass;
40 typedef struct _GUdevDevicePrivate GUdevDevicePrivate;
41
42 /**
43  * GUdevDevice:
44  *
45  * The #GUdevDevice struct is opaque and should not be accessed directly.
46  */
47 struct _GUdevDevice
48 {
49   GObject             parent;
50
51   /*< private >*/
52   GUdevDevicePrivate *priv;
53 };
54
55 /**
56  * GUdevDeviceClass:
57  * @parent_class: Parent class.
58  *
59  * Class structure for #GUdevDevice.
60  */
61 struct _GUdevDeviceClass
62 {
63   GObjectClass parent_class;
64
65   /*< private >*/
66   /* Padding for future expansion */
67   void (*reserved1) (void);
68   void (*reserved2) (void);
69   void (*reserved3) (void);
70   void (*reserved4) (void);
71   void (*reserved5) (void);
72   void (*reserved6) (void);
73   void (*reserved7) (void);
74   void (*reserved8) (void);
75 };
76
77 GType               g_udev_device_get_type                  (void) G_GNUC_CONST;
78 gboolean            g_udev_device_get_is_initialized        (GUdevDevice  *device);
79 guint64             g_udev_device_get_usec_since_initialized (GUdevDevice  *device);
80 const gchar        *g_udev_device_get_subsystem             (GUdevDevice  *device);
81 const gchar        *g_udev_device_get_devtype               (GUdevDevice  *device);
82 const gchar        *g_udev_device_get_name                  (GUdevDevice  *device);
83 const gchar        *g_udev_device_get_number                (GUdevDevice  *device);
84 const gchar        *g_udev_device_get_sysfs_path            (GUdevDevice  *device);
85 const gchar        *g_udev_device_get_driver                (GUdevDevice  *device);
86 const gchar        *g_udev_device_get_action                (GUdevDevice  *device);
87 guint64             g_udev_device_get_seqnum                (GUdevDevice  *device);
88 GUdevDeviceType     g_udev_device_get_device_type           (GUdevDevice  *device);
89 GUdevDeviceNumber   g_udev_device_get_device_number         (GUdevDevice  *device);
90 const gchar        *g_udev_device_get_device_file           (GUdevDevice  *device);
91 const gchar* const *g_udev_device_get_device_file_symlinks  (GUdevDevice  *device);
92 GUdevDevice        *g_udev_device_get_parent                (GUdevDevice  *device);
93 GUdevDevice        *g_udev_device_get_parent_with_subsystem (GUdevDevice  *device,
94                                                              const gchar  *subsystem,
95                                                              const gchar  *devtype);
96 const gchar* const *g_udev_device_get_property_keys         (GUdevDevice  *device);
97 gboolean            g_udev_device_has_property              (GUdevDevice  *device,
98                                                              const gchar  *key);
99 const gchar        *g_udev_device_get_property              (GUdevDevice  *device,
100                                                              const gchar  *key);
101 gint                g_udev_device_get_property_as_int       (GUdevDevice  *device,
102                                                              const gchar  *key);
103 guint64             g_udev_device_get_property_as_uint64    (GUdevDevice  *device,
104                                                              const gchar  *key);
105 gdouble             g_udev_device_get_property_as_double    (GUdevDevice  *device,
106                                                              const gchar  *key);
107 gboolean            g_udev_device_get_property_as_boolean   (GUdevDevice  *device,
108                                                              const gchar  *key);
109 const gchar* const *g_udev_device_get_property_as_strv      (GUdevDevice  *device,
110                                                              const gchar  *key);
111
112 const gchar        *g_udev_device_get_sysfs_attr            (GUdevDevice  *device,
113                                                              const gchar  *name);
114 gint                g_udev_device_get_sysfs_attr_as_int     (GUdevDevice  *device,
115                                                              const gchar  *name);
116 guint64             g_udev_device_get_sysfs_attr_as_uint64  (GUdevDevice  *device,
117                                                              const gchar  *name);
118 gdouble             g_udev_device_get_sysfs_attr_as_double  (GUdevDevice  *device,
119                                                              const gchar  *name);
120 gboolean            g_udev_device_get_sysfs_attr_as_boolean (GUdevDevice  *device,
121                                                              const gchar  *name);
122 const gchar* const *g_udev_device_get_sysfs_attr_as_strv    (GUdevDevice  *device,
123                                                              const gchar  *name);
124 const gchar* const *g_udev_device_get_tags                  (GUdevDevice  *device);
125
126 G_END_DECLS
127
128 #endif /* __G_UDEV_DEVICE_H__ */