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.
 
 
 
 
 
 

89 lines
3.5 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright © 2009 Codethink Limited
  4. * Copyright © 2009 Red Hat, Inc
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published
  8. * by the Free Software Foundation; either version 2 of the licence or (at
  9. * your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General
  17. * Public License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. *
  21. * Authors: Ryan Lortie <desrt@desrt.ca>
  22. * Alexander Larsson <alexl@redhat.com>
  23. */
  24. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  25. #error "Only <gio/gio.h> can be included directly."
  26. #endif
  27. #ifndef __G_SOCKET_SERVICE_H__
  28. #define __G_SOCKET_SERVICE_H__
  29. #include <gio/gsocketlistener.h>
  30. G_BEGIN_DECLS
  31. #define G_TYPE_SOCKET_SERVICE (g_socket_service_get_type ())
  32. #define G_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
  33. G_TYPE_SOCKET_SERVICE, GSocketService))
  34. #define G_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
  35. G_TYPE_SOCKET_SERVICE, GSocketServiceClass))
  36. #define G_IS_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
  37. G_TYPE_SOCKET_SERVICE))
  38. #define G_IS_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
  39. G_TYPE_SOCKET_SERVICE))
  40. #define G_SOCKET_SERVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
  41. G_TYPE_SOCKET_SERVICE, GSocketServiceClass))
  42. typedef struct _GSocketServicePrivate GSocketServicePrivate;
  43. typedef struct _GSocketServiceClass GSocketServiceClass;
  44. /**
  45. * GSocketServiceClass:
  46. * @incomming: signal emitted when new connections are accepted
  47. */
  48. struct _GSocketServiceClass
  49. {
  50. GSocketListenerClass parent_class;
  51. gboolean (* incoming) (GSocketService *service,
  52. GSocketConnection *connection,
  53. GObject *source_object);
  54. /* Padding for future expansion */
  55. void (*_g_reserved1) (void);
  56. void (*_g_reserved2) (void);
  57. void (*_g_reserved3) (void);
  58. void (*_g_reserved4) (void);
  59. void (*_g_reserved5) (void);
  60. void (*_g_reserved6) (void);
  61. };
  62. struct _GSocketService
  63. {
  64. GSocketListener parent_instance;
  65. GSocketServicePrivate *priv;
  66. };
  67. GType g_socket_service_get_type (void);
  68. GSocketService *g_socket_service_new (void);
  69. void g_socket_service_start (GSocketService *service);
  70. void g_socket_service_stop (GSocketService *service);
  71. gboolean g_socket_service_is_active (GSocketService *service);
  72. G_END_DECLS
  73. #endif /* __G_SOCKET_SERVICE_H__ */