webmcp

annotate libraries/extos/extos.autodoc.lua @ 270:aedd13009ddc

Proper handling of 404's and mime types for static file delivery
author jbe
date Fri Mar 20 16:38:37 2015 +0100 (2015-03-20)
parents 599b8463b985
children 985ffb3ef69f
rev   line source
jbe@268 1
jbe@268 2 --[[--
jbe@268 3 data_out, -- string containing stdout data, or nil in case of error
jbe@268 4 data_err, -- string containing error or stderr data
jbe@268 5 status = -- exit code, or negative code in case of abnormal termination
jbe@268 6 extos.pfilter{
jbe@268 7 data_in = data_in, -- string containing stdin data
jbe@268 8 filename = filename, -- executable
jbe@268 9 arg1 = arg1, -- first (non-zero) argument to executable
jbe@268 10 arg2 = arg2, -- second argument to executable
jbe@268 11 ...
jbe@268 12 }
jbe@268 13
jbe@268 14 Executes the executable given by "filename", passing optional arguments. A given string may be fed into the program as stdin. On success 3 values are returned: A string containing all stdout data of the sub-process, a string containing all stderr data of the sub-process, and a status code. The status code is negative, if the program didn't terminate normally. By convention a status code of zero indicates success, while positive status codes indicate error conditions. If program execution was not possible at all, then nil is returned as first value and an error string as second value.
jbe@268 15
jbe@268 16 --]]--
jbe@268 17 -- implemented in extos.c as
jbe@268 18 -- static int extos_pfilter(lua_State *L)
jbe@268 19 --//--
jbe@268 20
jbe@268 21
jbe@268 22 --[[--
jbe@268 23 directory_entries = -- table of directory entries
jbe@268 24 extos.listdir{
jbe@268 25 path = path -- path name
jbe@268 26 }
jbe@268 27
jbe@268 28 This function returns a table containing strings representing each entry in a directory. On error nil and an error message is returned.
jbe@268 29
jbe@268 30 --]]--
jbe@268 31 -- implemented in extos.c as
jbe@268 32 -- static int extos_listdir(lua_State *L)
jbe@268 33 --//--
jbe@268 34
jbe@268 35
jbe@268 36 --[[--
jbe@268 37 passhash = -- encrypted password
jbe@268 38 extos.crypt{
jbe@268 39 key = key, -- password to be one-way encrypted
jbe@268 40 salt = salt -- salt to be used for encryption, optionally starting with "$N$", where N is a digit
jbe@268 41 }
jbe@268 42
jbe@268 43 This function is a wrapper for the C function char *crypt(const char *key, const char *salt).
jbe@268 44
jbe@268 45 --]]--
jbe@268 46 -- implemented in extos.c as
jbe@268 47 -- static int extos_crypt(lua_State *L)
jbe@268 48 --//--
jbe@268 49
jbe@268 50
jbe@268 51 --[[--
jbe@268 52 seconds =
jbe@268 53 extos.hires_time()
jbe@268 54
jbe@268 55 Returns a unix time stamp representing current time with high resolution.
jbe@268 56
jbe@268 57 --]]--
jbe@268 58 -- implemented in extos.c as
jbe@268 59 -- static int extos_hires_time(lua_State *L)
jbe@268 60 --//--
jbe@268 61
jbe@268 62
jbe@268 63 --[[--
jbe@268 64 seconds =
jbe@268 65 extos.monotonic_hires_time()
jbe@268 66
jbe@268 67 Returns the number of (SI) seconds since loading the library with high resolution.
jbe@268 68
jbe@268 69 --]]--
jbe@268 70 -- implemented in extos.c as
jbe@268 71 -- static int extos_monotonic_hires_time(lua_State *L)
jbe@268 72 --//--
jbe@268 73

Impressum / About Us