efl/src/lib/efl/interfaces/efl_io_closer.eo

80 lines
2.4 KiB
Plaintext

import eina_types;
mixin Efl.Io.Closer {
[[Generic interface for objects that can close themselves.
This interface allows external objects to transparently close an
input or output stream, cleaning up its resources.
Calls to @.close() may or may not block, that's not up to this
interface to specify.
@since 1.19
]]
data: null;
methods {
close @virtual_pure {
[[Closes the Input/Output object.
This operation will be executed immediately and may or
may not block the caller thread for some time. The
details of blocking behavior is to be defined by the
implementation and may be subject to other parameters
such as non-blocking flags, maximum timeout or even
retry attempts.
You can understand this method as close(2) libc function.
]]
return: Eina.Error; [[0 on succeed, a mapping of errno otherwise]]
}
@property closed {
[[If true will notify object was closed.]]
get @virtual_pure { }
set {
[[If true, calls close()]]
return: bool; [[$true if could close, $false if already closed or errors.]]
}
values {
is_closed: bool;
}
}
@property close_on_exec {
[[If true will automatically close resources on exec() calls.
When using file descriptors this should set FD_CLOEXEC
so they are not inherited by the processes (children or
self) doing exec().
]]
get @virtual_pure { }
set @virtual_pure {
[[If true, will close on exec() call.]]
return: bool; [[$true if could set, $false if not supported or failed.]]
}
values {
close_on_exec: bool;
}
}
@property close_on_destructor {
[[If true will automatically close() on object destructor.
If the object was deleted without close, this property
will state whenever it should be closed or not.
]]
get @virtual_pure { }
set @virtual_pure { }
values {
close_on_destructor: bool;
}
}
}
events {
closed; [[Notifies closed, when property is marked as true]]
}
}