GMime Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
typedef enum { GMIME_STREAM_SEEK_SET = SEEK_SET, GMIME_STREAM_SEEK_CUR = SEEK_CUR, GMIME_STREAM_SEEK_END = SEEK_END, } GMimeSeekWhence; |
struct GMimeStream { GObject parent_object; /* Note: these are private fields!! */ GMimeStream *super_stream; off_t position; off_t bound_start; off_t bound_end; }; |
void g_mime_stream_construct (GMimeStream *stream, |
Initializes a new stream with bounds start and end.
stream : | stream |
start : | start boundary |
end : | end boundary |
void g_mime_stream_unref (GMimeStream *stream); |
Unref's a stream.
stream : | stream |
|
Attempts to read up to len bytes from stream into buf.
stream : | stream |
buf : | buffer |
len : | buffer length |
Returns : | the number of bytes read or -1 on fail. |
|
Attempts to write up to len bytes of buf to stream.
stream : | stream |
buf : | buffer |
len : | buffer length |
Returns : | the number of bytes written or -1 on fail. |
int g_mime_stream_flush (GMimeStream *stream); |
Sync's the stream to disk.
stream : | stream |
Returns : | 0 on success or -1 on fail. |
|
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.
stream : | stream |
offset : | positional offset |
whence : | seek directive |
Returns : | the resultant position on success or -1 on fail. |
|
Gets the current offset within the stream.
stream : | stream |
Returns : | the current position within the stream or -1 on fail. |
int g_mime_stream_reset (GMimeStream *stream); |
Resets the stream.
stream : | stream |
Returns : | 0 on success or -1 on fail. |
|
Tests the end-of-stream indicator for stream.
stream : | stream |
Returns : | TRUE on EOS or FALSE otherwise. |
int g_mime_stream_close (GMimeStream *stream); |
Closes the stream.
stream : | stream |
Returns : | 0 on success or -1 on fail. |
|
Gets the length of the stream.
stream : | stream |
Returns : | the length of the stream or -1 on fail. |
GMimeStream* g_mime_stream_substream (GMimeStream *stream, |
Creates a new substream of stream with bounds start and end.
stream : | stream |
start : | start boundary |
end : | end boundary |
Returns : | a substream of stream with bounds start and end. |
void g_mime_stream_set_bounds (GMimeStream *stream, |
Set the bounds on a stream.
stream : | stream |
start : | start boundary |
end : | end boundary |
|
Writes string to stream.
stream : | stream |
string : | string to write |
Returns : | the number of bytes written or -1 on fail. |
|
Write formatted output to a stream.
stream : | stream |
fmt : | format |
... : | arguments |
Returns : | the number of bytes written or -1 on fail. |
|
Attempts to write stream src to stream dest.
src : | source stream |
dest : | destination stream |
Returns : | the number of bytes written or -1 on fail. |
|
Writes at most count blocks described by vector to stream.
stream : | stream |
vector : | i/o vector |
count : | number of vector elements |
Returns : | the number of bytes written or -1 on fail. |