Optimize stream seeks and I/O. Expand stream event handlers. Rewrite xscript stream.
* include/mailutils/sys/stream.h (_MU_STR_EVENT_SET): Rename to _MU_STR_EVENT_SET. (_MU_STR_EVENT_CLR): Rename to _MU_STR_EVENT_CLRFLAG. (_MU_STR_EVENT_FILLBUF, _MU_STR_EVENT_FLUSHBUF): New event codes. (_MU_STR_EVMASK): New macro. (_mu_stream) <cur>: Replace with pos, indicating current position in the buffer. (event_cb): Change signature. (mu_stream_read_unbuffered): Remove. (mu_stream_write_unbuffered): Remove. * mailbox/iostream.c (mu_iostream_create): Provide the readdelim method only if the underlying input transpor stream provides it. * mailbox/streamref.c (mu_streamref_create_abridged): Likewise. * mailbox/stream.c (_stream_event): New macro. (mu_stream_read_unbuffered): Rename to static _stream_read_unbuffered. (mu_stream_write_unbuffered): Rename to static _stream_write_unbuffered. (_stream_advance_buffer, _stream_buffer_offset) (_stream_orig_level): Remove macros. (_stream_buffer_freespace): Rewrite. (_stream_curp): New macro. (_stream_fill_buffer): Make sure the `offset' indicates the offset int the transport, corresponding to the beginning of the current buffer. (_stream_flush_buffer): Essentially rewritten. (mu_stream_seek): Reflect changes to the _mu_stream structure. Optimize calls to the seek method. (_stream_skip_input_bytes): Likewise. (mu_stream_read, _stream_scandelim, mu_stream_write): Rewrite using new _mu_stream structure. * mailbox/xscript-stream.c: Rewrite using stream events. * mailbox/base64.c (_base64_encoder): Bugfix. * libproto/pop/pop3_stream.c (_pop3_event_cb): Update signature to match the changes above. * examples/mimetest.c (main): Add more error checking. * mail/testsuite/mail/write.exp: Minor fix.
Showing
9 changed files
with
202 additions
and
167 deletions
-
Please register or sign in to post a comment