#include int main(int argc, char **argv) { gchar *filebuf; gsize inlen; guchar *out_data; gsize out_len; gchar *out_name; GMimeEncoding state; g_assert(argc >= 2); g_file_get_contents(argv[1], &filebuf, &inlen, NULL); out_data = g_base64_decode(filebuf, &out_len); out_name = g_strconcat(argv[1], "_GLIB", NULL); g_file_set_contents(out_name, (const gchar *) out_data, out_len, NULL); g_free(out_data); g_free(out_name); g_mime_encoding_init_decode(&state, GMIME_CONTENT_ENCODING_BASE64); out_data = g_malloc(g_mime_encoding_outlen(&state, inlen) + 1U); out_len = g_mime_encoding_flush(&state, filebuf, inlen, (char *) out_data); out_name = g_strconcat(argv[1], "_GMIME", NULL); g_file_set_contents(out_name, (const gchar *) out_data, out_len, NULL); g_free(out_data); g_free(out_name); g_free(filebuf); return 0; }