Add tests for GTimer and GTimeVal
[platform/upstream/glib.git] / glib / gbytes.h
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, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author: Ryan Lortie <desrt@desrt.ca>
21  *         Stef Walter <stefw@collabora.co.uk>
22  */
23
24 #ifndef __G_BYTES_H__
25 #define __G_BYTES_H__
26
27 #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
28 #error "Only <glib.h> can be included directly."
29 #endif
30
31 #include <glib/gtypes.h>
32 #include <glib/garray.h>
33
34 G_BEGIN_DECLS
35
36 GLIB_AVAILABLE_IN_ALL
37 GBytes *        g_bytes_new                     (gconstpointer   data,
38                                                  gsize           size);
39
40 GLIB_AVAILABLE_IN_ALL
41 GBytes *        g_bytes_new_take                (gpointer        data,
42                                                  gsize           size);
43
44 GLIB_AVAILABLE_IN_ALL
45 GBytes *        g_bytes_new_static              (gconstpointer   data,
46                                                  gsize           size);
47
48 GLIB_AVAILABLE_IN_ALL
49 GBytes *        g_bytes_new_with_free_func      (gconstpointer   data,
50                                                  gsize           size,
51                                                  GDestroyNotify  free_func,
52                                                  gpointer        user_data);
53
54 GLIB_AVAILABLE_IN_ALL
55 GBytes *        g_bytes_new_from_bytes          (GBytes         *bytes,
56                                                  gsize           offset,
57                                                  gsize           length);
58
59 GLIB_AVAILABLE_IN_ALL
60 gconstpointer   g_bytes_get_data                (GBytes         *bytes,
61                                                  gsize          *size);
62
63 GLIB_AVAILABLE_IN_ALL
64 gsize           g_bytes_get_size                (GBytes         *bytes);
65
66 GLIB_AVAILABLE_IN_ALL
67 GBytes *        g_bytes_ref                     (GBytes         *bytes);
68
69 GLIB_AVAILABLE_IN_ALL
70 void            g_bytes_unref                   (GBytes         *bytes);
71
72 GLIB_AVAILABLE_IN_ALL
73 gpointer        g_bytes_unref_to_data           (GBytes         *bytes,
74                                                  gsize          *size);
75
76 GLIB_AVAILABLE_IN_ALL
77 GByteArray *    g_bytes_unref_to_array          (GBytes         *bytes);
78
79 GLIB_AVAILABLE_IN_ALL
80 guint           g_bytes_hash                    (gconstpointer   bytes);
81
82 GLIB_AVAILABLE_IN_ALL
83 gboolean        g_bytes_equal                   (gconstpointer   bytes1,
84                                                  gconstpointer   bytes2);
85
86 GLIB_AVAILABLE_IN_ALL
87 gint            g_bytes_compare                 (gconstpointer   bytes1,
88                                                  gconstpointer   bytes2);
89
90 G_END_DECLS
91
92 #endif /* __G_BYTES_H__ */