gunixfdlist.h 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Authors: Ryan Lortie <desrt@desrt.ca>
  19. */
  20. #ifndef __G_UNIX_FD_LIST_H__
  21. #define __G_UNIX_FD_LIST_H__
  22. #include <gio/gio.h>
  23. G_BEGIN_DECLS
  24. #define G_TYPE_UNIX_FD_LIST (g_unix_fd_list_get_type ())
  25. #define G_UNIX_FD_LIST(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
  26. G_TYPE_UNIX_FD_LIST, GUnixFDList))
  27. #define G_UNIX_FD_LIST_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
  28. G_TYPE_UNIX_FD_LIST, GUnixFDListClass))
  29. #define G_IS_UNIX_FD_LIST(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
  30. G_TYPE_UNIX_FD_LIST))
  31. #define G_IS_UNIX_FD_LIST_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
  32. G_TYPE_UNIX_FD_LIST))
  33. #define G_UNIX_FD_LIST_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
  34. G_TYPE_UNIX_FD_LIST, GUnixFDListClass))
  35. G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUnixFDList, g_object_unref)
  36. typedef struct _GUnixFDListPrivate GUnixFDListPrivate;
  37. typedef struct _GUnixFDListClass GUnixFDListClass;
  38. struct _GUnixFDListClass
  39. {
  40. GObjectClass parent_class;
  41. /*< private >*/
  42. /* Padding for future expansion */
  43. void (*_g_reserved1) (void);
  44. void (*_g_reserved2) (void);
  45. void (*_g_reserved3) (void);
  46. void (*_g_reserved4) (void);
  47. void (*_g_reserved5) (void);
  48. };
  49. struct _GUnixFDList
  50. {
  51. GObject parent_instance;
  52. GUnixFDListPrivate *priv;
  53. };
  54. GLIB_AVAILABLE_IN_ALL
  55. GType g_unix_fd_list_get_type (void) G_GNUC_CONST;
  56. GLIB_AVAILABLE_IN_ALL
  57. GUnixFDList * g_unix_fd_list_new (void);
  58. GLIB_AVAILABLE_IN_ALL
  59. GUnixFDList * g_unix_fd_list_new_from_array (const gint *fds,
  60. gint n_fds);
  61. GLIB_AVAILABLE_IN_ALL
  62. gint g_unix_fd_list_append (GUnixFDList *list,
  63. gint fd,
  64. GError **error);
  65. GLIB_AVAILABLE_IN_ALL
  66. gint g_unix_fd_list_get_length (GUnixFDList *list);
  67. GLIB_AVAILABLE_IN_ALL
  68. gint g_unix_fd_list_get (GUnixFDList *list,
  69. gint index_,
  70. GError **error);
  71. GLIB_AVAILABLE_IN_ALL
  72. const gint * g_unix_fd_list_peek_fds (GUnixFDList *list,
  73. gint *length);
  74. GLIB_AVAILABLE_IN_ALL
  75. gint * g_unix_fd_list_steal_fds (GUnixFDList *list,
  76. gint *length);
  77. G_END_DECLS
  78. #endif /* __G_UNIX_FD_LIST_H__ */