您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

168 行
6.3 KiB

  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 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, write to the
  17. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  18. * Boston, MA 02111-1307, USA.
  19. */
  20. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  21. #error "Only <gio/gio.h> can be included directly."
  22. #endif
  23. #ifndef __G_RESOLVER_H__
  24. #define __G_RESOLVER_H__
  25. #include <gio/giotypes.h>
  26. G_BEGIN_DECLS
  27. #define G_TYPE_RESOLVER (g_resolver_get_type ())
  28. #define G_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_RESOLVER, GResolver))
  29. #define G_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_RESOLVER, GResolverClass))
  30. #define G_IS_RESOLVER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_RESOLVER))
  31. #define G_IS_RESOLVER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_RESOLVER))
  32. #define G_RESOLVER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_RESOLVER, GResolverClass))
  33. typedef struct _GResolverPrivate GResolverPrivate;
  34. typedef struct _GResolverClass GResolverClass;
  35. struct _GResolver {
  36. GObject parent_instance;
  37. GResolverPrivate *priv;
  38. };
  39. struct _GResolverClass {
  40. GObjectClass parent_class;
  41. /* Signals */
  42. void ( *reload) (GResolver *resolver);
  43. /* Virtual methods */
  44. GList * ( *lookup_by_name) (GResolver *resolver,
  45. const gchar *hostname,
  46. GCancellable *cancellable,
  47. GError **error);
  48. void ( *lookup_by_name_async) (GResolver *resolver,
  49. const gchar *hostname,
  50. GCancellable *cancellable,
  51. GAsyncReadyCallback callback,
  52. gpointer user_data);
  53. GList * ( *lookup_by_name_finish) (GResolver *resolver,
  54. GAsyncResult *result,
  55. GError **error);
  56. gchar * ( *lookup_by_address) (GResolver *resolver,
  57. GInetAddress *address,
  58. GCancellable *cancellable,
  59. GError **error);
  60. void ( *lookup_by_address_async) (GResolver *resolver,
  61. GInetAddress *address,
  62. GCancellable *cancellable,
  63. GAsyncReadyCallback callback,
  64. gpointer user_data);
  65. gchar * ( *lookup_by_address_finish) (GResolver *resolver,
  66. GAsyncResult *result,
  67. GError **error);
  68. GList * ( *lookup_service) (GResolver *resolver,
  69. const gchar *rrname,
  70. GCancellable *cancellable,
  71. GError **error);
  72. void ( *lookup_service_async) (GResolver *resolver,
  73. const gchar *rrname,
  74. GCancellable *cancellable,
  75. GAsyncReadyCallback callback,
  76. gpointer user_data);
  77. GList * ( *lookup_service_finish) (GResolver *resolver,
  78. GAsyncResult *result,
  79. GError **error);
  80. /* Padding for future expansion */
  81. void (*_g_reserved1) (void);
  82. void (*_g_reserved2) (void);
  83. void (*_g_reserved3) (void);
  84. void (*_g_reserved4) (void);
  85. void (*_g_reserved5) (void);
  86. void (*_g_reserved6) (void);
  87. };
  88. GType g_resolver_get_type (void) G_GNUC_CONST;
  89. GResolver *g_resolver_get_default (void);
  90. void g_resolver_set_default (GResolver *resolver);
  91. GList *g_resolver_lookup_by_name (GResolver *resolver,
  92. const gchar *hostname,
  93. GCancellable *cancellable,
  94. GError **error);
  95. void g_resolver_lookup_by_name_async (GResolver *resolver,
  96. const gchar *hostname,
  97. GCancellable *cancellable,
  98. GAsyncReadyCallback callback,
  99. gpointer user_data);
  100. GList *g_resolver_lookup_by_name_finish (GResolver *resolver,
  101. GAsyncResult *result,
  102. GError **error);
  103. void g_resolver_free_addresses (GList *addresses);
  104. gchar *g_resolver_lookup_by_address (GResolver *resolver,
  105. GInetAddress *address,
  106. GCancellable *cancellable,
  107. GError **error);
  108. void g_resolver_lookup_by_address_async (GResolver *resolver,
  109. GInetAddress *address,
  110. GCancellable *cancellable,
  111. GAsyncReadyCallback callback,
  112. gpointer user_data);
  113. gchar *g_resolver_lookup_by_address_finish (GResolver *resolver,
  114. GAsyncResult *result,
  115. GError **error);
  116. GList *g_resolver_lookup_service (GResolver *resolver,
  117. const gchar *service,
  118. const gchar *protocol,
  119. const gchar *domain,
  120. GCancellable *cancellable,
  121. GError **error);
  122. void g_resolver_lookup_service_async (GResolver *resolver,
  123. const gchar *service,
  124. const gchar *protocol,
  125. const gchar *domain,
  126. GCancellable *cancellable,
  127. GAsyncReadyCallback callback,
  128. gpointer user_data);
  129. GList *g_resolver_lookup_service_finish (GResolver *resolver,
  130. GAsyncResult *result,
  131. GError **error);
  132. void g_resolver_free_targets (GList *targets);
  133. /**
  134. * G_RESOLVER_ERROR:
  135. *
  136. * Error domain for #GResolver. Errors in this domain will be from the
  137. * #GResolverError enumeration. See #GError for more information on
  138. * error domains.
  139. */
  140. #define G_RESOLVER_ERROR (g_resolver_error_quark ())
  141. GQuark g_resolver_error_quark (void);
  142. G_END_DECLS
  143. #endif /* __G_RESOLVER_H__ */