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.1 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 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
22#ifndef __G_BYTES_H__
23#define __G_BYTES_H__
24
25#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
26#error "Only <glib.h> can be included directly."
27#endif
28
29#include <glib/gtypes.h>
30#include <glib/garray.h>
31
32G_BEGIN_DECLS
33
34GLIB_AVAILABLE_IN_ALL
35GBytes * g_bytes_new (gconstpointer data,
36 gsize size);
37
38GLIB_AVAILABLE_IN_ALL
39GBytes * g_bytes_new_take (gpointer data,
40 gsize size);
41
42GLIB_AVAILABLE_IN_ALL
43GBytes * g_bytes_new_static (gconstpointer data,
44 gsize size);
45
46GLIB_AVAILABLE_IN_ALL
47GBytes * g_bytes_new_with_free_func (gconstpointer data,
48 gsize size,
49 GDestroyNotify free_func,
50 gpointer user_data);
51
52GLIB_AVAILABLE_IN_ALL
53GBytes * g_bytes_new_from_bytes (GBytes *bytes,
54 gsize offset,
55 gsize length);
56
57GLIB_AVAILABLE_IN_ALL
58gconstpointer g_bytes_get_data (GBytes *bytes,
59 gsize *size);
60
61GLIB_AVAILABLE_IN_ALL
62gsize g_bytes_get_size (GBytes *bytes);
63
64GLIB_AVAILABLE_IN_ALL
65GBytes * g_bytes_ref (GBytes *bytes);
66
67GLIB_AVAILABLE_IN_ALL
68void g_bytes_unref (GBytes *bytes);
69
70GLIB_AVAILABLE_IN_ALL
71gpointer g_bytes_unref_to_data (GBytes *bytes,
72 gsize *size);
73
74GLIB_AVAILABLE_IN_ALL
75GByteArray * g_bytes_unref_to_array (GBytes *bytes);
76
77GLIB_AVAILABLE_IN_ALL
78guint g_bytes_hash (gconstpointer bytes);
79
80GLIB_AVAILABLE_IN_ALL
81gboolean g_bytes_equal (gconstpointer bytes1,
82 gconstpointer bytes2);
83
84GLIB_AVAILABLE_IN_ALL
85gint g_bytes_compare (gconstpointer bytes1,
86 gconstpointer bytes2);
87
88G_END_DECLS
89
90#endif /* __G_BYTES_H__ */
91