Quellcode durchsuchen

+ Added moucalls and viocalls written by Tomas Hajny.
+ Final routines in doscalls implemented.
* Fixed bugs in dos.pas.
* Changed some old $ifdef FPK into $ifdef FPC.
- Removed go32 stuff from dos.pas.
- Removed '/' to '\' translation from system unit - EMX does this
automatically.

daniel vor 27 Jahren
Ursprung
Commit
bcb942b1dc
8 geänderte Dateien mit 3359 neuen und 985 gelöschten Zeilen
  1. 17 18
      rtl/os2/code2.as
  2. 10 8
      rtl/os2/code3.as
  3. 591 846
      rtl/os2/dos.pas
  4. 156 53
      rtl/os2/doscalls.pas
  5. 1055 44
      rtl/os2/kbdcalls.pas
  6. 467 0
      rtl/os2/moucalls.pas
  7. 3 16
      rtl/os2/sysos2.pas
  8. 1060 0
      rtl/os2/viocalls.pas

+ 17 - 18
rtl/os2/code2.as

@@ -1,27 +1,26 @@
-/ code2.s (emx+fpk) -- Copyright (c) 1992-1996 by Eberhard Mattes
-/                      Changed for FPK-Pascal in 1998 by Dani‰l Mantione.
-/					   This code is _not_ under the Library GNU Public
-/ 					   License, because the original is not. See copying.emx
-/	 				   for details. You should have received it with this
-/		 			   product, write the author if you haven't.
+/ code2.as (emx+fpk) -- Copyright (c) 1992-1996 by Eberhard Mattes
+/                       Changed for FPK-Pascal in 1998 by Dani‰l Mantione.
+/                       This code is _not_ under the Library GNU Public
+/                       License, because the original is not. See copying.emx
+/                       for details. You should have received it with this
+/                       product, write the author if you haven't.
 
-		.globl  DosGetMessage
-		.globl  _msgseg32
+        .globl  DosGetMessage
+        .globl  _msgseg32
 
 _msgseg32:
-		.byte   0xff
-		.asciz  "MSGSEG32"
-		.byte   0x01, 0x80, 0x00, 0x00
-		.long   L_tab
+        .byte   0xff
+        .asciz  "MSGSEG32"
+        .byte   0x01, 0x80, 0x00, 0x00
+        .long   L_tab
 
-		.align  2, 0x90
+        .align  2, 0x90
 
 DosGetMessage:
-		PROFILE_NOFRAME
-		popl    %ecx                    /* return address */
-		pushl   $_msgseg32
-		pushl   %ecx
-		jmp     _DOSCALLS$$_DOSTRUEGETMESSAGE$POINTER$PINSERTTABLE$LONGINT$PCHAR$LONGINT$LONGINT$PCHAR$LONGINT
+        popl    %ecx                    /* return address */
+        pushl   $_msgseg32
+        pushl   %ecx
+        jmp     _DOSCALLS$$_DOSTRUEGETMESSAGE$POINTER$PINSERTTABLE$LONGINT$PCHAR$LONGINT$LONGINT$PCHAR$LONGINT
 
 L_tab:  .short  0x0000
         .short  0xffff

+ 10 - 8
rtl/os2/code3.as

@@ -1,16 +1,18 @@
-/ code3.s (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes
+/ code2.as (emx+fpk) -- Copyright (c) 1992-1996 by Eberhard Mattes
+/                       Changed for FPK-Pascal in 1998 by Dani‰l Mantione.
+/                       This code is _not_ under the Library GNU Public
+/                       License, because the original is not. See copying.emx
+/                       for details. You should have received it with this
+/                       product, write the author if you haven't.
 
-#include <emx/asm386.h>
+        .globl  DosQueryMessageCP
 
-        .globl  _DosQueryMessageCP
-
-_DosQueryMessageCP:
-        PROFILE_NOFRAME
+DosQueryMessageCP:
         pushl   0(%esp)
-        movl    $__msgseg32, %eax
+        movl    $_msgseg32, %eax
         xchgl   20(%esp), %eax
         xchgl   16(%esp), %eax
         xchgl   12(%esp), %eax
         xchgl   8(%esp), %eax
         movl    %eax, 4(%esp)
-        jmp     _DosIQueryMessageCP
+        jmp     _DOSCALLS$$_DOSIQUERYMESSAGECP$$$$$LONGINT$PCHAR$LONGINT$POINTER

Datei-Diff unterdrückt, da er zu groß ist
+ 591 - 846
rtl/os2/dos.pas


+ 156 - 53
rtl/os2/doscalls.pas

@@ -91,19 +91,21 @@ interface
 uses    strings;
 
 type    Pstring=^string;
-{$ELSE} {$IFDEF FVISION_PSTRING}
-uses    strings,objects;
 {$ELSE}
+ {$IFDEF FVISION_PSTRING}
+uses    strings,objects;
+ {$ELSE}
     {$ERROR Pstring source unknown.}
+ {$ENDIF}
 {$ENDIF}
 
-{$ifdef FPK}
+{$ifdef FPC}
     {$packrecords 1}
-{$endif FPK}
+{$endif FPC}
 
 type    Tbytearray=array[0..$fff0] of byte;
         Pbytearray=^Tbytearray;
-        Tchararray=array[0..$fff0] of byte;
+        Tchararray=array[0..$fff0] of char;
         Pchararray=^Tchararray;
         Twordarray=array[0..$7ff8] of word;
         Pwordarray=^Twordarray;
@@ -594,7 +596,7 @@ The filename must consist of the driveletter followed by a semicolon.}
 function dosopen(filenaam:Pchar;var handle,action:longint;
                  initsize:longint;attrib,openflags,filemode:longint;
                  ea:PEAop2):word;
-{This variant of dosOpen always creates or overwrites a file.}
+{This variant of dosopen always creates or overwrites a file.}
 function doscreate(filenaam:Pchar;var handle:longint;
                    attrib,openmode:longint):word;
 {This variant of dosOpen always opens an existing file.}
@@ -643,7 +645,7 @@ function dossetfileptr(handle:word;pos:longint;method:longint;
  actual position.}
 function dossetfileptr(handle:word;pos:longint):word;
 {This variant returns the current filepointer.}
-function dosgetfileptr(handle:word;posactual:longint):word;
+function dosgetfileptr(handle:word;var posactual:longint):word;
 
 {Use dosqueryfileinfo or dosquerypathinfo to get the size of a file.}
 
@@ -1588,9 +1590,9 @@ const   pt16bit=0;
  naam           = Must be nil for Pchar or '' for string variant if ordinal
                   is zero. Otherwise it contains the procname.
  proctype       = One of the ptxxxx constants.}
-function dosqueryproctype(handle:longint;ordinal:longint;naam:Pchar;
+function dosqueryproctype(handle,ordinal:longint;naam:Pchar;
                           var proctype:longint):word;
-function dosqueryproctype(handle:longint;ordinal:longint;naam:string;
+function dosqueryproctype(handle,ordinal:longint;const naam:string;
                           var proctype:longint):word;
 
 {****************************************************************************
@@ -2034,15 +2036,15 @@ type    Pinserttable=^Tinserttable;
 function dosgetmessage(table:Pinserttable;tablesize:longint;buf:Pchar;
                        bufsize,msgnumber:longint;filenaam:Pchar;
                        var msgsize:longint):word;
-{And a variant using strings and open arrays.}
+{And a variant using strings and open arrays.
 function dosgetmessage(const table:array of Pstring;var buf:string;
-                       bufsize,msgnumber:longint;const filenaam:Pchar):word;
+                       bufsize,msgnumber:longint;const filenaam:Pchar):word;}
 
 {And a variant using strings, but with a Pchar buffer, because of long
- messages, and open arrays.}
+ messages, and open arrays.
 function dosgetmessage(const table:array of Pstring;buf:Pchar;
                        bufsize,msgnumber:longint;const filenaam:string;
-                       msgsize:longint):word;
+                       msgsize:longint):word;}
 
 {Insert textstrings into a message. The message must be loaded before with
  dosGetMessage. This function is used when the insert strings are not yet
@@ -2058,17 +2060,17 @@ function dosinsertmessage(table:Pinserttable;tablesize:longint;
                           message:Pchar;srcmessagesize:longint;
                           buf:Pchar;bufsize:longint;
                           var dstmessagesize:longint):word;
-{And a variant using strings and open arrays.}
+{And a variant using strings and open arrays.
 function dosinsertmessage(table:array of Pstring;
                           const message:string;
-                          var buf:openstring):word;
+                          var buf:openstring):word;}
 
 {And a variant using strings, but with a Pchar buffer, because of long
- messages, and open arrays.}
+ messages, and open arrays.
 function dosinsertmessage(table:array of Pstring;
                           message:Pchar;srcmessagesize:longint;
                           buf:Pchar;bufsize:longint;
-                          var dstmessagesize:longint):word;
+                          var dstmessagesize:longint):word;}
 
 {Write a message to a file.
  handle         = Handle of file.
@@ -2388,6 +2390,9 @@ procedure flattosel;
 implementation
 {***************************************************************************}
 
+{$l code2.oo2}
+{$l code3.oo2}
+
 function doscreatethread(var tid:longint;address:Tthreadentry;
                           Aparam:pointer;flags:longint;
                           stacksize:longint):word;
@@ -2457,16 +2462,16 @@ var t,t2:array[0..255] of char;
 
 begin
     strPcopy(@t,filenaam);
-    dosexecpgm:=dosexecpgm(@t2,execflag,args,env,res,@t);;
+    dosexecpgm:=dosexecpgm(@t2,sizeof(t2),execflag,args,env,res,@t);;
     objnaam:=strpas(@t2);
 end;
 
-function doswaitchild(action:longint;option:longint;var res:resultcodes;
+function doswaitchild(action:longint;option:longint;var res:Tresultcodes;
                       var termpid:longint;pid:longint):word;
 
 external 'DOSCALLS' index 280;
 
-function dossetpriority(scope,class,delta,portid:longint):word;
+function dossetpriority(scope,trclass,delta,portid:longint):word;
 
 external 'DOSCALLS' index 236;
 
@@ -2530,10 +2535,11 @@ function doscreate(const filenaam:string;var handle:longint;
                    attrib,openmode:longint):word;
 
 var t:array[0..255] of char;
+    action:longint;
 
 begin
     strPcopy(@t,filenaam);
-    doscreate:=dosopen(t,handle,action,0,attrib,18,openmode,nil);
+    doscreate:=dosopen(@t,handle,action,0,attrib,18,openmode,nil);
 end;
 
 function dosopen(const filenaam:string;var handle:longint;
@@ -2618,7 +2624,7 @@ var t,t2,t3:array[0..255] of char;
 begin
     strPcopy(@t,source);
     strPcopy(@t2,edit);
-    doseditname:=doseditname(metalevel,@t,@t2,@t3);
+    doseditname:=doseditname(metalevel,@t,@t2,@t3,sizeof(t3));
     target:=strpas(@t3);
 end;
 
@@ -2647,7 +2653,7 @@ var t,t2:array[0..255] of char;
 begin
     strPcopy(@t,oud);
     strPcopy(@t2,nieuw);
-    doscopy:=doscopy(@t,@t2);
+    doscopy:=doscopy(@t,@t2,option);
 end;
 
 function dosdelete(filenaam:Pchar):word;
@@ -2659,7 +2665,7 @@ function dosdelete(const filenaam:string):word;
 var t:array[0..255] of char;
 
 begin
-    strPcopy(@t,filanaam);
+    strPcopy(@t,filenaam);
     dosdelete:=dosdelete(@t);
 end;
 
@@ -2777,7 +2783,7 @@ begin
      count,infolevel);
 end;
 
-function dosfindnext(handle:longint;Afilestatus:Pfilefindbuf;
+function dosfindnext(handle:longint;Afilestatus:Pfilestatus;
                      cbfilestatus:longint;var count:longint):word;
 
 external 'DOSCALLS' index 265;
@@ -2829,7 +2835,7 @@ function dosenumattribute(handle:longint;
                           var count:longint;infolevel:longint):word;
 
 begin
-    dosenumatrribute:=dosenumattribute(0,@handle,entry,buf,bufsize,count,
+    dosenumattribute:=dosenumattribute(0,@handle,entry,buf,bufsize,count,
      infolevel);
 end;
 
@@ -2852,10 +2858,12 @@ external 'DOSCALLS' index 227;
 function dosscanenv(const naam:string;var value:string):word;
 
 var t:array[0..255] of char;
+    p:Pchar;
 
 begin
     strPcopy(@t,naam);
-    dosscanenv:=dosscanenv(@t,value);
+    dosscanenv:=dosscanenv(@t,p);
+    value:=strpas(p);
 end;
 
 function dossearchpath(flag:longint;dirlist,filenaam:Pchar;
@@ -2871,7 +2879,7 @@ var t1,t2,t3:array[0..255] of char;
 begin
     strPcopy(@t1,dirlist);
     strPcopy(@t2,filenaam);
-    dossearchpath:=dossearchpath(flag,@t1,@t2,@t3);
+    dossearchpath:=dossearchpath(flag,@t1,@t2,@t3,sizeof(t3));
     fullname:=strpas(@t3);
 end;
 
@@ -2996,7 +3004,7 @@ var t:array[0..255] of char;
 
 begin
     strPcopy(@t,naam);
-    getnamedsharedmem:=getnamedsharedmem(p,@t,flag);
+    dosgetnamedsharedmem:=dosgetnamedsharedmem(p,@t,flag);
 end;
 
 function dosallocsharedmem(var p:pointer;naam:Pchar;size,flag:longint):word;
@@ -3012,10 +3020,10 @@ begin
     if naam<>'' then
         begin
             strPcopy(@t,naam);
-            dosallocsharedmem:=dosallocsharedmem(p,naam,cb,flag);
+            dosallocsharedmem:=dosallocsharedmem(p,naam,size,flag);
         end
     else
-        dosallocsharedmem:=dosallocsharedmem(p,nil,flag);
+        dosallocsharedmem:=dosallocsharedmem(p,nil,size,flag);
 end;
 
 function dosquerymem(p:pointer;var size,flag:longint):word;
@@ -3064,7 +3072,7 @@ external 'DOSCALLS' index 325;
 
 function dosopeneventsem(const naam:string;var handle:longint):word;
 
-var t:array[0...255] of char;
+var t:array[0..255] of char;
 
 begin
     strPcopy(@t,naam);
@@ -3105,7 +3113,7 @@ begin
     if naam<>'' then
         begin
             strPcopy(@t,naam);
-            doscreatemutextsem:=doscreatemutexsem(@t,handle,attr,state);
+            doscreatemutexsem:=doscreatemutexsem(@t,handle,attr,state);
         end
     else
         doscreatemutexsem:=doscreatemutexsem(nil,handle,attr,state);
@@ -3121,7 +3129,7 @@ var t:array[0..255] of char;
 
 begin
     strPcopy(@t,naam);
-    dosopenmutex:=dosmutexsem(@t,handle);
+    dosopenmutexsem:=dosopenmutexsem(@t,handle);
 end;
 
 function dosclosemutexsem(handle:longint):word;
@@ -3205,12 +3213,12 @@ function dossetdatetime(var buf:Tdatetime):word;
 
 external 'DOSCALLS' index 292;
 
-function dosasynctimer(msec:longint;hsem:SEMhandle;
+function dosasynctimer(msec:longint;hsem:longint;
                        var TIMhandle:longint):word;
 
 external 'DOSCALLS' index 350;
 
-function dosstarttimer(msec:longint;hsem:SEMhandle;
+function dosstarttimer(msec:longint;hsem:longint;
                        var TIMhandle:longint):word;
 
 external 'DOSCALLS' index 351;
@@ -3232,14 +3240,14 @@ function dosloadmodule(objnaam:Pchar;objlen:longint;DLLnaam:Pchar;
 
 external 'DOSCALLS' index 318;
 
-function dosloadmodule(var objnaam:string;objlen:lognint;
+function dosloadmodule(var objnaam:string;objlen:longint;
                        const DLLnaam:string;var handle:longint):word;
 
 var t1,t2:array[0..255] of char;
 
 begin
     strPcopy(@t2,DLLnaam);
-    dosloadmodule:=dosloadmodule(@t1,objlen,DLLnaam,handle);
+    dosloadmodule:=dosloadmodule(@t1,objlen,@t2,handle);
     objnaam:=strpas(@t1);
 end;
 
@@ -3307,10 +3315,10 @@ begin
     if naam<>'' then
         begin
             strPcopy(@t1,naam);
-            dosqueryproctype(handle,ordinal,@t1,proctype);
+            dosqueryproctype:=dosqueryproctype(handle,ordinal,@t1,proctype);
         end
     else
-        dosqueryproctype(handle,ordinal,nil,proctype);
+        dosqueryproctype:=dosqueryproctype(handle,ordinal,nil,proctype);
 end;
 
 function dosgetresource(handle,restype,resnaam:longint;var p:pointer):word;
@@ -3330,7 +3338,7 @@ function dosqueryctryinfo(cb:longint;var country:Tcountrycode;
 
 external 'NLS' index 5;
 
-function dosqueryDBCSenv(cb:longint;var country:Pcountrycode;buf:Pchar):word;
+function dosqueryDBCSenv(cb:longint;var country:Tcountrycode;buf:Pchar):word;
 
 external 'NLS' index 6;
 
@@ -3372,7 +3380,7 @@ function dosunsetexceptionhandler(var regrec:Texceptionregistrationrecord
 
 external 'DOSCALLS' index 355;
 
-function dosraiseexception(var except:Texceptionreportrecord):word;
+function dosraiseexception(var excpt:Texceptionreportrecord):word;
 
 external 'DOSCALLS' index 356;
 
@@ -3429,7 +3437,7 @@ external 'QUECALLS' index 15;
 function dosopenqueue(var parent_pid:longint;var handle:longint;
                       const naam:string):word;
 
-var strPcopy(@t1,naam);
+var t1:array[0..255] of char;
 
 begin
     strPcopy(@t1,naam);
@@ -3439,7 +3447,7 @@ end;
 function dospeekqueue(handle:longint;var reqbuffer:Trequestdata;
                       var datalen:longint;var dataptr:pointer;
                       var element:longint;wait:longint;
-                      var priority:byte;Asem:SEMhandle):word;
+                      var priority:byte;Asem:longint):word;
 
 external 'QUECALLS' index 13;
 
@@ -3454,7 +3462,7 @@ external 'QUECALLS' index 12;
 function dosreadqueue(handle:longint;var reqbuffer:Trequestdata;
                       var datalen:longint;var dataptr:pointer;
                       element,wait:longint;var priority:byte;
-                      Asem:semhandle):word;
+                      Asem:longint):word;
 
 external 'QUECALLS' index 9;
 
@@ -3467,7 +3475,7 @@ function doserror(error:longint):word;
 
 external 'DOSCALLS' index 212;
 
-procedure doserrclass(code:longint;var class,action,locus:longint);
+procedure doserrclass(code:longint;var _class,action,locus:longint);
 
 external 'DOSCALLS' index 211;
 
@@ -3484,8 +3492,8 @@ function dosgetmessage(table:Pinserttable;tablesize:longint;buf:Pchar;
 
 external name 'DosGetMessage';  {Procedure is in code2.so2.}
 
-function dosgetmessage(const table:array of Pstring;var buf:openstring;
-                       msgnumber:longint;const filenaam:string):word;
+(*function dosgetmessage(const table:array of Pstring;var buf:openstring;
+                        msgnumber:longint;const filenaam:string):word;
 
 {Hmm. This takes too much stackspace. Let's use the
  heap instead.}
@@ -3537,94 +3545,189 @@ begin
             {Step 7: Free the memory.}
             freemem(buffer,s);
         end;
-end;
+end;*)
 
-function dosgetmessage(const table:array of Pstring;buf:Pchar;
+{function dosgetmessage(const table:array of Pstring;buf:Pchar;
                        bufsize,msgnumber:longint;const filenaam:string;
-                       msgsize:longint):word;
+                       msgsize:longint):word;}
 
 function dosinsertmessage(table:Pinserttable;tablesize:longint;
                           message:Pchar;srcmessagesize:longint;
                           buf:Pchar;bufsize:longint;
                           var dstmessagesize:longint):word;
 
-function dosinsertmessage(table:array of Pstring;
+external 'MSG' index 4;
+
+{function dosinsertmessage(table:array of Pstring;
                           const message:string;
                           var buf:openstring):word;
 
 function dosinsertmessage(table:array of Pstring;
                           message:Pchar;srcmessagesize:longint;
                           buf:Pchar;bufsize:longint;
-                          var dstmessagesize:longint):word;
+                          var dstmessagesize:longint):word;}
 
 function dosputmessage(handle,size:longint;buf:Pchar):word;
+
+external 'MSG' index 5;
+
 function dosputmessage(handle:longint;const buf:string):word;
 
+begin
+    dosputmessage:=dosputmessage(handle,length(buf),@buf[1]);
+end;
+
+function dosIquerymessageCP(var buf;bufsize:longint;filenaam:Pchar;
+                            var infosize:longint;messeg:pointer):word;
+
+external 'MSG' index 8;
+
 function dosquerymessageCP(var buf;bufsize:longint;filenaam:Pchar;
                            var infosize:longint):word;
+
+external name 'DosQueryMessageCP';
+
 function dosquerymessageCP(var buf;bufsize:longint;const filenaam:string;
                            var infosize:longint):word;
 
+var t:array[0..255] of char;
+
+begin
+    strPcopy(@t,filenaam);
+    dosquerymessageCP:=dosquerymessageCP(buf,bufsize,@t,infosize);
+end;
+
 function dosstartsession(const Astartdata:Tstartdata;
                          var sesid,pid:longint):word;
 
+external 'SESMGR' index 37;
+
 function dossetsession(sesid:longint;const Astatus:Tstatusdata):word;
 
+external 'SESMGR' index 39;
+
 function dosselectsession(sesid:longint):word;
 
+external 'SESMGR' index 38;
+
 function dosstopsession(scope,sesid:longint):word;
 
+external 'SESMGR' index 40;
+
 function doscreatepipe(var readhandle,writehandle:longint;
                        size:longint):word;
 
+external 'DOSCALLS' index 239;
+
 function doscreatenpipe(naam:Pchar;var handle:longint;openmode,pipemode,
                         outbufsize,inbufsize,msec:longint):word;
 
+external 'DOSCALLS' index 243;
+
 function doscreatenpipe(const naam:string;var handle:longint;openmode,
                         pipemode,outbufsize,inbufsize,msec:longint):word;
 
+var t:array[0..255] of char;
+
+begin
+    strPcopy(@t,naam);
+    doscreatenpipe:=doscreatenpipe(@t,handle,openmode,pipemode,outbufsize,
+     inbufsize,msec);
+end;
+
 function doscallnpipe(naam:Pchar;var input;inputsize:longint;
                       var output;outputsize:longint;var readbytes:longint;
                       msec:longint):word;
 
+external 'DOSCALLS' index 240;
+
 function doscallnpipe(const naam:string;var input;inputsize:longint;
                       var output;outputsize:longint;var readbytes:longint;
                       msec:longint):word;
 
+var t:array[0..255] of char;
+
+begin
+    strPcopy(@t,naam);
+    doscallnpipe:=doscallnpipe(@t,input,inputsize,output,outputsize,
+     readbytes,msec);
+end;
+
 function dosconnectnpipe(handle:longint):word;
 
+external 'DOSCALLS' index 241;
+
 function dosdisconnectnpipe(handle:longint):word;
 
+external 'DOSCALLS' index 242;
+
 function dospeeknpipe(handle:longint;var buffer;bufsize:longint;
                       var readbytes:longint;var avail:Tavaildata;
                       var state:longint):word;
 
+external 'DOSCALLS' index 244;
+
 function dosquerynphstate(handle:longint;var state:longint):word;
 
+external 'DOSCALLS' index 245;
+
 function dosquerynpipeinfo(handle,infolevel:longint;var buffer;
                            bufsize:longint):word;
 
+external 'DOSCALLS' index 248;
+
 function dosquerynpipesemstate(semhandle:longint;var semarray;
                                bufsize:longint):word;
 
+external 'DOSCALLS' index 249;
+
 function dossetnphstate(handle,state:longint):word;
 
+external 'DOSCALLS' index 250;
+
 function dossetnpipesem(pipehandle,semhandle,key:longint):word;
 
+external 'DOSCALLS' index 251;
+
 function dostransactnpipe(handle:longint;var outbuf;outsize:longint;
                           var inbuf;insize:longint;
                           var readbytes:longint):word;
 
+external 'DOSCALLS' index 252;
+
 function doswaitnpipe(naam:Pchar;msec:longint):word;
 
+external 'DOSCALLS' index 253;
+
 function doswaitnpipe(const naam:string;msec:longint):word;
 
+var t:array[0..255] of char;
+
+begin
+    strPcopy(@t,naam);
+    doswaitnpipe:=doswaitnpipe(@t,msec);
+end;
+
 function dosopenVDD(naam:Pchar;var handle:longint):word;
 
+external 'DOSCALLS' index 308;
+
 function dosrequestVDD(handle,sgroup,cmd:longint;
                        insize:longint;var inbuffer;
                        outsize:longint;var outbuffer):word;
 
+external 'DOSCALLS' index 309;
+
 function doscloseVDD(handle:longint):word;
 
+external 'DOSCALLS' index 310;
+
+procedure seltoflat;
+
+external 'DOSCALLS' index 425;
+
+procedure flattosel;
+
+external 'DOSCALLS' index 426;
+
 end.

Datei-Diff unterdrückt, da er zu groß ist
+ 1055 - 44
rtl/os2/kbdcalls.pas


+ 467 - 0
rtl/os2/moucalls.pas

@@ -0,0 +1,467 @@
+{Set tabsize to 4.}
+{****************************************************************************
+
+                           MOUCALLS interface unit
+                     FPK-Pascal Runtime Library for OS/2
+                   Copyright (c) 1993,94 by Florian Kl„mpfl
+                    Copyright (c) 1997 by Dani‰l Mantione
+                      Copyright (c) 1998 by Tomas Hajny
+
+ The FPK-Pascal runtime library is distributed under the Library GNU Public
+ License v2. So is this unit. The Library GNU Public License requires you to
+ distribute the source code of this unit with any product that uses it.
+ Because the EMX library isn't under the LGPL, we grant you an exception to
+ this, and that is, when you compile a program with the FPK Pascal compiler,
+ you do not need to ship source code with that program, AS LONG AS YOU ARE
+ USING UNMODIFIED CODE! If you modify this code, you MUST change the next
+ line:
+
+ <This is an official, unmodified FPK Pascal source code file.>
+
+ Send us your modified files, we can work together if you want!
+
+ FPK-Pascal is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ Library GNU General Public License for more details.
+
+ You should have received a copy of the Library GNU General Public License
+ along with FPK-Pascal; see the file COPYING.LIB.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+****************************************************************************}
+
+unit MouCalls;
+
+{ Interface library to MOUCALLS.DLL (through EMXWRAP.DLL)
+
+Changelog:
+
+    People:
+
+        TH - Tomas Hajny
+
+    Date:           Description of change:              Changed by:
+
+     -              First released version 0.50         TH
+
+Coding style:
+
+    I have tried to use the same coding style as Dani‰l Mantione in unit
+    DOSCALLS, although I can't say I would write it the same way otherwise
+    (I would write much more spaces myself, at least). Try to use it as well,
+    please. Original note by Dani‰l Mantione follows:
+
+
+    It may be well possible that coding style feels a bit strange to you.
+    Nevertheless I friendly ask you to try to make your changes not look all
+    to different. To make life easier, set your IDE to use tab characters,
+    turn optimal fill, autoindent and backspace unindents on and set a
+    tabsize of 4.}
+
+{***************************************************************************}
+interface
+{***************************************************************************}
+
+uses    strings;
+
+{$ifdef FPK}
+    {$packrecords 1}
+{$endif FPK}
+
+const
+{return codes / error constants}
+    ERROR_MOUSE_NO_DEVICE           =385;
+    ERROR_MOUSE_INV_HANDLE          =386;
+    ERROR_MOUSE_INV_PARMS           =387;
+    ERROR_MOUSE_CANT_RESET          =388;
+    ERROR_MOUSE_DISPLAY_PARMS       =389;
+    ERROR_MOUSE_INV_MODULE          =390;
+    ERROR_MOUSE_INV_ENTRY_PT        =391;
+    ERROR_MOUSE_INV_MASK            =392;
+    NO_ERROR_MOUSE_NO_DATA          =393;
+    NO_ERROR_MOUSE_PTR_DRAWN        =394;
+    ERROR_MOUSE_SMG_ONLY            =412;
+    ERROR_MOUSE_INVALID_ASCIIZ      =413;
+    ERROR_MOUSE_INVALID_MASK        =414;
+    ERROR_MOUSE_REGISTER            =415;
+    ERROR_MOUSE_DEREGISTER          =416;
+    ERROR_MOUSE_INVALID_IOWAIT      =435;
+    ERROR_MOU_DETACHED              =466;
+    ERROR_MOUSE_NO_CONSOLE          =501;
+    ERROR_MOUSE_INVALID_HANDLE      =502;
+    ERROR_MOU_EXTENDED_SG           =505;
+    ERROR_MOU_NOT_INITIALIZED       =530;
+    ERROR_MOUINITREAL_DONE          =531;
+    ERROR_MOUSE_CALLER_NOT_SUBSYS   =533;
+
+{constants for FnMask in MouRegister}
+    MR_MOUGETNUMBUTTONS =$00000001;
+    MR_MOUGETNUMMICKEYS =$00000002;
+    MR_MOUGETDEVSTATUS  =$00000004;
+    MR_MOUGETNUMQUEEL   =$00000008;
+    MR_MOUREADEVENTQUE  =$00000010;
+    MR_MOUGETSCALEFACT  =$00000020;
+    MR_MOUGETEVENTMASK  =$00000040;
+    MR_MOUSETSCALEFACT  =$00000080;
+    MR_MOUSETEVENTMASK  =$00000100;
+    MR_MOUOPEN          =$00000800;
+    MR_MOUCLOSE         =$00001000;
+    MR_MOUGETPTRSHAPE   =$00002000;
+    MR_MOUSETPTRSHAPE   =$00004000;
+    MR_MOUDRAWPTR       =$00008000;
+    MR_MOUREMOVEPTR     =$00010000;
+    MR_MOUGETPTRPOS     =$00020000;
+    MR_MOUSETPTRPOS     =$00040000;
+    MR_MOUINITREAL      =$00080000;
+    MR_MOUSETDEVSTATUS  =$00100000;
+
+{constants for mouse hot key bits in MouGetHotKey/MouSetHotKey}
+    MHK_BUTTON1 =1;
+    MHK_BUTTON2 =2;
+    MHK_BUTTON3 =4;
+
+{MouGetDevStatus/MouSetDevStatus device status constants}
+    MOUSE_QUEUEBUSY         =$0001;
+    MOUSE_BLOCKREAD         =$0002;
+    MOUSE_FLUSH             =$0004;
+    MOUSE_UNSUPPORTED_MODE  =$0008;
+    MOUSE_DISABLED          =$0100;
+    MOUSE_MICKEYS           =$0200;
+
+{constants for WaitFlag in MouReadEventQue}
+    MOU_NOWAIT   =$0000;
+    MOU_WAIT     =$0001;
+
+{constants for MouGetEventMask/MouSetEventMask events}
+    MOUSE_MOTION                =$0001;
+    MOUSE_MOTION_WITH_BN1_DOWN  =$0002;
+    MOUSE_BN1_DOWN              =$0004;
+    MOUSE_MOTION_WITH_BN2_DOWN  =$0008;
+    MOUSE_BN2_DOWN              =$0010;
+    MOUSE_MOTION_WITH_BN3_DOWN  =$0020;
+    MOUSE_BN3_DOWN              =$0040;
+
+{constants for Status in MouSetDevStatus}
+    MOU_DRAW    =0;
+    MOU_NODRAW  =1;
+
+    MOU_PELS    =0;
+    MOU_MICKEYS =2;
+
+type
+
+(*This should be removed as soon as cardinal arithmetic in FPC works OK.*)
+    cardinal=longint;
+
+{unnecessary, just FYI}
+    THMOU=word;
+    PHMOU=^THMOU;
+
+{record type for MouGetPos/SetPtrPos}
+    TPtrLoc=record
+        Row:word;
+        Col:word;
+    end;
+    PPtrLoc=^TPtrLoc;
+
+{record type for MouGetShape/SetPtrShape}
+    TPtrShape=record
+        cb:word;        {length of image buffer in bytes}
+        Col:word;       {pointer width in characters or pixels}
+        Row:word;       {pointer height in characters or pixels}
+        ColHot:word;    {hotspot offset from the left side}
+        RowHot:word;    {hotspot offset from the top}
+     end;
+     PPtrShape=^TPtrShape;
+
+{record type for MouReadEventQue}
+(*   #pragma pack(2) ??? *)
+    TMouEventInfo=record
+        fs:word;        {event bits}
+        Time:cardinal;  {event timestamp - unique number of milliseconds}
+        Row:integer;    {pointer current row position}
+        Col:integer;    {pointer current column position}
+    end;
+    PMouEventInfo=^TMouEventInfo;
+
+{record type for MouGetNumQueEl}
+    TMouQueInfo=record
+        cEvents:word;       {number of elements in event queue}
+        cmaxEvents:word;    {maximum queue size in elements}
+    end;
+    PMouQueInfo=^TMouQueInfo;
+
+{record type for MouGetScaleFact/MouSetScaleFact}
+    TScaleFact=record
+        RowScale:word;  {scaling factor of current row}
+        ColScale:word;  {scaling factor of current column}
+    end;
+    PScaleFact=^TScaleFact;
+
+{record type for MouRemovePtr}
+    TNoPtrRect=record
+        Row:word;   {row of the top of the rectangle}
+        Col:word;   {column of the left edge}
+        cRow:word;  {row of the bottom}
+        cCol:word;  {column of the right edge}
+    end;
+    PNoPtrRect=^TNoPtrRect;
+
+    TThreshold=record
+        Length:word;
+        Level1:word;    {first movement level}
+        Lev1Mult:word;  {first level multiplier}
+        Level2:word;    {second movement level}
+        Lev2Mult:word;  {second level multiplier}
+    end;
+    PThreshold=^TThreshold;
+
+
+function MouRegister(ModuleName,ProcName:PChar;FnMask:cardinal):word;
+
+function MouRegister(ModuleName,ProcName:string;FnMask:cardinal):word;
+
+function MouDeRegister:word;
+
+function MouFlushQue(MouHandle:word):word;
+
+function MouGetPtrPos(var MouPtr:TPtrLoc;MouHandle:word):word;
+
+function MouSetPtrPos(var MouPtr:TPtrLoc;MouHandle:word):word;
+
+function MouSetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
+                                                          MouHandle:word):word;
+
+function MouGetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
+                                                          MouHandle:word):word;
+
+function MouGetDevStatus(var Status:word;MouHandle:word):word;
+
+function MouGetNumButtons(var ButtonCount:word;MouHandle:word):word;
+
+function MouGetNumMickeys(var MickeyCnt:word;MouHandle:word):word;
+
+function MouReadEventQue(var Event:TMouEventInfo;var WaitFlag:word;
+                                                          MouHandle:word):word;
+
+function MouGetNumQueEl(var MouseQInfo:TMouQueInfo;MouHandle:word):word;
+
+function MouGetEventMask(var EventMask:word;MouHandle:word):word;
+
+function MouSetEventMask(var EventMask:word;MouHandle:word):word;
+
+function MouGetScaleFact(var Scale:TScaleFact;MouHandle:word):word;
+
+function MouSetScaleFact(var Scale:TScaleFact;MouHandle:word):word;
+
+function MouOpen(DriverName:PChar;var MouHandle:word):word;
+
+function MouOpen(DriverName:string;var MouHandle:word):word;
+
+function MouClose(MouHandle:word):word;
+
+function MouRemovePtr(var ProtectArea:TNoPtrRect;MouHandle:word):word;
+
+function MouDrawPtr(MouHandle:word):word;
+
+function MouSetDevStatus(var Status:word;MouHandle:word):word;
+
+function MouInitReal(DriverName:PChar):word;
+
+function MouInitReal(DriverName:string):word;
+
+function MouSynch(WaitFlag:word):word;
+
+function MouGetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
+
+function MouSetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
+
+(*
+following two functions are undocumented and not present within C header files:
+
+function MouGetHotKey(var ButtonBits:word;MouHandle:word):word;
+
+function MouSetHotKey(var ButtonBits:word;MouHandle:word):word;
+*)
+
+(* Following routines are not supported
+   (just have a look in some C header
+   file - you probably won't find it there either).
+MouFree (index 4)
+MouShellInit (index 12)
+*)
+
+{***************************************************************************}
+implementation
+{***************************************************************************}
+
+
+function MouRegister(ModuleName,ProcName:PChar;FnMask:cardinal):word;
+external 'EMXWRAP' index 324;
+{external 'MOUCALLS' index 24;}
+
+function MouRegister(ModuleName,ProcName:string;FnMask:cardinal):word;
+begin
+    if byte(ModuleName[0])>8 then byte(ModuleName[0]):=8;
+    ModuleName[Succ(byte(ModuleName[0]))]:=#0;
+    if byte(ProcName[0])>32 then byte(ProcName[0]):=32;
+    ProcName[Succ(byte(ProcName[0]))]:=#0;
+    MouRegister:=MouRegister(@ModuleName[1],@ProcName[1],FnMask);
+end;
+
+function MouDeRegister:word;
+external 'EMXWRAP' index 314;
+{external 'MOUCALLS' index 14;}
+
+function MouFlushQue(MouHandle:word):word;
+external 'EMXWRAP' index 307;
+{external 'MOUCALLS' index 7;}
+
+function MouGetPtrPos(var MouPtr:TPtrLoc;MouHandle:word):word;
+external 'EMXWRAP' index 319;
+{external 'MOUCALLS' index 19;}
+
+function MouSetPtrPos(var MouPtr:TPtrLoc;MouHandle:word):word;
+external 'EMXWRAP' index 321;
+{external 'MOUCALLS' index 21;}
+
+function MouSetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
+                                                          MouHandle:word):word;
+external 'EMXWRAP' index 302;
+{external 'MOUCALLS' index 2;}
+
+function MouGetPtrShape(ImageBuf:pointer;var ImageInfo:TPtrShape;
+                                                          MouHandle:word):word;
+external 'EMXWRAP' index 301;
+{external 'MOUCALLS' index 1;}
+
+function MouGetDevStatus(var Status:word;MouHandle:word):word;
+external 'EMXWRAP' index 322;
+{external 'MOUCALLS' index 22;}
+
+function MouGetNumButtons(var ButtonCount:word;MouHandle:word):word;
+external 'EMXWRAP' index 308;
+{external 'MOUCALLS' index 8;}
+
+function MouGetNumMickeys(var MickeyCnt:word;MouHandle:word):word;
+external 'EMXWRAP' index 303;
+{external 'MOUCALLS' index 3;}
+
+function MouReadEventQue(var Event:TMouEventInfo;var WaitFlag:word;
+                                                          MouHandle:word):word;
+external 'EMXWRAP' index 320;
+{external 'MOUCALLS' index 20;}
+
+function MouGetNumQueEl(var MouseQInfo:TMouQueInfo;MouHandle:word):word;
+external 'EMXWRAP' index 313;
+{external 'MOUCALLS' index 13;}
+
+function MouGetEventMask(var EventMask:word;MouHandle:word):word;
+external 'EMXWRAP' index 315;
+{external 'MOUCALLS' index 15;}
+
+function MouSetEventMask(var EventMask:word;MouHandle:word):word;
+external 'EMXWRAP' index 316;
+{external 'MOUCALLS' index 16;}
+
+function MouGetScaleFact(var Scale:TScaleFact;MouHandle:word):word;
+external 'EMXWRAP' index 306;
+{external 'MOUCALLS' index 6;}
+
+function MouSetScaleFact(var Scale:TScaleFact;MouHandle:word):word;
+external 'EMXWRAP' index 311;
+{external 'MOUCALLS' index 11;}
+
+function MouOpen(DriverName:PChar;var MouHandle:word):word;
+external 'EMXWRAP' index 317;
+{external 'MOUCALLS' index 17;}
+
+function MouOpen(DriverName:string;var MouHandle:word):word;
+
+var B:byte;
+
+begin
+    B:=byte(DriverName[0]);
+    if B=0 then MouOpen:=MouOpen(nil,MouHandle) else
+    begin
+        if B<>255 then
+        begin
+            DriverName[Succ(B)]:=#0;
+            MouOpen:=MouOpen(@DriverName[1],MouHandle);
+        end else
+        begin
+            Move(DriverName[1],DriverName[0],B);
+            DriverName[B]:=#0;
+            MouOpen:=MouOpen(@DriverName,MouHandle);
+        end;
+    end;
+end;
+
+function MouClose(MouHandle:word):word;
+external 'EMXWRAP' index 309;
+{external 'MOUCALLS' index 9;}
+
+function MouRemovePtr(var ProtectArea:TNoPtrRect;MouHandle:word):word;
+external 'EMXWRAP' index 318;
+{external 'MOUCALLS' index 18;}
+
+function MouDrawPtr(MouHandle:word):word;
+external 'EMXWRAP' index 326;
+{external 'MOUCALLS' index 26;}
+
+function MouSetDevStatus(var Status:word;MouHandle:word):word;
+external 'EMXWRAP' index 326;
+{external 'MOUCALLS' index 26;}
+
+function MouInitReal(DriverName:PChar):word;
+external 'EMXWRAP' index 327;
+{external 'MOUCALLS' index 27;}
+
+function MouInitReal(DriverName:string):word;
+
+var B:byte;
+
+begin
+    B:=byte(DriverName[0]);
+    if B=0 then MouInitReal:=MouInitReal(nil) else
+    begin
+        if B<>255 then
+        begin
+            DriverName[Succ(B)]:=#0;
+            MouInitReal:=MouInitReal(@DriverName[1]);
+        end else
+        begin
+            Move(DriverName[1],DriverName[0],B);
+            DriverName[B]:=#0;
+            MouInitReal:=MouInitReal(@DriverName);
+        end;
+    end;
+end;
+
+function MouSynch(WaitFlag:word):word;
+external 'EMXWRAP' index 323;
+{external 'MOUCALLS' index 23;}
+
+function MouGetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
+external 'EMXWRAP' index 329;
+{external 'MOUCALLS' index 29;}
+
+function MouSetThreshold(var MouThreshold:TThreshold;MouHandle:word):word;
+external 'EMXWRAP' index 330;
+{external 'MOUCALLS' index 30;}
+
+
+(*
+following two functions are undocumented and not present within C header files:
+
+function MouGetHotKey(var ButtonBits:word;MouHandle:word):word;
+external 'MOUCALLS' index 4;
+
+function MouSetHotKey(var ButtonBits:word;MouHandle:word):word;
+external 'MOUCALLS' index 10;
+*)
+
+
+end.

+ 3 - 16
rtl/os2/sysos2.pas

@@ -264,16 +264,6 @@ begin
         if p[i]='/' then p[i]:='\';
 end;
 
-function do_isdevice(handle:longint):boolean;
-begin
-  if (handle=stdoutputhandle) or (handle=stdinputhandle) or
-  (handle=stderrorhandle) then
-    do_isdevice:=FALSE;
-  else
-    do_isdevice:=TRUE;
-end;
-
-
 procedure do_close(h:longint);
 
 begin
@@ -575,25 +565,22 @@ begin
 end;
 
 
-procedure mkdir(const s : string);[IOCheck];
+procedure mkdir(const s : string);
 
 begin
-    If InOutRes <> 0 then exit;
     DosDir($39,s);
 end;
 
 
-procedure rmdir(const s : string);[IOCheck];
+procedure rmdir(const s : string);
 
 begin
-    If InOutRes <> 0 then exit;
     DosDir($3a,s);
 end;
 
-procedure chdir(const s : string);[IOCheck];
+procedure chdir(const s : string);
 
 begin
-    If InOutRes <> 0 then exit;
     DosDir($3b,s);
 end;
 

+ 1060 - 0
rtl/os2/viocalls.pas

@@ -0,0 +1,1060 @@
+{Set tabsize to 4.}
+{****************************************************************************
+
+                           VIOCALLS interface unit
+                     FPK-Pascal Runtime Library for OS/2
+                   Copyright (c) 1993,94 by Florian Kl„mpfl
+                    Copyright (c) 1997 by Dani‰l Mantione
+                      Copyright (c) 1998 by Tomas Hajny
+
+ The FPK-Pascal runtime library is distributed under the Library GNU Public
+ License v2. So is this unit. The Library GNU Public License requires you to
+ distribute the source code of this unit with any product that uses it.
+ Because the EMX library isn't under the LGPL, we grant you an exception to
+ this, and that is, when you compile a program with the FPK Pascal compiler,
+ you do not need to ship source code with that program, AS LONG AS YOU ARE
+ USING UNMODIFIED CODE! If you modify this code, you MUST change the next
+ line:
+
+ <This is an official, unmodified FPK Pascal source code file.>
+
+ Send us your modified files, we can work together if you want!
+
+ FPK-Pascal is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ Library GNU General Public License for more details.
+
+ You should have received a copy of the Library GNU General Public License
+ along with FPK-Pascal; see the file COPYING.LIB.  If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+****************************************************************************}
+
+unit VioCalls;
+
+{ Interface library to VIOCALLS.DLL (through EMXWRAP.DLL)
+
+Changelog:
+
+    People:
+
+        TH - Tomas Hajny
+
+    Date:           Description of change:              Changed by:
+
+     -              First released version 0.50         TH
+
+Coding style:
+
+    I have tried to use the same coding style as Dani‰l Mantione in unit
+    DOSCALLS, although I can't say I would write it the same way otherwise
+    (I would write much more spaces myself, at least). Try to use it as well,
+    please. Original note by Dani‰l Mantione follows:
+
+
+    It may be well possible that coding style feels a bit strange to you.
+    Nevertheless I friendly ask you to try to make your changes not look all
+    to different. To make life easier, set your IDE to use tab characters,
+    turn optimal fill, autoindent and backspace unindents on and set a
+    tabsize of 4.}
+
+
+{***************************************************************************}
+interface
+{***************************************************************************}
+
+uses    strings;
+
+{$ifdef FPK}
+    {$packrecords 1}
+{$endif FPK}
+
+
+const
+{return codes / error constants}
+    ERROR_VIO_INVALID_MASK          =349;
+    ERROR_VIO_PTR                   =350;
+    ERROR_VIO_APTR                  =351;
+    ERROR_VIO_RPTR                  =352;
+    ERROR_VIO_CPTR                  =353;
+    ERROR_VIO_LPTR                  =354;
+    ERROR_VIO_MODE                  =355;
+    ERROR_VIO_WIDTH                 =356;
+    ERROR_VIO_ATTR                  =357;
+    ERROR_VIO_ROW                   =358;
+    ERROR_VIO_COL                   =359;
+    ERROR_VIO_TOPROW                =360;
+    ERROR_VIO_BOTROW                =361;
+    ERROR_VIO_RIGHTCOL              =362;
+    ERROR_VIO_LEFTCOL               =363;
+    ERROR_VIO_WAIT_FLAG             =366;
+    ERROR_VIO_UNLOCK                =367;
+    ERROR_VIO_SMG_ONLY              =402;
+    ERROR_VIO_INVALID_ASCIIZ        =403;
+    ERROR_VIO_DEREGISTER            =404;
+    ERROR_VIO_NO_POPUP              =405;
+    ERROR_VIO_EXISTING_POPUP        =406;
+    ERROR_VIO_INVALID_PARMS         =421;
+    ERROR_VIO_FUNCTION_OWNED        =422;
+    ERROR_VIO_RETURN                =423;
+    ERROR_VIO_REGISTER              =426;
+    ERROR_VIO_NO_MODE_THREAD        =427;
+    ERROR_VIO_NO_SAVE_RESTORE_THD   =428;
+    ERROR_VIO_IN_BG                 =429;
+    ERROR_VIO_ILLEGAL_DURING_POPUP  =430;
+    ERROR_VIO_LOCK                  =434;
+    ERROR_VIO_INVALID_HANDLE        =436;
+    ERROR_VIO_ILLEGAL_DURING_LOCK   =437;
+    ERROR_VIO_INVALID_LENGTH        =438;
+    ERROR_VIO_DETACHED              =465;
+    ERROR_VIO_FONT                  =467;
+    ERROR_VIO_USER_FONT             =468;
+    ERROR_VIO_BAD_CP                =469;
+    ERROR_VIO_NO_CP                 =470;
+    ERROR_VIO_NA_CP                 =471;
+    ERROR_VIO_INTERNAL_RESOURCE     =479;
+    ERROR_VIO_SHELL_INIT            =480;
+    ERROR_VIO_TRANSPARENT_POPUP     =483;
+    ERROR_VIO_BAD_RESERVE           =486;
+    ERROR_VIO_EXTENDED_SG           =494;
+    ERROR_VIO_NOT_PRES_MGR_SG       =495;
+    ERROR_VIO_SHIELD_OWNED          =496;
+    ERROR_VIO_NO_MORE_HANDLES       =497;
+    ERROR_VIO_SEE_ERROR_LOG         =498;
+    ERROR_VIO_ASSOCIATED_DC         =499;
+
+{severity codes}
+    SEVERITY_NOERROR        =$0000;
+    SEVERITY_WARNING        =$0004;
+    SEVERITY_ERROR          =$0008;
+    SEVERITY_SEVERE         =$000C;
+    SEVERITY_UNRECOVERABLE  =$0010;
+
+{base component error values}
+    WINERR_BASE =$1000;    {Window Manager}
+    GPIERR_BASE =$2000;    {Graphics Presentation Interface}
+    DEVERR_BASE =$3000;    {Device Manager}
+    SPLERR_BASE =$4000;    {Spooler}
+
+
+{first parameter registration constants}
+    VR_VIOGETCURPOS     =$00000001;
+    VR_VIOGETCURTYPE    =$00000002;
+    VR_VIOGETMODE       =$00000004;
+    VR_VIOGETBUF        =$00000008;
+    VR_VIOGETPHYSBUF    =$00000010;
+    VR_VIOSETCURPOS     =$00000020;
+    VR_VIOSETCURTYPE    =$00000040;
+    VR_VIOSETMODE       =$00000080;
+    VR_VIOSHOWBUF       =$00000100;
+    VR_VIOREADCHARSTR   =$00000200;
+    VR_VIOREADCELLSTR   =$00000400;
+    VR_VIOWRTNCHAR      =$00000800;
+    VR_VIOWRTNATTR      =$00001000;
+    VR_VIOWRTNCELL      =$00002000;
+    VR_VIOWRTTTY        =$00004000;
+    VR_VIOWRTCHARSTR    =$00008000;
+    VR_VIOWRTCHARSTRATT =$00010000;
+    VR_VIOWRTCELLSTR    =$00020000;
+    VR_VIOSCROLLUP      =$00040000;
+    VR_VIOSCROLLDN      =$00080000;
+    VR_VIOSCROLLLF      =$00100000;
+    VR_VIOSCROLLRT      =$00200000;
+    VR_VIOSETANSI       =$00400000;
+    VR_VIOGETANSI       =$00800000;
+    VR_VIOPRTSC         =$01000000;
+    VR_VIOSCRLOCK       =$02000000;
+    VR_VIOSCRUNLOCK     =$04000000;
+    VR_VIOSAVREDRAWWAIT =$08000000;
+    VR_VIOSAVREDRAWUNDO =$10000000;
+    VR_VIOPOPUP         =$20000000;
+    VR_VIOENDPOPUP      =$40000000;
+    VR_VIOPRTSCTOGGLE   =$80000000;
+
+{second parameter registration constants}
+    VR_VIOMODEWAIT      =$00000001;
+    VR_VIOMODEUNDO      =$00000002;
+    VR_VIOGETFONT       =$00000004;
+    VR_VIOGETCONFIG     =$00000008;
+    VR_VIOSETCP         =$00000010;
+    VR_VIOGETCP         =$00000020;
+    VR_VIOSETFONT       =$00000040;
+    VR_VIOGETSTATE      =$00000080;
+    VR_VIOSETSTATE      =$00000100;
+
+{constants for TVioModeInfo.Color}
+    COLORS_2    =$0001;
+    COLORS_4    =$0002;
+    COLORS_16   =$0004;
+
+{constants for TVioModeInfo.fbType}
+    VGMT_OTHER          =$01;
+    VGMT_GRAPHICS       =$02;
+    VGMT_DISABLEBURST   =$04;
+
+{constants for CharType in VioCheckCharType}
+    VCC_SBCSCHAR        =0;
+    VCC_DBCSFULLCHAR    =1;
+    VCC_DBCS1STHALF     =2;
+    VCC_DBCS2NDHALF     =3;
+
+{constants for Mode in VioGetAnsi/VioSetAnsi}
+    ANSI_ON     =1;
+    ANSI_OFF    =0;
+
+{constants for RequestType in VioSavRedrawWait}
+    VSRWI_SAVEANDREDRAW =0;
+    VSRWI_REDRAW        =1;
+
+{constants for NotifyType in VioSavRedrawWait}
+    VSRWN_SAVE          =0;
+    VSRWN_REDRAW        =1;
+
+{constants for Ownership in VioSavRedrawUndo}
+    UNDOI_GETOWNER      =0;
+    UNDOI_RELEASEOWNER  =1;
+
+{constants for KillThread in VioSavRedrawUndo}
+    UNDOK_ERRORCODE     =0;
+    UNDOK_TERMINATE     =1;
+
+    VMWR_POPUP  =0;
+    VMWN_POPUP  =0;
+
+{constants for WaitFlag in VioScrLock}
+    LOCKIO_NOWAIT   =0;
+    LOCKIO_WAIT     =1;
+
+{constants for Status in VioScrLock}
+    LOCK_SUCCESS    =0;
+    LOCK_FAIL       =1;
+
+{constants for OptionFlags in VioPopup}
+    VP_NOWAIT       =$0000;
+    VP_WAIT         =$0001;
+    VP_OPAQUE       =$0000;
+    VP_TRANSPARENT  =$0002;
+
+{constants for TVioConfigInfo.Adapter}
+    DISPLAY_MONOCHROME     =$0000;
+    DISPLAY_CGA            =$0001;
+    DISPLAY_EGA            =$0002;
+    DISPLAY_VGA            =$0003;
+    DISPLAY_8514A          =$0007;
+    DISPLAY_IMAGEADAPTER   =$0008;
+    DISPLAY_XGA            =$0009;
+
+{constants for TVioConfigInfo.Display}
+    MONITOR_MONOCHROME     =$0000;
+    MONITOR_COLOR          =$0001;
+    MONITOR_ENHANCED       =$0002;
+    MONITOR_8503           =$0003;
+    MONITOR_851X_COLOR     =$0004;
+    MONITOR_8514           =$0009;
+    MONITOR_FLATPANEL      =$000A;
+    MONITOR_8507_8604      =$000B;
+    MONITOR_8515           =$000C;
+    MONITOR_9515           =$000F;
+    MONITOR_9517           =$0011;
+    MONITOR_9518           =$0012;
+
+{constants for TVioConfigInfo.Configuration, TVioSetTarget.DefaultAlgorithm
+and usConfigID in VioGetConfig}
+    VIO_CONFIG_CURRENT     =0;
+    VIO_CONFIG_PRIMARY     =1;
+    VIO_CONFIG_SECONDARY   =2;
+
+{constants for TVioFontInfo.rType}
+    VGFI_GETCURFONT        =0;
+    VGFI_GETROMFONT        =1;
+
+{constants for TFAttrs.fsSelection}
+    FATTR_SEL_ITALIC        =$0001;
+    FATTR_SEL_UNDERSCORE    =$0002;
+    FATTR_SEL_OUTLINE       =$0008;
+    FATTR_SEL_STRIKEOUT     =$0010;
+    FATTR_SEL_BOLD          =$0020;
+
+{constants for TFAttrs.fsType}
+    FATTR_TYPE_KERNING      =$0004;
+    FATTR_TYPE_MBCS         =$0008;
+    FATTR_TYPE_DBCS         =$0010;
+    FATTR_TYPE_ANTIALIASED  =$0020;
+
+{constants for TFAttrs.fsFontUse}
+    FATTR_FONTUSE_NOMIX         =$0002;
+    FATTR_FONTUSE_OUTLINE       =$0004;
+    FATTR_FONTUSE_TRANSFORMABLE =$0008;
+
+{size for fields in the font records}
+    FACESIZE    =32;
+
+{constants for TFontMetrics.fsType}
+    FM_TYPE_FIXED       =$0001;
+    FM_TYPE_LICENSED    =$0002;
+    FM_TYPE_KERNING     =$0004;
+    FM_TYPE_DBCS        =$0010;
+    FM_TYPE_MBCS        =$0018;
+    FM_TYPE_64K         =$8000;
+    FM_TYPE_ATOMS       =$4000;
+    FM_TYPE_FAMTRUNC    =$2000;
+    FM_TYPE_FACETRUNC   =$1000;
+
+{constants for TFontMetrics.fsDefn}
+    FM_DEFN_OUTLINE =$0001;
+    FM_DEFN_IFI     =$0002;
+    FM_DEFN_WIN     =$0004;
+    FM_DEFN_GENERIC =$8000;
+
+{constants for TFontMetrics.fsSelection}
+    FM_SEL_ITALIC           =$0001;
+    FM_SEL_UNDERSCORE       =$0002;
+    FM_SEL_NEGATIVE         =$0004;
+    FM_SEL_OUTLINE          =$0008;    { Hollow Outline Font }
+    FM_SEL_STRIKEOUT        =$0010;
+    FM_SEL_BOLD             =$0020;
+    FM_SEL_ISO9241_TESTED   =$0040;
+{ISO 9241 is an international standard covering health and safety
+in the work place for users of visual display terminals. Part 3 of
+this standard covers clarity and legibility of text displayed on
+computer screens, it places requirements on minimum sizes and
+luminance contrast. The presence of FM_SEL_ISO9241_TESTED flag in the
+font metrics indicates that the font has been tested for compliance
+to the standard. The FM_ISO_XXX flags indicate the results of the
+test on the IBM 9515, 9517 and 9518 color displays at the supported
+dimensions of 640x480 and 1024x768. To ensure compliance the
+sXDeviceRes and sYDeviceRes must also match the target display
+resolution.}
+
+{constants for TPanose.fbPassedISO and TPanose.fbFailedISO}
+    FM_ISO_9518_640     =$01;
+    FM_ISO_9515_640     =$02;
+    FM_ISO_9515_1024    =$04;
+    FM_ISO_9517_640     =$08;
+    FM_ISO_9517_1024    =$10;
+
+{constant for TFontMetrics.fsCapabilities}
+    FM_CAP_NOMIX    =$0001;
+
+
+type
+
+(*This should be removed as soon as cardinal arithmetic in FPC works OK.*)
+    cardinal=longint;
+
+{unnecessary, just FYI}
+    THVio=word;
+    PHVio=^THVio;
+    THVPS=word;
+    PHVPS=^THVPS;
+
+    TQWord=record
+        Lo:cardinal;
+        Hi:cardinal;
+    end;
+    PQWord=^TQWord;
+
+{record type for VioSetCurType/VioGetCurType}
+    TVioCursorInfo=record
+        yStart:word;    {Cursor start scan line (0-based)}
+        cEnd:word;      {Cursor end scan line}
+        cx:word;        {Cursor width (0=default width)}
+        Attr:word;      {Cursor colour attribute (-1=hidden)}
+    end;
+    PVioCursorInfo=^TVioCursorInfo;
+
+{record type for VioSetMode/GetMode}
+    TVioModeInfo=record
+        cb:word;                    {Size of the record}
+        fbType:byte;                {8-bit mask identifying the mode}
+                                    {- see VGMT_* constants         }
+        Color:byte;                 {Number of colour bits available}
+                                    {(1=>2 colours, 2=>4,...) - see }
+                                    {COLORS_* constants             }
+        Col:word;                   {Number of text character columns}
+        Row:word;                   {Number of text character rows}
+        HRes:word;                  {Display width in pixels}
+        VRes:word;                  {Display height in pixels}
+        fmt_ID:byte;                {Format of the attributes}
+        Attrib:byte;                {Number of attributes in fmt_ID field}
+        Buf_Addr:cardinal;          {Address of the physical display buffer}
+        Buf_Length:cardinal;        {Length of the physical display buffer}
+        Full_Length:cardinal;       {Size of the buffer needed to save}
+                                    {the whole physical buffer        }
+        Partial_Length:cardinal;    {Size of the buffer needed to save}
+                                    {the part of the physical buffer  }
+                                    {overwritten with VioPopup        }
+        Ext_Data_Addr:pointer;      {Address of an extended-mode data}
+    end;
+    PVioModeInfo=^TVioModeInfo;
+
+{record type for VioGetPhysBuf}
+    TVioPhysBuf=record
+        pBuf:pointer;   {Absolute screen address}
+        cb:cardinal;    {Length of the buffer in bytes}
+        Sel:word;       {Selector for video access}
+    end;
+    PVioPhysBuf=^TVioPhysBuf;
+
+{record type for VioGetConfig}
+(*   #pragma pack(2) ??? *)
+    type
+        TVioConfigInfo=record
+            cb:word;                {Size of the record}
+            Adapter:word;           {Adapter type (see DISPLAY_* constants)}
+            Display:word;           {Display type (see MONITOR_* constants)}
+            cbMemory:cardinal;      {Amount of RAM in bytes on the adapter}
+            Configuration:word;     {Configuration ID (see  }
+                                    {VIO_CONFIG_* constants)}
+            VDHVersion:word;        {Reserved, set to zero}
+            Flags:word;             {Flags; 1 sets the default}
+                                    {power-on configuration   }
+            HWBufferSize:cardinal;  {Size of the buffer needed to save}
+                                    {the full adapter state (not      }
+                                    {including the physical buffer)   }
+            FullSaveSize:cardinal;  {Size of the buffer needed to}
+                                    {save the full adapter state }
+            PartSaveSize:cardinal;  {Size of the buffer needed to save}
+                                    {the part of the physical buffer  }
+                                    {overwritten with VioPopup        }
+            EmAdaptersOff:word;     {Offset of the information   }
+                                    {about emulated adapter types}
+            EmDisplaysOff:word;     {Offset of the information   }
+                                    {about emulated display types}
+       end;
+       PVioConfigInfo=^TVioConfigInfo;
+
+{record type for VioGetFont/VioSetFont}
+    TVioFontInfo=record
+        cb:word;        {Size of the record}
+        rType:word;     {Request type}
+        cxCell:word;    {Columns per cell (cell width)}
+        cyCell:word;    {Rows per cell (cell height)}
+        pbData:pointer; {Address of caller's buffer}
+        cbData:word;    {Size of caller's buffer in bytes}
+    end;
+    PVioFontInfo=^TVioFontInfo;
+
+{record types for VioGetState/VioSetState}
+    TVioPalState=record
+        cb:word;                        {Size of the record}
+        rtype:word;                     {0=palette}
+        iFirst:word;                    {The first register}
+        AColor:array[0..15] of word;    {Up to 16 register values}
+    end;
+    PVioPalState=^TVioPalState;
+
+    TVioOverscan=record
+        cb:word;    {Size of the record}
+        rType:word; {1=border colour}
+        Color:word; {The colour of the border area}
+    end;
+    PVioOverscan=^TVioOverscan;
+
+    TVioIntensity=record
+        cb:word;    {Size of the record}
+        rType:word; {2=blink/bold settings}
+        fs:word;    {The flink/bold background switch}
+    end;
+    PVioIntensity=^TVioIntensity;
+
+    TVioColorReg=record
+        cb:word;                {Size of the record}
+        rType:word;             {3=colour registers}
+        FirstColorReg:word;     {The first colour register}
+        NumColorRegs:word;      {Number of colour registers}
+        ColorRegAddr:pointer;   {pointer to an array with colour values}
+    end;
+    PVioColorReg=^TVioColorReg;
+
+    TVioSetULineLoc=record
+        cb:word;        {Size of the record}
+        rType:word;     {5=underline}
+        ScanLine:word;  {Location of the underline (32=no underline)}
+    end;
+    PVioSetULineLoc=^TVioSetULineLoc;
+
+    TVioSetTarget=record
+        cb:word;                {Size of the record}
+        rType:word;             {6=target for VioSetMode}
+        DefaultAlgorithm:word;  {Default/primary/secondary   }
+                                {(see VIO_CONFIG_* constants)}
+    end;
+    PVioSetTarget=^TVioSetTarget;
+
+    TStr8=array[0..7] of char;
+    PStr8=^TStr8;
+
+{font record type for Vio/GpiCreateLogFont}
+    TFAttrs=record
+        usRecordLength:word;
+        fsSelection:word;
+        lMatch:longint;
+        szFacename:array[0..FACESIZE-1] of char;
+        idRegistry:word;
+        usCodePage:word;
+        lMaxBaselineExt:longint;
+        lAveCharWidth:longint;
+        fsType:word;
+        fsFontUse:word;
+    end;
+    PFAttrs=^TFAttrs;
+
+{font metrics returned by GpiQueryFonts and others}
+    TPanose=record
+        bFamilyType:byte;
+        bSerifStyle:byte;
+        bWeight:byte;
+        bProportion:byte;
+        bContrast:byte;
+        bStrokeVariation:byte;
+        bArmStyle:byte;
+        bLetterform:byte;
+        bMidline:byte;
+        bXHeight:byte;
+        fbPassedISO:byte;
+        fbFailedISO:byte;
+    end;
+
+    TFontMetrics=record
+        szFamilyname:array[0..FACESIZE-1] of char;
+        szFacename:array[0..FACESIZE-1] of char;
+        idRegistry:word;
+        usCodePage:word;
+        lEmHeight:longint;
+        lXHeight:longint;
+        lMaxAscender:longint;
+        lMaxDescender:longint;
+        lLowerCaseAscent:longint;
+        lLowerCaseDescent:longint;
+        lInternalLeading:longint;
+        lExternalLeading:longint;
+        lAveCharWidth:longint;
+        lMaxCharInc:longint;
+        lEmInc:longint;
+        lMaxBaselineExt:longint;
+        sCharSlope:longint;
+        sInlineDir:integer;
+        sCharRot:integer;
+        usWeightClass:word;
+        usWidthClass:word;
+        sXDeviceRes:integer;
+        sYDeviceRes:integer;
+        sFirstChar:integer;
+        sLastChar:integer;
+        sDefaultChar:integer;
+        sBreakChar:integer;
+        sNominalPointSize:integer;
+        sMinimumPointSize:integer;
+        sMaximumPointSize:integer;
+        fsType:word;
+        fsDefn:word;
+        fsSelection:word;
+        fsCapabilities:word;
+        lSubscriptXSize:longint;
+        lSubscriptYSize:longint;
+        lSubscriptXOffset:longint;
+        lSubscriptYOffset:longint;
+        lSuperscriptXSize:longint;
+        lSuperscriptYSize:longint;
+        lSuperscriptXOffset:longint;
+        lSuperscriptYOffset:longint;
+        lUnderscoreSize:longint;
+        lUnderscorePosition:longint;
+        lStrikeoutSize:longint;
+        lStrikeoutPosition:longint;
+        sKerningPairs:integer;
+        sFamilyClass:integer;
+        lMatch:longint;
+        FamilyNameAtom:longint;
+        FaceNameAtom:longint;
+        Panose:TPanose;
+    end;
+    PFontMetrics=^TFontMetrics;
+
+
+function VioRegister(ModuleName,ProcName:PChar;FnMask1,FnMask2:cardinal):word;
+
+function VioRegister(ModuleName,ProcName:string;FnMask1,FnMask2:cardinal):word;
+
+function VioGlobalReg(ModuleName,ProcName:PChar;FnMask1,FnMask2:cardinal;
+                                                             Return:word):word;
+
+function VioGlobalReg(ModuleName,ProcName:string;FnMask1,FnMask2:cardinal;
+                                                             Return:word):word;
+
+function VioDeRegister:word;
+
+function VioGetBuf(var LVBAddr:pointer;var LVBLength:word;VioHandle:word):word;
+
+function VioGetCurPos(var Row,Column:word;VioHandle:word):word;
+
+function VioSetCurPos(Row,Column,VioHandle:word):word;
+
+function VioGetCurType(var CurData:TVioCursorInfo;VioHandle:word):word;
+
+function VioSetCurType(var CurData:TVioCursorInfo;VioHandle:word):word;
+
+function VioGetMode(var Mode:TVioModeInfo;VioHandle:word):word;
+
+function VioSetMode(var Mode:TVioModeInfo;VioHandle:word):word;
+
+function VioGetPhysBuf(var PBData:TVioPhysBuf;Reserved:word):word;
+
+function VioReadCellStr(var Buf;var BufLen:word;
+                                               Row,Column,VioHandle:word):word;
+
+function VioReadCharStr(var Buf;var BufLen:word;
+                                               Row,Column,VioHandle:word):word;
+
+function VioWrtCellStr(CellStr:pointer;Len,Row,Column,VioHandle:word):word;
+
+function VioWrtCharStr(CharStr:pointer;Len,Row,Column,VioHandle:word):word;
+
+function VioScrollDn(TopRow,LeftCol,BotRow,RightCol,Lines:word;var Cell:word;
+                                                          VioHandle:word):word;
+
+function VioScrollUp(TopRow,LeftCol,BotRow,RightCol,Lines:word;var Cell:word;
+                                                          VioHandle:word):word;
+
+function VioScrollLf(TopRow,LeftCol,BotRow,RightCol,Col:word;var Cell:word;
+                                                          VioHandle:word):word;
+
+function VioScrollRt(TopRow,LeftCol,BotRow,RightCol,Col:word;var Cell:word;
+                                                          VioHandle:word):word;
+
+function VioWrtNAttr(var Attr:byte;Times,Row,Column,VioHandle:word):word;
+
+function VioWrtNCell(var Cell:word;Times,Row,Column,VioHandle:word):word;
+
+function VioWrtNChar(var Ch:byte;Times,Row,Column,VioHandle:word):word;
+
+function VioWrtNChar(var Ch:char;Times,Row,Column,VioHandle:word):word;
+
+function VioWrtTTY(CharStr:pointer;Len,VioHandle:word):word;
+
+function VioWrtCharStrAtt(CharStr:pointer;Len,Row,Column:word;var Attr:byte;
+                                                          VioHandle:word):word;
+
+function VioCheckCharType(var CharType:word;Row,Column,VioHandle:word):word;
+
+function VioShowBuf(BufOfs,Len,VioHandle:word):word;
+
+function VioSetAnsi(Mode,VioHandle:word):word;
+
+function VioGetAnsi(var Mode:word;VioHandle:word):word;
+
+function VioPrtSc(VioHandle:word):word;
+
+function VioPrtScToggle(VioHandle:word):word;
+
+(*
+function VioRedrawSize(var RedrawSize:cardinal):word;
+*)
+
+function VioSavRedrawWait(RequestType:word;var NotifyType:word;
+                                                           Reserved:word):word;
+
+function VioSavRedrawUndo(Ownership,KillThread,Reserved:word):word;
+
+function VioModeWait(RequestType:word;var NotifyType:word;Reserved:word):word;
+
+function VioModeUndo(Ownership,KillThread,Reserved:word):word;
+
+function VioScrLock(WaitFlag:word;var Status:word;VioHandle:word):word;
+
+function VioScrUnLock(VioHandle:word):word;
+
+function VioPopUp(var OptionFlags:word;VioHandle:word):word;
+
+function VioEndPopUp(VioHandle:word):word;
+
+function VioGetConfig(ConfigId:word;var VideoConfig:TVioConfigInfo;
+                                                          VioHandle:word):word;
+
+function VioGetFont(var FontData:TVioFontInfo;VioHandle:word):word;
+
+function VioSetFont(var FontData:TVioFontInfo;VioHandle:word):word;
+
+function VioGetCp(Reserved:word;var CodePage:word;VioHandle:word):word;
+
+function VioSetCp(Reserved:word;CodePage:word;VioHandle:word):word;
+
+function VioGetState(var State;VioHandle:word):word;
+
+function VioSetState(var State;VioHandle:word):word;
+
+function VioAssociate(DC:cardinal;VPS:word):word;
+
+function VioCreateLogFont(var FAtAttrs:TFAttrs;LLCId:longint;var Name:TStr8;
+                                                                VPS:word):word;
+
+function VioCreatePS(var VPS:word;Depth,Width,Format,Attrs:integer;
+                                                           Reserved:word):word;
+
+function VioDeleteSetId(LLCId:longint;VPS:word):word;
+
+function VioDestroyPS(VPS:word):word;
+
+function VioGetDeviceCellSize(var Height,Width:integer;VPS:word):word;
+
+function VioGetOrg(var Row,Column:integer;VPS:word):word;
+
+function VioQueryFonts(var Remfonts:longint;var fmMetrics:TFontMetrics;
+                MetricsLength:longint;var Fonts:longint;FaceName:PChar;
+                                             flOptions:cardinal;VPS:word):word;
+
+function VioQueryFonts(var Remfonts:longint;var fmMetrics:TFontMetrics;
+                MetricsLength:longint;var Fonts:longint;FaceName:string;
+                                             flOptions:cardinal;VPS:word):word;
+
+function VioQuerySetIds(var allCIds:longint;var Names:TStr8;
+                              var alTypes:longint;Count:longint;VPS:word):word;
+
+function VioSetDeviceCellSize(Height,Width:integer;VPS:word):word;
+
+function VioSetOrg(Row,Column:integer;VPS:word):word;
+
+function VioShowPS(Depth,Width,offCell:integer;VPS:word):word;
+
+{Default message processing for AVio PS's - imported from PMVIOP.DLL}
+function WinDefAVioWindowProc(WND:cardinal;Msg:word;mp1,mp2:cardinal):pointer;
+
+
+(* Following routines are not supported
+   (just have a look in some C header
+   file - you probably won't find it there either).
+VioFree (index 4)
+Avs_Prtsc (index 14)
+VioSrfUnblock (index 16)
+VioSrfBlock (index 17)
+VioSave (index 20)
+VioHetInit (index 34)
+VioSswSwitch (index 36)
+Avs_PrtscToggle (index 38)
+VioInit (index 39)
+VioRestore (index 41)
+VioShellInit (index 54)
+VioGetPSAddress (index 67)
+VioQueryConsole (index 68)
+XVioSetCAState (index 71)
+XVioCheckCharType (index 72)
+XVioDestroyCA (index 73)
+XVioCreateCA (index 74)
+XVioGetCAState (index 76)
+*)
+
+
+{***************************************************************************}
+implementation
+{***************************************************************************}
+
+
+function VioRegister(ModuleName,ProcName:PChar;FnMask1,FnMask2:cardinal):word;
+external 'EMXWRAP' index 145;
+{external 'VIOCALLS' index 45;}
+
+function VioRegister(ModuleName,ProcName:string;FnMask1,FnMask2:cardinal):word;
+begin
+    if byte(ModuleName[0])>8 then byte(ModuleName[0]):=8;
+    ModuleName[Succ(byte(ModuleName[0]))]:=#0;
+    if byte(ProcName[0])>32 then byte(ProcName[0]):=32;
+    ProcName[Succ(byte(ProcName[0]))]:=#0;
+    VioRegister:=VioRegister(@ModuleName[1],@ProcName[1],FnMask1,FnMask2);
+end;
+
+function VioGlobalReg(ModuleName,ProcName:PChar;FnMask1,FnMask2:cardinal;
+                                                             Return:word):word;
+external 'EMXWRAP' index 170;
+{external 'VIOCALLS' index 70;}
+
+function VioGlobalReg(ModuleName,ProcName:string;FnMask1,FnMask2:cardinal;
+                                                             Return:word):word;
+begin
+    if byte(ModuleName[0])>8 then byte(ModuleName[0]):=8;
+    ModuleName[Succ(byte(ModuleName[0]))]:=#0;
+    if byte(ProcName[0])>32 then byte(ProcName[0]):=32;
+    ProcName[Succ(byte(ProcName[0]))]:=#0;
+    VioGlobalReg:=VioGlobalReg(@ModuleName[1],@ProcName[1],FnMask1,FnMask2,
+                                                                       Return);
+end;
+
+function VioDeRegister:word;
+external 'EMXWRAP' index 106;
+{external 'VIOCALLS' index 6;}
+
+function VioGetBuf(var LVBAddr:pointer;var LVBLength:word;VioHandle:word):word;
+external 'EMXWRAP' index 131;
+{external 'VIOCALLS' index 31;}
+
+function VioGetCurPos(var Row,Column:word;VioHandle:word):word;
+external 'EMXWRAP' index 109;
+{external 'VIOCALLS' index 9;}
+
+function VioSetCurPos(Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 115;
+{external 'VIOCALLS' index 15;}
+
+function VioGetCurType(var CurData:TVioCursorInfo;VioHandle:word):word;
+external 'EMXWRAP' index 127;
+{external 'VIOCALLS' index 27;}
+
+function VioSetCurType(var CurData:TVioCursorInfo;VioHandle:word):word;
+external 'EMXWRAP' index 132;
+{external 'VIOCALLS' index 32;}
+
+function VioGetMode(var Mode:TVioModeInfo;VioHandle:word):word;
+external 'EMXWRAP' index 121;
+{external 'VIOCALLS' index 21;}
+
+function VioSetMode(var Mode:TVioModeInfo;VioHandle:word):word;
+external 'EMXWRAP' index 122;
+{external 'VIOCALLS' index 22;}
+
+function VioGetPhysBuf(var PBData:TVioPhysBuf;Reserved:word):word;
+external 'EMXWRAP' index 102;
+{external 'VIOCALLS' index 2;}
+
+function VioReadCellStr(var Buf;var BufLen:word;
+                                               Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 124;
+{external 'VIOCALLS' index 24;}
+
+function VioReadCharStr(var Buf;var BufLen:word;
+                                               Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 130;
+{external 'VIOCALLS' index 30;}
+
+function VioWrtCellStr(CellStr:pointer;Len,Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 110;
+{external 'VIOCALLS' index 10;}
+
+function VioWrtCharStr(CharStr:pointer;Len,Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 113;
+{external 'VIOCALLS' index 13;}
+
+function VioScrollDn(TopRow,LeftCol,BotRow,RightCol,Lines:word;var Cell:word;
+                                                          VioHandle:word):word;
+external 'EMXWRAP' index 147;
+{external 'VIOCALLS' index 47;}
+
+function VioScrollUp(TopRow,LeftCol,BotRow,RightCol,Lines:word;var Cell:word;
+                                                          VioHandle:word):word;
+external 'EMXWRAP' index 107;
+{external 'VIOCALLS' index 7;}
+
+function VioScrollLf(TopRow,LeftCol,BotRow,RightCol,Col:word;var Cell:word;
+                                                          VioHandle:word):word;
+external 'EMXWRAP' index 144;
+{external 'VIOCALLS' index 44;}
+
+function VioScrollRt(TopRow,LeftCol,BotRow,RightCol,Col:word;var Cell:word;
+                                                          VioHandle:word):word;
+external 'EMXWRAP' index 112;
+{external 'VIOCALLS' index 12;}
+
+function VioWrtNAttr(var Attr:byte;Times,Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 126;
+{external 'VIOCALLS' index 26;}
+
+function VioWrtNCell(var Cell:word;Times,Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 152;
+{external 'VIOCALLS' index 52;}
+
+function VioWrtNChar(var Ch:byte;Times,Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 153;
+{external 'VIOCALLS' index 53;}
+
+function VioWrtNChar(var Ch:char;Times,Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 153;
+{external 'VIOCALLS' index 53;}
+
+function VioWrtTTY(CharStr:pointer;Len,VioHandle:word):word;
+external 'EMXWRAP' index 119;
+{external 'VIOCALLS' index 19;}
+
+function VioWrtCharStrAtt(CharStr:pointer;Len,Row,Column:word;var Attr:byte;
+                                                          VioHandle:word):word;
+external 'EMXWRAP' index 148;
+{external 'VIOCALLS' index 48;}
+
+function VioCheckCharType(var CharType:word;Row,Column,VioHandle:word):word;
+external 'EMXWRAP' index 175;
+{external 'VIOCALLS' index 75;}
+
+function VioShowBuf(BufOfs,Len,VioHandle:word):word;
+external 'EMXWRAP' index 143;
+{external 'VIOCALLS' index 43;}
+
+function VioSetAnsi(Mode,VioHandle:word):word;
+external 'EMXWRAP' index 105;
+{external 'VIOCALLS' index 5;}
+
+function VioGetAnsi(var Mode:word;VioHandle:word):word;
+external 'EMXWRAP' index 103;
+{external 'VIOCALLS' index 3;}
+
+function VioPrtSc(VioHandle:word):word;
+external 'EMXWRAP' index 108;
+{external 'VIOCALLS' index 8;}
+
+function VioPrtScToggle(VioHandle:word):word;
+external 'EMXWRAP' index 150;
+{external 'VIOCALLS' index 50;}
+
+(*
+function VioRedrawSize(var RedrawSize:cardinal):word;
+!!!not defined in EMXWRAP.DLL!!!
+{external 'VIOCALLS' index 69;}
+*)
+
+function VioSavRedrawWait(RequestType:word;var NotifyType:word;
+                                                           Reserved:word):word;
+external 'EMXWRAP' index 125;
+{external 'VIOCALLS' index 25;}
+
+function VioSavRedrawUndo(Ownership,KillThread,Reserved:word):word;
+external 'EMXWRAP' index 128;
+{external 'VIOCALLS' index 28;}
+
+function VioModeWait(RequestType:word;var NotifyType:word;Reserved:word):word;
+external 'EMXWRAP' index 137;
+{external 'VIOCALLS' index 37;}
+
+function VioModeUndo(Ownership,KillThread,Reserved:word):word;
+external 'EMXWRAP' index 135;
+{external 'VIOCALLS' index 35;}
+
+function VioScrLock(WaitFlag:word;var Status:word;VioHandle:word):word;
+external 'EMXWRAP' index 123;
+{external 'VIOCALLS' index 23;}
+
+function VioScrUnLock(VioHandle:word):word;
+external 'EMXWRAP' index 118;
+{external 'VIOCALLS' index 18;}
+
+function VioPopUp(var OptionFlags:word;VioHandle:word):word;
+external 'EMXWRAP' index 111;
+{external 'VIOCALLS' index 11;}
+
+function VioEndPopUp(VioHandle:word):word;
+external 'EMXWRAP' index 101;
+{external 'VIOCALLS' index 1;}
+
+function VioGetConfig(ConfigId:word;var VideoConfig:TVioConfigInfo;
+                                                          VioHandle:word):word;
+external 'EMXWRAP' index 146;
+{external 'VIOCALLS' index 46;}
+
+function VioGetFont(var FontData:TVioFontInfo;VioHandle:word):word;
+external 'EMXWRAP' index 129;
+{external 'VIOCALLS' index 29;}
+
+function VioSetFont(var FontData:TVioFontInfo;VioHandle:word):word;
+external 'EMXWRAP' index 133;
+{external 'VIOCALLS' index 33;}
+
+function VioGetCp(Reserved:word;var CodePage:word;VioHandle:word):word;
+external 'EMXWRAP' index 140;
+{external 'VIOCALLS' index 40;}
+
+function VioSetCp(Reserved:word;CodePage:word;VioHandle:word):word;
+external 'EMXWRAP' index 142;
+{external 'VIOCALLS' index 42;}
+
+function VioGetState(var State;VioHandle:word):word;
+external 'EMXWRAP' index 149;
+{external 'VIOCALLS' index 49;}
+
+function VioSetState(var State;VioHandle:word):word;
+external 'EMXWRAP' index 151;
+{external 'VIOCALLS' index 51;}
+
+
+{Extended functions for windowed VIO follow.}
+function VioAssociate(DC:cardinal;VPS:word):word;
+external 'EMXWRAP' index 155;
+{external 'VIOCALLS' index 55;}
+
+function VioCreateLogFont(var FAtAttrs:TFAttrs;LLCId:longint;var Name:TStr8;
+                                                                VPS:word):word;
+external 'EMXWRAP' index 160;
+{external 'VIOCALLS' index 60;}
+
+function VioCreatePS(var VPS:word;Depth,Width,Format,Attrs:integer;
+                                                           Reserved:word):word;
+external 'EMXWRAP' index 156;
+{external 'VIOCALLS' index 56;}
+
+function VioDeleteSetId(LLCId:longint;VPS:word):word;
+external 'EMXWRAP' index 157;
+{external 'VIOCALLS' index 57;}
+
+function VioDestroyPS(VPS:word):word;
+external 'EMXWRAP' index 161;
+{external 'VIOCALLS' index 61;}
+
+function VioGetDeviceCellSize(var Height,Width:integer;VPS:word):word;
+external 'EMXWRAP' index 158;
+{external 'VIOCALLS' index 58;}
+
+function VioGetOrg(var Row,Column:integer;VPS:word):word;
+external 'EMXWRAP' index 159;
+{external 'VIOCALLS' index 59;}
+
+function VioQueryFonts(var Remfonts:longint;var fmMetrics:TFontMetrics;
+                MetricsLength:longint;var Fonts:longint;FaceName:PChar;
+                                             flOptions:cardinal;VPS:word):word;
+external 'EMXWRAP' index 164;
+{external 'VIOCALLS' index 64;}
+
+function VioQueryFonts(var Remfonts:longint;var fmMetrics:TFontMetrics;
+                MetricsLength:longint;var Fonts:longint;FaceName:string;
+                                             flOptions:cardinal;VPS:word):word;
+
+var B:byte;
+
+begin
+    B:=byte(FaceName[0]);
+    if B=0 then VioQueryFonts:=VioQueryFonts(RemFonts,fmMetrics,MetricsLength,
+                                                  Fonts,nil,flOptions,VPS) else
+    begin
+        if B<>255 then
+        begin
+            FaceName[Succ(B)]:=#0;
+            VioQueryFonts:=VioQueryFonts(RemFonts,fmMetrics,MetricsLength,
+                                             Fonts,@FaceName[1],flOptions,VPS);
+        end else
+        begin
+            Move(FaceName[1],FaceName[0],B);
+            FaceName[B]:=#0;
+            VioQueryFonts:=VioQueryFonts(RemFonts,fmMetrics,MetricsLength,
+                                                Fonts,@FaceName,flOptions,VPS);
+        end;
+    end;
+end;
+
+function VioQuerySetIds(var allCIds:longint;var Names:TStr8;
+                              var alTypes:longint;Count:longint;VPS:word):word;
+external 'EMXWRAP' index 162;
+{external 'VIOCALLS' index 62;}
+
+function VioSetDeviceCellSize(Height,Width:integer;VPS:word):word;
+external 'EMXWRAP' index 165;
+{external 'VIOCALLS' index 65;}
+
+function VioSetOrg(Row,Column:integer;VPS:word):word;
+external 'EMXWRAP' index 163;
+{external 'VIOCALLS' index 63;}
+
+function VioShowPS(Depth,Width,offCell:integer;VPS:word):word;
+external 'EMXWRAP' index 166;
+{external 'VIOCALLS' index 66;}
+
+function WinDefAVioWindowProc(WND:cardinal;Msg:word;mp1,mp2:cardinal):pointer;
+external 'EMXWRAP' index 30;
+{external 'PMVIOP' index 30;}
+
+end.

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.