diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3901f75c15..16f6a70f9a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,12 @@ +19991007-01:42 GMT+1 Victor Szel + * include/filesys.h + source/rtl/filesys.c + % Only use hb_fsReadLarge() and hb_fsWriteLarge() when the size of an + unsigned int is not the same as the size of an unsigned long. + (Same logic as for xmem*() functions) + * source/rtl/dummy.prg + - ReadKey() removed. + 19991007-01:16 GMT+1 Victor Szel + source/vm/main.c (added) source/vm/Makefile diff --git a/harbour/include/filesys.h b/harbour/include/filesys.h index 6a5b0ca48e..ad473289e0 100644 --- a/harbour/include/filesys.h +++ b/harbour/include/filesys.h @@ -88,7 +88,6 @@ extern BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart, extern BOOL hb_fsMkDir ( BYTE * pDirName ); extern FHANDLE hb_fsOpen ( BYTE * pFilename, USHORT uiFlags ); extern USHORT hb_fsRead ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount ); -extern ULONG hb_fsReadLarge ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ); extern BOOL hb_fsRmDir ( BYTE * pDirName ); extern int hb_fsRename ( BYTE * pOldName, BYTE * pNewName ); extern ULONG hb_fsSeek ( FHANDLE hFileHandle, LONG lOffset, USHORT uiMode ); @@ -96,7 +95,17 @@ extern ULONG hb_fsTell ( FHANDLE hFileHandle ); extern void hb_fsSetDevMode ( FHANDLE hFileHandle, USHORT uiDevMode ); extern void hb_fsSetError ( USHORT uiError ); extern USHORT hb_fsWrite ( FHANDLE hFileHandle, BYTE * pBuff, USHORT ulCount ); + +#if UINT_MAX == ULONG_MAX + /* NOTE: hb_fsRead/hb_fsWrite can work with ULONG data blocks */ + #define hb_fsReadLarge hb_fsRead + #define hb_fsWriteLarge hb_fsWrite +#else + /* NOTE: otherwise, the extended version of the functions + will be used to copy and/or set ULONG data blocks */ +extern ULONG hb_fsReadLarge ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ); extern ULONG hb_fsWriteLarge ( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ); +#endif extern PHB_FNAME hb_fsFNameSplit ( char * szFilename ); /* Split given filename into path, name and extension */ extern char * hb_fsFNameMerge ( char * szFileName, PHB_FNAME pFileName ); /* This function joins path, name and extension into a string with a filename */ diff --git a/harbour/source/rtl/dummy.prg b/harbour/source/rtl/dummy.prg index 2f2ecd8cfd..a8025f2685 100644 --- a/harbour/source/rtl/dummy.prg +++ b/harbour/source/rtl/dummy.prg @@ -80,17 +80,14 @@ FUNCTION __dbTotal() ; RETURN NIL FUNCTION __dbUpdate() ; RETURN NIL FUNCTION __dbZap() ; RETURN NIL -FUNCTION __LabelForm() ; RETURN NIL -FUNCTION __ReportForm() ; RETURN NIL - -FUNCTION __SetFormat() ; RETURN NIL -FUNCTION __TypeFile() ; RETURN NIL - FUNCTION Browse() ; RETURN .T. FUNCTION dbEdit() ; RETURN NIL FUNCTION IsPrinter() ; RETURN .T. FUNCTION NetName() ; RETURN "" -FUNCTION ReadKey() ; RETURN 0 +FUNCTION __qqPub() ; RETURN NIL +FUNCTION __TypeFile() ; RETURN NIL +FUNCTION __LabelForm() ; RETURN NIL +FUNCTION __ReportForm() ; RETURN NIL FUNCTION GetActive() ; RETURN NIL FUNCTION GetApplyKey() ; RETURN NIL @@ -102,6 +99,5 @@ FUNCTION ReadFormat() ; RETURN .F. FUNCTION ReadKill() ; RETURN .F. FUNCTION ReadUpdated() ; RETURN .T. FUNCTION Updated() ; RETURN .T. - -FUNCTION __qqPub() ; RETURN NIL +FUNCTION __SetFormat() ; RETURN NIL diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index a3483f59ea..3873955dda 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -519,6 +519,8 @@ USHORT hb_fsWrite( FHANDLE hFileHandle, BYTE * pBuff, USHORT uiCount ) return uiWritten; } +#if UINT_MAX != ULONG_MAX + ULONG hb_fsReadLarge( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ) { ULONG ulRead = 0L, ulLeftToRead = ulCount; @@ -605,6 +607,8 @@ ULONG hb_fsWriteLarge( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount ) return ulWritten; } +#endif + ULONG hb_fsSeek( FHANDLE hFileHandle, LONG lOffset, USHORT uiFlags ) { ULONG ulPos = -1;