GMime Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
struct GMimeStream { /* Note: these are private fields!! */ GMimeStream *super_stream; unsigned int type; int refcount; off_t position; off_t bound_start; off_t bound_end; void (*destroy) (GMimeStream *stream); ssize_t (*read) (GMimeStream *stream, char *buf, size_t len); ssize_t (*write) (GMimeStream *stream, char *buf, size_t len); int (*flush) (GMimeStream *stream); int (*close) (GMimeStream *stream); gboolean (*eos) (GMimeStream *stream); int (*reset) (GMimeStream *stream); off_t (*seek) (GMimeStream *stream, off_t offset, GMimeSeekWhence whence); off_t (*tell) (GMimeStream *stream); ssize_t (*length) (GMimeStream *stream); GMimeStream *(*substream) (GMimeStream *stream, off_t start, off_t end); }; |
typedef enum { GMIME_STREAM_SEEK_SET = SEEK_SET, GMIME_STREAM_SEEK_CUR = SEEK_CUR, GMIME_STREAM_SEEK_END = SEEK_END, } GMimeSeekWhence; |
void g_mime_stream_construct (GMimeStream *stream, GMimeStream *stream_template, unsigned int type, off_t start, off_t end); |
Initializes a new stream of type type, using the virtual methods from stream_template, with bounds start and end.
ssize_t g_mime_stream_read (GMimeStream *stream, char *buf, size_t len); |
Attempts to read up to len bytes from stream into buf.
ssize_t g_mime_stream_write (GMimeStream *stream, char *buf, size_t len); |
Attempts to write up to len bytes of buf to stream.
off_t g_mime_stream_seek (GMimeStream *stream, off_t offset, GMimeSeekWhence whence); |
Repositions the offset of the stream stream to the argument offset according to the directive whence as follows:
GMIME_STREAM_SEEK_SET: The offset is set to offset bytes.
GMIME_STREAM_SEEK_CUR: The offset is set to its current location plus offset bytes.
GMIME_STREAM_SEEK_END: The offset is set to the size of the stream plus offset bytes.
off_t g_mime_stream_tell (GMimeStream *stream); |
Gets the current offset within the stream.
gboolean g_mime_stream_eos (GMimeStream *stream); |
Tests the end-of-stream indicator for stream.
ssize_t g_mime_stream_length (GMimeStream *stream); |
Gets the length of the stream.
GMimeStream* g_mime_stream_substream (GMimeStream *stream, off_t start, off_t end); |
Creates a new substream of stream with bounds start and end.
void g_mime_stream_set_bounds (GMimeStream *stream, off_t start, off_t end); |
Sets the bounds on the stream stream.
ssize_t g_mime_stream_write_string (GMimeStream *stream, const char *string); |
Writes string to stream.
ssize_t g_mime_stream_printf (GMimeStream *stream, const char *fmt, ...); |
Write formatted output to a stream.
ssize_t g_mime_stream_write_to_stream (GMimeStream *src, GMimeStream *dest); |
Attempts to write stream src to stream dest.
ssize_t g_mime_stream_writev (GMimeStream *stream, IOVector *vector, size_t count); |
Writes at most count blocks described by vector to stream.