gunixconnection.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright © 2009 Codethink Limited
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General
  18. * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  19. *
  20. * Authors: Ryan Lortie <desrt@desrt.ca>
  21. */
  22. #ifndef __G_UNIX_CONNECTION_H__
  23. #define __G_UNIX_CONNECTION_H__
  24. #include <gio/gio.h>
  25. G_BEGIN_DECLS
  26. #define G_TYPE_UNIX_CONNECTION (g_unix_connection_get_type ())
  27. #define G_UNIX_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
  28. G_TYPE_UNIX_CONNECTION, GUnixConnection))
  29. #define G_UNIX_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
  30. G_TYPE_UNIX_CONNECTION, GUnixConnectionClass))
  31. #define G_IS_UNIX_CONNECTION(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
  32. G_TYPE_UNIX_CONNECTION))
  33. #define G_IS_UNIX_CONNECTION_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
  34. G_TYPE_UNIX_CONNECTION))
  35. #define G_UNIX_CONNECTION_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
  36. G_TYPE_UNIX_CONNECTION, GUnixConnectionClass))
  37. typedef struct _GUnixConnection GUnixConnection;
  38. typedef struct _GUnixConnectionPrivate GUnixConnectionPrivate;
  39. typedef struct _GUnixConnectionClass GUnixConnectionClass;
  40. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixConnection, g_object_unref)
  41. struct _GUnixConnectionClass
  42. {
  43. GSocketConnectionClass parent_class;
  44. };
  45. struct _GUnixConnection
  46. {
  47. GSocketConnection parent_instance;
  48. GUnixConnectionPrivate *priv;
  49. };
  50. GIO_AVAILABLE_IN_ALL
  51. GType g_unix_connection_get_type (void);
  52. GIO_AVAILABLE_IN_ALL
  53. gboolean g_unix_connection_send_fd (GUnixConnection *connection,
  54. gint fd,
  55. GCancellable *cancellable,
  56. GError **error);
  57. GIO_AVAILABLE_IN_ALL
  58. gint g_unix_connection_receive_fd (GUnixConnection *connection,
  59. GCancellable *cancellable,
  60. GError **error);
  61. GIO_AVAILABLE_IN_ALL
  62. gboolean g_unix_connection_send_credentials (GUnixConnection *connection,
  63. GCancellable *cancellable,
  64. GError **error);
  65. GIO_AVAILABLE_IN_2_32
  66. void g_unix_connection_send_credentials_async (GUnixConnection *connection,
  67. GCancellable *cancellable,
  68. GAsyncReadyCallback callback,
  69. gpointer user_data);
  70. GIO_AVAILABLE_IN_2_32
  71. gboolean g_unix_connection_send_credentials_finish (GUnixConnection *connection,
  72. GAsyncResult *result,
  73. GError **error);
  74. GIO_AVAILABLE_IN_2_32
  75. GCredentials *g_unix_connection_receive_credentials (GUnixConnection *connection,
  76. GCancellable *cancellable,
  77. GError **error);
  78. GIO_AVAILABLE_IN_2_32
  79. void g_unix_connection_receive_credentials_async (GUnixConnection *connection,
  80. GCancellable *cancellable,
  81. GAsyncReadyCallback callback,
  82. gpointer user_data);
  83. GIO_AVAILABLE_IN_ALL
  84. GCredentials *g_unix_connection_receive_credentials_finish (GUnixConnection *connection,
  85. GAsyncResult *result,
  86. GError **error);
  87. G_END_DECLS
  88. #endif /* __G_UNIX_CONNECTION_H__ */