Update of /cvsroot/squeak/squeak/platforms/win32/plugins/FilePlugin
In directory usw-pr-cvs1:/tmp/cvs-serv9561
Modified Files:
sqWin32FilePrims.c
Log Message:
updates for large image files
Index: sqWin32FilePrims.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/win32/plugins/FilePlugin/sqWin32FilePrims.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** sqWin32FilePrims.c 5 May 2002 17:18:02 -0000 1.5
--- sqWin32FilePrims.c 5 May 2002 18:08:16 -0000 1.6
***************
*** 277,286 ****
}
! int sqImageFilePosition(sqImageFile h)
{
! return (int)SetFilePointer((HANDLE)(h-1), 0, NULL, FILE_CURRENT);
}
! int sqImageFileRead(void *ptr, int sz, int count, sqImageFile h)
{
DWORD dwReallyRead;
--- 277,289 ----
}
! squeakFileOffsetType sqImageFilePosition(sqImageFile h)
{
! win32FileOffset ofs;
! ofs.offset = 0;
! ofs.dwLow = SetFilePointer((HANDLE)(h-1), 0, &ofs.dwHigh, FILE_CURRENT);
! return ofs.offset;
}
! size_t sqImageFileRead(void *ptr, size_t sz, size_t count, sqImageFile h)
{
DWORD dwReallyRead;
***************
*** 299,317 ****
}
! int sqImageFileSeek(sqImageFile h, int pos)
{
! return (int) SetFilePointer((HANDLE)(h-1), pos, NULL, FILE_BEGIN);
}
! int sqImageFileWrite(void *ptr, int sz, int count, sqImageFile h)
{
DWORD dwReallyWritten;
WriteFile((HANDLE)(h-1), (LPVOID) ptr, count*sz, &dwReallyWritten, NULL);
! return (int) (dwReallyWritten / sz);
}
! int sqImageFileSize(sqImageFile h)
{
! return GetFileSize((HANDLE)(h-1), NULL);
}
--- 302,326 ----
}
! squeakFileOffsetType sqImageFileSeek(sqImageFile h, squeakFileOffsetType pos)
{
! win32FileOffset ofs;
! ofs.offset = pos;
! ofs.dwLow = SetFilePointer((HANDLE)(h-1), ofs.dwLow, &ofs.dwHigh, FILE_BEGIN);
! return ofs.offset;
}
! size_t sqImageFileWrite(void *ptr, size_t sz, size_t count, sqImageFile h)
{
DWORD dwReallyWritten;
WriteFile((HANDLE)(h-1), (LPVOID) ptr, count*sz, &dwReallyWritten, NULL);
! return (size_t) (dwReallyWritten / sz);
}
! squeakFileOffsetType sqImageFileSize(sqImageFile h)
{
! win32FileOffset ofs;
! ofs.offset = 0;
! ofs.dwLow = GetFileSize((HANDLE)(h-1), &ofs.dwHigh);
! return ofs.offset;
}
|