Przeglądaj źródła

Native large file support.

woollybah 11 lat temu
rodzic
commit
8a216bb2e6
2 zmienionych plików z 11 dodań i 11 usunięć
  1. 7 7
      freeprocess.mod/freeprocess.bmx
  2. 4 4
      freeprocess.mod/freeprocess.c

+ 7 - 7
freeprocess.mod/freeprocess.bmx

@@ -32,8 +32,8 @@ Import "freeprocess.c"
 'again.
 Extern
 Function fdClose(fd)
-Function fdRead(fd,buffer:Byte Ptr,count)
-Function fdWrite(fd,buffer:Byte Ptr,count)
+Function fdRead:Long(fd,buffer:Byte Ptr,count:Long)
+Function fdWrite:Long(fd,buffer:Byte Ptr,count:Long)
 Function fdFlush(fd)
 Function fdAvail(fd)
 Function fdProcess(exe$,in_fd Ptr,out_fd Ptr,err_fd Ptr,flags)="fdProcess"
@@ -46,7 +46,7 @@ Const HIDECONSOLE=1
 Type TPipeStream Extends TStream
 
 	Field	readbuffer:Byte[4096]
-	Field	bufferpos
+	Field	bufferpos:Long
 	Field	readhandle,writehandle
 
 	Method Close()
@@ -60,11 +60,11 @@ Type TPipeStream Extends TStream
 		EndIf
 	End Method
 
-	Method Read( buf:Byte Ptr,count )
+	Method Read:Long( buf:Byte Ptr,count:Long )
 		Return fdRead(readhandle,buf,count)
 	End Method
 
-	Method Write( buf:Byte Ptr,count )
+	Method Write:Long( buf:Byte Ptr,count:Long )
 		Return fdWrite(writehandle,buf,count)
 	End Method
 	
@@ -87,7 +87,7 @@ Type TPipeStream Extends TStream
 	End Method
 	
 	Method ReadLine$()	'nonblocking - returns empty string if no data available
-		Local	n,r,p0,p1,line$
+		Local	n:Long,r:Long,p0,p1,line$
 		n=ReadAvail()
 		If n
 			If bufferpos+n>4096 n=4096-bufferpos
@@ -202,4 +202,4 @@ Function TerminateProcess(process:TProcess)
 	Return process.Terminate()
 End Function
 
-OnEnd TProcess.TerminateAll
+OnEnd TProcess.TerminateAll

+ 4 - 4
freeprocess.mod/freeprocess.c

@@ -13,8 +13,8 @@
 #include <sys/wait.h>
 
 int fdClose(int fd) {return close(fd);}
-int fdRead(int fd,char *buffer,int count) {return read(fd,buffer,count);}
-int fdWrite(int fd,char *buffer,int count) {return write(fd,buffer,count);}
+BBLONG fdRead(int fd,char *buffer,BBLONG count) {return read(fd,buffer,count);}
+BBLONG fdWrite(int fd,char *buffer,BBLONG count) {return write(fd,buffer,count);}
 int fdAvail(int fd) {int avail;if (ioctl(fd,FIONREAD,&avail)) avail=avail;return avail;}
 int fdFlush(int fd) {}//flush(fd);}
 
@@ -189,7 +189,7 @@ int fdClose(int fd)
 	return CloseHandle((HANDLE)fd);
 }
 
-int fdRead(int fd,char *buffer,int bytes)
+BBLONG fdRead(int fd,char *buffer,BBLONG bytes)
 {
 	int		res; 
 	long	count;
@@ -198,7 +198,7 @@ int fdRead(int fd,char *buffer,int bytes)
 	return 0;
 }
 
-int fdWrite(int fd,char *buffer,int bytes)
+BBLONG fdWrite(int fd,char *buffer,BBLONG bytes)
 {
 	int		res;
 	long	count;