aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-mem.h
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Update the copyrights, replacing Helix Code with Ximian andEttore Perazzoli2001-06-231-2/+2
| | | | | | helixcode.com with ximian.com all over the place. svn path=/trunk/; revision=10440
* Big header cleanups and nntp compile fixKjartan Maraas2001-03-301-1/+1
| | | | svn path=/trunk/; revision=9024
* No, we must not encode the headers here. These interfaces ARE rawNot Zed2000-10-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-18 Not Zed <NotZed@HelixCode.com> * camel-mime-part.c (add_header): No, we must not encode the headers here. These interfaces ARE raw interfaces as they are defined in camel_medium. Also removed a bogus/meaningless FIXME. (set_header): Likewise here, we must not. (process_header): Removed another bogus comment. * camel-object.c (shared_is_of_type): Comment out the spitting of a big warning when we're trying to determine types from code. * providers/mbox/camel-mbox-summary.c (message_info_new_from_parser): Only call ibex funcitons if we have an index. * providers/mh/camel-mh-summary.c (camel_mh_summary_add): Only call ibex functions if we have an index. (remove_summary): Likewise. (camel_mh_summary_check): Likewise. * providers/nntp/camel-nntp-store.c (nntp_store_get_folder): get_folder -> flags argument. * providers/vee/camel-vee-store.c (vee_get_folder): create->flags. * providers/pop3/camel-pop3-store.c (get_folder): Changed create -> flags. * providers/imap/camel-imap-store.c (get_folder): Added flags argument. * providers/mh/camel-mh-folder.c (camel_mh_folder_new): Added flags argument, and fixed code appropriately. * providers/mh/camel-mh-store.c (get_folder): Added flags argument. * camel-folder-search.c (message_body_contains): Perform a regex match on the contents of messages. This wont quite work yet as message contents are encoded when written to a stream. (build_match_regex): Converts a number of strings into a regex matching pattern, escaping special chars. (match_message): match a single message from a folder, by uid. Slow. (search_body_contains): Changed to support matching where no index is supplied. Matches are performed by retrieving message contents, etc. () WTF? camel should not be including any widget headers. * providers/mbox/camel-mbox-folder.c (camel_mbox_folder_new): Added flags argument. (mbox_refresh_info): Changed into a NOP, the refresh info code moved into the new function. (camel_mbox_folder_new): If we have an index requested, build one, otherwise, remove an old one, or just dont do anything. * providers/mbox/camel-mbox-store.c (get_folder): Changed create to flags, changed code to suit. * camel-store.c (camel_store_get_folder): Changed create to flags. (get_folder_internal): And here. (get_folder): And here too. * camel-store.h (camel_store_get_folder): Change the create argument to be a flags argument. svn path=/trunk/; revision=5978
* Merge with camel-async.Peter Williams2000-08-111-5/+5
| | | | svn path=/trunk/; revision=4687
* providers/imap/camel-imap-summary.c now buildsJeffrey Stedfast2000-06-081-4/+5
| | | | svn path=/trunk/; revision=3470
* > searchpart = strchr(namepart, '?');NotZed2000-05-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use CamelException to signal failure. (camel_stream_write_strings):Dan Winship2000-05-091-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Make camel not leak like a sieve.Dan Winship2000-05-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Big cleanup of camel-stream-*, got rid of 3 classes, improved the interfaces,NotZed2000-04-261-28/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* rename camel_stream_mem_new_with_buffer to ..._with_byte_array and add aDan Winship2000-03-281-3/+5
| | | | | | | | * camel-stream-mem.c (camel_stream_mem_new_with_buffer): rename camel_stream_mem_new_with_buffer to ..._with_byte_array and add a new ..._with_buffer that takes a char * rather than a GByteArray. svn path=/trunk/; revision=2189
* fix the name of "Helix Code, Inc." in all the copyrightsDan Winship2000-03-101-1/+1
| | | | svn path=/trunk/; revision=2091
* New header with the typedefs for all camel classes. Now the class headersDan Winship2000-02-191-3/+3
| | | | | | | | | | | | | | | * 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
* parent class is now CamelSeekableStream idem idem idem idem (_seek):bertrand2000-01-251-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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
* More work:Ettore Perazzoli1999-11-171-1/+1
| | | | | | | - Fixed some Camel API naming issues. - Moved the message composer stuff to the `composer' directory. svn path=/trunk/; revision=1395
* Copyright changeBertrand Guiheneuf1999-10-231-1/+4
| | | | svn path=/trunk/; revision=1348
* Address updateBertrand Guiheneuf1999-08-301-1/+1
| | | | svn path=/trunk/; revision=1147
* contruct the content from the buffer before calling CamelMediumbertrand1999-08-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sync before going homeBertrand Guiheneuf1999-08-021-2/+3
| | | | svn path=/trunk/; revision=1064
* new memory buffer based stream.Bertrand Guiheneuf1999-08-021-0/+80
* 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=1056