2000-01-24 bertrand <bertrand@helixcode.com> * camel/camel-recipient.c (camel_recipient_table_add_list): add recipient_list to the recipients, not recipients_list. I don't know what that variable was doing here. 2000-01-23 bertrand <bertrand@helixcode.com> * camel/camel-store.c (camel_store_get_session): added a public get_session method. * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary): (camel_mbox_load_summary): load/save message sizes in the summary file * camel/providers/mbox/camel-mbox-summary.h: added a size field to the message information structure. * camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary): copy message size to the mbox summary information too. * camel/camel-stream-fs.c (_seek): updated to work with bounded fs streams. (_write): ditto. (_read): ditto. * camel/camel-stream-fs.h (struct ): added the cur_pos, inf_bound and sup_bound members to allow for bounded fs stream. * camel/camel-stream-fs.c (_set_bounds): new func. (_init_with_fd_and_bounds): idem. (_init_with_name_and_bounds): idem. New functions to allow the usage of bounded fs streams. The bounded fs stream allow, for example, to make a stream from a message stored in an mbox file. svn path=/trunk/; revision=1620
50 lines
1.4 KiB
C
50 lines
1.4 KiB
C
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
/* tests mime message file parsing */
|
|
#include "gmime-utils.h"
|
|
#include "stdio.h"
|
|
#include "camel-log.h"
|
|
#include "camel-mime-message.h"
|
|
#include "camel-mime-part.h"
|
|
#include "camel-stream.h"
|
|
#include "camel-stream-fs.h"
|
|
#include "camel.h"
|
|
|
|
int
|
|
main (int argc, char**argv)
|
|
{
|
|
GHashTable *header_table;
|
|
CamelMimeMessage *message;
|
|
CamelStream *input_stream, *output_stream;
|
|
|
|
gtk_init (&argc, &argv);
|
|
camel_init ();
|
|
camel_debug_level = CAMEL_LOG_LEVEL_FULL_DEBUG;
|
|
|
|
message = camel_mime_message_new_with_session( (CamelSession *)NULL);
|
|
|
|
|
|
input_stream = camel_stream_fs_new_with_name ("mail.test", CAMEL_STREAM_FS_READ);
|
|
if (!input_stream) {
|
|
perror ("could not open input file");
|
|
printf ("You must create the file mail.test before running this test");
|
|
exit(2);
|
|
}
|
|
|
|
camel_data_wrapper_construct_from_stream ( CAMEL_DATA_WRAPPER (message), input_stream);
|
|
|
|
camel_debug_level = CAMEL_LOG_LEVEL_FULL_DEBUG;
|
|
camel_medium_get_content_object (CAMEL_MEDIUM (message));
|
|
camel_stream_close (input_stream);
|
|
gtk_object_unref (GTK_OBJECT (input_stream));
|
|
|
|
output_stream = camel_stream_fs_new_with_name ("mail2.test", CAMEL_STREAM_FS_WRITE);
|
|
camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message), output_stream);
|
|
camel_stream_close (output_stream);
|
|
gtk_object_unref (GTK_OBJECT (output_stream));
|
|
|
|
//gtk_object_unref (GTK_OBJECT (message));
|
|
|
|
return 0;
|
|
|
|
}
|