gsocketaddressenumerator.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2008 Red Hat, Inc.
  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.1 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
  16. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __G_SOCKET_ADDRESS_ENUMERATOR_H__
  19. #define __G_SOCKET_ADDRESS_ENUMERATOR_H__
  20. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  21. #error "Only <gio/gio.h> can be included directly."
  22. #endif
  23. #include <gio/giotypes.h>
  24. G_BEGIN_DECLS
  25. #define G_TYPE_SOCKET_ADDRESS_ENUMERATOR (g_socket_address_enumerator_get_type ())
  26. #define G_SOCKET_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_SOCKET_ADDRESS_ENUMERATOR, GSocketAddressEnumerator))
  27. #define G_SOCKET_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_SOCKET_ADDRESS_ENUMERATOR, GSocketAddressEnumeratorClass))
  28. #define G_IS_SOCKET_ADDRESS_ENUMERATOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_SOCKET_ADDRESS_ENUMERATOR))
  29. #define G_IS_SOCKET_ADDRESS_ENUMERATOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_SOCKET_ADDRESS_ENUMERATOR))
  30. #define G_SOCKET_ADDRESS_ENUMERATOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_SOCKET_ADDRESS_ENUMERATOR, GSocketAddressEnumeratorClass))
  31. /**
  32. * GSocketAddressEnumerator:
  33. *
  34. * Enumerator type for objects that contain or generate
  35. * #GSocketAddress instances.
  36. */
  37. typedef struct _GSocketAddressEnumeratorClass GSocketAddressEnumeratorClass;
  38. struct _GSocketAddressEnumerator
  39. {
  40. /*< private >*/
  41. GObject parent_instance;
  42. };
  43. /**
  44. * GSocketAddressEnumeratorClass:
  45. * @next: Virtual method for g_socket_address_enumerator_next().
  46. * @next_async: Virtual method for g_socket_address_enumerator_next_async().
  47. * @next_finish: Virtual method for g_socket_address_enumerator_next_finish().
  48. *
  49. * Class structure for #GSocketAddressEnumerator.
  50. */
  51. struct _GSocketAddressEnumeratorClass
  52. {
  53. /*< private >*/
  54. GObjectClass parent_class;
  55. /*< public >*/
  56. /* Virtual Table */
  57. GSocketAddress * (* next) (GSocketAddressEnumerator *enumerator,
  58. GCancellable *cancellable,
  59. GError **error);
  60. void (* next_async) (GSocketAddressEnumerator *enumerator,
  61. GCancellable *cancellable,
  62. GAsyncReadyCallback callback,
  63. gpointer user_data);
  64. GSocketAddress * (* next_finish) (GSocketAddressEnumerator *enumerator,
  65. GAsyncResult *result,
  66. GError **error);
  67. };
  68. GLIB_AVAILABLE_IN_ALL
  69. GType g_socket_address_enumerator_get_type (void) G_GNUC_CONST;
  70. GLIB_AVAILABLE_IN_ALL
  71. GSocketAddress *g_socket_address_enumerator_next (GSocketAddressEnumerator *enumerator,
  72. GCancellable *cancellable,
  73. GError **error);
  74. GLIB_AVAILABLE_IN_ALL
  75. void g_socket_address_enumerator_next_async (GSocketAddressEnumerator *enumerator,
  76. GCancellable *cancellable,
  77. GAsyncReadyCallback callback,
  78. gpointer user_data);
  79. GLIB_AVAILABLE_IN_ALL
  80. GSocketAddress *g_socket_address_enumerator_next_finish (GSocketAddressEnumerator *enumerator,
  81. GAsyncResult *result,
  82. GError **error);
  83. G_END_DECLS
  84. #endif /* __G_SOCKET_ADDRESS_ENUMERATOR_H__ */