| Camel Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
CamelSeekableStream; enum CamelStreamSeekPolicy; #define CAMEL_STREAM_UNBOUND goffset camel_seekable_stream_seek (CamelSeekableStream *stream,goffset offset,CamelStreamSeekPolicy policy,GError **error); goffset camel_seekable_stream_tell (CamelSeekableStream *stream); gint camel_seekable_stream_set_bounds (CamelSeekableStream *stream,goffset start,goffset end,GError **error);
GObject +----CamelObject +----CamelStream +----CamelSeekableStream +----CamelSeekableSubstream +----CamelStreamFs +----CamelStreamMem
typedef enum {
CAMEL_STREAM_SET = SEEK_SET,
CAMEL_STREAM_CUR = SEEK_CUR,
CAMEL_STREAM_END = SEEK_END
} CamelStreamSeekPolicy;
goffset camel_seekable_stream_seek (CamelSeekableStream *stream,goffset offset,CamelStreamSeekPolicy policy,GError **error);
Seek to the specified position in stream.
If policy is CAMEL_STREAM_SET, seeks to offset.
If policy is CAMEL_STREAM_CUR, seeks to the current position plus
offset.
If policy is CAMEL_STREAM_END, seeks to the end of the stream plus
offset.
Regardless of policy, the stream's final position will be clamped
to the range specified by its lower and upper bounds, and the
stream's eos state will be updated.
|
a CamelStream object |
|
offset value |
|
what to do with the offset |
|
return location for a GError, or NULL
|
Returns : |
new position, -1 if operation failed.
|
goffset camel_seekable_stream_tell (CamelSeekableStream *stream);
Get the current position of a seekable stream.
|
a CamelSeekableStream object |
Returns : |
the current position of the stream. |
gint camel_seekable_stream_set_bounds (CamelSeekableStream *stream,goffset start,goffset end,GError **error);
Set the range of valid data this stream is allowed to cover. If
there is to be no end value, then end should be set to
CAMEL_STREAM_UNBOUND.
|
a CamelSeekableStream object |
|
the first valid position |
|
the first invalid position, or CAMEL_STREAM_UNBOUND |
|
return location for a GError, or NULL
|
Returns : |
-1 on error.
|