You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

92 rivejä
4.0 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. * Copyright © 2008 Christian Kellner, Samuel Cormier-Iijima
  3. * Copyright © 2009 Codethink Limited
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published
  7. * by the Free Software Foundation; either version 2 of the licence or (at
  8. * 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. * Authors: Christian Kellner <gicmo@gnome.org>
  21. * Samuel Cormier-Iijima <sciyoshi@gmail.com>
  22. * Ryan Lortie <desrt@desrt.ca>
  23. * Alexander Larsson <alexl@redhat.com>
  24. */
  25. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  26. #error "Only <gio/gio.h> can be included directly."
  27. #endif
  28. #ifndef __G_SOCKET_CONNECTION_H__
  29. #define __G_SOCKET_CONNECTION_H__
  30. #include <glib-object.h>
  31. #include <gio/gsocket.h>
  32. #include <gio/giostream.h>
  33. G_BEGIN_DECLS
  34. #define G_TYPE_SOCKET_CONNECTION (g_socket_connection_get_type ())
  35. #define G_SOCKET_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
  36. G_TYPE_SOCKET_CONNECTION, GSocketConnection))
  37. #define G_SOCKET_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
  38. G_TYPE_SOCKET_CONNECTION, GSocketConnectionClass))
  39. #define G_IS_SOCKET_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
  40. G_TYPE_SOCKET_CONNECTION))
  41. #define G_IS_SOCKET_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
  42. G_TYPE_SOCKET_CONNECTION))
  43. #define G_SOCKET_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
  44. G_TYPE_SOCKET_CONNECTION, GSocketConnectionClass))
  45. typedef struct _GSocketConnectionPrivate GSocketConnectionPrivate;
  46. typedef struct _GSocketConnectionClass GSocketConnectionClass;
  47. struct _GSocketConnectionClass
  48. {
  49. GIOStreamClass parent_class;
  50. /* Padding for future expansion */
  51. void (*_g_reserved1) (void);
  52. void (*_g_reserved2) (void);
  53. void (*_g_reserved3) (void);
  54. void (*_g_reserved4) (void);
  55. void (*_g_reserved5) (void);
  56. void (*_g_reserved6) (void);
  57. };
  58. struct _GSocketConnection
  59. {
  60. GIOStream parent_instance;
  61. GSocketConnectionPrivate *priv;
  62. };
  63. GType g_socket_connection_get_type (void) G_GNUC_CONST;
  64. GSocket *g_socket_connection_get_socket (GSocketConnection *connection);
  65. GSocketAddress *g_socket_connection_get_local_address (GSocketConnection *connection,
  66. GError **error);
  67. GSocketAddress *g_socket_connection_get_remote_address (GSocketConnection *connection,
  68. GError **error);
  69. void g_socket_connection_factory_register_type (GType g_type,
  70. GSocketFamily family,
  71. GSocketType type,
  72. gint protocol);
  73. GType g_socket_connection_factory_lookup_type (GSocketFamily family,
  74. GSocketType type,
  75. gint protocol_id);
  76. GSocketConnection *g_socket_connection_factory_create_connection (GSocket *socket);
  77. G_END_DECLS
  78. #endif /* __G_SOCKET_CONNECTION_H__ */