File: anything.c

package info (click to toggle)
libtinymail 0.0.9-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 18,148 kB
  • ctags: 19,175
  • sloc: ansic: 151,565; xml: 20,145; sh: 9,245; makefile: 2,394; cs: 243; cpp: 141; python: 93; perl: 71
file content (34 lines) | stat: -rw-r--r-- 851 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <string.h>
#include <camel/camel.h>

#include <gtk/gtk.h>

#define TEST "This is a test to compres to compress to compres"

int main (int argc, char **argv)
{
	CamelStream *in, *out, *com, *de;
	CamelInternetAddress *addr;

	g_thread_init (NULL);
	camel_type_init ();

	addr = camel_internet_address_new ();

	out = camel_stream_fs_new_with_name ("/tmp/testing", O_CREAT, S_IRWXU);
	in = camel_stream_mem_new_with_buffer (TEST, strlen (TEST));

	com = camel_stream_gzip_new (in, 7, CAMEL_STREAM_GZIP_ZIP, CAMEL_STREAM_GZIP_ZIP);
	de = camel_stream_gzip_new (out, 7, CAMEL_STREAM_GZIP_UNZIP, CAMEL_STREAM_GZIP_UNZIP);

	camel_stream_write_to_stream (com, de);

	camel_object_unref (CAMEL_OBJECT (com));
	camel_object_unref (CAMEL_OBJECT (de));
	camel_object_unref (CAMEL_OBJECT (out));
	camel_object_unref (CAMEL_OBJECT (in));

	return 0;

}