diff options
Diffstat (limited to 'packages/morphunits/src/amigados.pas')
-rw-r--r-- | packages/morphunits/src/amigados.pas | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/packages/morphunits/src/amigados.pas b/packages/morphunits/src/amigados.pas index 68c12198d1..a411b01527 100644 --- a/packages/morphunits/src/amigados.pas +++ b/packages/morphunits/src/amigados.pas @@ -814,6 +814,24 @@ const ST_LINKFILE = -4; ST_PIPEFILE = -5; +type + TCLIDataItem = record + cdi_CLINum: LongInt; // CLI number of the CLI + cdi_DefaultStack: LongInt; // cli_DefaultStack of the CLI + cdi_GlobVec: LongInt; // pr_GlobVec[0] of the CLI + cdi_Future: LongWord; // For future expansion, 0 for now + cdi_Pri: ShortInt; // CLI priority + cdi_Flags: Byte; // If bit 0 is set cdi_command is valid + cdi_Command: array[0..0] of Char; // 0-terminated command being executed + end; + PCLIDataItem = ^TCLIDataItem; + + TCLIData = record + cd_NumCLIs: LongWord; // Number of entries in cd_cli array + cd_CLI: array[0..100] of PCLIDataItem; // the entries (could be more than 101 though) + end; + PCLIData = ^TCLIData; + { * dos asl definitions @@ -1297,8 +1315,33 @@ const FSCONTEXTINFOTAG_NAME = FSCONTEXTINFOTAG_Dummy + $1; SEGLISTTAG_Dummy = TAG_USER + 3400; - // return the ObjData object when it exists or nil. - SEGLISTTAG_OBJDATA = SEGLISTTAG_Dummy + $1; + + SEGLISTTAG_OBJDATA = SEGLISTTAG_Dummy + $1; // return the ObjData object when it exists or nil. + // V51.52 + SEGLISTTAG_SEGLISTTYPE = SEGLISTTAG_Dummy + $2; // return the seglist type, one of SEGLISTTYPE_*. + SEGLISTTAG_DOS_SEGINDEX = SEGLISTTAG_Dummy + $3; // specify that segment index is the hunk number, starting from 0. + SEGLISTTAG_ELF_SEGINDEX = SEGLISTTAG_Dummy + $4; // specify that the segment index is the elf segment number, starting from 1. + SEGLISTTAG_SEGSTART = SEGLISTTAG_Dummy + $5; // return segment start address for segment specified by either SEGLISTTAG_DOS_SEGINDEX or SEGLISTTAG_ELF_SEGINDEX. + // note that SEGLISTTAG_ELF_SEGINDEX segments might return a nil pointer, so be prepared for this. + SEGLISTTAG_SEGSIZE = SEGLISTTAG_Dummy + $6; // return segment data size for segment specified by either SEGLISTTAG_DOS_SEGINDEX or SEGLISTTAG_ELF_SEGINDEX. + // V51.54 + SEGLISTTAG_ELF_SEGTYPE = SEGLISTTAG_Dummy + $7; // return ELF segment type (ELF SHT_*). Only applicable for ELF. + SEGLISTTAG_ELF_SEGOFFSET = SEGLISTTAG_Dummy + $8; // return ELF segment file offset. Only applicable for ELF. + SEGLISTTAG_ELF_SEGFLAGS = SEGLISTTAG_Dummy + $9; // return ELF segment flags. Meaning depends on segment type. Refer to ELF documentation for details. Only applicable for ELF. + SEGLISTTAG_ELF_SEGADDRALIGN = SEGLISTTAG_Dummy + $a; // return ELF segment alignment. 0 and 1 mean unaligned. Only applicable for ELF. + SEGLISTTAG_ELF_SEGNAME = SEGLISTTAG_Dummy + $b; // return ELF segname name. Only applicable for ELF. + + + // for tag SEGLISTTAG_SEGLISTTYPE + SEGLISTTYPE_ELF = 1; + SEGLISTTYPE_POWERUP = 2; + SEGLISTTYPE_AMIGA = 3; + + // QueryCLIDataTagList tags (V51.51) + CLIDATATAG_Dummy = TAG_USER + 3500; + CLIDATATAG_CLINumber = CLIDATATAG_Dummy + $1; // Return only CLI matching the given CLI number (returns 0 or 1 entries) + CLIDATATAG_CommandName = CLIDATATAG_Dummy + $2; // Return only CLIs matching the given command (0 to n entries possible) + CLIDATATAG_Sorted = CLIDATATAG_Dummy + $3; // When ti_Data is TRUE, return results sorted by CLI number(default to FALSE) { * dos stdio definitions @@ -2264,6 +2307,12 @@ function ExNext64(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; sys function ExNext64TagList(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1150; function ExamineFH64(Fh: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1156; function ExamineFH64TagList(Fh: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1156; +// V51.51 +procedure ReleaseCLINumber(CLINum: LongInt); syscall BaseSysV MOS_DOSBase 1162; +function QueryCLIDataTagList(Tags: PTagItem): PCLIData; syscall BaseSysV MOS_DOSBase 1168; +procedure FreeCLIData(Data: PCLIData); syscall BaseSysV MOS_DOSBase 1174; +// V51.52 +function GetSegListAttrTagList(SegList: BPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1180; { * dos global definitions (V50) @@ -2301,6 +2350,9 @@ function Examine64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of Ptr function ExNext64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt; inline; function ExamineFH64Tags(Fh: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt; inline; +function QueryCLIDataTags(const Tags: array of PtrUInt): PCLIData; inline; +function GetSegListAttrTags(SegList: BPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt; const Tags: array of PtrUInt): LongInt; inline; + implementation @@ -2406,6 +2458,17 @@ begin ExamineFH64Tags := ExamineFH64(Fh, Fib, @Tags); end; +function QueryCLIDataTags(const Tags: array of PtrUInt): PCLIData; +begin + QueryCLIDataTags := QueryCLIDataTagList(@Tags); +end; + +function GetSegListAttrTags(SegList: BPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt; const Tags: array of PtrUInt): LongInt; inline; +begin + GetSegListAttrTags := GetSegListAttrTagList(SegList, Attr, Storage, StorageSize, @Tags); +end; + + begin DosBase:=MOS_DOSBase; end. |