aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-multipart.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed unneeded CAMEL_OBJECT() casts.Jeffrey Stedfast2003-10-241-5/+5
| | | | | | | | 2003-10-23 Jeffrey Stedfast <fejj@ximian.com> * *.c: Removed unneeded CAMEL_OBJECT() casts. svn path=/trunk/; revision=23052
* namespaced the encoding/decoding routines.Jeffrey Stedfast2003-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-09-18 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: namespaced the encoding/decoding routines. * camel-mime-filter-basic.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-multipart.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-sasl-digest-md5.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-sasl.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * camel-vee-folder.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * providers/imap/camel-imap-search.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c * providers/pop3/camel-pop3-folder.c: updated for namespace changes to the encoding/decoding routines in camel-mime-utils.c svn path=/trunk/; revision=22615
* s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g andJeffrey Stedfast2003-09-191-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-26 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and s/_header_state/_camel_mime_parser_state/g * camel-filter-driver.c: Same. * camel-folder-summary.c: Here too. * camel-http-stream.c: And here. * camel-mime-message.c: ... * camel-mime-part-utils.c: ... * camel-mime-part.c: ... * camel-movemail.c: ... * camel-multipart-signed.c: ... * camel-multipart.c: ... * providers/local/camel-mbox-folder.c: ... * providers/local/camel-mbox-summary.c: ... * providers/local/camel-mh-summary.c: ... * providers/nntp/camel-nntp-summary.c: ... * providers/pop3/camel-pop3-folder.c: ... 2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22613
* temporarily reverting my camel namespace patches until after we merge in ↵Jeffrey Stedfast2003-08-271-6/+6
| | | | | | some of the other branches svn path=/trunk/; revision=22373
* s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g andJeffrey Stedfast2003-08-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-26 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-parser.[c,h]: s/HSCAN_/CAMEL_MIME_PARSER_STATE_/g and s/_header_state/_camel_mime_parser_state/g * camel-filter-driver.c: Same. * camel-folder-summary.c: Here too. * camel-http-stream.c: And here. * camel-mime-message.c: ... * camel-mime-part-utils.c: ... * camel-mime-part.c: ... * camel-movemail.c: ... * camel-multipart-signed.c: ... * camel-multipart.c: ... * providers/local/camel-mbox-folder.c: ... * providers/local/camel-mbox-summary.c: ... * providers/local/camel-mh-summary.c: ... * providers/nntp/camel-nntp-summary.c: ... * providers/pop3/camel-pop3-folder.c: ... svn path=/trunk/; revision=22365
* Namespaced.Jeffrey Stedfast2003-08-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22355
* ** See bug #47634.Not Zed2003-08-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 2003-08-15 Not Zed <NotZed@Ximian.com> ** See bug #47634. * tests/lib/messages.c (test_message_compare): check write_to_stream returns. (message_dump_rec): helper to dump message structure. * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): dont set content encoding here. (camel_mime_part_construct_content_from_parser): set it here instead, on every part. basically same as setting the mime_type_field always. * camel-multipart-signed.c (camel_multipart_signed_class_init): * camel-mime-message.c (camel_mime_message_class_init): * camel-multipart.c (camel_multipart_class_init): override decode_to_stream to always do the same as write_to_stream, since we can never be encoded. svn path=/trunk/; revision=22252
* New test suite for the mime parser (which is where the below 2 fixes wereJeffrey Stedfast2003-08-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/message/test4.c: New test suite for the mime parser (which is where the below 2 fixes were noticed). * camel-mime-parser.c (folder_boundary_check): Calculate 'len' by subtracting the boundary start from inend rather than 'atleast'. (folder_scan_content): Calculate 'inend' differently depending on the EOF state. 2003-08-08 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-filter-tohtml.c (html_convert): Rather than checking *inptr == '\n', check inptr >= inend - this gets rid of an Invalid Read report from valgrind. * camel-mime-part.c (write_to_stream): Don't necessarily re-encode just because the encodings differ. Need to look into making it so that message/rfc822 and multipart parts ignore the Content-Transfer-Encoding header and just keep their 'encoding' bits set to DEFAULT. 2003-08-05 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (get_content): Updated. * camel-mime-message.c (camel_mime_message_init): Don't override the mime_type here. (process_header): Updated to use CamelDataWrapper's mime_type field. (find_best_encoding): Same. (best_encoding): Here too. * camel-digest-folder.c (camel_digest_folder_new): Updated for CamelMimePart::content_type change. * camel-mime-part.c (camel_mime_part_init): Override our parent class's default mime_type. (camel_mime_part_finalize): Don't need to unref the content_type anymore. (process_header): Updated to use CamelDataWrapper's mime_type field. (camel_mime_part_set_filename): Same. (camel_mime_part_get_filename): Same. (camel_mime_part_get_content_type): Same. (set_content_object): Here too. (write_to_stream): Updated. (construct_from_parser): Updated. * camel-mime-part.h: Remove the content_type field. 2003-07-31 Jeffrey Stedfast <fejj@ximian.com> * tests/lib/messages.c (test_message_compare_content): If the chunks differ, perform a hexdump on the data being compared so that we may analyse it easier. * camel-multipart-signed.c (write_to_stream): Return ssize_t. * camel-mime-utils.h: Added the CamelMimePartEncodingType enum here. * camel-mime-part.h: Removed the CamelMimePartEncodingType enum from here. * camel-mime-part.c (write_to_stream): Updated to return ssize_t. Also minor changes to only re-encode the content stream if the charset or encoding changed (this way we write it out in the original raw form if nothing changed). * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Drastically simplify. We no longer scan html content to try and find the charset, nor do we care about converting the content to UTF-8 and handling broken windows charsets. * camel-mime-message.c (find_best_encoding): Use decode_to_stream() here. Also updated to not assume the content charset is UTF-8 since it is very likely not the case anymore since data-wrappers no longer are converted to UTF-8 at parse time. * camel-folder-summary.c (summary_build_content_info_message): Use decode_to_stream instead here too. * camel-folder-search.c (match_words_1message): Use decode_to_stream instead of write_to_stream so we can search the contents. * camel-data-wrapper.c (camel_data_wrapper_init): Set the default encoding to DEFAULT. (write_to_stream): Updated to return ssize_t (camel_data_wrapper_decode_to_stream): New virtual function to decode a data wrapper to a stream (results in nearly identical behaviour to the old write_to_stream method). (decode_to_stream): Default implementation of above virtual method. Decodes base64/qp/etc streams. * camel-data-wrapper.h: Removed the rawtext bit and added an encoding member. svn path=/trunk/; revision=22171
* Also updated.Jeffrey Stedfast2003-07-311-4/+4
| | | | | | | | | | | | | | | | 2003-07-30 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-message.c (write_to_stream): Also updated. * camel-data-wrapper.c (write_to_stream): This should return ssize_t * camel-multipart-signed.c (write_to_stream): Updated. * camel-multipart.c (write_to_stream): Same. * camel-mime-part.c (write_to_stream): Here too. svn path=/trunk/; revision=22029
* Ensure cmdbuf is initialized to avoid compiler warning.Jeremy Katz2003-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2003-05-16 Jeremy Katz <katzj@redhat.com> * providers/smtp/camel-smtp-transport.c (smtp_helo): Ensure cmdbuf is initialized to avoid compiler warning. * providers/local/camel-mbox-summary.c (summary_header_load): Cast folder_size to uint32 to fix warning. (camel_mbox_summary_sync_mbox): Update for new API. * providers/imap/camel-imap-utils.c (parse_params): imap_parse_nstring expects size_t, not int (imap_body_decode): Likewise. * camel-stream-filter.c (do_read): presize needs to be size_t instead of int. (do_write): Likewise. * camel-seekable-substream.c (stream_read): Return ssize_t instead of int to match prototypes. (stream_write): Likewise. * camel-mime-part.c (construct_from_parser): len needs to be size_t instead of int. * camel-mime-parser.c (folder_scan_step): datalength needs to be a size_t* instead of an int* to make dependent APIs safe. (camel_mime_parser_step): Likewise. (folder_scan_content): Likewise. * camel-mime-parser.h: Likewise. * camel-mime-message.c (camel_mime_message_class_init): Use glib macro for pointer/int conversions. (construct_from_parser): Update for new API. * camel-folder-summary.c (camel_folder_summary_info_new_from_parser): Update len to be size_t for new API. (summary_build_content_info): Likewise. * camel-http-stream.c (http_get_headers): Likewise. * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Likewise. * camel-multipart-signed.c (signed_construct_from_parser): Likewise. * camel-multipart.c (construct_from_parser): Likewise. * camel-folder-search.c (match_words_index): Use glib macros for pointer/int conversions. * camel-html-parser.c (tokenise_setup): Likewise. (convert_entity): Likewise. * camel-block-file.c (block_hash_func): Likewise. (camel_block_file_get_block): Likewise. (camel_block_file_get_block): Likewise. (camel_block_file_detach_block): Likewise. * camel-session.c (session_thread_msg_new): Likewise. (session_thread_msg_free): Likewise. (session_thread_wait): Likewise. * camel-text-index.c (text_index_compress_nosync): Likewise. (text_index_compress_nosync): Likewise. (camel_text_index_validate): Likewise. * camel-vee-folder.c (vee_folder_remove_folder): Likewise. (unmatched_check_uid): Likewise. (folder_added_uid): Likewise. (vee_folder_build_folder): Likewise. (folder_changed_add_uid): Likewise. (folder_changed_remove_uid): Likewise. * providers/imap/camel-imap-search.c (imap_body_contains): Likewise. * providers/pop3/camel-pop3-folder.c (cmd_list): Likewise. (cmd_uidl): Likewise. * camel-data-cache.c (data_cache_init): Cast to CamelCopyFunc. Fixes a warning. svn path=/trunk/; revision=21220
* Updated to not use camel_type_get_global_classfuncs() since this is just aJeffrey Stedfast2002-07-121-1/+1
| | | | | | | | | | 2002-07-12 Jeffrey Stedfast <fejj@ximian.com> * camel-multipart.c (camel_multipart_class_init): Updated to not use camel_type_get_global_classfuncs() since this is just a cast macro now. svn path=/trunk/; revision=17436
* Added a protocol field for users to use.Not Zed2002-05-311-5/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-05-30 Not Zed <NotZed@Ximian.com> * camel-cipher-context.h: Added a protocol field for users to use. * camel-stream-filter.c (do_read): Sigh, the pre-size is READ_PAD not READ_SIZE. Big difference. (READ_PAD): Bumped upto 128 from 64, so we can fit a typical line in full. * providers/imap/camel-imap-folder.c (get_content): Changed to load multipart/signed as an opaque block into the right kind of object. * camel-multipart.h (struct _CamelMultipart): Removed the boundary field. It wans't actually used anywhere. * camel-seekable-substream.c (camel_seekable_substream_new_with_seekable_stream_and_bounds): Shortened this stupidly long name to just :new(), its the only way its ever used. Fixed all callers. * camel-multipart-signed.[ch]: new wrapper for multipart/signed types. We need to treat the entire content as a blob of data for transport purposes. This also cleans up a lot of the sign/verify handling. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Just call camel_multipart_construct_from_parser for multipart parts, also use a multipart_signed for multipart/signed types. * camel-multipart.c (camel_multipart_construct_from_parser): New virtual function for multiparts to buld themselves. (construct_from_parser): Implement for normal multiparts. (toplevel): Got rid of a warning, it'll never be an abstract class. * camel-pgp-context.c (pgp_hash_to_id): (pgp_id_to_hash): Implement. (camel_pgp_context_init): Init the pgp protocol specifier. * camel-cipher-context.c (camel_cipher_id_to_hash): (camel_cipher_hash_to_id): Util virtual methods to handle the cipher id string. * camel-mime-filter-canon.[ch]: A new filter, end/start of line canonicalisation filter. Can escape "From " and strip trailing whitespace, and canonicalise the end of line to crlf or to lf. 2002-05-29 Not Zed <NotZed@Ximian.com> * camel-multipart.h (struct _CamelMultipart): Removed the 'parent', nothing used it, anywhere. Cleaned up some formatting slightly. svn path=/trunk/; revision=17057
* Don't g_return_val_if_fail here if the boundary is an empty string. SeeJeffrey Stedfast2002-04-201-3/+3
| | | | | | | | | | | | | | | | | 2002-04-19 Jeffrey Stedfast <fejj@ximian.com> * camel-multipart.c (write_to_stream): Don't g_return_val_if_fail here if the boundary is an empty string. See bug #23676 for details. The way I see it, we have 2 options: 1) leave this fix the way it is, thus allowing multipart boundaries to be empty-strings; or 2) make camel_multipart_get_boundary() change the boundary to something legal if the boundary is an empty-string. Since the parser should be able to handle an empty-string boundary *and* more importantly because we want to keep the same boundaries as the original raw message so as to be able to verify multipart/signed parts, I vote for solution #1. svn path=/trunk/; revision=16539
* Fixing the license text.Ettore Perazzoli2001-10-281-1/+0
| | | | svn path=/trunk/; revision=14212
* Update the licensing information to require version 2 of the GPLEttore Perazzoli2001-10-271-2/+2
| | | | | | (instead of version 2 or any later version). svn path=/trunk/; revision=14190
* Virtualize this.Dan Winship2001-09-191-0/+20
| | | | | | | | | | | | | * camel-data-wrapper.c (camel_data_wrapper_is_offline): Virtualize this. * camel-medium.c (is_offline): A medium is offline if its content object is offline. * camel-multipart.c (is_offline): A multipart is offline if any of its subparts are offline. svn path=/trunk/; revision=12948
* constificationJeffrey Stedfast2001-09-081-3/+3
| | | | svn path=/trunk/; revision=12682
* Update the copyrights, replacing Helix Code with Ximian andEttore Perazzoli2001-06-231-1/+1
| | | | | | helixcode.com with ximian.com all over the place. svn path=/trunk/; revision=10440
* Big header cleanups and nntp compile fixKjartan Maraas2001-03-301-3/+7
| | | | svn path=/trunk/; revision=9024
* Remove this. It was only a thin wrapper around struct _header_content_typeDan Winship2000-12-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * gmime-content-field.[ch]: Remove this. It was only a thin wrapper around struct _header_content_type anyway, and didn't match the naming scheme of anything else. * Makefile.am: Remove gmime-content-field.[ch] * camel.h: Remove gmime-content-field.h * camel-types.h: Add CamelContentType as a typedef for struct _header_content_type (especially for use outside of camel). * camel-multipart.c: * camel-mime-part.c: * camel-mime-message.c: * camel-folder-summary.c: * camel-folder-search.c: * camel-data-wrapper.[ch]: Use CamelContentType and header_content_type_* functions rather than the GMime stuff. * camel-mime-part-utils.c: * camel-medium.c: Remove unused gmime-content-field.h include. svn path=/trunk/; revision=7186
* Set the preface/postface from the parser into the multipart object.Not Zed2000-11-041-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-11-04 Not Zed <NotZed@HelixCode.com> * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Set the preface/postface from the parser into the multipart object. * camel-multipart.c (camel_multipart_set_postface): Function to set the postface text on a multipart. (camel_multipart_set_preface): Similarly for preface text. * camel-mime-parser.c (folder_scan_content): If we scan until a boundary, then we do not include the \n that starts the boundary line in the content. (struct _header_scan_stack): Added a ByteArray to store the multipart pre/post-text as we're scanning. (folder_pull_part): Free pre/posttext if they are allocated. (folder_scan_step): Build into the pre/posttext arrays as we encounter data. (camel_mime_parser_preface): REturn the multipart preface text, if there is any scanned. (camel_mime_parser_postface): Likewise for postface text. (byte_array_to_string): helper function for above. * providers/mbox/camel-mbox-folder.c (mbox_append_message): Change the from line to be "\nFrom ..." always, so no need to check/append a \n to messages. (mbox_append_message): Open the output stream with append mode [assuming this is more efficient than seeking to the end] And dont prepend \n on the From line if its the first in the mbox. (mbox_append_message): Pass the offset of the real start of the "From " line when we perform the update (which may != 'seek') * camel-mime-filter-charset.c (complete): Removed the terminating NUL 'fix'. * camel-stream-filter.c (do_read): Added some debug. (do_flush): And here. (do_write): And here too. (do_write): ARGH!!! ARGH! Ok, so the filter stream was writing a different number of bytes than the requester was asking it to write (because of filtering, of course!). So instead of returning the true number of written bytes, we'll return what they asked us to write - unless there is an error in which case we return -1. * camel-mime-utils.c (base64_encode_close): Sigh, forgot to make it unsigned. I think this is actually a gcc bug as (48 >> 2) somehow ended up negative, when it obviously should not, even if the data load was signed. svn path=/trunk/; revision=6388
* Take an additional argument, "break_lines", saying whether or not to addDan Winship2000-10-311-1/+1
| | | | | | | | | | | | * camel-mime-utils.c (base64_encode_step, base64_encode_close): Take an additional argument, "break_lines", saying whether or not to add '\n's to the output. * camel-multipart.c (set_boundary): * camel-mime-filter-basic.c (filter, complete): Update for base64 api change. svn path=/trunk/; revision=6271
* Fixed some warnings.Christopher James Lahey2000-08-111-0/+2
| | | | | | | | | | | | | | | | 2000-08-10 Christopher James Lahey <clahey@helixcode.com> * camel-folder-search.c, camel-folder-summary.c, camel-medium.c, camel-mime-filter-charset.c, camel-mime-filter.c, camel-mime-filter.h, camel-mime-message.c, camel-mime-parser.c, camel-mime-part-utils.c, camel-mime-part.c, camel-mime-utils.c, camel-movemail.c, camel-multipart.c, camel-object.c, camel-stream-mem.c, providers/mbox/camel-mbox-folder.c, providers/mbox/camel-mbox-summary.c, providers/mh/camel-mh-folder.c, providers/smtp/camel-smtp-transport.c: Fixed some warnings. svn path=/trunk/; revision=4719
* Merge with camel-async.Peter Williams2000-08-111-49/+35
| | | | svn path=/trunk/; revision=4687
* Don't set a default boundary. Require the caller to do that.Dan Winship2000-05-261-4/+25
| | | | | | | | | | | | * camel-multipart.c (camel_multipart_init): Don't set a default boundary. Require the caller to do that. (set_boundary): if boundary is NULL, generate a "random" boundary. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Add a call to camel_multipart_set_boundary after creating a new multipart. svn path=/trunk/; revision=3217
* > searchpart = strchr(namepart, '?');NotZed2000-05-201-17/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-05-19 NotZed <NotZed@HelixCode.com> * camel-simple-data-wrapper.c (construct_from_stream): If we already have been constructed, unref our content. (write_to_stream): Check we've been constructued, and change for stream api changes. * camel-mime-parser.c: Removed exception stuff. * md5-utils.c (md5_get_digest_from_stream): repaired. * camel-mime-message.c: Remove exception from write_to_stream, and fix, and fix formatting. * providers/sendmail/camel-sendmail-transport.c (_send_internal): Fix for stream changes. * providers/pop3/camel-pop3-store.c (camel_pop3_command): Fixes for stream changes. * providers/mbox/camel-mbox-folder.c, and elsewhere, fix all stream api changes. (mbox_append_message): Use stream_close() now its back. (mbox_append_message): unref the from filter. * camel-stream-mem.c: And here. * camel-stream-fs.[ch]: Here too. * camel-stream-filter.c: Likewise. This is getting tedious. * camel-stream-buffer.c (stream_write): Fix a few little problems. (stream_close): Reimplmeent. (camel_stream_buffer_read_line): Slightly more efficient version, that also only allocates the right amount of memory for strings. * camel-seekable-substream.c: Likewise. * camel-seekable-stream.[ch]: Remove exceptions, fix formatting, changes for stream (re)fixes. set_bounds returns an error. * camel-stream.[ch]: Remove exceptions. Make flush and reset return an error code, repair all the screwed up formatting, and put back close. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): And here. * camel-mime-part.c (camel_mime_part_set_content): And this too. (write_to_stream): Fixed for stream changes. * camel.h: Fixed. * providers/vee/camel-vee-folder.c (vee_search_by_expression): Implement. Performs an intersection of the two searches. (camel_vee_folder_finalise): Unref search folders. (vee_append_message): Implement append. svn path=/trunk/; revision=3142
* fix a stupid typo. Thank you, C.Dan Winship2000-05-111-1/+1
| | | | | | | | | | * camel-multipart.c (write_to_stream): fix a stupid typo. Thank you, C. * camel-mime-part.c (write_to_stream): don't ref the stream before wrapper a filter around it, since nothing will ever unref it. svn path=/trunk/; revision=2978
* Use CamelException to signal failure. (camel_stream_write_strings):Dan Winship2000-05-091-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * camel-stream.c (camel_stream_read, camel_stream_write, camel_stream_flush, camel_stream_reset, camel_stream_printf, camel_stream_write_to_stream): Use CamelException to signal failure. (camel_stream_write_strings): Remove. camel_stream_printf is more useful in most of the places that used this. (camel_stream_write_string): Change from macro to function to prevent problems with double-evaluation. * camel-seekable-stream.c (camel_seekable_stream_seek, camel_seekable_stream_set_bounds): Use CamelException. (reset): Update. * camel-seekable-substream.c, camel-stream-buffer.c, camel-stream-filter.c, camel-stream-fs.c, camel-stream-mem.c: Update. * camel-stream-fs.c: Remove the virtual init functions and move the code into the creator functions. Add CamelExceptions to creation functions that could fail. * camel-data-wrapper.c (camel_data_wrapper_write_to_stream): Use CamelException. * camel-mime-message.c, camel-mime-part.c, camel-multipart.c (write_to_stream): Update. * camel-mime-parser.c: add an exception to the mime parser private data and pass that to stream functions as needed. * gmime-content-field.c, md5-utils.c: Update (badly) for stream changes. * camel-exception.h (camel_exception_is_set): convenience macro. * providers/Makefile.am: disable SMTP for now * providers/mbox/camel-mbox-folder.c (mbox_append_message): Pass CamelException to the functions that now need it. Check the exception after calling camel_stream_flush, and fail if it fails. (mbox_get_message_by_uid): More updates. * providers/pop/camel-pop3-folder.c, providers/pop/camel-pop3-store.c, providers/sendmail/camel-sendmail/transport.c: Update. svn path=/trunk/; revision=2924
* > * gmime-utils.[ch]: What the hell, remove it. This will break theMichael Zucci2000-05-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | > nntp provider (but its broken anyway). The mime parser can be > used instead though. > Removed from all code including it (but none were using it). > > * gmime-utils.c (_store_header_pair_from_string): Removed bizarre > string_dichotomy version of this. This code is somewhat redundant > now, and is headed for death anyway. > > * gstring-util.c (g_string_dichotomy): Same with this one. > (g_string_clone): Removed a memory leak, g_string_new() allocates > its own memory. > (g_string_append_g_string): Allow to append an empty gstring onto > another gstring, dont abort()! > > * string-utils.c (string_dichotomy): Removed this incredibly weird > function. > > * camel-folder.c (_create): Replaced the rather obtuse use of > "string_dichotomy" function with a simple strrchr(). Still not > sure it'll work. > > * camel-folder-summary.c: cvs removed a long-removed file. svn path=/trunk/; revision=2753
* remove an unused #includeDan Winship2000-04-291-1/+0
| | | | svn path=/trunk/; revision=2679
* Remove. We weren't using the fields that made this different fromDan Winship2000-04-271-84/+29
| | | | | | | | | | | | | * camel-mime-body-part.[ch]: Remove. We weren't using the fields that made this different from camel-mime-part, so it basically just forced us to do lots of gratuitous typecasting. * camel-multipart.[ch]: Use CamelMimePart. Remove the multipart parent stuff, since we weren't using that either. * etc: update for CamelMimeBodyPart -> CamelMimePart svn path=/trunk/; revision=2645
* Big cleanup of camel-stream-*, got rid of 3 classes, improved the interfaces,NotZed2000-04-261-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and fixed at least one problem (end of stream never happening in certain cases). Things that can fail now have a way of saying they failed too. So much for taking ANZAC day off to get drunk! 2000-04-26 NotZed <NotZed@HelixCode.com> * camel-seekable-substream.c (stream_seek): Changed to have absolute seek semantics, not relative to the bounds. * camel-seekable-stream.c (reset): When we reset, seek to the start of the bound, if there is one. (stream_tell): Make tell virtual. * camel-stream-filter.c (do_available): Removed. * camel-stream-buffer.c: Remove leading _'s from static functions. (stream_read): Renamed from read(). Fancy that conflicting! (my boo!) Others too. * providers/pop3/camel-pop3-folder.c (get_message_by_number): Changed to stream_mem interface. * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Fixed for streamfs interface changes, and implement a failure case. (_append_message): Changed for fs stream interface change. * camel-multipart.c (print_part): Iterate rahter than callback. I hate glists's interface (hence, move this to write_to_stream). (write_to_stream): Return an error (yuck, this is a royal PITA to do with the stream write interface). * camel-mime-message.c: Removed leading _ from static names. * camel-mime-part.h: construct_from_parser() now returns an error code. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Changed to use a camel-data-wrapper instead of a camel-simple-data-wrapper (no change needed elsewhere?). (simple_data_wrapper_construct_from_parser): Fixes for stream-mem interface changes. * camel-simple-data-wrapper.[ch], camel-simple-data-wrapper-stream.[ch], camel-stream-data-wrapper.[ch], removed. Fixed including of these files. * camel-mime-part.c (camel_mime_part_set_text): Remove the use of the camel-simple-data-wrapper-stream, just use a mem stream. (write_to_stream): Renamed from my_* (construct_from_stream): Return an error on error. * camel-stream-mem.c (camel_stream_mem_new*): Remove mode parameter. * camel-stream-mem.h (enum CamelStreamMemMode): Removed. It wasn't used at all. * camel-data-wrapper.h: Add camel_data_wrapper_new() to create these. (write_to_stream, construct_from_stream): Return an error indicator for success. Fixed all methods to match (ICK). * Makefile.am (libcamel_la_SOURCES): Remove camel-simple-data-wrapper.c, camel-simple-data-wrapper-stream.c, camel-stream-data-wrapper.c. Obsoleted by code re-use! * camel-data-wrapper.c (construct_from_stream): Change the default implementation to just set the output stream == construction stream. Well, this lets me get rid of both simple-data-wrapper and stream-data-wrapper (unused anyway), and simple-data-wrapper-stream in one hit. CamelDataWrapper is now also a concrete class. (write_to_stream): Use camel_stream_write_to_stream() to calculate/return values (and save code). Include <errno.h> for obvious reasons. * camel-stream.c (eos): Provide a default implementation of .eos(). (camel_stream_write_to_stream): Make it return an error code on error. (camel_stream_printf): Changed to return the number of bytes written/error. (camel_stream_available): Removed. * camel-stream-fs.h (enum CamelStreamFsMode): Removed. Changed to use unix modes and so forth (wasn't used for anything but new file creation and didn't work well either). * camel-stream-fs.c: Removed leading _'s for names. And removed some virtual method 'documentation'. (destroy): Dont try and close a closed/error fd. Only report error if close returns -1. Moved all the code to finalise(), and killed this function. (init_with_fd): Properly setup the seek offset, if it is a valid and seekable file descriptor. (init_with_fd_and_bounds): Use off_t for bounds, set bounds on the seekable stream. (init_with_name): Return error codes. (init_with_name_and_bounds): Ditto. (camel_stream_fs_new_with_name): REturn NULL object if it failed. (camel_stream_fs_new_with_name_and_bounds): Return NULL object on failure. Changed with_name* api's to take unix open style args and flags. (read): The bounded stream bounds checking seemed off, simplified code a bit. (write): Implement bounds checking for writing, the comment was wrong, it could make sense to bound writing. Cleaned up a little. (available): Gone. (eos): Removed. Use CamelStream's implementation now. (close): Reset the fd to -1, provide a warning for bad usage. (seek): Cleaned up. Changed the behaviour a little, the returned offset is the absolute position in the file, even in bounded streams. (seek): Seek from end mirrors lseek() behaviour (reverse seeking). 2000-04-25 NotZed <NotZed@HelixCode.com> * camel-stream-fs.h (struct _CamelStreamFs): Moved bounds and eof indicator to other parent classes. * camel-stream.c (camel_stream_printf): New utility function. Obvious use. * camel-stream-mem.c: Removed leading _'s from static func's. (camel_stream_mem_new_with_byte_array): Fixed for api changes, set the owner for the byte array to us. : Removed A bunch of gtk doc stuff for static (implementation) functions. (available): Removed. (write): Fixed the write implementation so that seek() works on a seekable memory stream, as expected. Seeking past the end of the buffer has unix semantics (filling with 0). (available): Removed. (write): Implement seekable stream bounded stream. (read): Implement seekable stream bounded stream. (close): Dont free the stream_mem if we're not the owner. (seek): Allow to seek beyond the end of memory area, implement bounds checking. (seek): Set errno on bad policy. * camel-stream-mem.h (struct _CamelStreamMem): Changed position to off_t. (new_with_buffer): Changed len to be a size_t. (set_buffer, set_byte_array): New interface functions. (struct _CamelStreamMem): Removed position, it is stored in the superclass. * camel-stream.h: Removed some of the seemingly random whitespace. Removed the available method (its not impelemented/useful enough). * camel-seekable-substream.c (init_with_seekable_stream_and_bounds): Remove the data_available stuff, it hasn't been properly implemented/finished, and may never work (unfortunately *sigh). (reemit_parent_signal): Removed part of the above change. (set_bounds): Removed (moved to seekable-stream). : Fixed up some of the generally unreadable indenting (sorry, wrapping at 80 characters with camels_really_long_function_names() just_doesnt_work_very_well_does_it(). (available): Removed. (stream_seek): Fixup for object changes. Make sure we return -1 if the parent stream can't seek. * camel-seekable-stream.c (ccamel_seekable_stream_set_bounds): New function to bound any seekable stream. : Removed _'s. (camel_seekable_stream_class_init): Implement an init function, to setup the stream bounds to unbound. * camel-seekable-stream.h (CamelSeekableStreamClass): New virtual method set_bounds for seekable streams. (CAMEL_STREAM_UNBOUND): New define for no bound. * camel-seekable-substream.h (struct _CamelSeekableSubstream): Removed sup_bound and inf_bound, moved to CamelSeekableStream (and renamed, and changed to off_t's). (new_with_seekable_stream_and_bounds): Use off_t as the bounds. (CamelSeekableSubstreamClass): Uh, why was the intialiser virtual? Removed. * camel-seekable-stream.[ch] (CamelSeekableStreamClass): Changed seek to accept an off_t as the offset. (struct _CamelSeekableStream): Renamed cur_pos to position and changed it to an off_t type. (enum CamelStreamSeekPolicy): Set to match the SEEK_* constants from lseek(). (get_current_position): Renamed to tell(). * camel-stream-buffer.h: Commented out set_vbuf - never implemented. svn path=/trunk/; revision=2624
* No longer call data_wrapper_repository_init.NotZed2000-04-241-160/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-04-24 NotZed <NotZed@HelixCode.com> * camel.c (camel_init): No longer call data_wrapper_repository_init. * camel-medium.c (write_to_stream): Moved (back) to camel-mime-part. (add_header): (set_header): (remove_header): (get_header): Make all these abstract, and spit warnings if called. I guess it could manage the list, but well, it doesn't. * camel-medium.h (struct _CamelMedium): Dont store headers here, the implementor is the only one who knows their format. (CamelMediumClass): Changed header values to be void *'s. They need not be strings? * camel-simple-data-wrapper.c (construct_from_stream): And we're back. Set the output stream. (construct_from_parser): Moved to camel-mime-part-utils. * camel-mime-part-utils.c (camel_mime_part_construct_content_from_parser): Create the contents of multipart and simple messages. * camel-multipart.c (construct_from_parser): Moved to camel-mime-part-utils. (separate_part): Removed. * camel-mime-part.c (construct_from_stream): Back again! This now switches over to using a mime parser for any mime parts, only. (my_write_to_stream): Write our headers and so forth here. (add_header): Add header directly, parent class is abstract. (remove_header): Ditto. (set_header): Ditto. * camel-data-wrapper.c (camel_data_wrapper_construct_from_stream): Remade abstract. (camel_data_wrapper_construct_from_parser): Moved to camel_mime_part. * camel-data-wrapper.h: Put back construct_from_stream. * camel-mime-part.h: Put construct_from_parser in here, the data-wrapper shouldn't know about mime. Ok, so now to undo half of the last hours changes ... duh. 2a51,93 * providers/pop3/camel-pop3-folder.c (get_message_by_number): Use construct_from_stream instead of set_input_stream(). * camel-simple-data-wrapper-stream.c (camel_simple_data_wrapper_stream_construct): REmoved the destroy callback code. (wrapper_destroy_cb): Removed. * camel-simple-data-wrapper.h: Add prototype for _construct() method. * camel.c: Include unicode.h to kill a warning. * camel-data-wrapper.h (CameldataWrapperClass): Removed construct_from_stream virtual method. Removed get/set input stream. * data-wrapper-repository.[ch]: Removed&from build. Obsoleted? The justification as is follows: It is mixing storage protocol/format with message architecture. It really just doesn't serve any purpose, as each medium implementor will have to have its own type->handler mapping, and the only current implementor, mimepart has a very simple structure and no need for this. * camel-medium.c (write_to_stream): Moved here from most of the stuff in camel-mime-part. Well, the MEDIUM is the one that knows what the headers are, and the content is, let it write it out. * camel-mime-part-utils.c (camel_mime_part_construct_content): Copied from camel-mime-part.c, removed handling of message followon state (moved to camel-mime-message). (camel_mime_part_construct_content_from_parser): Renamed from construct_content. (camel_mime_part_construct_headers_from_stream): (camel_mime_part_construct_content_from_stream): (camel_mime_part_store_stream_in_buffer): Removed. Replaced by the new construct from parser stuff. * camel-mime-message.c (construct_from_parser): Do construct_from_parser for mime-message. (_write_to_stream): Set the mime-version header for medium to write out, rather than writing it out ourselves. 4a96,102 (construct_from_stream): Removed. (camel_data_wrapper_construct_from_stream): Changed to a helper function, creates a mime_parser, and constructs from that. (set_input_stream): Removed. (camel_data_wrapper_set_input_stream): Removed. (get_input_stream): Removed. (camel_data_wrapper_get_input_stream): Removed. 11a110,111 (_get_message_by_uid): Use construct_from_stream() instead of creating our own parser. 16a117,131 (camel_mime_part_construct_content): Removed to camel-mime-part-utils.c (my_get_output_stream): Removed. The streeam is in the data-wrapper. (my_get_content_object): Removed. The content object is stored in the medium. If none is there, the object wasn't created properly. (my_write_content_to_stream): Removed. The content object is the one that knows how to write itself out!!!!!!!! (my_write_to_stream): Remove the base header writing stuff - has been moved to camel-medium, where it belongs. This can just be used to check for mandatory headers. (my_construct_from_stream): Removed. (my_set_input_stream): What the hell, i'll remove this too. Nobody seems to understand how it differs from create from stream, and they both seem to serve the same purpose ... 19a135,136 (construct_from_stream): Removed! Job taken over by construct_from_parser. 24a142 (set_input_stream): REmoved. Replaced by construct_from_parser. svn path=/trunk/; revision=2577
* Whole swag of changes. Still lots of cleanup remaining ...NotZed2000-04-231-16/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-04-23 NotZed <NotZed@HelixCode.com> * camel-data-wrapper.c (set_mime_type_field): Ref the content_field when we get it? * camel-mime-parser.c (camel_mime_parser_unstep): New function. Cause a subsequent call to mime_parser_step() to return the same state over again. * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Initial test code using the mime parser to construct the message. * camel-mime-part.c (construct_from_parser): part constructor. (camel_mime_part_construct_content): Basically a simpler replacement for the datawrapper repository. (camel_mime_part_init): Set the default type to text/plain. * camel-simple-data-wrapper.c (construct_from_parser): Initial implementation of a content constructor. * camel-multipart.c (construct_from_parser): Multipart construction routine. (camel_multipart_init): Set the default multipart type to multipart/mixed. Duh, no subtype is not allowed anyway. 2000-04-22 NotZed <NotZed@HelixCode.com> * camel-mime-message.h (struct _CamelMimeMessage): Removed send_date, and received_date, and replaced it with a time_t 'date' (this is what the header is called), and date_offset to store the GMT offset of the date. * camel-mime-message.c (camel_mime_message_set_from): Update raw header as we go. (_set_from): Removed. (_get_from): Removed. (camel_mime_message_get_from): Moved implementation here. (camel_mime_message_get_subject): Move implementation here. (_get_subject): Nuked. (camel_mime_message_set_subject): Handle utf-8 input, and also update raw header when changed. (_set_subject): Removed. (_set_received_date): Removed. (camel_mime_message_set_received_date): Removed. (_get_received_date): Removed. (camel_mime_message_get_received_date): Removed. (_get_sent_date): Removed. (camel_mime_message_get_sent_date): Removed. (camel_mime_message_get_date): New function to get the date as a time_t/offset. (camel_mime_message_set_date): Set the date as a time_t/offset. (camel_mime_message_get_date_string): Get the date as a string. (camel_mime_message_init): Initialise the current date as 'CMAEL_MESSAGE_DATE_CURRENT'. (_set_reply_to): Removed. (camel_mime_message_set_reply_to): Moved implementation here. This is still broken, reply-to can have multiple addresses. (_get_reply_to): Removed. (_set_field): Removed, no longer used anywhere. (_get_field): Also removed. (_init_header_name_table): Add the Date header. (process_header): Also handle snooping of Date header here. * camel-stream-filter.c (finalise): Unref the source stream on finalise, and also call the parent class (oops). * camel-mime-parser.c (camel_mime_parser_state): New function to get the current parser state. (camel_mime_parser_stream): Allow you to get the stream back from the mime_parser. (camel_mime_parser_fd): Alternative to allow you to get the fd back from the mime_parser. (folder_scan_init_with_stream): Properly ref/unref the stream. (folder_scan_close): Properly unref the stream/close the fd on exit. (folder_scan_init_with_fd): Close the old fd if there is one. * camel-data-wrapper.c (camel_data_wrapper_construct_from_parser): New method, construct a data wrapper from an initialised parser. (construct_from_parser): Empty implementation. * providers/mbox/camel-mbox-summary.c (message_struct_new): Convert subject line to unicode, before storing in the summary. (strdup_trim): Removed, no longer needed. * providers/mbox/camel-mbox-folder.c (_get_message_by_uid): Ref the folder after setting it in the new message. * camel-mime-part.c (my_set_content_object): Have the headers follow the content-type change here too. (my_write_to_stream): Dont write content-type here, automatically stored in the headers ... (my_write_to_stream): Use header_disposition_format() to format the content-disposition header. (my_write_to_stream): Removed old code, all headers are now stored in the camel-medium level, always. Need to do the same with camel-mime-message i suppose ... (my_write_to_stream): Write the content using the parent class, not some weird function. (camel_mime_part_class_init): Dont override get_output_stream. (camel_mime_part_encoding_from_string): Bleh, make it case-insensitive. * camel-mime-utils.c (header_content_type_is): Handle empty types. (header_encode_string): Start of an implementation of the rfc2047 encoder. It does iso-8859-1, and us-ascii, and utf-8 (others get tricky *sigh*) (rfc2047_encode_word): Convert a single word/string into rfc2047 encoding. (quoted_encode): Different quoted-printable encoding for rfc2047 encoding of headers. * gmime-content-field.c (gmime_content_field_write_to_stream): Use header_content_type_format() to format it. svn path=/trunk/; revision=2560
* clean, document, etc. (camel_multipart_init): pick a prettier defaultDan Winship2000-04-231-245/+334
| | | | | | | | * camel-multipart.[ch]: clean, document, etc. (camel_multipart_init): pick a prettier default boundary. Still need to deal with the larger problem svn path=/trunk/; revision=2553
* kill camel-logDan Winship2000-04-191-46/+8
| | | | svn path=/trunk/; revision=2487
* make this return a CamelStream rather than a CamelSeekableSubstream,Dan Winship2000-03-291-2/+2
| | | | | | | | | | * camel-seekable-substream.c (camel_seekable_substream_new_with_seekable_stream_and_bounds): make this return a CamelStream rather than a CamelSeekableSubstream, because that's the way Gtk objects tend to work. svn path=/trunk/; revision=2218
* fix the name of "Helix Code, Inc." in all the copyrightsDan Winship2000-03-101-1/+1
| | | | svn path=/trunk/; revision=2091
* More changes than a man can remember.Bertrand Guiheneuf2000-03-061-0/+1
| | | | | | The UI works now. svn path=/trunk/; revision=2074
* don't forget to set the state to 0 after 3. (my_read_encode): don't forgetbertrand2000-03-031-112/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-03-02 bertrand <bertrand@helixcode.com> * camel-stream-b64.c (my_read_encode): don't forget to set the state to 0 after 3. (my_read_encode): don't forget to encode, even in state 3. * camel-simple-data-wrapper.c: static functions are prefixed with my_ instead of _ * camel-multipart.c: static functions are prefixed with my_ instead of _ (my_write_to_stream): commented. (my_write_to_stream): warning in case the boudary is set but is a zero length string. * camel-mime-part.c (camel_mime_part_encoding_from_string): remove debug trace. * camel-mime-part.c: Replaced all static functions with name begining with _ by the same name begining with "my_" to prevent the possible conflicts with system symbols Dan warned us about. Mime mail generation works now, at least with b64 encoding. QP needs to be done now. svn path=/trunk/; revision=2016
* New header with the typedefs for all camel classes. Now the class headersDan Winship2000-02-191-1/+1
| | | | | | | | | | | | | | | * camel/camel-types.h: New header with the typedefs for all camel classes. Now the class headers can just include this and the header for the parent type. This makes it possible for CamelService to include a CamelSession without creating an #include loop. * camel/*: * composer/e-msg-composer-attachment-bar.h: * mail/folder-browser.c: * mail/message-list.c: frob #includes to match the new reality svn path=/trunk/; revision=1850
* revamped so that it uses the output stream of the data wrapperbertrand2000-02-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-17 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-formatter.c (handle_text_plain): revamped so that it uses the output stream of the data wrapper (handle_text_html): ditto. * camel/camel-simple-data-wrapper.h: * camel/camel-simple-data-wrapper.c (camel_simple_data_wrapper_new): use (void) instead of (). (_get_output_stream): simple implementation. A lot of small fixes so that the new parser scheme works properly. Simple implementation of the stream though. Changed vette-formatter files so that they work with the new scheme. The new parser is now in a usable state. Still needs some work but the infrastructure is here. /me is happy. svn path=/trunk/; revision=1822
* don't seek the begining of the substream. (_eos): fix eos conditionbertrand2000-02-171-140/+60
| | | | | | | | | | | | | | | | | | | | | | 2000-02-16 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-seekable-substream.c (_set_bounds): don't seek the begining of the substream. (_eos): fix eos condition testing. (_finalize): unref parent stream (_init_with_seekable_stream_and_bounds): ref parent stream * camel/gstring-util.c (g_string_equal_for_hash): (g_string_equal_for_glist): return type is int. * camel/camel.h: * camel/camel.c (camel_init): use (void) instead of (). A lot of other small changes to make the set_input_stream scheme work. It actually works. svn path=/trunk/; revision=1798
* this routine replaces the _read_part routine and does not store the partbertrand2000-02-161-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | 2000-02-15 bertrand <bertrand@helixcode.com> * camel/camel-multipart.c (_localize_part): this routine replaces the _read_part routine and does not store the part in a buffer. (_set_input_stream): use the set_input_stream instead of the construct_from_stream. each bodypart is given an input stream. * camel/camel-mime-part-utils.c: include the data-wrapper-repository header. (camel_mime_part_construct_content_from_stream): use the set_input_stream instead of the construct_from_stream method. * camel/camel-seekable-substream.c (_set_bounds): cur position is set to 0 not to inf_bound. Sync svn path=/trunk/; revision=1790
* include gmime-base64.h various compilation and runtime fixes.bertrand2000-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-15 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-mime-part.c: include gmime-base64.h various compilation and runtime fixes. (_set_input_stream): store the input substream for the content object. * camel/camel-data-wrapper.h: declare the set/get function on input/output stream. * camel/camel-mime-part.c (_get_content_object): don't use a temporary mem stream. * camel/camel-seekable-substream.c (_seek): (_eos): (_read): the substream can be unlimited in length * camel/camel-data-wrapper.c (camel_data_wrapper_class_init): set the get/set_input/output_stream methods. * camel/camel-multipart.c (_construct_from_stream): camel_stream_seek -> camel_seekable_stream_seek work on the new parser scheme. temporary sync to laptop. svn path=/trunk/; revision=1781
* various typo fixes in the ctree construction.bertrand2000-02-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-09 bertrand <Bertrand.Guiheneuf@aful.org> * tests/ui-tests/message-browser.c: various typo fixes in the ctree construction. * camel/string-utils.c (string_trim): fix braindead trailing trim bug. * camel/gmime-content-field.c (gmime_content_field_construct_from_string): strip the leading and trailing quotes when constructing the content field. This should be done in a more generic RFC822 approach, but this fixes a bug that prevent matt from analysing some multipart messages. * camel/camel-data-wrapper.h: reorganize the deprecated and new methods. * camel/providers/mbox/camel-mbox-folder.c (_check_get_or_maybe_generate_summary_file): Use "From " as the message separating string. * camel/providers/mbox/camel-mbox-folder.c (_append_message): set the mode when creating the mbox file. * camel/providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev): ditto * camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary): ditto svn path=/trunk/; revision=1711
* Updated my e-mail address to reflect my new employmentBertrand Guiheneuf2000-01-041-1/+1
| | | | svn path=/trunk/; revision=1533
* Fix copyright informations once againBertrand Guiheneuf1999-12-151-1/+1
| | | | svn path=/trunk/; revision=1489
* Here is my initial Evolution work: message composition widget and someEttore Perazzoli1999-11-061-5/+8
| | | | | | installation fixes for Camel. svn path=/trunk/; revision=1369
* Copyright changeBertrand Guiheneuf1999-10-231-1/+4
| | | | svn path=/trunk/; revision=1348
* Address updateBertrand Guiheneuf1999-08-301-1/+1
| | | | svn path=/trunk/; revision=1147
* return the number of bytes read. How can this have ever worked ?bertrand1999-08-181-5/+8
| | | | | | | | | | | | | | | | 1999-08-17 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-stream.c (camel_stream_read): return the number of bytes read. How can this have ever worked ? (camel_stream_flush): don't return anything. * camel/gmime-utils.c (get_header_table_from_stream): mem leak fixed. + various other mem leaks. svn path=/trunk/; revision=1120
* implemented destructors.bertrand1999-08-111-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | 1999-08-11 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-multipart.c (_finalize): * camel/camel-simple-data-wrapper.c (_finalize): * camel/camel-mime-part.c (_finalize): implemented destructors. * camel/gmime-content-field.c (gmime_content_field_ref): (gmime_content_field_unref): New reference mechanism for GMimeContentField objects. * camel/camel-data-wrapper.c (_finalize): Started implementing destructors. * camel/camel-mime-part.c (_construct_from_stream): * camel/gmime-content-field.c (gmime_content_field_write_to_stream): * camel/camel-multipart.c (_construct_from_stream): removed forgotten anarchic traces. Go away memory leaks! svn path=/trunk/; revision=1103
* There is a probleme here. We can not allow mime part content-type fieldBertrand Guiheneuf1999-08-031-6/+3
| | | | | | | | | | | | | | | | | | * camel/camel-mime-part.c (_set_content_object): There is a probleme here. We can not allow mime part content-type field and content_object mime-type to be different. I thus chosed to set mime part object content field to be freed (if necessary) and set to be a pointer to content_object mime type field. (_construct_from_stream): set content_object mime type to be the same as mime_part's one. This is necessary because we use _set_content_type. This two things are a bit hackish ansd may need to be redesigned. svn path=/trunk/; revision=1071
* Multipart Mime message parsing works with plain text parts. Woohooo :))))bertrand1999-08-031-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making it work with other types is now just a matter of writing the various data wrappers. And display them will just be a matter of writing the good bonobo components. 1999-08-03 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-simple-data-wrapper.c (_construct_from_stream): more debugging output + nb_bytes_read is now a signed int to avoid bug when eos is encountered. * camel/camel-mime-part.c (_construct_from_stream): sync to data_wrapper_repository function name changes. Use default "text/plain" type when conten-type field is not found. (following RFC 2046 spec). * camel/data-wrapper-repository.c (data_wrapper_repository_set_data_wrapper_type): (data_wrapper_repository_get_data_wrapper_type): change function name prefix (s/data_wrapper/data_wrapper_repository/) * camel/camel-multipart.c (_read_part): add `\n` at eol but not before boundary. * camel/gmime-utils.c (get_header_table_from_stream): correct implementation of end of stream detection. svn path=/trunk/; revision=1070
* Update logs and sync home/work versions.Bertrand Guiheneuf1999-08-031-24/+1
| | | | | | | | | | | | | | | | | | | | | | | * camel/camel-multipart.c (_read_part): use a stream to store the part instead of GString. * camel/camel-mime-part.c (camel_mime_part_set_text): set data wrapper content type to "text/plain". * camel/camel-stream-mem.c: * camel/camel-stream-mem.h: new memory buffer based stream. * camel/camel-stream-fs.c (_seek): implementation for file system based stream. * camel/camel-stream.c (camel_stream_seek): new method. * camel/camel-stream-fs.c (camel_stream_fs_class_init): pass CamelStreamFsClass instead of CamelStreamClass. svn path=/trunk/; revision=1069
* sync before going homeBertrand Guiheneuf1999-08-021-15/+25
| | | | svn path=/trunk/; revision=1064
* do not return NULL when line is empty.Bertrand Guiheneuf1999-08-021-7/+6
| | | | | | | | | | * camel/gmime-utils.c (gmime_read_line_from_stream): do not return NULL when line is empty. * camel/camel-multipart.c (_read_part): return true when end of multipart is found, not the contrary svn path=/trunk/; revision=1055
* Adding missing filesBertrand Guiheneuf1999-08-011-0/+467
svn path=/trunk/; revision=1053