aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/.proc.luadoc
blob: c10de330c600d57d8c472be92129543525f9e22d (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
-- Copyright 2012-2014 Mitchell mitchell.att.foicica.com. See LICENSE.
-- This is a DUMMY FILE used for making LuaDoc for functions in the proc
-- userdata defined by the lspawn module.

---
-- Userdata representing a process created by `spawn()`.
module('proc')

---
-- Returns the status of process *proc*, which is either "running" or
-- "terminated".
-- @param proc A process created by `spawn()`.
-- @return "running" or "terminated"
function status(proc) end

---
-- Blocks until process *proc* finishes.
-- @param proc A process created by `spawn()`.
function wait(proc) end

---
-- Reads and returns stdout from process *proc*, according to string format or
-- number *arg*.
-- Similar to Lua's `io.read()` and blocks for input. *proc* must still be
-- running. If an error occurs while reading, returns `nil`, an error code, and
-- an error message.
-- Ensure any read operations read all stdout available. The stdout callback
-- function passed to `spawn()` will not be called until the stdout buffer is
-- clear.
-- @param proc A process created by `spawn()`.
-- @param arg Optional argument similar to those in Lua's `io.read()`, but "*n"
--   is not supported. The default value is "*l", which reads a line.
-- @return string of bytes read
function read(proc, arg) end

---
-- Writes string input to the stdin of process *proc*.
-- @param proc A process created by `spawn()`.
-- @param ... Standard input for *proc*.
function write(proc, ...) end

---
-- Kills running process *proc*.
-- @param proc A running process created by `spawn()`.
function kill(proc) end