Commit Graph

39 Commits

Author SHA1 Message Date
156996ac5e Remove this. It was only a thin wrapper around struct _header_content_type
* 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
2000-12-28 19:28:39 +00:00
99e80d6ecf Add tests.
2000-11-24  Not Zed  <NotZed@HelixCode.com>

	* Makefile.am (SUBDIRS): Add tests.

	* camel-mime-filter-basic.c (filter): Well, I'll add the extra
	bytes here too, lathough not strictly needed, might save a
	re-malloc when we get to complete().

	* camel-mime-filter-charset.c (filter): Make sure we have room if
	we only convert very short data.
	(complete): and here too.

	* tests/Makefile.am: Initial test harness & tests.  Requires gcc
	for this.

	* camel-internet-address.c (d): Turn off debug.

	* camel-charset-map.c (camel_charset_step): Oops, & masks for set
	intersection, not | them.  Dunno how this got even close to
	working.

2000-11-23  Not Zed  <NotZed@HelixCode.com>

	* camel-mime-filter-basic.c (filter): For base64 encoding, the
	output size for 0, 1, or 2 bytes of input can exceed input*2, so
	make sure we account for that as well.
	(complete): And here.
	(complete): Similarly for qp encoding, if we have a trailing
	space, we need some extra bytes (not needed for 'filter()', as any
	such bytes are stored in state/save).

	* camel-mime-utils.c (quoted_decode_step): Removed fixme not required.
	(quoted_encode_close): Dont append a trailing afterall.  Otherwise
	a pass through the encode/decode will grow the message each time.

svn path=/trunk/; revision=6656
2000-11-24 03:18:20 +00:00
a34a4b15b8 Shite, -1 on error, >=0 on success. So i've just been truncating all the
2000-11-21  Not Zed  <NotZed@HelixCode.com>

	* providers/local/camel-mh-summary.c (mh_summary_sync_message):
	Shite, -1 on error, >=0 on success.  So i've just been truncating
	all the messages I touched, good one zed.
	(mh_summary_sync_message): Sigh, and write to the right damn fd as
	well.
	(mh_summary_sync_message): Argh, and we need to compare the length
	of the old xev -1 to the new xev, to check if we can optimise it.

	* camel-folder.c (camel_folder_change_info_new): Init the pool.
	(camel_folder_change_info_add_source): Allocate string in the
	pool.
	(camel_folder_change_info_add_source_list):
	(camel_folder_change_info_add_update): No longer free the key, as
	it cannot be yet.
	(change_info_add_uid): Add a new arg, copy, telling it whether to
	copy the uid argument or not, and copy using mempool_strdup.
	(change_info_cat): Tell add_uid to copy the string.
	(camel_folder_change_info_add_update): Call add_uid directly.
	(change_info_remove): Call add_uid directly, with no copy, and
	dont free the key.
	(change_info_free_update): No longer required since we dont malloc
	the keys.
	(camel_folder_change_info_add_uid): Fix for add_uid change.
	(camel_folder_change_info_remove_uid):
	(camel_folder_change_info_change_uid):
	(change_info_clear): No longer needed, just set the size to 0 on
	the array directly.
	(camel_folder_change_info_clear): Empty the arrays directly, and
	flush the mempool too, and also clear uid_source, incase anyone
	was silly enough to call us in the wrong order.
	(camel_folder_change_info_free): Dont bother clearing the array's
	contents, just free the pool and throw away all the indexes.

	* camel-folder.h: Added a mempool to CamelFolderChangeInfo to
	store the uid's we get.

	* camel-folder-search.c (search_match_all): If we are only
	matching a single info, just use that/do the search.
	(camel_folder_search_match_expression): New function.  Matches a
	single message info against an expression.
	(camel_folder_search_init): Init a hash table used to map the
	returned gptrarrays' to mempools.
	(camel_folder_search_execute_expression): Store all of the string
	data in a mempool, slightly faster, less wasted space (usually),.
	(camel_folder_search_free_result): Check for the mempool that
	stores the data for the list, and free that if we have it,
	otherwise assume we need to use g_free() (which should only happen
	if the list is empty at the moment).
	: commented out the debugging prints.  Got sick of 'executing
	header search' crap.

	* providers/vee/camel-vee-folder.c (camel_vee_folder_init): Init
	changes.
	(camel_vee_folder_finalise): Free changes.
	(vfolder_add_match): Simple helper to add a new matching info
	record.
	(camel_vee_folder_add_folder): Only trigger a changed event if we
	have changes.
	(vfolder_change_match): New function, changes our local vfolder
	info to match the source.
	(vfolder_add_match): Add a new info to the vfolder list.
	(vfolder_remove_match): Remove a no-longer matching info from the
	vfolder summary.
	(message_changed): check if the message still matches, and
	remove/etc as required.
	(camel_vee_folder_finalise, init): init/free search object.
	(vee_folder_build_folder): Build the changes to the folder into
	the changes data, as we go.
	(folder_changed): If the folder gave us an explicit list of
	changes, then process each one separately (unless there's a lot
	added/changed).

	* providers/vee/camel-vee-folder.h: Added a changes field to the
	folder.

svn path=/trunk/; revision=6628
2000-11-21 13:38:53 +00:00
338344b2e4 Set the preface/postface from the parser into the multipart object.
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
2000-11-04 02:34:46 +00:00
81f994a359 More UTF-8 handling
svn path=/trunk/; revision=5032
2000-08-25 04:31:13 +00:00
40eea3692e Fixed some warnings.
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
2000-08-11 02:57:11 +00:00
8cb514d6dd Merge with camel-async.
svn path=/trunk/; revision=4687
2000-08-10 17:30:50 +00:00
4f20138bfc flush the filter stream before unreffing it, so it will
* camel-mime-part.c (write_to_stream): flush the filter stream
	before unreffing it, so it will camel_mime_filter_complete.

	* camel-stream-filter.c (camel_stream_filter_class_init): Fix a
	braino so camel_stream_flush works here.

	* camel-stream-mem.c (stream_seek): Fix a bug that resulted in
	large attachments being silently dropped.

	* providers/pop3/camel-pop3-store.c
	(camel_pop3_command_get_additional_data): Don't use g_strjoinv
	here, since it is O(n^2) on the length of the output string, and
	we can do O(n).

	* camel-mime-part-utils.c
	(simple_data_wrapper_construct_from_parser): add a CRLF decoder
	after the QP/B64 decoder if it's text.

svn path=/trunk/; revision=3658
2000-06-21 02:09:48 +00:00
f0600c2ccb KLUDGE! Since neither ETable nor GtkHTML supports UTF-8 yet, output
* camel-mime-utils.c (rfc2047_decode_word):
	* camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser):
	* camel-folder-summary.c (summary_build_content_info):
	KLUDGE! Since neither ETable nor GtkHTML supports UTF-8 yet,
	output ISO-8859-1 instead, so Ettore can read his Italian mail. :)
	This will be reverted later.

svn path=/trunk/; revision=3597
2000-06-16 22:42:12 +00:00
7e66242575 Fixes Bug 192.
2000-06-01  Not Zed  <NotZed@HelixCode.com>

        * camel-mime-part.c (construct_from_parser): For a message part,
        set the default content-type to message/rfc822.  Maybe needs to be
        done for multiparts too?

2000-05-31  Not Zed  <NotZed@HelixCode.com>

        * camel-mime-message.c (construct_from_parser): Typo in assersion.

        * camel-mime-parser.c (folder_scan_step): Use a default type of
        message/rfc822 for multipart/digest.  Bug Z192.
        (folder_scan_drop_step): Remove warning.

svn path=/trunk/; revision=3340
2000-06-01 22:08:07 +00:00
f5ba4dde57 Don't set a default boundary. Require the caller to do that.
* 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
2000-05-26 14:46:13 +00:00
5429c7017c Replace simple data wrapper here too, oops.
2000-05-25  NotZed  <NotZed@HelixCode.com>

	* camel-mime-part-utils.c
	(camel_mime_part_construct_content_from_parser): Replace simple
	data wrapper here too, oops.

svn path=/trunk/; revision=3208
2000-05-25 23:25:35 +00:00
0cd1c1934c remove get/set_output_stream operations. They're redundant with
* camel-data-wrapper.c: remove get/set_output_stream operations.
	They're redundant with write_to_stream, and CamelMimePart and
	CamelMimeMessage only implement the latter, meaning that trying to
	get_output_stream on a CamelMimeMessage that was built from pieces
	rather than being parsed from a stream doesn't work. Anything that
	uses get_output_stream can be rewritten to use write_to_stream, so
	we'll standardize on that.
	(camel_data_wrapper_new): remove this: CamelDataWrapper is
	supposed to be an abstract class.
	(write_to_stream): remove default implementation. (Moved to
	CamelSimpleDataWrapper)

	* camel-simple-data-wrapper.c: resurrect, although it's not really
	the same thing it was before. A simple data wrapper, which is
	backed by a CamelStream.

	* camel-mime-part-utils.c
	(simple_data_wrapper_construct_from_parser): Use
	construct_from_stream rather than set_output_stream.
	(camel_mime_part_construct_content_from_parser): Change
	camel_data_wrapper_new to camel_simple_data_wrapper_new.

	* camel-mime-part.c (camel_mime_part_set_content): Change
	camel_data_wrapper_new to camel_simple_data_wrapper_new.

svn path=/trunk/; revision=3112
2000-05-18 01:00:25 +00:00
580d885820 Make camel not leak like a sieve.
* camel-object.c: New subclass of GtkObject which is now the base
	of the Camel object hierarchy. Currently the only difference
	between CamelObject and GtkObject is that CamelObjects don't start
	out floating.

	* *.h: Move a bunch of typedefs to camel-types.h. Standardize on
	using <camel/foo.h> in header files rather than <foo.h>, "foo.h",
	or "camel/foo.h". Remove some unneeded includes.

	* camel-address.c, camel-data-wrapper.c, camel-folder-search.c,
	camel-folder-summary.c, camel-folder.c, camel-mime-filter.c,
	camel-mime-parser.c, camel-service.c, camel-session.c,
	camel-stream.c: These are now subclasses of CamelObject.

	* camel-data-wrapper.c (set_output_stream):
	* camel-medium.c (set_content_object):
	* camel-seekable-substream.c
	(init_with_seekable_stream_and_bounds):
	* providers/mbox/camel-mbox-folder.c (mbox_get_message_by_uid):
	remove gtk_object_sink calls.

	* camel-stream-buffer.c (init_vbuf):
	* camel-stream-filter.c (camel_stream_filter_new_with_stream):
	ref the original stream.

	* camel-folder-summary.c (camel_folder_summary_finalise): unref
	the filters when finalizing.

	* camel-mime-part-utils.c
	(simple_data_wrapper_construct_from_parser,
	camel_mime_part_construct_content_from_parser):
	* camel-mime-part.c (camel_mime_part_set_content): Unref objects
	that are created only to be handed off to other objects. If
	they're going to be needed later, they will have been additionally
	ref'ed by the object that needs them.

	* providers/pop3/camel-pop3-folder.c (get_message_by_number):
	unref the message stream after creating the data from it.

	* camel-stream.c, camel-stream-buffer.c, camel-stream-filter.c,
	camel-stream-fs.c, camel-stream-mem.c: Remove camel_stream_close,
	since its semantics are dubious (what happens when you close a
	stream other people still have references on?).

	* providers/nntp/camel-nntp-store.c:
	* providers/smtp/camel-smtp-transport.c:
	* providers/pop3/camel-pop3-store.c:
	replace camel_stream_close calls with gtk_object_unref.

	* providers/mbox/camel-mbox-folder.c:
	* providers/nntp/camel-nntp-folder.c:
	* providers/sendmail/camel-sendmail-transport.c:
	replace camel_stream_close with camel_stream_flush +
	gtk_object_unref

svn path=/trunk/; revision=2882
2000-05-07 21:56:32 +00:00
aa7851f1f0 And same here ...
2000-05-05  NotZed  <NotZed@HelixCode.com>

        * camel-folder-summary.c: And same here ...

        * camel-mime-utils.c: Defined out some memory profiling stuff I
        left there by mistake.

        * camel-mime-parser.c (folder_scan_content): Apply the fix from
        the header scanner to here too.
        (folder_scan_header): Only check for end of header if we have
        space for it (didn't end the read with a newline)
        (folder_scan_header): inptr is the only real thing we need
        registerised for performance.  Try to help the compiler be smart
        about it ..
        (folder_scan_header): Simplified the save header case a tad.

        Commented out some memory profiling stuff.

svn path=/trunk/; revision=2811
2000-05-05 08:47:02 +00:00
f8bfbef0a7 No, we're not going to have g_strcasecmp for no good reason,
not even if its slipped in with no changelog.

2000-05-04  NotZed  <NotZed@HelixCode.com>

	* providers/mbox/camel-mbox-summary.c: Yes, and anotherone.

	* camel-mime-utils.c: And another one.

	* camel-mime-part.c: And another one.

	* camel-mime-part-utils.c: And another one.

	* camel-folder-search.c: And another one.

	* camel-mime-parser.c: Reverted a change wihtout a ChangeLog entry.

2000-05-04  NotZed  <NotZed@HelixCode.com>

	* camel-folder-summary.[hc]: Yes, CamelFolderSummary is back ...
	... re-usable class to summarise and index any stream or message
	and to manage/load/save the created summaries.

	* camel-folder.c: Include string.h to kill a warning.

2000-05-03  NotZed  <NotZed@HelixCode.com>

	* camel-folder.h: Added pos/bodypos/endpos to the basic message
	content info object.  Size to be removed?  Moved the
	messageconentinfo and messageinfo back to camel-folder-summary.h.

	* camel-mime-filter-index.c (camel_mime_filter_index_set_ibex):
	New function to (re)set the index to use on a filter.

	* camel-mime-parser.c (camel_mime_parser_scan_from): Whole bunch
	of inline docs.
	(camel_mime_parser_drop_step): New function to drop a state from
	the parser.  Needs more testing.

svn path=/trunk/; revision=2789
2000-05-04 05:45:30 +00:00
3ccfb61399 s/strcasecmp/g_strcasecamp/ everywhere except intl/, per michael's
request.

svn path=/trunk/; revision=2776
2000-05-03 14:43:10 +00:00
44575d972d > * gmime-utils.[ch]: What the hell, remove it. This will break the
> 	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
2000-05-02 20:37:06 +00:00
2
b5ddb0c7c8 Dont use autofill on these fucking long function anmes!!!!!!
2000-05-02    <notzed@helixcode.com>

        * camel-mime-part-utils.c
        (simple_data_wrapper_construct_from_parser): Dont use autofill on
        these fucking long function anmes!!!!!!

svn path=/trunk/; revision=2750
2000-05-02 18:05:13 +00:00
18903e6b22 camel_mime_parser_tell() returns an offset from where it started parsing,
* camel-mime-part-utils.c
	(simple_data_wrapper_construct_from_parser):
	camel_mime_parser_tell() returns an offset from where it started
	parsing, not necessarily from the start of data. Since we're
	parsing a bounded seekable_stream, we need to add the stream's
	starting bound to camel_mime_parser_tell's return value to
	create the substream in the right place.

	* camel-seekable-substream.c
	(camel_seekable_substream_new_with_seekable_stream_and_bounds):
	say CAMEL_STREAM_UNBOUND rather than -1 in doc.

	* camel-seekable-stream.c (camel_seekable_stream_seek): Add more
	info to docs.

svn path=/trunk/; revision=2680
2000-04-29 15:57:11 +00:00
2a6a191e05 Remove. We weren't using the fields that made this different from
* 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
2000-04-26 21:30:32 +00:00
c93a2e37f5 Big cleanup of camel-stream-*, got rid of 3 classes, improved the interfaces,
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
2000-04-26 10:35:25 +00:00
d38dcd1631 fix a cut-and-pasto.
* camel-mime-part-utils.c
	(simple_data_wrapper_construct_from_parser): fix a cut-and-pasto.

svn path=/trunk/; revision=2587
2000-04-24 19:58:28 +00:00
27937ec41f Big fixes for the last commit which broke the message creation entirely.
Plus an address decoder/formatter, etc.

	* camel-mime-message.c (construct_from_parser): Allow MESSAGE_END
	_or_ EOF as valid termination conditions.

	* providers/mbox/camel-mbox-summary.c (message_struct_new): Decode
	and then re-encode the addresses, so they are consistently
	formatted.

	* camel-mime-utils.c (header_decode_mailbox): Store the address in
	a _header_address.  And try to get a comment-stored name if there
	is one.
	(header_decode_address): Actually return an address.
	(header_to_decode): Renamed to header_address_decode()
	(header_mailbox_decode): New function to get a single mailbox.
	(header_mime_decode): Return the major/minor value, as
	appropriate.
	(header_address_new, and friends): Whole bunch of utility
	functions for working with the address thingies.
	(header_decode_domain): Free the string header, and dont expand
	'.' into ' . '.

	(camel_mime_part_construct_content_from_parser): Oops, this was
	totally screwed up, try creating the right cotnent on the right
	object.

svn path=/trunk/; revision=2579
2000-04-24 09:12:31 +00:00
8c9b0cc3f0 No longer call data_wrapper_repository_init.
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
2000-04-24 06:05:41 +00:00
fe97fa2fbb kill camel-log
svn path=/trunk/; revision=2487
2000-04-18 19:05:15 +00:00
1e7ab47d26 fix the name of "Helix Code, Inc." in all the copyrights
svn path=/trunk/; revision=2091
2000-03-09 19:52:48 +00:00
519501b7fe Make sure we open with create with a creation mask.
2000-03-03  NotZed  <NotZed@HelixCode.com>

        * providers/mbox/camel-mbox-utils.c (camel_mbox_write_xev): Make
        sure we open with create with a creation mask.

2000-03-01  NotZed  <NotZed@HelixCode.com>

        * camel-mime-part-utils.c
        (camel_mime_part_construct_content_from_stream): DO NOT assert on
        content type, we have fallback code 4 lines below it ... *sigh*

svn path=/trunk/; revision=2026
2000-03-03 20:28:04 +00:00
e4842dc1b1 Free the data in the headers hash table. (_add_header): g_strdup the
* camel-medium.c (_finalize): Free the data in the headers hash
        table.
        (_add_header): g_strdup the header name and value when adding it.

        * camel-mime-part-utils.c
        (camel_mime_part_construct_headers_from_stream): Free the header
        data after calling camel_medium_add_header, since it will have
        g_strdup()ed it itself.

svn path=/trunk/; revision=1913
2000-02-23 21:04:30 +00:00
7f04720b1e don't seek the begining of the substream. (_eos): fix eos condition
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
2000-02-16 18:04:40 +00:00
f926f10e86 this routine replaces the _read_part routine and does not store the part
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
2000-02-16 10:44:35 +00:00
8e008e868d If we get a -1 read, DONT update the total bytes, and try and truncate the
2000-02-09  NotZed  <notzed@zedzone.helixcode.com>

	* camel/camel-mime-part-utils.c
	(camel_mime_part_store_stream_in_buffer): If we get a -1 read,
	DONT update the total bytes, and try and truncate the array in
	reverse.  Eek.

	* camel/camel-mime-part.c (camel_mime_part_encoding_from_string):
	This was DEFINETLEY not the right way to do it. strncmp!=strcmp
	(camel_mime_part_encoding_to_string): Handle the default case.
	: include string.h for strcmp() etc.

svn path=/trunk/; revision=1720
2000-02-10 02:15:02 +00:00
316a4c47ff Updated my e-mail address to reflect my new employment
svn path=/trunk/; revision=1533
2000-01-03 23:05:55 +00:00
331335d12c Fix copyright informations once again
svn path=/trunk/; revision=1489
1999-12-14 22:40:38 +00:00
8fe1aa5f41 Copyright change
svn path=/trunk/; revision=1348
1999-10-23 15:19:51 +00:00
d938232d3c Address update
svn path=/trunk/; revision=1147
1999-08-29 22:13:34 +00:00
68a9dad22b text parameter declared const
1999-08-28  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-mime-part.c (camel_mime_part_set_text):
	text parameter declared const

	* camel/camel-mime-part-utils.c (camel_mime_part_store_stream_in_buffer):
	actually test correctly nb_bytes_read_chunk is >0

	* camel/gstring-util.c:
	* camel/gmime-content-field.c:
	* camel/providers/MH/camel-mh-folder.c:
	* camel/camel-stream-fs.c:
	include string.h

	* camel/camel-stream-mem.c (_write): return
	the numver of written bytes.

	* camel/camel-stream-buffered-fs.c (_eos):
	return sthg

	* camel/camel-stream.c (default_camel_seek):
	return something.

* Started to work on new recipient code.
* fixed various leaks.

svn path=/trunk/; revision=1146
1999-08-29 15:57:47 +00:00
e826255bf1 contruct the content from the buffer before calling CamelMedium
1999-08-26  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-mime-part.c (_get_content_object):
	contruct the content from the buffer before calling
	CamelMedium implementation.
	(_construct_from_stream): Do not construct the content
	by default, just store the content bytes in
	a temporary buffer. Content will be constructed only
	at caller request (when calling CamelMedium::get_content_object)
	Providers with better access to the messages (mbox/MH ...)
	will have to provider lighter implementation, that is
	shall not read content at all unless the caller asks
	for it (again with get_content).

	* camel/camel-mime-part-utils.c: new file, groups
	mime-part related utils. Meant to be used by providers
	subclassing MimeMessage.
	(camel_mime_part_construct_headers_from_stream):
	(camel_mime_part_construct_content_from_stream):
	no more useless temporary hash table.

	* camel/camel-mime-part.c (_construct_from_stream): calls
	mime-part-utils functions now.

	* camel/gmime-utils.c (_store_header_pair_from_string):
	do not use hash table to store header, use an array instead.

svn path=/trunk/; revision=1145
1999-08-26 15:29:40 +00:00
2a912b3301 new file, groups mime-part related utils. Meant to be used by providers
1999-08-26  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-mime-part-utils.c: new file, groups
	mime-part related utils. Meant to be used by providers
	subclassing MimeMessage.
	(camel_mime_part_construct_headers_from_stream):
	(camel_mime_part_construct_content_from_stream):
	no more useless temporary hash table.

	* camel/camel-mime-part.c (_construct_from_stream): calls
	mime-part-utils functions now.

	* camel/gmime-utils.c (_store_header_pair_from_string):
	do not use hash table to store header, use an array instead.


* MimePart cleanup. Not complete yet. Content must not be
parsed when constructing but only when content object is requested.
Default implementation will keep content in a stream.

svn path=/trunk/; revision=1144
1999-08-26 09:44:33 +00:00