Browse Source

AROS: use BPTR type as filehandle. BPTR is now PtrInt instead of a Pointer, because it's usually not directly referenceable, and that allows interoperability with THandle type

git-svn-id: trunk@31181 -
Károly Balogh 10 năm trước cách đây
mục cha
commit
7eb05ba2ab
3 tập tin đã thay đổi với 18 bổ sung18 xóa
  1. 1 1
      rtl/aros/doslibd.inc
  2. 16 16
      rtl/aros/i386/doslibf.inc
  3. 1 1
      rtl/aros/system.pp

+ 1 - 1
rtl/aros/doslibd.inc

@@ -133,7 +133,7 @@ const // Checked OK 04.08.2011 ALB
 
 
 type  // Checked OK 04.08.2011 ALB
-  BPTR = Pointer;
+  BPTR = PtrInt;
   BSTR = Pointer;
 
 type  // Checked OK 04.08.2011 ALB

+ 16 - 16
rtl/aros/i386/doslibf.inc

@@ -15,21 +15,21 @@
 
 function Open(name: PChar; accessMode: longint): Cardinal; syscall AOS_DOSBase 5;
 function dosClose(_file: Cardinal): LongBool;  syscall AOS_DOSBase 6;
-function dosRead(_file: Cardinal; buffer: Pointer; length: longint): longint; syscall AOS_DOSBase 7;
-function dosWrite(_file: Cardinal; buffer: Pointer; length: longint): longint;  syscall AOS_DOSBase 8;
-function dosInput: Cardinal; syscall AOS_DOSBase 9;
-function dosOutput: Cardinal; syscall AOS_DOSBase 10;
-function DosError1: Cardinal;  syscall AOS_DOSBase 142;
-function dosSeek(_file: longint;position: longint;offset: longint): longint; syscall AOS_DOSBase 11;
+function dosRead(_file: BPTR; buffer: Pointer; length: longint): longint; syscall AOS_DOSBase 7;
+function dosWrite(_file: BPTR; buffer: Pointer; length: longint): longint;  syscall AOS_DOSBase 8;
+function dosInput: BPTR; syscall AOS_DOSBase 9;
+function dosOutput: BPTR; syscall AOS_DOSBase 10;
+function DosError1: BPTR;  syscall AOS_DOSBase 142;
+function dosSeek(_file: BPTR; position: longint;offset: longint): longint; syscall AOS_DOSBase 11;
 function dosDeleteFile(const name: PChar): LongBool; syscall AOS_DOSBase 12;
 function dosRename(const oldName: PChar;newName: PChar): LongInt; syscall AOS_DOSBase 13;
-function Lock(const name: PChar;_type: longint): longint; syscall AOS_DOSBase 14;
-function UnLock(lock: longint): longint; syscall AOS_DOSBase 15;
-function DupLock(Lock: longint): longint; syscall AOS_DOSBase 16;
-function Examine(lock: longint; fileInfoBlock: PFileInfoBlock): LongInt; syscall AOS_DOSBase 17;
-function Info(lock: longint; parameterBlock: PInfoData): LongInt; syscall AOS_DOSBase 19;
-function dosCreateDir(const name: PChar): longint; syscall AOS_DOSBase 20;
-function CurrentDir(lock: longint): longint; syscall AOS_DOSBase 21;
+function Lock(const name: PChar;_type: longint): BPTR; syscall AOS_DOSBase 14;
+function UnLock(lock: BPTR): LongInt; syscall AOS_DOSBase 15;
+function DupLock(Lock: BPTR): BPTR; syscall AOS_DOSBase 16;
+function Examine(lock: BPTR; fileInfoBlock: PFileInfoBlock): LongInt; syscall AOS_DOSBase 17;
+function Info(lock: BPTR; parameterBlock: PInfoData): LongInt; syscall AOS_DOSBase 19;
+function dosCreateDir(const name: PChar): BPTR; syscall AOS_DOSBase 20;
+function CurrentDir(lock: BPTR): BPTR; syscall AOS_DOSBase 21;
 function IoErr: longint; syscall AOS_DOSBase 22;
 procedure dosExit(ErrCode: longint); syscall AOS_DOSBase 24;
 function SetProtection(const name: PChar; protect: longword): LongInt; syscall AOS_DOSBase 31;
@@ -38,14 +38,14 @@ procedure dosDelay(ticks: LongWord); syscall AOS_DOSBase 33;
 function AllocDosObject(Type_: LongWord; const Tags: PTagItem): Pointer; syscall AOS_DOSBase 38;
 procedure FreeDosObject(Type_: LongWord; Ptr: Pointer); syscall AOS_DOSBase 39;
 function SetFileDate(name: PChar; date: PDateStamp): LongBool; syscall AOS_DOSBase 66;
-function NameFromLock(lock: longint; buffer: PChar; len: longint): LongBool; syscall AOS_DOSBase 67;
-function SetFileSize(fh: longint; pos: longint; mode: longint): longint; syscall AOS_DOSBase 76;
+function NameFromLock(lock: BPTR; buffer: PChar; len: longint): LongBool; syscall AOS_DOSBase 67;
+function SetFileSize(fh: BPTR; pos: longint; mode: longint): longint; syscall AOS_DOSBase 76;
 function Cli : pCommandLineInterface; syscall AOS_DOSBase 82;
 function CreateNewProc(const Tags: PTagItem): PProcess; syscall AOS_DOSBase 83;
 function GetArgStr: PChar; syscall AOS_DOSBase 89;
 function GetCurrentDirName(buf: PChar; len: longint): LongBool; syscall AOS_DOSBase 94;
 function GetProgramName(buf: PChar; len: longint): LongBool; syscall AOS_DOSBase 96;
-function GetProgramDir: longint; syscall AOS_DOSBase 100;
+function GetProgramDir: BPTR; syscall AOS_DOSBase 100;
 function SystemTagList(command: PChar; tags: PTagItem): longint; syscall AOS_DOSBase 101;
 function LockDosList(flags: longword): PDosList; syscall AOS_DOSBase 109;
 procedure UnLockDosList(flags: longword); syscall AOS_DOSBase 110;

+ 1 - 1
rtl/aros/system.pp

@@ -401,7 +401,7 @@ var
   self: PProcess;
 begin
   self := PProcess(FindTask(nil));
-  if self^.pr_CLI = NIL then begin
+  if self^.pr_CLI = 0 then begin
     { if we're running from Ambient/Workbench, we catch its message }
     WaitPort(@self^.pr_MsgPort);
     AOS_wbMsg:=GetMsg(@self^.pr_MsgPort);