1/* grefstring.h: Reference counted strings
2 *
3 * Copyright 2018 Emmanuele Bassi
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
19#pragma once
20
21#include "gmem.h"
22#include "gmacros.h"
23
24G_BEGIN_DECLS
25
26GLIB_AVAILABLE_IN_2_58
27char * g_ref_string_new (const char *str);
28GLIB_AVAILABLE_IN_2_58
29char * g_ref_string_new_len (const char *str,
30 gssize len);
31GLIB_AVAILABLE_IN_2_58
32char * g_ref_string_new_intern (const char *str);
33
34GLIB_AVAILABLE_IN_2_58
35char * g_ref_string_acquire (char *str);
36GLIB_AVAILABLE_IN_2_58
37void g_ref_string_release (char *str);
38
39GLIB_AVAILABLE_IN_2_58
40gsize g_ref_string_length (char *str);
41
42typedef char GRefString;
43
44G_END_DECLS
45