gbase64.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifndef __G_BASE64_H__
  21. #define __G_BASE64_H__
  22. #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
  23. #error "Only <glib.h> can be included directly."
  24. #endif
  25. #include <glib/gtypes.h>
  26. G_BEGIN_DECLS
  27. GLIB_AVAILABLE_IN_ALL
  28. gsize g_base64_encode_step (const guchar *in,
  29. gsize len,
  30. gboolean break_lines,
  31. gchar *out,
  32. gint *state,
  33. gint *save);
  34. GLIB_AVAILABLE_IN_ALL
  35. gsize g_base64_encode_close (gboolean break_lines,
  36. gchar *out,
  37. gint *state,
  38. gint *save);
  39. GLIB_AVAILABLE_IN_ALL
  40. gchar* g_base64_encode (const guchar *data,
  41. gsize len) G_GNUC_MALLOC;
  42. GLIB_AVAILABLE_IN_ALL
  43. gsize g_base64_decode_step (const gchar *in,
  44. gsize len,
  45. guchar *out,
  46. gint *state,
  47. guint *save);
  48. GLIB_AVAILABLE_IN_ALL
  49. guchar *g_base64_decode (const gchar *text,
  50. gsize *out_len) G_GNUC_MALLOC;
  51. GLIB_AVAILABLE_IN_ALL
  52. guchar *g_base64_decode_inplace (gchar *text,
  53. gsize *out_len);
  54. G_END_DECLS
  55. #endif /* __G_BASE64_H__ */