Documentation of kernel API
This commit is contained in:
parent
77b197786d
commit
4582df8946
|
@ -487,3 +487,52 @@ as a device alias.
|
|||
|
||||
On success, `C` will contain `STATUS_OK`. On error, `C` will contain
|
||||
a negative value which indicates the specific error type.
|
||||
|
||||
## `0x1A`: Get Environment Variable
|
||||
|
||||
Arguments:
|
||||
- `C`: `0x1A`
|
||||
- `X`: Bank of argument structure
|
||||
- `Y`: Address of argument structure
|
||||
|
||||
Return Values:
|
||||
- `C`: Status code
|
||||
|
||||
Argument Structure:
|
||||
|
||||
```
|
||||
struct {
|
||||
char *name; // The name of the variable to read
|
||||
char *value; // Buffer for the value of the variable
|
||||
};
|
||||
```
|
||||
|
||||
This call gets the value of an environment variable specified by the
|
||||
`name` field of the argument structure, and copies it into the buffer
|
||||
pointed to by the `value` field. If the variable is not set, the value
|
||||
will be set to `NULL`, and the status code will be `ERR_ENV_UNSET`; otherwise
|
||||
the status code will be `STATUS_OK`.
|
||||
|
||||
## `0x1B`: Set Environment Variable
|
||||
|
||||
Arguments:
|
||||
- `C`: `0x1A`
|
||||
- `X`: Bank of argument structure
|
||||
- `Y`: Address of argument structure
|
||||
|
||||
Return Values:
|
||||
- `C`: Status code
|
||||
|
||||
Argument Structure:
|
||||
|
||||
```
|
||||
struct {
|
||||
char *name; // The name of the variable to set
|
||||
char *value; // Buffer for the new value of the variable
|
||||
};
|
||||
```
|
||||
|
||||
This call sets the value of an environment variable specified by the
|
||||
`name` field of the argument structure by copying the string pointed
|
||||
to by the `value` field. To unset a variable, pass `NULL` in the `value`
|
||||
field. This call always returns `STATUS_OK`.
|
Loading…
Reference in New Issue