summaryrefslogtreecommitdiff
path: root/luxio.c
diff options
context:
space:
mode:
authorRichard Ipsum <richardipsum@fastmail.co.uk>2017-05-09 22:16:54 +0100
committerRichard Ipsum <richardipsum@fastmail.co.uk>2017-05-10 22:54:40 +0100
commit24cab850eb11336730abd23c923b14ec2ed0b83e (patch)
tree4f29da4d8e802fc17afd952d701c8b9ff5673d09 /luxio.c
parent311d2d56745b27c12771392f5f07b289ca3509b0 (diff)
downloadluxio-24cab850eb11336730abd23c923b14ec2ed0b83e.tar.bz2
docs: Environment variables
Add more details to Environment variables section.
Diffstat (limited to 'luxio.c')
-rw-r--r--luxio.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/luxio.c b/luxio.c
index 27de64e..eaedec0 100644
--- a/luxio.c
+++ b/luxio.c
@@ -833,6 +833,10 @@ luxio_times(lua_State *L) /* 4.5.2 */
*/
/*** Get an environment variable.
+
+Returns the value of the environment variable, or nil if the environment
+variable does not exist.
+
@tparam string name
@treturn string|nil return value
@function getenv
@@ -853,6 +857,15 @@ luxio_getenv(lua_State *L) /* 4.6.1 */
}
/*** Set an environment variable.
+
+Returns zero on success, or -1 on error, with errno set appropriately.
+
+Add the variable with name `name` to the environment if it
+doesn't already exist. If it does already exist then overwrite
+it if `overwrite` is non-zero, otherwise do nothing.
+_Note: `setenv()` still returns successfully if the variable
+is found and `overwrite` is zero._
+
@tparam string name
@tparam string value
@tparam[opt=0] number overwrite
@@ -874,6 +887,9 @@ luxio_setenv(lua_State *L) /* POSIX.1-2001 */
}
/*** Unsets an environment variable.
+
+Returns zero on success, or -1 on error, with errno set appropriately.
+
@tparam string name
@treturn number return value
@treturn errno