A2osX/_Docs/KERNEL.md

190 lines
2.8 KiB
Markdown
Raw Normal View History

2016-10-22 20:52:00 +00:00
*** Auto generated by docgen.cmd ***
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#GetArgC
##In:
+ none.
##Out:
+ A = Command line Arg Count (Including /path/cmd)
#GetArgA
##In:
+ none.
##Out:
+ CC : success
+ Y,A = PStr To Arg[A]
+ CS : Out Of Bound
2016-10-22 20:47:32 +00:00
#FOpen
2016-10-22 20:48:45 +00:00
Open a file
2016-10-22 20:58:29 +00:00
2016-10-22 20:47:32 +00:00
##In :
2016-10-22 20:48:45 +00:00
+ PUSHW = AUXTYPE
+ PUSHB = TYPE
+ PUSHB = MODE
2016-10-23 16:27:20 +00:00
+ SYS.FOPEN.R : if R and exists -> ERROR
+ SYS.FOPEN.W : if W and exists -> CREATE
+ SYS.FOPEN.A : Append
+ SYS.FOPEN.T : Open/Append in Text mode
+ SYS.FOPEN.X : Create if not exists
2016-10-22 20:46:04 +00:00
+ PUSHW = PATH (PSTR)
2016-10-22 20:53:35 +00:00
2016-10-22 20:52:00 +00:00
##Out :
2016-10-22 20:48:45 +00:00
+ CC : A = hFILE
2016-10-22 20:45:19 +00:00
+ CS : A = EC
2016-10-22 20:59:49 +00:00
2016-10-22 20:48:45 +00:00
#FCloseA
Close a file
2016-10-22 20:58:29 +00:00
2016-10-22 20:48:45 +00:00
##In :
+ A = hFILE
2016-10-22 20:58:29 +00:00
2016-10-22 20:48:45 +00:00
##Out :
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#FRead
Read bytes from file
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In :
+ PULLB = hFILE
+ PULLW = Bytes To Read
+ PULLW = Dest Ptr
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out :
+ Y,A = Bytes Read
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#FWrite
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##In:
2016-10-22 20:52:00 +00:00
+ PULLB = hFILE
+ PULLW = Bytes To Write
+ PULLW = Src Ptr
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#Out:
2016-10-22 20:52:00 +00:00
+ Y,A = Bytes Written
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#FFLUSHA
##In:
+ A = hFILE
#FSEEK
##In:
+ PUSHW = OffsetHi
+ PUSHW = OffsetLo
+ PUSHB = From
+ PUSHB = hFILE
#FTELLA
##In:
+ A = hFILE
##Out:
+ Y,A,X = Offset
#FEOFA
##In:
+ A = hFILE
##Out:
+ CC :
+ A=0 EOF
+ A =0 NOT EOF
+ CS :
#REMOVEYA
#RENAME
Rename a file
##In :
+ PUSHW = New Name
+ PUSHW = Old Name
##Out :
#STAT
Return information about a file
##In :
+ PUSHW = PTR to S.STAT buffer
+ PUSHW = PTR to Filename (PSTR)
##Out :
2016-10-22 20:52:00 +00:00
#NewPStrYA
Create a new copy of PSTR
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In:
+ Y,A = PTR to buffer
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out:
+ CC : success
+ Y,A = PTR to String
+ X = hMem (PSTRING)
+ CS : error
+ A = SYS error code
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#PStrMatch
Compare a String against pattern
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In:
+ PUSHW = PTR to Pattern (e.g. '*test?.txt')
+ PUSHW = PTR to Src String
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out:
+ CC : match
+ CS : no match
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#PStrUprYA/PStrLwrYA
Convert string to UPPERCASE/lowercase
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##In:
+ Y,A = PTR to String (PSTRING)
2016-10-22 20:58:29 +00:00
2016-10-22 20:52:00 +00:00
##Out:
+ Uppercased/lowercased String in Buffer
2016-10-22 20:59:49 +00:00
2016-10-22 20:52:00 +00:00
#PStrFTime
Convert S.TIME struct to PSTR
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##In:
2016-10-22 20:52:00 +00:00
+ PUSHW = Dst PTR To PSTR Buf
+ PUSHW = Src PTR To Format String
+ %a : Abbreviated weekday name : Thu
+ %A : Full weekday name : Thursday
+ %b : Abbreviated month name : Aug
+ %B : Full month name : August
+ %d : Day of the month, zero-padded (01-31)
+ %H : Hour in 24h format (00-23) 14
+ %I : Hour in 12h format (01-12) 02
+ %m : Month as a decimal number (01-12) 08
+ %M : Minute (00-59) 55
+ %p : AM or PM designation PM
+ %S : Second (00-61) 02
+ %w : Weekday as a decimal number with Sunday as 0 (0-6)
+ %y : Year, last two digits (00-99)
+ %Y : Year four digits 2001
+ PUSHW = Src PTR To S.Time
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##Out:
2016-10-22 20:52:00 +00:00
+ none. always succeed.
2016-10-22 20:59:49 +00:00
2016-10-23 16:27:20 +00:00
#PStr2StrArrayYA
2016-10-22 20:52:00 +00:00
Convert a PSTR (e.g. : command Line) to a Array of PSTRs (Args[])
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##In:
2016-10-22 20:52:00 +00:00
+ Y,A = PTR to String
2016-10-22 20:58:29 +00:00
2016-10-23 16:27:20 +00:00
##Out:
2016-10-22 20:52:00 +00:00
+ CC : success
+ Y,A = PTR to StrArray
+ X = hMem
+ CS : error
+ A = SYS error code