+/**
+ * g_base64_decode_inplace:
+ * @text: (inout) (array length=out_len) (element-type guint8): zero-terminated
+ * string with base64 text to decode
+ * @out_len: (inout): The length of the decoded data is written here
+ *
+ * Decode a sequence of Base-64 encoded text into binary data
+ * by overwriting the input data.
+ *
+ * Returns: (transfer none): The binary data that @text responds. This pointer
+ * is the same as the input @text.
+ *
+ * Since: 2.20
+ */
+guchar *
+g_base64_decode_inplace (gchar *text,
+ gsize *out_len)
+{
+ gint input_length, state = 0;
+ guint save = 0;
+
+ g_return_val_if_fail (text != NULL, NULL);
+ g_return_val_if_fail (out_len != NULL, NULL);
+
+ input_length = strlen (text);
+
+ g_return_val_if_fail (input_length > 1, NULL);
+
+ *out_len = g_base64_decode_step (text, input_length, (guchar *) text, &state, &save);
+
+ return (guchar *) text;
+}