1/* gbase64.h - Base64 coding functions
2 *
3 * Copyright (C) 2005 Alexander Larsson <alexl@redhat.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef __G_BASE64_H__
22#define __G_BASE64_H__
23
24#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
25#error "Only <glib.h> can be included directly."
26#endif
27
28#include <glib/gtypes.h>
29
30G_BEGIN_DECLS
31
32GLIB_AVAILABLE_IN_ALL
33gsize g_base64_encode_step (const guchar *in,
34 gsize len,
35 gboolean break_lines,
36 gchar *out,
37 gint *state,
38 gint *save);
39GLIB_AVAILABLE_IN_ALL
40gsize g_base64_encode_close (gboolean break_lines,
41 gchar *out,
42 gint *state,
43 gint *save);
44GLIB_AVAILABLE_IN_ALL
45gchar* g_base64_encode (const guchar *data,
46 gsize len) G_GNUC_MALLOC;
47GLIB_AVAILABLE_IN_ALL
48gsize g_base64_decode_step (const gchar *in,
49 gsize len,
50 guchar *out,
51 gint *state,
52 guint *save);
53GLIB_AVAILABLE_IN_ALL
54guchar *g_base64_decode (const gchar *text,
55 gsize *out_len) G_GNUC_MALLOC;
56GLIB_AVAILABLE_IN_ALL
57guchar *g_base64_decode_inplace (gchar *text,
58 gsize *out_len);
59
60
61G_END_DECLS
62
63#endif /* __G_BASE64_H__ */
64