diff --git a/ChangeLog.txt b/ChangeLog.txt index a6af656013..68ccca6dab 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,24 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2015-09-01 15:07 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * ChangeLog.txt + ! fixed typo in ChangeLog entry. I used hb_socketNew() instead of + hb_socketSetFilter() + + * include/hbapifs.h + * src/rtl/filebuf.c + + added helper C function: + HB_SIZE hb_fileResult( HB_SIZE nSize ); + It converts ( HB_SIZE ) FS_ERROR to 0 so it can be used to wrap + hb_fileRead()/hb_fileWrite() to force previous results. + + * src/rdd/dbffpt/dbffpt1.c + * reduced variable scope + + * src/rtl/copyfile.c + ! fixed typo in last commit - thanks to Viktor. + 2015-08-31 23:48 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbnetio/netiosrv.c ! removed unnecessary casting (c&p typo) @@ -210,7 +228,7 @@ ZNET filter always disables any other filters and operates on raw socket. Please remember that it's optional module. If programmer does not - use hb_socketNewZNet() explicitly and prefers using hb_socketNew() + use hb_socketNewZNet() explicitly and prefers using hb_socketSetFilter() then he should force linking this module by REQUEST hb_socketNewZNet + added fSync parameter to hb_znetFlush() @@ -226,7 +244,7 @@ ZSOCK socket filter can be created by new PRG functions: hb_socketNewZSock( , [] ) -> | NIL or by standard socket API with "ZSOCK" as filter name. - Programmers using hb_socketNew() can force linking this module by + Programmers using hb_socketSetFilter() can force linking this module by REQUEST hb_socketNewZSock ZSOCK filter can be used with other filters. ZSOCK filter recognize the following settings in initialization @@ -252,7 +270,7 @@ BFSOCK socket filter can be created by new PRG functions: hb_socketNewBFSock( , [] ) -> | NIL or by standard socket API with "BFSOCK" as filter name. - Programmers using hb_socketNew() can force linking this module by + Programmers using hb_socketSetFilter() can force linking this module by REQUEST hb_socketNewBFSock BFSOCK filter can be used with other filters, i.e. with ZSOCK. Please only remember that good encryption algorithms have to @@ -277,7 +295,7 @@ hb_socketNewSSL_accept( , [, ] ) -> | NIL or by standard socket API with "SSL" as filter name. - Programmers using hb_socketNew() can force linking this module by + Programmers using hb_socketSetFilter() can force linking this module by REQUEST hb_socketNewSSL_connect or REQUEST hb_socketNewSSL_accept diff --git a/include/hbapifs.h b/include/hbapifs.h index d47f8a89e7..cb40e62db2 100644 --- a/include/hbapifs.h +++ b/include/hbapifs.h @@ -416,6 +416,7 @@ extern HB_EXPORT PHB_FILE hb_fileFromHandle( HB_FHANDLE hFile ); extern HB_EXPORT HB_BOOL hb_fileDetach( PHB_FILE pFile ); extern HB_EXPORT HB_BOOL hb_fileIsLocal( PHB_FILE pFile ); extern HB_EXPORT HB_BOOL hb_fileIsLocalName( const char * pszFileName ); +extern HB_EXPORT HB_SIZE hb_fileResult( HB_SIZE nSize ); /* interface to PRG level hb_vf*() file pointer items */ extern HB_EXPORT PHB_FILE hb_fileParam( int iParam ); diff --git a/src/rdd/dbffpt/dbffpt1.c b/src/rdd/dbffpt/dbffpt1.c index 628e7ee46d..d62c8c7d43 100644 --- a/src/rdd/dbffpt/dbffpt1.c +++ b/src/rdd/dbffpt/dbffpt1.c @@ -1001,11 +1001,11 @@ static HB_ULONG hb_fptGetMemoLen( FPTAREAP pArea, HB_USHORT uiIndex ) if( pArea->bMemoType == DB_MEMO_DBT ) { HB_BYTE pBlock[ DBT_DEFBLOCKSIZE ]; - HB_SIZE nLen, n; + HB_SIZE n; do { - nLen = hb_fileReadAt( pArea->pMemoFile, pBlock, DBT_DEFBLOCKSIZE, fOffset ); + HB_SIZE nLen = hb_fileReadAt( pArea->pMemoFile, pBlock, DBT_DEFBLOCKSIZE, fOffset ); if( nLen == 0 || nLen == ( HB_SIZE ) FS_ERROR ) break; fOffset += nLen; @@ -2412,7 +2412,6 @@ static HB_ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, HB_BYTE ** pbMemoBuf, HB_B char * pszStr = ( char * ) ( *pbMemoBuf ); *pbMemoBuf += ulLen; - if( iTrans == FPT_TRANS_UNICODE ) { hb_itemPutStrLenU16( pItem, HB_CDP_ENDIAN_LITTLE, diff --git a/src/rtl/copyfile.c b/src/rtl/copyfile.c index 3124458c3c..6ad50349c0 100644 --- a/src/rtl/copyfile.c +++ b/src/rtl/copyfile.c @@ -132,7 +132,7 @@ static HB_BOOL hb_copyfile( const char * pszSource, const char * pszDest ) while( nWritten < nRead ) { HB_SIZE nDone = hb_fileWrite( pDest, buffer + nWritten, nRead - nWritten, -1 ); - if( nDone > 0 ) + if( nDone != ( HB_SIZE ) FS_ERROR ) nWritten += nDone; if( nWritten < nRead ) { diff --git a/src/rtl/filebuf.c b/src/rtl/filebuf.c index f15b514326..24df5c9bd2 100644 --- a/src/rtl/filebuf.c +++ b/src/rtl/filebuf.c @@ -1482,3 +1482,8 @@ PHB_FILE hb_filePOpen( const char * pszFileName, const char * pszMode ) return pFile; } + +HB_SIZE hb_fileResult( HB_SIZE nSize ) +{ + return nSize == ( HB_SIZE ) FS_ERROR ? 0 : nSize; +}