PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/liquidfeedback/webmcp/libraries/extos/extos.autodoc.lua

https://gitlab.com/fuzzynemesis/hajaannu
Lua | 149 lines | 0 code | 16 blank | 133 comment | 0 complexity | 80d02edd46297981203ce88710a4fa57 MD5 | raw file
Possible License(s): Apache-2.0
  1. --[[--
  2. data_out, -- string containing stdout data, or nil in case of error
  3. data_err, -- string containing error or stderr data
  4. status = -- exit code, or negative code in case of abnormal termination
  5. extos.pfilter{
  6. data_in = data_in, -- string containing stdin data
  7. filename = filename, -- executable
  8. arg1 = arg1, -- first (non-zero) argument to executable
  9. arg2 = arg2, -- second argument to executable
  10. ...
  11. }
  12. 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.
  13. --]]--
  14. -- implemented in extos.c as
  15. -- static int extos_pfilter(lua_State *L)
  16. --//--
  17. --[[--
  18. directory_entries, -- table of directory entries
  19. errmsg = -- error message if directory could not be read
  20. extos.listdir(
  21. path -- path name
  22. )
  23. This function returns a table containing strings representing each entry in a directory. On error nil and an error message are returned.
  24. --]]--
  25. -- implemented in extos.c as
  26. -- static int extos_listdir(lua_State *L)
  27. --//--
  28. --[[--
  29. filestat_table, -- table with information on the file, false if file does not exist, nil on error
  30. errmsg = -- error message if file information could not be read or file does not exist
  31. extos.stat(
  32. filename -- path to a file on the file system
  33. )
  34. Return information on a file, following symbolic links if applicable. See also: extos.lstat(...) and extos.fstat(...).
  35. The returned table contains the following fields:
  36. - "dev" (numeric ID of the device containing the file)
  37. - "ino" (file's inode number)
  38. - "nlink" (number of hard links to the file)
  39. - "atime" (time when file data was last accessed)
  40. - "mtime" (time when file data was last modified)
  41. - "ctime" (time when file status was last changed)
  42. - "size" (file size in bytes)
  43. - "blksize" (optimal I/O block size for the file)
  44. - "blocks" (actual number of blocks allocated for the file in 512-byte units)
  45. - "uid" (user ID of the file's owner)
  46. - "gid" (group ID of the file)
  47. - "mode" (bitfield including the access permissions)
  48. - "isblk" (true if block special file)
  49. - "ischr" (true if character special file)
  50. - "isdir" (true if directory)
  51. - "isfifo" (true if pope of FIFO special file)
  52. - "islnk" (true if symbolic link)
  53. - "isreg" (true if regular file)
  54. - "issock" (true if socket)
  55. If the file does not exist, false and an error message are returned.
  56. In case of any other error, nil and an error message are returned.
  57. --]]--
  58. -- implemented in extos.c as
  59. -- static int extos_stat(lua_State *L)
  60. --//--
  61. --[[--
  62. filestat_table, -- table with information on the file, false if file does not exist, nil on error
  63. errmsg = -- error message if file information could not be read or file does not exist
  64. extos.lstat(
  65. filename -- path to a file on the file system
  66. )
  67. Return information on a file. Symbolic links are not followed, which means that if the filename points to a symbolic link, information on that symbolic link will be returned. Otherwise this function behaves like extos.stat(filename).
  68. See extos.stat(...) for further information.
  69. --]]--
  70. -- implemented in extos.c as
  71. -- static int extos_stat(lua_State *L)
  72. --//--
  73. --[[--
  74. filestat_table, -- table with information on the file, nil on error
  75. errmsg = -- error message if file information could not be determined
  76. extos.fstat(
  77. file_handle -- Lua file handle (e.g. as returned by io.open(...))
  78. )
  79. Return information on an open file. The file is specified by passing an open file handle to this function. Otherwise this function behaves like extos.stat(...).
  80. See extos.stat(...) for further information.
  81. --]]--
  82. -- implemented in extos.c as
  83. -- static int extos_stat(lua_State *L)
  84. --//--
  85. --[[--
  86. passhash = -- encrypted password
  87. extos.crypt{
  88. key = key, -- password to be one-way encrypted
  89. salt = salt -- salt to be used for encryption, optionally starting with "$N$", where N is a digit
  90. }
  91. This function is a wrapper for the C function char *crypt(const char *key, const char *salt).
  92. --]]--
  93. -- implemented in extos.c as
  94. -- static int extos_crypt(lua_State *L)
  95. --//--
  96. --[[--
  97. seconds =
  98. extos.hires_time()
  99. Returns a unix time stamp representing current time with high resolution.
  100. --]]--
  101. -- implemented in extos.c as
  102. -- static int extos_hires_time(lua_State *L)
  103. --//--
  104. --[[--
  105. seconds =
  106. extos.monotonic_hires_time()
  107. Returns the number of (SI) seconds since loading the library with high resolution.
  108. --]]--
  109. -- implemented in extos.c as
  110. -- static int extos_monotonic_hires_time(lua_State *L)
  111. --//--