gbytes.h 3.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
 * Copyright © 2009, 2010 Codethink Limited
 * Copyright © 2011 Collabora Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the licence, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 * Author: Ryan Lortie <desrt@desrt.ca>
 *         Stef Walter <stefw@collabora.co.uk>
 */

24 25 26
#ifndef __G_BYTES_H__
#define __G_BYTES_H__

27 28 29 30
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
#error "Only <glib.h> can be included directly."
#endif

31 32 33
#include <glib/gtypes.h>
#include <glib/garray.h>

34 35
G_BEGIN_DECLS

36
GLIB_AVAILABLE_IN_ALL
37 38 39
GBytes *        g_bytes_new                     (gconstpointer   data,
                                                 gsize           size);

40
GLIB_AVAILABLE_IN_ALL
41 42 43
GBytes *        g_bytes_new_take                (gpointer        data,
                                                 gsize           size);

44
GLIB_AVAILABLE_IN_ALL
45 46 47
GBytes *        g_bytes_new_static              (gconstpointer   data,
                                                 gsize           size);

48
GLIB_AVAILABLE_IN_ALL
49 50 51 52 53
GBytes *        g_bytes_new_with_free_func      (gconstpointer   data,
                                                 gsize           size,
                                                 GDestroyNotify  free_func,
                                                 gpointer        user_data);

54
GLIB_AVAILABLE_IN_ALL
55 56 57 58
GBytes *        g_bytes_new_from_bytes          (GBytes         *bytes,
                                                 gsize           offset,
                                                 gsize           length);

59
GLIB_AVAILABLE_IN_ALL
60 61
gconstpointer   g_bytes_get_data                (GBytes         *bytes,
                                                 gsize          *size);
62

63
GLIB_AVAILABLE_IN_ALL
64 65
gsize           g_bytes_get_size                (GBytes         *bytes);

66
GLIB_AVAILABLE_IN_ALL
67 68
GBytes *        g_bytes_ref                     (GBytes         *bytes);

69
GLIB_AVAILABLE_IN_ALL
70 71
void            g_bytes_unref                   (GBytes         *bytes);

72
GLIB_AVAILABLE_IN_ALL
73 74 75
gpointer        g_bytes_unref_to_data           (GBytes         *bytes,
                                                 gsize          *size);

76
GLIB_AVAILABLE_IN_ALL
77 78
GByteArray *    g_bytes_unref_to_array          (GBytes         *bytes);

79
GLIB_AVAILABLE_IN_ALL
80 81
guint           g_bytes_hash                    (gconstpointer   bytes);

82
GLIB_AVAILABLE_IN_ALL
83 84 85
gboolean        g_bytes_equal                   (gconstpointer   bytes1,
                                                 gconstpointer   bytes2);

86
GLIB_AVAILABLE_IN_ALL
87 88 89
gint            g_bytes_compare                 (gconstpointer   bytes1,
                                                 gconstpointer   bytes2);

90 91
G_END_DECLS

92
#endif /* __G_BYTES_H__ */