gudevclient.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_CLIENT_H__
  23. #define __G_UDEV_CLIENT_H__
  24. #include <gudev/gudevtypes.h>
  25. G_BEGIN_DECLS
  26. #define G_UDEV_TYPE_CLIENT (g_udev_client_get_type ())
  27. #define G_UDEV_CLIENT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_UDEV_TYPE_CLIENT, GUdevClient))
  28. #define G_UDEV_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_UDEV_TYPE_CLIENT, GUdevClientClass))
  29. #define G_UDEV_IS_CLIENT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_UDEV_TYPE_CLIENT))
  30. #define G_UDEV_IS_CLIENT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_UDEV_TYPE_CLIENT))
  31. #define G_UDEV_CLIENT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_UDEV_TYPE_CLIENT, GUdevClientClass))
  32. typedef struct _GUdevClientClass GUdevClientClass;
  33. typedef struct _GUdevClientPrivate GUdevClientPrivate;
  34. /**
  35. * GUdevClient:
  36. *
  37. * The #GUdevClient struct is opaque and should not be accessed directly.
  38. */
  39. struct _GUdevClient
  40. {
  41. GObject parent;
  42. /*< private >*/
  43. GUdevClientPrivate *priv;
  44. };
  45. /**
  46. * GUdevClientClass:
  47. * @parent_class: Parent class.
  48. * @uevent: Signal class handler for the #GUdevClient::uevent signal.
  49. *
  50. * Class structure for #GUdevClient.
  51. */
  52. struct _GUdevClientClass
  53. {
  54. GObjectClass parent_class;
  55. /* signals */
  56. void (*uevent) (GUdevClient *client,
  57. const gchar *action,
  58. GUdevDevice *device);
  59. /*< private >*/
  60. /* Padding for future expansion */
  61. void (*reserved1) (void);
  62. void (*reserved2) (void);
  63. void (*reserved3) (void);
  64. void (*reserved4) (void);
  65. void (*reserved5) (void);
  66. void (*reserved6) (void);
  67. void (*reserved7) (void);
  68. void (*reserved8) (void);
  69. };
  70. GType g_udev_client_get_type (void) G_GNUC_CONST;
  71. GUdevClient *g_udev_client_new (const gchar* const *subsystems);
  72. GList *g_udev_client_query_by_subsystem (GUdevClient *client,
  73. const gchar *subsystem);
  74. GUdevDevice *g_udev_client_query_by_device_number (GUdevClient *client,
  75. GUdevDeviceType type,
  76. GUdevDeviceNumber number);
  77. GUdevDevice *g_udev_client_query_by_device_file (GUdevClient *client,
  78. const gchar *device_file);
  79. GUdevDevice *g_udev_client_query_by_sysfs_path (GUdevClient *client,
  80. const gchar *sysfs_path);
  81. GUdevDevice *g_udev_client_query_by_subsystem_and_name (GUdevClient *client,
  82. const gchar *subsystem,
  83. const gchar *name);
  84. G_END_DECLS
  85. #endif /* __G_UDEV_CLIENT_H__ */