Details
struct GMimeStream
struct GMimeStream {
/* Note: these are private fields!! */
GMimeStream *super_stream;
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);
}; |
enum GMimeSeekWhence
typedef enum {
GMIME_STREAM_SEEK_SET = SEEK_SET,
GMIME_STREAM_SEEK_CUR = SEEK_CUR,
GMIME_STREAM_SEEK_END = SEEK_END,
} GMimeSeekWhence; |
GMIME_STREAM()
#define GMIME_STREAM(stream) ((GMimeStream *) stream) |
g_mime_stream_construct ()
void g_mime_stream_construct (GMimeStream *stream,
GMimeStream *stream_template,
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.
g_mime_stream_ref ()
Ref's a stream.
g_mime_stream_unref ()
Unref's a stream.
g_mime_stream_read ()
ssize_t g_mime_stream_read (GMimeStream *stream,
char *buf,
size_t len); |
Attempts to read up to len bytes from stream into buf.
g_mime_stream_write ()
ssize_t g_mime_stream_write (GMimeStream *stream,
char *buf,
size_t len); |
Attempts to write up to len bytes of buf to stream.
g_mime_stream_flush ()
Sync's the stream to disk.
g_mime_stream_seek ()
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.
g_mime_stream_reset ()
Resets the stream.
g_mime_stream_eos ()
Tests the end-of-stream indicator for stream.
g_mime_stream_close ()
Closes the stream.
g_mime_stream_substream ()
g_mime_stream_set_bounds ()
void g_mime_stream_set_bounds (GMimeStream *stream,
off_t start,
off_t end); |
Set the bounds on a stream.
g_mime_stream_write_string ()
ssize_t g_mime_stream_write_string (GMimeStream *stream,
const char *string); |
Writes string to stream.
g_mime_stream_printf ()
ssize_t g_mime_stream_printf (GMimeStream *stream,
const char *fmt,
...); |
Write formatted output to a stream.
g_mime_stream_write_to_stream ()
Attempts to write stream src to stream dest.
g_mime_stream_writev ()
size_t g_mime_stream_writev (GMimeStream *stream,
IOVector *vector,
size_t count); |
Writes at most count blocks described by vector to stream.