gudevdevice.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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 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. #if !defined (_GUDEV_COMPILATION) && !defined(_GUDEV_INSIDE_GUDEV_H)
  20. #error "Only <gudev/gudev.h> can be included directly, this file may disappear or change contents."
  21. #endif
  22. #ifndef __G_UDEV_DEVICE_H__
  23. #define __G_UDEV_DEVICE_H__
  24. #include <gudev/gudevtypes.h>
  25. G_BEGIN_DECLS
  26. #define G_UDEV_TYPE_DEVICE (g_udev_device_get_type ())
  27. #define G_UDEV_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_UDEV_TYPE_DEVICE, GUdevDevice))
  28. #define G_UDEV_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_UDEV_TYPE_DEVICE, GUdevDeviceClass))
  29. #define G_UDEV_IS_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_UDEV_TYPE_DEVICE))
  30. #define G_UDEV_IS_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_UDEV_TYPE_DEVICE))
  31. #define G_UDEV_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_UDEV_TYPE_DEVICE, GUdevDeviceClass))
  32. typedef struct _GUdevDeviceClass GUdevDeviceClass;
  33. typedef struct _GUdevDevicePrivate GUdevDevicePrivate;
  34. /**
  35. * GUdevDevice:
  36. *
  37. * The #GUdevDevice struct is opaque and should not be accessed directly.
  38. */
  39. struct _GUdevDevice
  40. {
  41. GObject parent;
  42. /*< private >*/
  43. GUdevDevicePrivate *priv;
  44. };
  45. /**
  46. * GUdevDeviceClass:
  47. * @parent_class: Parent class.
  48. *
  49. * Class structure for #GUdevDevice.
  50. */
  51. struct _GUdevDeviceClass
  52. {
  53. GObjectClass parent_class;
  54. /*< private >*/
  55. /* Padding for future expansion */
  56. void (*reserved1) (void);
  57. void (*reserved2) (void);
  58. void (*reserved3) (void);
  59. void (*reserved4) (void);
  60. void (*reserved5) (void);
  61. void (*reserved6) (void);
  62. void (*reserved7) (void);
  63. void (*reserved8) (void);
  64. };
  65. GType g_udev_device_get_type (void) G_GNUC_CONST;
  66. gboolean g_udev_device_get_is_initialized (GUdevDevice *device);
  67. guint64 g_udev_device_get_usec_since_initialized (GUdevDevice *device);
  68. const gchar *g_udev_device_get_subsystem (GUdevDevice *device);
  69. const gchar *g_udev_device_get_devtype (GUdevDevice *device);
  70. const gchar *g_udev_device_get_name (GUdevDevice *device);
  71. const gchar *g_udev_device_get_number (GUdevDevice *device);
  72. const gchar *g_udev_device_get_sysfs_path (GUdevDevice *device);
  73. const gchar *g_udev_device_get_driver (GUdevDevice *device);
  74. const gchar *g_udev_device_get_action (GUdevDevice *device);
  75. guint64 g_udev_device_get_seqnum (GUdevDevice *device);
  76. GUdevDeviceType g_udev_device_get_device_type (GUdevDevice *device);
  77. GUdevDeviceNumber g_udev_device_get_device_number (GUdevDevice *device);
  78. const gchar *g_udev_device_get_device_file (GUdevDevice *device);
  79. const gchar* const *g_udev_device_get_device_file_symlinks (GUdevDevice *device);
  80. GUdevDevice *g_udev_device_get_parent (GUdevDevice *device);
  81. GUdevDevice *g_udev_device_get_parent_with_subsystem (GUdevDevice *device,
  82. const gchar *subsystem,
  83. const gchar *devtype);
  84. const gchar* const *g_udev_device_get_property_keys (GUdevDevice *device);
  85. gboolean g_udev_device_has_property (GUdevDevice *device,
  86. const gchar *key);
  87. const gchar *g_udev_device_get_property (GUdevDevice *device,
  88. const gchar *key);
  89. gint g_udev_device_get_property_as_int (GUdevDevice *device,
  90. const gchar *key);
  91. guint64 g_udev_device_get_property_as_uint64 (GUdevDevice *device,
  92. const gchar *key);
  93. gdouble g_udev_device_get_property_as_double (GUdevDevice *device,
  94. const gchar *key);
  95. gboolean g_udev_device_get_property_as_boolean (GUdevDevice *device,
  96. const gchar *key);
  97. const gchar* const *g_udev_device_get_property_as_strv (GUdevDevice *device,
  98. const gchar *key);
  99. const gchar* const *g_udev_device_get_sysfs_attr_keys (GUdevDevice *device);
  100. gboolean g_udev_device_has_sysfs_attr (GUdevDevice *device,
  101. const gchar *key);
  102. const gchar *g_udev_device_get_sysfs_attr (GUdevDevice *device,
  103. const gchar *name);
  104. gint g_udev_device_get_sysfs_attr_as_int (GUdevDevice *device,
  105. const gchar *name);
  106. guint64 g_udev_device_get_sysfs_attr_as_uint64 (GUdevDevice *device,
  107. const gchar *name);
  108. gdouble g_udev_device_get_sysfs_attr_as_double (GUdevDevice *device,
  109. const gchar *name);
  110. gboolean g_udev_device_get_sysfs_attr_as_boolean (GUdevDevice *device,
  111. const gchar *name);
  112. const gchar* const *g_udev_device_get_sysfs_attr_as_strv (GUdevDevice *device,
  113. const gchar *name);
  114. const gchar* const *g_udev_device_get_tags (GUdevDevice *device);
  115. G_END_DECLS
  116. #endif /* __G_UDEV_DEVICE_H__ */