mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-27 02:32:51 +00:00
81 lines
1.8 KiB
Plaintext
81 lines
1.8 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
*/--------------------------------------
|
||
* # SetEnv
|
||
* Change or add an environment variable
|
||
* ## C / CSH
|
||
* `int setenv(const char *name, const char *value);`
|
||
* ## ASM
|
||
* `>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
|
||
* `>PUSHW name`
|
||
* `>PUSHW value`
|
||
* `>SYSCALL getenv`
|
||
* ## RETURN VALUE
|
||
* CC : Y,A = PTR to VALUE (C-String)
|
||
* CS : not found
|
||
*\--------------------------------------
|
||
K.GetEnv >PULLW FORPNT value
|
||
*/--------------------------------------
|
||
* # 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
|
||
* `>PUSHW name`
|
||
* `>SYSCALL unsetenv`
|
||
* ## RETURN VALUE
|
||
*\--------------------------------------
|
||
K.UnsetEnv >PULLW TXTPTR name
|
||
|
||
K.GetEnv.I ldy #S.PS.hENV FROM STDLIB:EXPAND
|
||
lda (pPS),y
|
||
pha
|
||
|
||
ldy #S.PS.hSession
|
||
lda (pPS),y
|
||
|
||
tay
|
||
lda S.Table.hSID-1,y
|
||
|
||
tay Y = hSID
|
||
pla A = hENV
|
||
|
||
jmp K.SYSCALL.JMPX
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/sys/kernel.s.env
|
||
LOAD usr/src/sys/kernel.s
|
||
ASM
|