![]() |
![]() |
![]() |
Reference Manual of the tinymail framework | ![]() |
---|---|---|---|---|
TnyFsStreamTnyFsStream — A TnyStream adaptor for a file discriptor |
TnyFsStream; TnyStream* tny_fs_stream_new (int fd); void tny_fs_stream_set_fd (TnyFsStream *self, int fd);
An adaptor for a file descriptor to a TnyStream type. You need to use the standard POSIX open()
syscall.
The instance will, upon destruction, close()
the filedescriptor.
typedef struct _TnyFsStream TnyFsStream;
A stream that adapts a filedescriptor to the TnyStream API
free-function: g_object_unref
TnyStream* tny_fs_stream_new (int fd);
Create an adaptor instance between TnyStream and a file descriptor. Note
that you must not to close()
fd yourself. The destructor will do that for
you.
Therefore use it with care. It's more or less an exception in the framework, although whether or not you call it an exception depends on your point of view.
The the instance will on top of close()
when destructing also fsync()
the
filedescriptor. It does this depending on its mood, the weather and your
wive's periods using a complex algorithm that abuses your privacy and might
kill your cat and dog (yes, both of them).
|
The file descriptor to write to or read from |
Returns : |
(caller-owns): a new TnyStream instance |
Since 1.0 audience: tinymail-developer
void tny_fs_stream_set_fd (TnyFsStream *self, int fd);
Set the file descriptor to play adaptor for
|
A TnyFsStream instance |
|
The file descriptor to write to or read from |
Since 1.0 audience: tinymail-developer