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.
 
 
 
 
 
 

106 lines
4.7 KiB

  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  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: Ryan Lortie <desrt@desrt.ca>
  21. */
  22. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  23. #error "Only <gio/gio.h> can be included directly."
  24. #endif
  25. #ifndef __G_SOCKET_CONTROL_MESSAGE_H__
  26. #define __G_SOCKET_CONTROL_MESSAGE_H__
  27. #include <gio/giotypes.h>
  28. G_BEGIN_DECLS
  29. #define G_TYPE_SOCKET_CONTROL_MESSAGE (g_socket_control_message_get_type ())
  30. #define G_SOCKET_CONTROL_MESSAGE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
  31. G_TYPE_SOCKET_CONTROL_MESSAGE, \
  32. GSocketControlMessage))
  33. #define G_SOCKET_CONTROL_MESSAGE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
  34. G_TYPE_SOCKET_CONTROL_MESSAGE, \
  35. GSocketControlMessageClass))
  36. #define G_IS_SOCKET_CONTROL_MESSAGE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
  37. G_TYPE_SOCKET_CONTROL_MESSAGE))
  38. #define G_IS_SOCKET_CONTROL_MESSAGE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
  39. G_TYPE_SOCKET_CONTROL_MESSAGE))
  40. #define G_SOCKET_CONTROL_MESSAGE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
  41. G_TYPE_SOCKET_CONTROL_MESSAGE, \
  42. GSocketControlMessageClass))
  43. typedef struct _GSocketControlMessagePrivate GSocketControlMessagePrivate;
  44. typedef struct _GSocketControlMessageClass GSocketControlMessageClass;
  45. /**
  46. * GSocketControlMessageClass:
  47. * @get_size: gets the size of the message.
  48. * @get_level: gets the protocol of the message.
  49. * @get_type: gets the protocol specific type of the message.
  50. * @serialize: Writes out the message data.
  51. * @deserialize: Tries to deserialize a message.
  52. **/
  53. struct _GSocketControlMessageClass
  54. {
  55. GObjectClass parent_class;
  56. gsize (* get_size) (GSocketControlMessage *message);
  57. int (* get_level) (GSocketControlMessage *message);
  58. int (* get_type) (GSocketControlMessage *message);
  59. void (* serialize) (GSocketControlMessage *message,
  60. gpointer data);
  61. GSocketControlMessage *(* deserialize) (int level,
  62. int type,
  63. gsize size,
  64. gpointer data);
  65. /*< private >*/
  66. /* Padding for future expansion */
  67. void (*_g_reserved1) (void);
  68. void (*_g_reserved2) (void);
  69. void (*_g_reserved3) (void);
  70. void (*_g_reserved4) (void);
  71. void (*_g_reserved5) (void);
  72. };
  73. struct _GSocketControlMessage
  74. {
  75. GObject parent_instance;
  76. GSocketControlMessagePrivate *priv;
  77. };
  78. GType g_socket_control_message_get_type (void) G_GNUC_CONST;
  79. gsize g_socket_control_message_get_size (GSocketControlMessage *message);
  80. int g_socket_control_message_get_level (GSocketControlMessage *message);
  81. int g_socket_control_message_get_msg_type (GSocketControlMessage *message);
  82. void g_socket_control_message_serialize (GSocketControlMessage *message,
  83. gpointer data);
  84. GSocketControlMessage *g_socket_control_message_deserialize (int level,
  85. int type,
  86. gsize size,
  87. gpointer data);
  88. G_END_DECLS
  89. #endif /* __G_SOCKET_CONTROL_MESSAGE_H__ */