A2osX/SYS/KERNEL.S.ENV.txt
2020-02-14 08:21:56 +01:00

80 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*/--------------------------------------
* # SetEnv
* Change or add an environment variable
* ## C / CSH
* `int setenv(const char *name, const char *value);`
* ## ASM
* **In:**
* `>PUSHW name`
* `>PUSHW value`
* `>SYSCALL setenv`
* ## RETURN VALUE
*\--------------------------------------
K.SetEnv
* >PULLW FORPNT value
* >PULLW TXTPTR name
* ldy #S.PS.hENV
* lda (pPs),y
* jmp K.SYSCALL.JMPX
*/--------------------------------------
* # GetEnv
* searches the environment list to find the environment variable name,
* and returns a pointer to the corresponding value string.
* ## C / CSH
* `char *getenv(const char *name, char *value);`
* ## ASM
* **In:**
* `>PUSHW name`
* `>PUSHW value`
* `>SYSCALL getenv`
* ## RETURN VALUE
* CC : Y,A = PTR to VALUE (C-String)
* CS : not found
*\--------------------------------------
K.GetEnv >PULLW FORPNT value
* >PULLW TXTPTR name
*
* ldy #S.PS.hENV
* lda (pPs),y
* jmp K.SYSCALL.JMPX
*/--------------------------------------
* # PutEnv
* Change or add an environment variable, string is 'NAME=VALUE'
* ## C / CSH
* `int putenv(char *string);`
* ## ASM
* **In:**
* `>PUSHW string`
* `>SYSCALL putenv`
* ## RETURN VALUE
*\--------------------------------------
K.PutEnv >PULLW TXTPTR NAME=VALUE
*/--------------------------------------
* # UnsetEnv
* Remove an environment variable
* ## C / CSH
* `int unsetenv(const char *name);`
* ## ASM
* **In:**
* `>PUSHW name`
* `>SYSCALL unsetenv`
* ## RETURN VALUE
*\--------------------------------------
K.UnsetEnv
* >PULLW TXTPTR name
ldy #S.PS.hENV
lda (pPs),y
jmp K.SYSCALL.JMPX
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.ENV
LOAD USR/SRC/SYS/KERNEL.S
ASM