Commit Graph

60 Commits

Author SHA1 Message Date
2c2cdb4ee5 Same.
2001-10-28  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-tcp-stream-raw.c (stream_write): Same.

	* camel-stream-fs.c (stream_write): If errno isn't EAGAIN, just
	exit with -1 and instead of using continue (which doesn't go to
	the top of the do-while thus making our logic suck), just set w to
	0. Still seems to be a bug in select() if it's telling us the
	socket is ready for data when it really isn't but oh well.

svn path=/trunk/; revision=14286
2001-10-28 07:03:32 +00:00
08fb7329cb Fixing the license text.
svn path=/trunk/; revision=14212
2001-10-27 16:59:46 +00:00
02dcd0aadf Update the licensing information to require version 2 of the GPL
(instead of version 2 or any later version).

svn path=/trunk/; revision=14190
2001-10-27 00:25:49 +00:00
66c5805817 Same as in the TcpStreamRaw code. (stream_write): And again here...
2001-10-24  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-stream-fs.c (stream_read): Same as in the TcpStreamRaw code.
	(stream_write): And again here...

	* camel-tcp-stream-raw.c (stream_read): Handle the EAGAIN error
	case as well.
	(stream_write): Same here, this might fix the SMTP truncation
	thing? I hope?

svn path=/trunk/; revision=13993
2001-10-24 21:09:35 +00:00
846fe128cb As below.
2001-10-17  Not Zed  <NotZed@Ximian.com>

        * camel-tcp-stream-raw.c (stream_write): As below.

        * camel-stream-fs.c (stream_write): If not checking cancellation,
        make sure we write out everything asked of us.

svn path=/trunk/; revision=13717
2001-10-17 04:09:17 +00:00
f74417fca8 Save the errno before calling fcntl so fcntl doesn't overwrite errno in
2001-10-15  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-stream-fs.c (stream_read): Save the errno before calling
	fcntl so fcntl doesn't overwrite errno in case of a previous
	error.
	(stream_write): Same.

svn path=/trunk/; revision=13687
2001-10-15 22:10:19 +00:00
91cc026904 Update the copyrights, replacing Helix Code with Ximian and
helixcode.com with ximian.com all over the place.

svn path=/trunk/; revision=10440
2001-06-23 08:52:02 +00:00
fe962a2055 Big header cleanups and nntp compile fix
svn path=/trunk/; revision=9024
2001-03-29 20:31:40 +00:00
49f8a687a4 Changed to push the operation into a status stack.
2001-02-07  Not Zed  <NotZed@Ximian.com>

        * camel-operation.c (camel_operation_start): Changed to push the
        operation into a status stack.
        (camel_operation_progress): Changed to only accept % complete.
        (camel_operation_reset): Free status stack as well.

        * providers/pop3/camel-pop3-folder.c (pop3_get_message): Get the
        octect count from the return line, and pass it to
        get_additional_data().
        (pop3_refresh_info): Added status stuff.

        * providers/pop3/camel-pop3-store.c
        (camel_pop3_command_get_additional_data): Added a total bytes
        expected argument for progress reporting & fixed callers.
        (camel_pop3_command_get_additional_data): Added progress
        reporting.

        * providers/local/camel-mbox-summary.c (mbox_summary_sync_full):
        (mbox_summary_sync_quick):
        (summary_rebuild): Added progress reporting stuff.

svn path=/trunk/; revision=8095
2001-02-08 01:42:53 +00:00
19daa2bae2 Added a missing #include.
2001-02-05  Christopher James Lahey  <clahey@helixcode.com>

	* camel-stream-fs.c: Added a missing #include.

	* camel-search-private.c: Added a missing #include.

svn path=/trunk/; revision=7999
2001-02-05 22:37:24 +00:00
764b9e26b0 Revert jeff's earlier change, the change below is the more-correct fix.
2001-02-05  Not Zed  <NotZed@Ximian.com>

	* camel-stream-filter.c (do_write): Revert jeff's earlier change,
	the change below is the more-correct fix.  All his was doing was
	ignoring the return code & looping actually :)

	* camel-stream-fs.c (stream_write): Since we are non-blocking on
	the outgoing fd, keep looping if writing out large blocks, so we
	can keep checking for cancel, etc.

svn path=/trunk/; revision=7966
2001-02-05 07:15:50 +00:00
f735b43e8e Make do_write loop until the entire buffer is written.
2001-02-04  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-stream-filter.c (do_write): Make do_write loop until the
	entire buffer is written.

svn path=/trunk/; revision=7963
2001-02-05 00:12:07 +00:00
ebd3b72501 Add missing header for cancel check stuff.
2001-02-02  Not Zed  <NotZed@Ximian.com>

        * camel-stream-fs.c: Add missing header for cancel check stuff.

        * camel-session.c (camel_cancel_cancel): Fix a wrong cast.

        * camel-mime-part.c (init_header_name_table): Setup a new table
        header_formatted_table, that lists headers that we dont want to
        fold (they've already been folded).
        (write_to_stream): Check for already formatted headers, and dont
        try and fold them.  This is a fix for bug #1097.

svn path=/trunk/; revision=7941
2001-02-02 02:13:13 +00:00
3f72f52320 fcntl(fd, F_GETFL) returns the flags as the return value, not via a passed
* camel-tcp-stream-raw.c (stream_getsockopt, stream_setsockopt):
	* camel-stream-fs.c (stream_read, stream_write):
	* camel-remote-store.c (socket_connect): fcntl(fd, F_GETFL)
	returns the flags as the return value, not via a passed in
	pointer. And F_SETFL looks for an int, not a long, and you have to
	pass it what it's expecting because it's a va_arg parameter. (Yes,
	the man page lies on Linux. But check the UNIX98 spec or the glibc
	source.) Also, fix another bug in socket_connect: if we manage to
	connect right away, unset O_NONBLOCK so it doesn't mess us up
	later.

	Fixes a bunch of problems with non-blocking I/O being done in the
	allegedly-blocking case and then returning EWOULDBLOCK.

svn path=/trunk/; revision=7555
2001-01-16 23:27:51 +00:00
e3a451cb33 Chganged len back to be unsigned. And do a simple range check on the
2001-01-16  Not Zed  <NotZed@Ximian.com>

        * camel-folder-summary.c (camel_folder_summary_decode_string):
        Chganged len back to be unsigned.  And do a simple range check on
        the string value to try and detect corrupted summary files.

        * providers/imap/camel-imap-command.c (imap_read_untagged): Handle
        cancelled stream reads with an appropriate exception.

        * providers/imap/camel-imap-private.h: Fix the include-once
        macro.  Doh, confliced with camel-private.h.

        * providers/imap/camel-imap-store.c (imap_store_refresh_folders):
        A copy of camel_remote_store_refresh_folders.  We avoid locking
        each folder when we call it though.  This should be removed when i
        can work out how to remove the folder lock from this function
        easily.

        * camel-stream-fs.c (stream_write): Fix n' argument of select.
        (stream_read): Likewise.

        * camel-remote-store.c (socket_connect): Bump the connect timeout
        upto 4 minutes.
        (socket_connect): Oops, fix the 'n' argument of select.

        * camel-session.c (camel_cancel_cancel): If we are given no
        cancellation node, then do it for all active ones.

svn path=/trunk/; revision=7526
2001-01-16 03:54:45 +00:00
d9b76e981f If the close() is successful, set the fd to -1.
2001-01-15  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-stream-fs.c (stream_close): If the close() is successful,
	set the fd to -1.

	* camel-tcp-stream-raw.c: Removed the disconnect() method.
	(stream_close): If the close() is successful, set the sockfd to
	-1.

	* camel-tcp-stream-ssl.c: Removed the disconnect() method.
	(stream_close): If the close() is successful, set the sockfd to
	NULL.

	* camel-tcp-stream.c (camel_tcp_stream_disconnect): Removed,
	easier to just use the close() method as it did the same thing
	anyway.

svn path=/trunk/; revision=7522
2001-01-16 00:54:18 +00:00
b64ffc9183 A cancellable connection routine. (remote_send_string): Return cancelled
2001-01-15  Not Zed  <NotZed@Ximian.com>

        * camel-remote-store.c (socket_connect): A cancellable connection
        routine.
        (remote_send_string): Return cancelled exception if we were.
        (remote_send_stream): "
        (remote_recv_line): "

        * camel-stream-fs.c (stream_read): First cut at cancellation
        stuff.  Its looking a bit ugly.

svn path=/trunk/; revision=7496
2001-01-15 07:55:30 +00:00
a8d65409de stream_flush does make sense for a substream afterall (if you have a
2000-12-05  Not Zed  <NotZed@HelixCode.com>

        * camel-seekable-substream.c (stream_flush): stream_flush does
        make sense for a substream afterall (if you have a stream_write).
        (stream_write): Implement this.
        (stream_seek): Change the STREAM_END behaviour to be more sane.
        if bounded go from the end of the bound, if unbounded, go from the
        end of the parent stream.

        * camel-stream-mem.c (stream_read): Dont return error if reading
        past the end of data, just return 0.

        * camel-stream-fs.c (camel_stream_fs_init): Initialise the stream
        to be unbound.
        (stream_seek): Fix the logic when seeking from the end of an
        unbounded stream.
        (camel_stream_fs_new_with_fd): If the fd is invalid (-1), then
        return NULL immediately.
        (stream_seek): Range check a SEEK_END so it fits within
        bound_start.

2000-12-01  Not Zed  <NotZed@HelixCode.com>

        * tests/lib/folders.c (test_folder_basic): New test to perform
        basic store operations on folders (taken from folders/test1).
        (test_folder_message_ops): Tkane the guts out of folders/test2.

svn path=/trunk/; revision=6790
2000-12-05 11:50:32 +00:00
8cb514d6dd Merge with camel-async.
svn path=/trunk/; revision=4687
2000-08-10 17:30:50 +00:00
4b82b86ee5 Changed the read and write method prototypes to return an ssize_t type
2000-06-06  Jeffrey Stedfast  <fejj@helixcode.com>

	* camel-stream.[c,h]: Changed the read and write method prototypes
	to return an ssize_t type rather than an int and also changed
	the 'number of bytes' to read or write to a size_t type

	* camel-stream-fs.c: same as above

	* camel-stream-mem.c: again, same as above

	* camel-stream-buffer.c: same

	* camel-imap-stream.[c,h]: Added this new stream, cache's previously
	read data so each successive call will instead read from the cache

svn path=/trunk/; revision=3450
2000-06-06 22:55:06 +00:00
2ce4eb74b6 > searchpart = strchr(namepart, '?');
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
2000-05-19 19:58:41 +00:00
65ec43cb55 Use CamelException to signal failure. (camel_stream_write_strings):
* 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
2000-05-08 22:27:59 +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
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
fe97fa2fbb kill camel-log
svn path=/trunk/; revision=2487
2000-04-18 19:05:15 +00:00
c7ae879700 fix warnings
svn path=/trunk/; revision=2217
2000-03-28 21:12:12 +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
7c164f12b9 More changes than a man can remember.
The UI works now.

svn path=/trunk/; revision=2074
2000-03-06 09:38:42 +00:00
f4b7a46325 Tons of fixes to fix things
svn path=/trunk/; revision=2057
2000-03-05 05:33:55 +00:00
8eb9e1f40b stream the raw content instead of nothing if the encoding is not
2000-03-04  bertrand  <bertrand@helixcode.com>

	* camel-mime-part.c (my_write_content_to_stream):
	stream the raw content instead of nothing if the encoding
	is not supported.

	* camel-stream-fs.c (_seek): handle eos more
	properly.

svn path=/trunk/; revision=2047
2000-03-04 22:23:06 +00:00
41694524a6 use set_input_stream instead of construct_from_stream to feed the message
2000-03-03  bertrand  <bertrand@helixcode.com>

	* providers/mbox/camel-mbox-folder.c (_get_message_by_uid):
	use set_input_stream instead of construct_from_stream
	to feed the message object.

	* camel-data-wrapper.c (my_write_to_stream): reset output stream.
	(my_set_input_stream): unref the previous input stream.
	use the set_output_stream for default behaviour.
	(my_set_output_stream): unref previous output stream.

	* camel-mime-part.c (my_write_content_to_stream): reset content
	object output stream.

mbox provider now also constructs message bodies. I should have looked
here first. damn.

svn path=/trunk/; revision=2030
2000-03-03 22:26:13 +00:00
2392d67981 don't forget to set the state to 0 after 3. (my_read_encode): don't forget
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
2000-03-03 02:54:25 +00:00
39400a38c7 use camel_stream_reset instead of seek. The formatter should be able to
2000-02-17  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-formatter.c (handle_text_plain):
	(handle_text_html): use camel_stream_reset instead
	of seek. The formatter should be able to work
	with all streams, not only seekable streams.
	In the case where some provider implementation
	would not be able to provide a reset method
	to their stream, implementors would have
	to find a workaround.

	* camel/camel-session.c (camel_session_new): use
	(void) instean of () in function decl.

	* camel/camel-folder.c: ifdef async operation
	related code.

	* camel/camel-seekable-stream.c (_seek): added a warning.
	(_reset): default implementation of reset for seekable
	stream.

	* camel/camel-mime-message.h: set_received_date declaration fix.
	cosmetic changes.

	* camel/providers/mbox/camel-mbox-provider.c (camel_provider_module_init):
	use (void) instead of ().

	* camel/camel-stream.c (camel_stream_reset):
	new method for CamelStream.

svn path=/trunk/; revision=1835
2000-02-17 22:16:33 +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
a020ef5168 include gmime-base64.h various compilation and runtime fixes.
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
2000-02-15 14:17:01 +00:00
8d959d83b2 use the eos stream method. (gmime_read_line_from_stream): ditto.
2000-02-14  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/gmime-utils.c (get_header_array_from_stream): use the
	eos stream method.
	(gmime_read_line_from_stream): ditto.

	* camel/camel-stream-fs.h (struct ): add the eof field
	cosmetics changes.

	* camel/camel-stream-fs.c (camel_stream_fs_init): set eof.
	(_read): set eof on end of file.
	(_eos): implemented.

	* camel/gmime-utils.c (get_header_array_from_stream):
	make a blocking version of the header parser.
	When the fs stream uses gnome-vfs, this should
	be changed.
	(gmime_read_line_from_stream): ditto.

svn path=/trunk/; revision=1780
2000-02-14 22:45:13 +00:00
6cffd8501c use the eos stream method. (gmime_read_line_from_stream): ditto.
2000-02-14  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/gmime-utils.c (get_header_array_from_stream): use the
	eos stream method.
	(gmime_read_line_from_stream): ditto.

	* camel/camel-stream-fs.h (struct ): add the eof field
	cosmetics changes.

	* camel/camel-stream-fs.c (camel_stream_fs_init): set eof.
	(_read): set eof on end of file.
	(_eos): implemented.

	* camel/gmime-utils.c (get_header_array_from_stream):
	make a blocking version of the header parser.
	When the fs stream uses gnome-vfs, this should
	be changed.
	(gmime_read_line_from_stream): ditto.

svn path=/trunk/; revision=1779
2000-02-14 22:27:54 +00:00
fe058b1be7 make a blocking version of the header parser. When the fs stream uses
2000-02-14  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/gmime-utils.c (get_header_array_from_stream):
	make a blocking version of the header parser.
	When the fs stream uses gnome-vfs, this should
	be changed.
	(gmime_read_line_from_stream): ditto.

2000-02-11  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-stream-fs.c:
	everywhere, when using the cur_pos field, do it
	on the CamelSeekableStream object.
	(_seek): small fix.

	* camel/camel-seekable-stream.c (camel_seekable_stream_seek):
	s/camel_stream_seek/camel_seekable_stream_seek/g

	* camel/camel-seekable-stream.h:
	(struct ): added a field to store the
	current position.

	* camel/camel-seekable-stream.c (camel_seekable_stream_get_current_position):
	New function. Allows to get the current position
	of a seekable stream.


In fact much more changes, but I am lazy.
This is the begining of some major changes
in camel.

svn path=/trunk/; revision=1778
2000-02-14 22:03:58 +00:00
e4bbdf696c + * camel/camel-stream-fs.c (_init_with_name): Set stream_fs->fd to
+	-1 if we fail to load the file.
+	(camel_stream_fs_new_with_name): If stream_fs->fd is -1, return
+	NULL. These changes make it so that a CamelStreamFs won't be
+	created if you give it a bogus filename; they may be replaced once
+	exception handling is in place.

svn path=/trunk/; revision=1767
2000-02-14 00:53:16 +00:00
db6312e254 parent class is seekable stream, not stream
2000-02-11  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-stream-fs.c (camel_stream_fs_class_init):
	parent class is seekable stream, not stream

svn path=/trunk/; revision=1731
2000-02-11 04:56:13 +00:00
50e5c22f0f parent class is now CamelSeekableStream idem idem idem idem (_seek):
2000-01-24  bertrand  <bertrand@helixcode.com>

	* camel/camel-seekable-stream.c:
	* camel/camel-seekable-stream.h:

	* camel/camel-simple-data-wrapper-stream.h:  parent class is now
	CamelSeekableStream
	* camel/camel-stream-buffered-fs.h: idem
	* camel/camel-stream-buffered-fs.c: idem
	* camel/camel-stream-mem.h: idem
	* camel/camel-stream-mem.c: idem
	(_seek): change declaration
	* camel/camel-stream-fs.c: parent class is now
	CamelSeekableStream
	(_seek): change declaration

	* camel/camel-stream-fs.h: parent class is now
	CamelSeekableStream

Major compatible change in the stream hierarchy.
Removed the seek method from the general streams
so that we can use them as "DataSources".

svn path=/trunk/; revision=1622
2000-01-25 01:09:56 +00:00
7dded29a63 converted all gint64 variables into guint32.
2000-01-24  bertrand  <bertrand@helixcode.com>

	* camel/camel-stream-fs.[ch]: converted all
	gint64 variables into guint32.


	* camel/camel-stream-fs.c (_read): fix stupid bug.
	(_write): ditto.

	* camel/camel-exception.c (camel_exception_new): don't
	forget to clean the exception when creating it.

svn path=/trunk/; revision=1621
2000-01-24 22:29:49 +00:00
98e15c6b5c add recipient_list to the recipients, not recipients_list. I don't know
2000-01-24  bertrand  <bertrand@helixcode.com>

	* camel/camel-recipient.c (camel_recipient_table_add_list):
	add recipient_list to the recipients, not recipients_list.
	I don't know what that variable was doing here.

2000-01-23  bertrand  <bertrand@helixcode.com>

	* camel/camel-store.c (camel_store_get_session):
	added a public get_session method.

	* camel/providers/mbox/camel-mbox-summary.c (camel_mbox_save_summary):
	(camel_mbox_load_summary): load/save message sizes in the summary file

	* camel/providers/mbox/camel-mbox-summary.h:
	added a size field to the message information
	structure.

	* camel/providers/mbox/camel-mbox-utils.c (parsed_information_to_mbox_summary):
	copy message size to the mbox summary information too.

	* camel/camel-stream-fs.c (_seek): updated to
	work with bounded fs streams.
	(_write): ditto.
	(_read): ditto.

	* camel/camel-stream-fs.h (struct ):
	added the cur_pos, inf_bound and sup_bound
	members to allow for bounded fs stream.

	* camel/camel-stream-fs.c (_set_bounds): new func.
	(_init_with_fd_and_bounds): idem.
	(_init_with_name_and_bounds): idem.
	New functions to allow the usage of bounded fs streams.

	The bounded fs stream allow, for example, to make a stream
	from a message stored in an mbox file.

svn path=/trunk/; revision=1620
2000-01-24 15:07:18 +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
f5be7984b2 When using g_free (obj) don't test if obj != NULL g_free () already do
1999-09-01  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-folder.c (_finalize):
	(_set_name):
	* camel/camel-mime-message.c (_finalize):
	* camel/camel-mime-part.c (_finalize):
	(_set_description):
	(_set_disposition):
	* camel/camel-service.c (_finalize):
	* camel/camel-stream-fs.c (_finalize):
	* camel/gmime-content-field.c:
	(gmime_content_field_construct_from_string):
	* camel/url-util.c (g_url_free):

	When using g_free (obj) don't test if obj != NULL
	g_free () already do that. Thanks to elerium for
	the feedback.

19

svn path=/trunk/; revision=1151
1999-09-01 11:53:18 +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
6881fd1bf7 new class. Will handle all sort of information media (Mime mail messages,
1999-08-24  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-medium.c (camel_medium_class_init):
	new class. Will handle all sort of information media
	(Mime mail messages, Lotus Notes  mail messages,
	postit notes, faxes, who knows .... :)
	CamelMimePart will inherit from it.

	* camel/camel-mime-part.c (_set_disposition):
	(_set_description):
	description and disposition parameters are now const.


	* camel/gmime-content-field.c (gmime_content_field_free): added
	assertion code.

	* camel/providers/MH/camel-mh-folder.c (_get_message):
	uses buffered stream.

	* camel/camel-stream-buffered-fs.c:
	new stream to accelerate file ops.

Thanks to jwz, I've decided to add a level of abstraction to Camel.
In the future, it should be able to handle other mail systems, but
also non-mail information vehicles.

Enough for today. Roller time!

svn path=/trunk/; revision=1140
1999-08-24 21:01:10 +00:00