| Reference Manual of the tinymail framework | ||||
|---|---|---|---|---|
TnySeekableTnySeekable — Makes a TnyStream seekable |
TnySeekable;
TnySeekableIface;
off_t tny_seekable_seek (TnySeekable *self,
off_t offset,
int policy);
off_t tny_seekable_tell (TnySeekable *self);
gint tny_seekable_set_bounds (TnySeekable *self,
off_t start,
off_t end);
TnySeekable is implemented by TnyCamelStream, TnyFsStream, TnyCamelMemStream and TnyVfsStream.
typedef struct {
GTypeInterface parent;
off_t (*seek) (TnySeekable *self, off_t offset, int policy);
off_t (*tell) (TnySeekable *self);
gint (*set_bounds) (TnySeekable *self, off_t start, off_t end);
} TnySeekableIface;
off_t tny_seekable_seek (TnySeekable *self, off_t offset, int policy);
Seek to the specified position in self.
If policy is SEEK_SET, seeks to offset.
If policy is SEEK_CUR, seeks to the current position plus offset.
If policy is SEEK_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.
self : |
a TnySeekable |
offset : |
offset value |
policy : |
what to do with the offset |
| Returns : | new position, -1 if operation failed.
|
Since 1.0 audience: application-developer
off_t tny_seekable_tell (TnySeekable *self);
Get the current position of a seekable stream.
self : |
a TnySeekable |
| Returns : | the current position of the stream. |
Since 1.0 audience: application-developer
gint tny_seekable_set_bounds (TnySeekable *self, off_t start, off_t end);
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 ~0.
self : |
a TnySeekable |
start : |
the first valid position |
end : |
the first invalid position, or ~0 for unbound |
| Returns : | -1 on error
|
Since 1.0 audience: application-developer