gpollableutils.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* GIO - GLib Input, Output and Streaming Library
  2. *
  3. * Copyright (C) 2012 Red Hat, Inc.
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at 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. #ifndef __G_POLLABLE_UTILS_H__
  19. #define __G_POLLABLE_UTILS_H__
  20. #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
  21. #error "Only <gio/gio.h> can be included directly."
  22. #endif
  23. #include <gio/gio.h>
  24. G_BEGIN_DECLS
  25. GLIB_AVAILABLE_IN_ALL
  26. GSource *g_pollable_source_new (GObject *pollable_stream);
  27. GLIB_AVAILABLE_IN_2_34
  28. GSource *g_pollable_source_new_full (gpointer pollable_stream,
  29. GSource *child_source,
  30. GCancellable *cancellable);
  31. GLIB_AVAILABLE_IN_2_34
  32. gssize g_pollable_stream_read (GInputStream *stream,
  33. void *buffer,
  34. gsize count,
  35. gboolean blocking,
  36. GCancellable *cancellable,
  37. GError **error);
  38. GLIB_AVAILABLE_IN_2_34
  39. gssize g_pollable_stream_write (GOutputStream *stream,
  40. const void *buffer,
  41. gsize count,
  42. gboolean blocking,
  43. GCancellable *cancellable,
  44. GError **error);
  45. GLIB_AVAILABLE_IN_2_34
  46. gboolean g_pollable_stream_write_all (GOutputStream *stream,
  47. const void *buffer,
  48. gsize count,
  49. gboolean blocking,
  50. gsize *bytes_written,
  51. GCancellable *cancellable,
  52. GError **error);
  53. G_END_DECLS
  54. #endif /* _G_POLLABLE_UTILS_H_ */