diff options
| author | ruki <[email protected]> | 2026-03-30 23:11:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-30 23:11:44 +0800 |
| commit | e8d7d0dfdcb0b3076ed2c26a1324f77d188e43c7 (patch) | |
| tree | d22c8e56f8fa843988db9a081d65a51ac2b36546 /xmake/core/base/pipe.lua | |
| parent | 21760e232a003e32f6ac10099a603a6366eb6aca (diff) | |
update comments
Diffstat (limited to 'xmake/core/base/pipe.lua')
| -rw-r--r-- | xmake/core/base/pipe.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/xmake/core/base/pipe.lua b/xmake/core/base/pipe.lua index 4b122ed9e..137f9c779 100644 --- a/xmake/core/base/pipe.lua +++ b/xmake/core/base/pipe.lua @@ -59,6 +59,11 @@ function _instance:cdata() end -- write data to pipe file +-- +-- @param data the data to write (string or bytes) +-- @param opt the options, e.g. {block = true} +-- @return the real written size, or -1 and error info +-- function _instance:write(data, opt) -- ensure opened @@ -119,6 +124,12 @@ function _instance:write(data, opt) end -- read data from pipe +-- +-- @param buff the buffer to receive data +-- @param size the read size +-- @param opt the options, e.g. {block = true} +-- @return the real read size, or -1 and error info +-- function _instance:read(buff, size, opt) assert(buff) @@ -187,6 +198,10 @@ function _instance:read(buff, size, opt) end -- connect pipe, only for named pipe (server-side) +-- +-- @param opt the options +-- @return true on success +-- function _instance:connect(opt) -- ensure opened @@ -218,6 +233,11 @@ function _instance:connect(opt) end -- wait pipe events +-- +-- @param events the events to wait, e.g. pipe.EV_READ, pipe.EV_WRITE +-- @param timeout the timeout in milliseconds, -1 for infinite +-- @return the received events, or 0 on timeout +-- function _instance:wait(events, timeout) -- ensure opened @@ -241,6 +261,9 @@ function _instance:wait(events, timeout) end -- close pipe file +-- +-- @return true on success +-- function _instance:close() -- ensure opened |
