From 24cab850eb11336730abd23c923b14ec2ed0b83e Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Tue, 9 May 2017 22:16:54 +0100 Subject: docs: Environment variables Add more details to Environment variables section. --- luxio.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'luxio.c') 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 -- cgit v1.2.1