task API demo page, string stuff
This commit is contained in:
@@ -5,4 +5,6 @@ first
|
||||
join
|
||||
nibble
|
||||
split
|
||||
str_to_lower
|
||||
str_to_upper
|
||||
trim
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Task API
|
||||
|
||||
kill
|
||||
task
|
||||
task_pid
|
||||
@@ -0,0 +1,15 @@
|
||||
:sig
|
||||
s64 kill(pid_t pid, s64 sig)
|
||||
|
||||
:params
|
||||
pid : PID of the process
|
||||
sig : signal number
|
||||
return value : 0 if signal was sent, -1 otherwise
|
||||
|
||||
:desc
|
||||
This is the standard POSIX kill() function, provided here for reference.
|
||||
|
||||
Possible signal numbers are: SIGABND, SIGABRT, SIGALRM, SIGBUS, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGKILL, SIGPIPE, SIGPOLL, SIGPROF, SIGQUIT, SIGSEGV, SIGSYS, SIGTERM, SIGTRAP, SIGURG, SIGUSR1, SIGUSR2, SIGVTALRM, SIGXCPU, SIGXFSZ, SIGCHLD, SIGIO, SIGIOERR, SIGWINCH, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGCONT.
|
||||
|
||||
:see
|
||||
>task
|
||||
@@ -0,0 +1,14 @@
|
||||
:sig
|
||||
String str_to_lower(String s)
|
||||
|
||||
:params
|
||||
s : the string to be converted
|
||||
return value : returns a version of 's' where all upper case characters have been changed into lower case
|
||||
|
||||
:desc
|
||||
Returns a lower case version of the input string 's'.
|
||||
|
||||
Note: this function is not yet Unicode-aware.
|
||||
|
||||
:see
|
||||
>string
|
||||
@@ -0,0 +1,14 @@
|
||||
:sig
|
||||
String str_to_upper(String s)
|
||||
|
||||
:params
|
||||
s : the string to be converted
|
||||
return value : returns a version of 's' where all lower case characters have been changed into upper case
|
||||
|
||||
:desc
|
||||
Returns a upper case version of the input string 's'.
|
||||
|
||||
Note: this function is not yet Unicode-aware.
|
||||
|
||||
:see
|
||||
>string
|
||||
@@ -0,0 +1,13 @@
|
||||
:sig
|
||||
pid_t task(String key, std::function<void()> exec_func)
|
||||
|
||||
:params
|
||||
key : string uniquely identifying the task
|
||||
exec_func : function to execute
|
||||
return value : the process ID of the started (or still running) task
|
||||
|
||||
:desc
|
||||
task() starts the 'exec_func' in a new process and returns that process' ID. If a process with the same 'key' is already running, task will not start a new process but instead just return the PID of the process that is already running.
|
||||
|
||||
:see
|
||||
>task
|
||||
@@ -0,0 +1,12 @@
|
||||
:sig
|
||||
pid_t task_pid(String key)
|
||||
|
||||
:params
|
||||
key : string uniquely identifying the task
|
||||
return value : the process ID of the task
|
||||
|
||||
:desc
|
||||
Checks whether a process with the given 'key' is running and returns its PID if it is. Returns 0 otherwise.
|
||||
|
||||
:see
|
||||
>task
|
||||
Reference in New Issue
Block a user