From 9ad4b23a6cfff9f5329ef10654dc91fc46197ea8 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Mon, 18 Dec 2023 18:44:31 +1000 Subject: [PATCH] version bump and documentation update --- clite/bios.js | 2 +- clite/core.js | 2 +- readme-libs.txt | 91 ++++++++++++++++++++++++++++++++++++++++++--- readme-programs.txt | 12 +++--- readme.txt | 11 ++++-- 5 files changed, 102 insertions(+), 16 deletions(-) diff --git a/clite/bios.js b/clite/bios.js index e412e62..b80ff64 100644 --- a/clite/bios.js +++ b/clite/bios.js @@ -1,7 +1,7 @@ (function() { var bios = { data:{ - version:'0.1.3', + version:'0.1.4', id:'BIOS', bootable:'clite/core.js', entry:null diff --git a/clite/core.js b/clite/core.js index df7e9eb..88b3429 100644 --- a/clite/core.js +++ b/clite/core.js @@ -1,6 +1,6 @@ var clite = { state:{ - version:'0.6.0', + version:'0.6.1', isinit:false, runlevel:1, bios:null, diff --git a/readme-libs.txt b/readme-libs.txt index 16e558d..895d35a 100644 --- a/readme-libs.txt +++ b/readme-libs.txt @@ -76,26 +76,32 @@ stdlib (libstd.so): io.include('stdlib') return; wait(cb) - Calls cb(pid) once any child of the current process has exited. + Calls cb(pid,exit_status) once any child of the current process has exited. Calls immediately if the are no child processes. Returns false on error. waitpid(pid,cb) - Calls cb(pid) when the process with id pid has exited. Calls + Calls cb(pid,exit_status) when the process with id pid has exited. Calls immediately if the process does not exist. If pid is less than 0, functions like wait(cb) Returns false on error. waitall(cb) - Calls cb(pid) once all child processes of the current process + Calls cb(pid,exit_status) once all child processes of the current process group have exited. Calls immediately if the are no child processes. Returns false on error. getuid() - Returns the numeric user id of the current process. + Returns the (real) numeric user id of the current process. + + geteuid() + Returns the effective numeric user id of the current process. getgid() - Returns the numeric group id of the current process. + Returns the (real) numeric group id of the current process. + + getegid() + Returns the effective numeric group id of the current process. getpwuid(uid) Returns a pw object, containing the passwd file data of the user @@ -105,6 +111,17 @@ stdlib (libstd.so): io.include('stdlib') Returns a pw object, containing the passwd file data of the user who's username = name + setpwent() + getpwent() + endpwent() + Used for iterating over passwd file entries: + let pw = null; + setpwent(); + while ((pw = getpwent()) != null) { + stdio.printf('username: %s\n',pw.pw_name); + } + endpwent(); + getgrgid(gid) Returns a gr object, containing the group file data of the group who's numeric group id = gid @@ -113,6 +130,17 @@ stdlib (libstd.so): io.include('stdlib') Returns a gr object, containing the group file data of the group who's groupname = name + setgrent() + getgrent() + endgrent() + Used for iterating over group file entries: + let gr = null; + setgrent(); + while ((gr = getgrent()) != null) { + stdio.printf('group name: %s\n',gr.gr_name); + } + endgrent(); + clite (libclite.so): io.include('clite') Provides provides special functions used in CLIte. @@ -176,6 +204,18 @@ clite (libclite.so): io.include('clite') The directory is readable, writable, and searchable by all, but only the file's owner may delete a file in the directory. + cookienotice() + Prints a standard cookie notice to stdout, because hurrah for + the web. + getcookiestate() + Get whether the current user has accepted cookies + true - accepted + false - rejected + null - user has not accepted or rejected cookies, default to + rejected + + setcookiestate(bool) + Set whether the user has accepted cookies or not (true/false) stdio (libio.so): io.include('stdio') Provides access to io functions and types for file access @@ -524,3 +564,44 @@ time (libtime.so): io.include('time') time() Returns the current time, as seconds since epoch. + +auth (libauth.so): io.include('auth') + Provides function for interacting with user accounts and groups. + + setpwentry(pw) + Creates a new entry in the passwd file, creating a new account, + see getpw*() for details on the pw object. + Returns true on success. + + removepw(uid) + Removes the passwd file entry for the user with id uid, deleting + the account. + Returns true on success. + + setgrentry(gr) + Creates a new entry in the group file, creating a new group, see + getgr*() for details on the gr object. + Returns true on success. + + removegr(gid) + Removes the group file entry for the group with id gid, deleting + the group. + Returns true on success. + + setpassuid(uid, pass) + Sets the password for the user account with id uid. + Returns true on success. + + setpassnam(name, pass) + Sets the password for the user account with username name. + Returns true on success. + + checkpassuid(uid, pass) + Check if a password is the correct password for the user account + with id uid. + Returns true on success. + + checkpassnam(name, pass) + Check if a password is the correct password for the user account + with the username name. + Returns true on success. diff --git a/readme-programs.txt b/readme-programs.txt index 597697c..5c90e01 100644 --- a/readme-programs.txt +++ b/readme-programs.txt @@ -31,12 +31,14 @@ The function in the second argument is roughly equivalent to main() in C. io.stdin file descriptor for standard input - io.exit(value) exits the program, equivalent to the C exit() function. - A program can also be exited by returning a non-null value from the 'main' - function. + io.exit(value) + exits the program, equivalent to the C exit() function. + A program can also be exited by returning a non-null value from + the 'main' function. - io.include('name') loads a library into the current scope for use. See - the libs readme file for more details. + io.include('name') + Loads a library into the current scope for use. See the libs + readme file for more details. Example Programs: diff --git a/readme.txt b/readme.txt index 3ce7d76..b99d42d 100644 --- a/readme.txt +++ b/readme.txt @@ -44,15 +44,18 @@ rm - remove files chmod - change file modes (permissions) +chown - change file ownership + +su - switch user accounts + mkdir - make a directory date - view the current system date +user - user account manager + +passwd - change user passwords -Under Development: -view - file viewer, should display files something like the way a - text mode browser would, so is for actually viewing the website - content Running any command with the argument -? will give you help for that program.