2015-08-31 16:49 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
+ added hb_socketAutoShutdown()
* src/rtl/vfile.c
* updated for possible -1 result returned by hb_fileRead()/hb_fileWrite()
This commit is contained in:
@@ -10,6 +10,13 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2015-08-31 16:49 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* include/harbour.hbx
|
||||
+ added hb_socketAutoShutdown()
|
||||
|
||||
* src/rtl/vfile.c
|
||||
* updated for possible -1 result returned by hb_fileRead()/hb_fileWrite()
|
||||
|
||||
2015-08-31 13:26 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* src/rtl/hbsockhb.c
|
||||
+ added new PRG function:
|
||||
|
||||
@@ -784,6 +784,7 @@ DYNAMIC hb_SHA512
|
||||
DYNAMIC hb_Shadow
|
||||
DYNAMIC hb_socketAccept
|
||||
DYNAMIC hb_socketAutoFlush
|
||||
DYNAMIC hb_socketAutoShutdown
|
||||
DYNAMIC hb_socketBind
|
||||
DYNAMIC hb_socketClose
|
||||
DYNAMIC hb_socketConnect
|
||||
|
||||
@@ -584,7 +584,10 @@ HB_FUNC( HB_VFREAD )
|
||||
uiError = hb_fsError();
|
||||
}
|
||||
|
||||
hb_retns( nRead );
|
||||
if( nRead == ( HB_SIZE ) -1 )
|
||||
hb_retni( -1 );
|
||||
else
|
||||
hb_retns( nRead );
|
||||
hb_fsSetFError( uiError );
|
||||
}
|
||||
}
|
||||
@@ -607,6 +610,8 @@ HB_FUNC( HB_VFREADLEN )
|
||||
nRead = hb_fileRead( pFile, buffer, nToRead, hb_parnintdef( 3, -1 ) );
|
||||
uiError = hb_fsError();
|
||||
|
||||
if( nRead == ( HB_SIZE ) -1 )
|
||||
nRead = 0;
|
||||
hb_retclen_buffer( buffer, nRead );
|
||||
}
|
||||
else
|
||||
@@ -636,8 +641,12 @@ HB_FUNC( HB_VFWRITE )
|
||||
nLen = nWrite;
|
||||
}
|
||||
|
||||
hb_retns( hb_fileWrite( pFile, hb_parc( 2 ), nLen,
|
||||
hb_parnintdef( 4, -1 ) ) );
|
||||
nLen = hb_fileWrite( pFile, hb_parc( 2 ), nLen,
|
||||
hb_parnintdef( 4, -1 ) );
|
||||
if( nLen == ( HB_SIZE ) -1 )
|
||||
hb_retni( -1 );
|
||||
else
|
||||
hb_retns( nLen );
|
||||
uiError = hb_fsError();
|
||||
}
|
||||
else
|
||||
@@ -674,7 +683,10 @@ HB_FUNC( HB_VFREADAT )
|
||||
uiError = hb_fsError();
|
||||
}
|
||||
|
||||
hb_retns( nRead );
|
||||
if( nRead == ( HB_SIZE ) -1 )
|
||||
hb_retni( -1 );
|
||||
else
|
||||
hb_retns( nRead );
|
||||
hb_fsSetFError( uiError );
|
||||
}
|
||||
}
|
||||
@@ -700,8 +712,12 @@ HB_FUNC( HB_VFWRITEAT )
|
||||
nLen = nWrite;
|
||||
}
|
||||
|
||||
hb_retns( hb_fileWriteAt( pFile, pszData, nLen,
|
||||
( HB_FOFFSET ) hb_parnintdef( 4, -1 ) ) );
|
||||
nLen = hb_fileWriteAt( pFile, pszData, nLen,
|
||||
( HB_FOFFSET ) hb_parnintdef( 4, -1 ) );
|
||||
if( nLen == ( HB_SIZE ) -1 )
|
||||
hb_retni( -1 );
|
||||
else
|
||||
hb_retns( nLen );
|
||||
uiError = hb_fsError();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user