chiark / gitweb /
gudev: add device::get_sysfs_attr_keys and device::has_sysfs_attr
[elogind.git] / src / gudev / gudevenumerator.h
1 /* -*- Mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
2  *
3  * Copyright (C) 2008-2010 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 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.
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  * Library General Public License for more details.
14  *
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
18  */
19
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."
22 #endif
23
24 #ifndef __G_UDEV_ENUMERATOR_H__
25 #define __G_UDEV_ENUMERATOR_H__
26
27 #include <gudev/gudevtypes.h>
28
29 G_BEGIN_DECLS
30
31 #define G_UDEV_TYPE_ENUMERATOR         (g_udev_enumerator_get_type ())
32 #define G_UDEV_ENUMERATOR(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), G_UDEV_TYPE_ENUMERATOR, GUdevEnumerator))
33 #define G_UDEV_ENUMERATOR_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), G_UDEV_TYPE_ENUMERATOR, GUdevEnumeratorClass))
34 #define G_UDEV_IS_ENUMERATOR(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_UDEV_TYPE_ENUMERATOR))
35 #define G_UDEV_IS_ENUMERATOR_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), G_UDEV_TYPE_ENUMERATOR))
36 #define G_UDEV_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_UDEV_TYPE_ENUMERATOR, GUdevEnumeratorClass))
37
38 typedef struct _GUdevEnumeratorClass   GUdevEnumeratorClass;
39 typedef struct _GUdevEnumeratorPrivate GUdevEnumeratorPrivate;
40
41 /**
42  * GUdevEnumerator:
43  *
44  * The #GUdevEnumerator struct is opaque and should not be accessed directly.
45  *
46  * Since: 165
47  */
48 struct _GUdevEnumerator
49 {
50   GObject              parent;
51
52   /*< private >*/
53   GUdevEnumeratorPrivate *priv;
54 };
55
56 /**
57  * GUdevEnumeratorClass:
58  * @parent_class: Parent class.
59  *
60  * Class structure for #GUdevEnumerator.
61  *
62  * Since: 165
63  */
64 struct _GUdevEnumeratorClass
65 {
66   GObjectClass   parent_class;
67
68   /*< private >*/
69   /* Padding for future expansion */
70   void (*reserved1) (void);
71   void (*reserved2) (void);
72   void (*reserved3) (void);
73   void (*reserved4) (void);
74   void (*reserved5) (void);
75   void (*reserved6) (void);
76   void (*reserved7) (void);
77   void (*reserved8) (void);
78 };
79
80 GType            g_udev_enumerator_get_type                     (void) G_GNUC_CONST;
81 GUdevEnumerator *g_udev_enumerator_new                          (GUdevClient      *client);
82 GUdevEnumerator *g_udev_enumerator_add_match_subsystem          (GUdevEnumerator  *enumerator,
83                                                                  const gchar      *subsystem);
84 GUdevEnumerator *g_udev_enumerator_add_nomatch_subsystem        (GUdevEnumerator  *enumerator,
85                                                                  const gchar      *subsystem);
86 GUdevEnumerator *g_udev_enumerator_add_match_sysfs_attr         (GUdevEnumerator  *enumerator,
87                                                                  const gchar      *name,
88                                                                  const gchar      *value);
89 GUdevEnumerator *g_udev_enumerator_add_nomatch_sysfs_attr       (GUdevEnumerator  *enumerator,
90                                                                  const gchar      *name,
91                                                                  const gchar      *value);
92 GUdevEnumerator *g_udev_enumerator_add_match_property           (GUdevEnumerator  *enumerator,
93                                                                  const gchar      *name,
94                                                                  const gchar      *value);
95 GUdevEnumerator *g_udev_enumerator_add_match_name               (GUdevEnumerator  *enumerator,
96                                                                  const gchar      *name);
97 GUdevEnumerator *g_udev_enumerator_add_match_tag                (GUdevEnumerator  *enumerator,
98                                                                  const gchar      *tag);
99 GUdevEnumerator *g_udev_enumerator_add_match_is_initialized     (GUdevEnumerator  *enumerator);
100 GUdevEnumerator *g_udev_enumerator_add_sysfs_path               (GUdevEnumerator  *enumerator,
101                                                                  const gchar      *sysfs_path);
102 GList           *g_udev_enumerator_execute                      (GUdevEnumerator  *enumerator);
103
104 G_END_DECLS
105
106 #endif /* __G_UDEV_ENUMERATOR_H__ */