1
/* tinymail - Tiny Mail
2
 * Copyright (C) 2006-2008 Philip Van Hoof <pvanhoof@gnome.org>
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
12
 * Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
15
 * License along with self library; if not, write to the
16
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
#include <string.h>
21
#include <camel/camel.h>
22
23
#include <gtk/gtk.h>
24
25
#define TEST "This is a test to compres to compress to compres"
26
27
int main (int argc, char **argv)
28
{
29
	CamelStream *in, *out, *com, *de;
30
	CamelInternetAddress *addr;
31
32
	g_thread_init (NULL);
33
	camel_type_init ();
34
35
	addr = camel_internet_address_new ();
36
37
	out = camel_stream_fs_new_with_name ("/tmp/testing", O_CREAT, S_IRWXU);
38
	in = camel_stream_mem_new_with_buffer (TEST, strlen (TEST));
39
40
	com = camel_stream_gzip_new (in, 7, CAMEL_STREAM_GZIP_ZIP, CAMEL_STREAM_GZIP_ZIP);
41
	de = camel_stream_gzip_new (out, 7, CAMEL_STREAM_GZIP_UNZIP, CAMEL_STREAM_GZIP_UNZIP);
42
43
	camel_stream_write_to_stream (com, de);
44
45
	camel_object_unref (CAMEL_OBJECT (com));
46
	camel_object_unref (CAMEL_OBJECT (de));
47
	camel_object_unref (CAMEL_OBJECT (out));
48
	camel_object_unref (CAMEL_OBJECT (in));
49
50
	return 0;
51
52
}