summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_io_closer.eo
blob: 91e35eb75dff5e963659ea26b36680e0ae8eeafa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import eina_types;

interface 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.22
    ]]

    methods {
        close {
            [[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 { }
            values {
                is_closed: bool; [[$true if closed, $false otherwise]]
            }
        }

        @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 { }
            set {
                [[If $true, will close on exec() call.]]
                return: bool; [[$true if could set, $false if not supported or failed.]]
            }
            values {
                close_on_exec: bool; [[$true if close on exec(), $false otherwise]]
            }
        }

        @property close_on_invalidate {
            [[If true will automatically close() on object invalidate.

              If the object was disconnected from its parent (including the main loop) without close,
	      this property will state whenever it should be closed or not.
            ]]
            get { }
            set { }
            values {
                close_on_invalidate: bool; [[$true if close on invalidate, $false otherwise]]
            }
        }
    }

    events {
        closed: void; [[Notifies closed, when property is marked as true]]
    }
}