gbytes.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright © 2009, 2010 Codethink Limited
  3. * Copyright © 2011 Collabora Ltd.
  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 licence, 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 Public
  16. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * Author: Ryan Lortie <[email protected]>
  19. * Stef Walter <[email protected]>
  20. */
  21. #ifndef __G_BYTES_H__
  22. #define __G_BYTES_H__
  23. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  24. #error "Only <glib.h> can be included directly."
  25. #endif
  26. #include <glib/gtypes.h>
  27. #include <glib/garray.h>
  28. G_BEGIN_DECLS
  29. GLIB_AVAILABLE_IN_ALL
  30. GBytes * g_bytes_new (gconstpointer data,
  31. gsize size);
  32. GLIB_AVAILABLE_IN_ALL
  33. GBytes * g_bytes_new_take (gpointer data,
  34. gsize size);
  35. GLIB_AVAILABLE_IN_ALL
  36. GBytes * g_bytes_new_static (gconstpointer data,
  37. gsize size);
  38. GLIB_AVAILABLE_IN_ALL
  39. GBytes * g_bytes_new_with_free_func (gconstpointer data,
  40. gsize size,
  41. GDestroyNotify free_func,
  42. gpointer user_data);
  43. GLIB_AVAILABLE_IN_ALL
  44. GBytes * g_bytes_new_from_bytes (GBytes *bytes,
  45. gsize offset,
  46. gsize length);
  47. GLIB_AVAILABLE_IN_ALL
  48. gconstpointer g_bytes_get_data (GBytes *bytes,
  49. gsize *size);
  50. GLIB_AVAILABLE_IN_ALL
  51. gsize g_bytes_get_size (GBytes *bytes);
  52. GLIB_AVAILABLE_IN_ALL
  53. GBytes * g_bytes_ref (GBytes *bytes);
  54. GLIB_AVAILABLE_IN_ALL
  55. void g_bytes_unref (GBytes *bytes);
  56. GLIB_AVAILABLE_IN_ALL
  57. gpointer g_bytes_unref_to_data (GBytes *bytes,
  58. gsize *size);
  59. GLIB_AVAILABLE_IN_ALL
  60. GByteArray * g_bytes_unref_to_array (GBytes *bytes);
  61. GLIB_AVAILABLE_IN_ALL
  62. guint g_bytes_hash (gconstpointer bytes);
  63. GLIB_AVAILABLE_IN_ALL
  64. gboolean g_bytes_equal (gconstpointer bytes1,
  65. gconstpointer bytes2);
  66. GLIB_AVAILABLE_IN_ALL
  67. gint g_bytes_compare (gconstpointer bytes1,
  68. gconstpointer bytes2);
  69. G_END_DECLS
  70. #endif /* __G_BYTES_H__ */