2014-02-26 13:21 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* ChangeLog.txt
* include/harbour.hbx
* src/rtl/Makefile
- src/rtl/xfile.c
+ src/rtl/vfile.c
* renamed PRG functions HB_X*() to HB_VF*()
* renamed PRG functions hb_vf[GS]etAttr() to hb_vfAttr[GS]et()
* renamed PRG functions hb_vf[GS]etDateTime() to hb_vfTime[GS]et()
* include/hbapifs.h
* src/rtl/filebuf.c
* src/rtl/fscopy.c
* contrib/hbmemio/memio.c
* contrib/hbnetio/netio.h
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
* renamed C functions hb_file[GS]etAttr() to hb_fileAttr[GS]et()
* renamed C functions hb_file[GS]etFileTime() to hb_fileTime[GS]et()
* contrib/hbnetio/netio.h
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
+ added support for redirecting hb_vfConfig() to the server.
NETIO does not use it anyhow NETIO works as full redirector
to server system and it may be used on the server side.
This commit is contained in:
101
ChangeLog.txt
101
ChangeLog.txt
@@ -10,6 +10,33 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2014-02-26 13:21 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* ChangeLog.txt
|
||||
* include/harbour.hbx
|
||||
* src/rtl/Makefile
|
||||
- src/rtl/xfile.c
|
||||
+ src/rtl/vfile.c
|
||||
* renamed PRG functions HB_X*() to HB_VF*()
|
||||
* renamed PRG functions hb_vf[GS]etAttr() to hb_vfAttr[GS]et()
|
||||
* renamed PRG functions hb_vf[GS]etDateTime() to hb_vfTime[GS]et()
|
||||
|
||||
* include/hbapifs.h
|
||||
* src/rtl/filebuf.c
|
||||
* src/rtl/fscopy.c
|
||||
* contrib/hbmemio/memio.c
|
||||
* contrib/hbnetio/netio.h
|
||||
* contrib/hbnetio/netiocli.c
|
||||
* contrib/hbnetio/netiosrv.c
|
||||
* renamed C functions hb_file[GS]etAttr() to hb_fileAttr[GS]et()
|
||||
* renamed C functions hb_file[GS]etFileTime() to hb_fileTime[GS]et()
|
||||
|
||||
* contrib/hbnetio/netio.h
|
||||
* contrib/hbnetio/netiocli.c
|
||||
* contrib/hbnetio/netiosrv.c
|
||||
+ added support for redirecting hb_vfConfig() to the server.
|
||||
NETIO does not use it anyhow NETIO works as full redirector
|
||||
to server system and it may be used on the server side.
|
||||
|
||||
2014-02-26 00:10 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* include/hbapifs.h
|
||||
* src/rtl/filebuf.c
|
||||
@@ -90,60 +117,60 @@
|
||||
+ src/rtl/xfile.c
|
||||
+ added PRG interface to Harbour FILE IO API
|
||||
The following PRG functions are available for Harbour programmers:
|
||||
HB_XEXISTS( <cFileName>, [ @<cDestFileName> ] ) -> <lOK>
|
||||
HB_XERASE( <cFileName> ) -> <nResult>
|
||||
HB_XRENAME( <cFileSrc>, <cFileDst> ) -> <nResult>
|
||||
HB_XCOPYFILE( <cFileSrc>, <cFileDst> ) -> <nResult>
|
||||
HB_XDIREXISTS( <cDirName> ) -> <lExists>
|
||||
HB_XDIRMAKE( <cDirName> ) -> <nSuccess>
|
||||
HB_XDIRREMOVE( <cDirName> ) -> <nSuccess>
|
||||
HB_XDIRECTORY( [ <cDirSpec> ], [ <cAttr> ] ) -> <aDirectory>
|
||||
HB_XDIRSPACE( <cDirName>, [ <nInfoType> ] ) -> <nFreeSpace>
|
||||
HB_XGETATTR( <cFileName>, @<nAttr> ) -> <lOK>
|
||||
HB_XSETATTR( <cFileName>, <nAttr> ) -> <lOK>
|
||||
HB_XGETDATETIME( <cFileName>, @<tsDateTime> ) -> <lOK>
|
||||
HB_XSETDATETIME( <cFileName>, <tsDateTime> ) -> <lOK>
|
||||
HB_XLINK( <cExistingFileName>, <cNewFileName> ) -> <nSuccess>
|
||||
HB_XLINKSYM( <cTargetFileName>, <cNewFileName> ) -> <nSuccess>
|
||||
HB_XLINKREAD( <cFileName> ) -> <cDestFileName> | ""
|
||||
HB_XOPEN( <cFileName>, [ <nMode> ], [ <nAttr> ] ) -> <pHandle> | NIL
|
||||
HB_XCLOSE( <pHandle> ) -> <lOK>
|
||||
HB_XLOCK( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <lOK>
|
||||
HB_XUNLOCK( <pHandle>, <nStart>, <nLen> ) -> <lOK>
|
||||
HB_XLOCKTEST( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) ;
|
||||
HB_VFEXISTS( <cFileName>, [ @<cDestFileName> ] ) -> <lOK>
|
||||
HB_VFERASE( <cFileName> ) -> <nResult>
|
||||
HB_VFRENAME( <cFileSrc>, <cFileDst> ) -> <nResult>
|
||||
HB_VFCOPYFILE( <cFileSrc>, <cFileDst> ) -> <nResult>
|
||||
HB_VFDIREXISTS( <cDirName> ) -> <lExists>
|
||||
HB_VFDIRMAKE( <cDirName> ) -> <nSuccess>
|
||||
HB_VFDIRREMOVE( <cDirName> ) -> <nSuccess>
|
||||
HB_VFDIRECTORY( [ <cDirSpec> ], [ <cAttr> ] ) -> <aDirectory>
|
||||
HB_VFDIRSPACE( <cDirName>, [ <nInfoType> ] ) -> <nFreeSpace>
|
||||
HB_VFATTRGET( <cFileName>, @<nAttr> ) -> <lOK>
|
||||
HB_VFATTRSET( <cFileName>, <nAttr> ) -> <lOK>
|
||||
HB_VFTIMEGET( <cFileName>, @<tsDateTime> ) -> <lOK>
|
||||
HB_VFTIMESET( <cFileName>, <tsDateTime> ) -> <lOK>
|
||||
HB_VFLINK( <cExistingFileName>, <cNewFileName> ) -> <nSuccess>
|
||||
HB_VFLINKSYM( <cTargetFileName>, <cNewFileName> ) -> <nSuccess>
|
||||
HB_VFLINKREAD( <cFileName> ) -> <cDestFileName> | ""
|
||||
HB_VFOPEN( <cFileName>, [ <nMode> ], [ <nAttr> ] ) -> <pHandle> | NIL
|
||||
HB_VFCLOSE( <pHandle> ) -> <lOK>
|
||||
HB_VFLOCK( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <lOK>
|
||||
HB_VFUNLOCK( <pHandle>, <nStart>, <nLen> ) -> <lOK>
|
||||
HB_VFLOCKTEST( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) ;
|
||||
-> <nPID> | 0 (nolock) | -1 (err)
|
||||
HB_XREAD( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nTimeOut> ] ) ;
|
||||
HB_VFREAD( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nTimeOut> ] ) ;
|
||||
-> <nRead>
|
||||
HB_XWRITE( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nTimeOut> ] ) ;
|
||||
HB_VFWRITE( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nTimeOut> ] ) ;
|
||||
-> <nWritten>
|
||||
HB_XREADAT( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nAtOffset> ] ) ;
|
||||
HB_VFREADAT( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nAtOffset> ] ) ;
|
||||
-> <nRead>
|
||||
HB_XWRITEAT( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nAtOffset> ] ) ;
|
||||
HB_VFWRITEAT( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nAtOffset> ] ) ;
|
||||
-> <nWritten>
|
||||
HB_XSEEK( <pHandle>, <nOffset>, [ <nWhence> ] ) -> <nOffset>
|
||||
HB_XTRUNC( <pHandle>, [ <nAtOffset> ] ) -> <lOK>
|
||||
HB_XSIZE( <pHandle> ) -> <nSize>
|
||||
HB_XEOF( <pHandle> ) -> <lEOF>
|
||||
HB_XFLUSH( <pHandle>, [ <lDirtyOnly> ] ) -> NIL
|
||||
HB_XCOMMIT( <pHandle> ) -> NIL
|
||||
HB_XCONFIG( <pHandle>, <nSet>, [ <nParam> ] ) -> <nResult>
|
||||
HB_XHANDLE( <pHandle> ) -> <nOsHandle>
|
||||
HB_XTEMPFILE( @<cFileName>, [ <cDir> ], [ <cPrefix> ], [ <cExt> ], ;
|
||||
HB_VFSEEK( <pHandle>, <nOffset>, [ <nWhence> ] ) -> <nOffset>
|
||||
HB_VFTRUNC( <pHandle>, [ <nAtOffset> ] ) -> <lOK>
|
||||
HB_VFSIZE( <pHandle> ) -> <nSize>
|
||||
HB_VFEOF( <pHandle> ) -> <lEOF>
|
||||
HB_VFFLUSH( <pHandle>, [ <lDirtyOnly> ] ) -> NIL
|
||||
HB_VFCOMMIT( <pHandle> ) -> NIL
|
||||
HB_VFCONFIG( <pHandle>, <nSet>, [ <nParam> ] ) -> <nResult>
|
||||
HB_VFHANDLE( <pHandle> ) -> <nOsHandle>
|
||||
HB_VFTEMPFILE( @<cFileName>, [ <cDir> ], [ <cPrefix> ], [ <cExt> ], ;
|
||||
[ <nAttr> ] ) -> <pHandle> | NIL
|
||||
Please remember that not all redirectors have to support all of them.
|
||||
I.e. MEMIO allows to use directory names in files but does not allow to
|
||||
create or remove directories. It also does not support file attributes
|
||||
and times in current implementation though it can be easy added.
|
||||
HB_XCONFIG() is general function which can be used by redirector
|
||||
HB_VFCONFIG() is general function which can be used by redirector
|
||||
authors to make some special operations which are specific to given
|
||||
device.
|
||||
HB_XTEMPFILE() always creates temporary files on local system without
|
||||
HB_VFTEMPFILE() always creates temporary files on local system without
|
||||
switching to FILE IO redirector. It's intentional behavior.
|
||||
|
||||
* src/rtl/fscopy.c
|
||||
* used Harbour FILE IO API in hb_fsCopy()/HB_FCOPY()
|
||||
Please remember that HB_FCOPY() always makes operation using current
|
||||
system when HB_XCOPY() may optimize it moving the operation to low
|
||||
system when HB_VFCOPY() may optimize it moving the operation to low
|
||||
level subsystem or even other computer i.e. NETIO can do that when
|
||||
both files are located on the same server.
|
||||
|
||||
|
||||
@@ -851,7 +851,7 @@ static PHB_ITEM s_fileDirectory( const char * pszDirSpec, const char * pszAttr )
|
||||
}
|
||||
|
||||
|
||||
static HB_BOOL s_fileGetFileTime( const char * pszFileName, long * plJulian, long * plMillisec )
|
||||
static HB_BOOL s_fileTimeGet( const char * pszFileName, long * plJulian, long * plMillisec )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pszFileName );
|
||||
HB_SYMBOL_UNUSED( plJulian );
|
||||
@@ -860,7 +860,7 @@ static HB_BOOL s_fileGetFileTime( const char * pszFileName, long * plJulian, lon
|
||||
}
|
||||
|
||||
|
||||
static HB_BOOL s_fileSetFileTime( const char * pszFileName, long lJulian, long lMillisec )
|
||||
static HB_BOOL s_fileTimeSet( const char * pszFileName, long lJulian, long lMillisec )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pszFileName );
|
||||
HB_SYMBOL_UNUSED( lJulian );
|
||||
@@ -869,7 +869,7 @@ static HB_BOOL s_fileSetFileTime( const char * pszFileName, long lJulian, long l
|
||||
}
|
||||
|
||||
|
||||
static HB_BOOL s_fileGetAttr( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
static HB_BOOL s_fileAttrGet( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pszFileName );
|
||||
HB_SYMBOL_UNUSED( pulAttr );
|
||||
@@ -877,7 +877,7 @@ static HB_BOOL s_fileGetAttr( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
}
|
||||
|
||||
|
||||
static HB_BOOL s_fileSetAttr( const char * pszFileName, HB_FATTR ulAttr )
|
||||
static HB_BOOL s_fileAttrSet( const char * pszFileName, HB_FATTR ulAttr )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pszFileName );
|
||||
HB_SYMBOL_UNUSED( ulAttr );
|
||||
@@ -1080,10 +1080,10 @@ static const HB_FILE_FUNCS s_fileFuncs =
|
||||
s_fileDirSpace,
|
||||
s_fileDirectory,
|
||||
|
||||
s_fileGetFileTime,
|
||||
s_fileSetFileTime,
|
||||
s_fileGetAttr,
|
||||
s_fileSetAttr,
|
||||
s_fileTimeGet,
|
||||
s_fileTimeSet,
|
||||
s_fileAttrGet,
|
||||
s_fileAttrSet,
|
||||
|
||||
s_fileLink,
|
||||
s_fileLinkSym,
|
||||
|
||||
@@ -114,13 +114,14 @@
|
||||
#define NETIO_DIRREMOVE 32
|
||||
#define NETIO_DIRECTORY 33
|
||||
#define NETIO_DIRSPACE 34
|
||||
#define NETIO_GETATTR 35
|
||||
#define NETIO_SETATTR 36
|
||||
#define NETIO_GETFTIME 37
|
||||
#define NETIO_SETFTIME 38
|
||||
#define NETIO_ATTRGET 35
|
||||
#define NETIO_ATTRSET 36
|
||||
#define NETIO_FTIMEGET 37
|
||||
#define NETIO_FTIMESET 38
|
||||
#define NETIO_LINK 39
|
||||
#define NETIO_LINKSYM 40
|
||||
#define NETIO_LINKREAD 41
|
||||
#define NETIO_CONFIGURE 42
|
||||
|
||||
#define NETIO_CONNECTED 0x4321DEAD
|
||||
|
||||
@@ -134,10 +135,10 @@
|
||||
/* { NETIO_EXISTS, len[ 2 ], ... } + filename[ len ] -> { NETIO_EXISTS, ... } */
|
||||
/* { NETIO_DELETE, len[ 2 ], ... } + filename[ len ] -> { NETIO_DELETE, ... } */
|
||||
/* { NETIO_RENAME, len[ 2 ], len2[ 2 ], ... } + filename[ len ] + filename[ len2 ] -> { NETIO_RENAME, ... } */
|
||||
/* { NETIO_GETATTR, len[ 2 ], ... } + filename[ len ] -> { NETIO_GETATTR, attr[ 4 ], ... } */
|
||||
/* { NETIO_SETATTR, len[ 2 ], attr[ 4 ], ... } + filename[ len ] -> { NETIO_SETATTR, ... } */
|
||||
/* { NETIO_GETFTIME, len[ 2 ], ... } + filename[ len ] -> { NETIO_GETFTIME, julian[ 4 ], msec[ 4 ], ... } */
|
||||
/* { NETIO_SETFTIME, len[ 2 ], julian[ 4 ], msec[ 4 ], ... } + filename[ len ] -> { NETIO_SETFTIME, ... } */
|
||||
/* { NETIO_ATTRGET, len[ 2 ], ... } + filename[ len ] -> { NETIO_ATTRGET, attr[ 4 ], ... } */
|
||||
/* { NETIO_ATTRSET, len[ 2 ], attr[ 4 ], ... } + filename[ len ] -> { NETIO_ATTRSET, ... } */
|
||||
/* { NETIO_FTIMEGET, len[ 2 ], ... } + filename[ len ] -> { NETIO_FTIMEGET, julian[ 4 ], msec[ 4 ], ... } */
|
||||
/* { NETIO_FTIMESET, len[ 2 ], julian[ 4 ], msec[ 4 ], ... } + filename[ len ] -> { NETIO_FTIMESET, ... } */
|
||||
/* { NETIO_LINK, len[ 2 ], len2[ 2 ], ... } + existing[ len ] + newname[ len2 ] -> { NETIO_LINK, ... } */
|
||||
/* { NETIO_LINKSYM, len[ 2 ], len2[ 2 ], ... } + target[ len ] + newname[ len2 ] -> { NETIO_LINKSYM, ... } */
|
||||
/* { NETIO_LINKREAD, len[ 2 ], ... } + filename[ len ] -> { NETIO_LINKREAD, size[ 4 ], err[ 4 ], ... } + data[ size ] */
|
||||
@@ -156,6 +157,7 @@
|
||||
/* { NETIO_COMMIT, file_no[2], ... } -> { NETIO_SYNC, ... } | NULL */
|
||||
/* { NETIO_CLOSE, file_no[2], ... } -> { NETIO_CLOSE, ... } */
|
||||
/* { NETIO_UNLOCK, file_no[2], start[ 8 ], len[ 8 ], flags[ 2 ], ... } -> { NETIO_SYNC, ... } | NULL */
|
||||
/* { NETIO_CONFIGURE, file_no[2], size[ 4 ], index[ 4 ], ... } + itmdata[ size ] -> { NETIO_CONFIGURE, size[ 4 ], result[ 4 ], err[ 4 ], ... } + itmdata[ size ] */
|
||||
/* { NETIO_PROCIS, size[ 4 ] } + (funcname + \0 + data)[ size ] -> { NETIO_PROCIS, ... } */
|
||||
/* { NETIO_PROC, size[ 4 ] } + (funcname + \0 + data)[ size ] -> { NETIO_SYNC, ... } | NULL */
|
||||
/* { NETIO_PROCW, size[ 4 ] } + (funcname + \0 + data)[ size ] -> { NETIO_PROC, ... } */
|
||||
|
||||
@@ -1762,7 +1762,7 @@ static HB_BOOL s_fileCopy( const char * pszSrcFile, const char * pszDstFile )
|
||||
return fResult;
|
||||
}
|
||||
|
||||
static HB_BOOL s_fileGetAttr( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
static HB_BOOL s_fileAttrGet( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
{
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
PHB_CONCLI conn;
|
||||
@@ -1778,7 +1778,7 @@ static HB_BOOL s_fileGetAttr( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
HB_BYTE msgbuf[ NETIO_MSGLEN ];
|
||||
HB_U16 len = ( HB_U16 ) strlen( pszFileName );
|
||||
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_GETATTR );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_ATTRGET );
|
||||
HB_PUT_LE_UINT16( &msgbuf[ 4 ], len );
|
||||
memset( msgbuf + 6, '\0', sizeof( msgbuf ) - 6 );
|
||||
if( s_fileSendMsg( conn, msgbuf, pszFileName, len, HB_TRUE, HB_FALSE ) )
|
||||
@@ -1794,7 +1794,7 @@ static HB_BOOL s_fileGetAttr( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
return fResult;
|
||||
}
|
||||
|
||||
static HB_BOOL s_fileSetAttr( const char * pszFileName, HB_FATTR ulAttr )
|
||||
static HB_BOOL s_fileAttrSet( const char * pszFileName, HB_FATTR ulAttr )
|
||||
{
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
PHB_CONCLI conn;
|
||||
@@ -1810,7 +1810,7 @@ static HB_BOOL s_fileSetAttr( const char * pszFileName, HB_FATTR ulAttr )
|
||||
HB_BYTE msgbuf[ NETIO_MSGLEN ];
|
||||
HB_U16 len = ( HB_U16 ) strlen( pszFileName );
|
||||
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_SETATTR );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_ATTRSET );
|
||||
HB_PUT_LE_UINT16( &msgbuf[ 4 ], len );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 6 ], ulAttr );
|
||||
memset( msgbuf + 10, '\0', sizeof( msgbuf ) - 10 );
|
||||
@@ -1823,7 +1823,7 @@ static HB_BOOL s_fileSetAttr( const char * pszFileName, HB_FATTR ulAttr )
|
||||
return fResult;
|
||||
}
|
||||
|
||||
static HB_BOOL s_fileGetFileTime( const char * pszFileName, long * plJulian, long * plMillisec )
|
||||
static HB_BOOL s_fileTimeGet( const char * pszFileName, long * plJulian, long * plMillisec )
|
||||
{
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
PHB_CONCLI conn;
|
||||
@@ -1839,7 +1839,7 @@ static HB_BOOL s_fileGetFileTime( const char * pszFileName, long * plJulian, lon
|
||||
HB_BYTE msgbuf[ NETIO_MSGLEN ];
|
||||
HB_U16 len = ( HB_U16 ) strlen( pszFileName );
|
||||
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_GETFTIME );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_FTIMEGET );
|
||||
HB_PUT_LE_UINT16( &msgbuf[ 4 ], len );
|
||||
memset( msgbuf + 6, '\0', sizeof( msgbuf ) - 6 );
|
||||
if( s_fileSendMsg( conn, msgbuf, pszFileName, len, HB_TRUE, HB_FALSE ) )
|
||||
@@ -1856,7 +1856,7 @@ static HB_BOOL s_fileGetFileTime( const char * pszFileName, long * plJulian, lon
|
||||
return fResult;
|
||||
}
|
||||
|
||||
static HB_BOOL s_fileSetFileTime( const char * pszFileName, long lJulian, long lMillisec )
|
||||
static HB_BOOL s_fileTimeSet( const char * pszFileName, long lJulian, long lMillisec )
|
||||
{
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
PHB_CONCLI conn;
|
||||
@@ -1872,7 +1872,7 @@ static HB_BOOL s_fileSetFileTime( const char * pszFileName, long lJulian, long l
|
||||
HB_BYTE msgbuf[ NETIO_MSGLEN ];
|
||||
HB_U16 len = ( HB_U16 ) strlen( pszFileName );
|
||||
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_SETFTIME );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_FTIMESET );
|
||||
HB_PUT_LE_UINT16( &msgbuf[ 4 ], len );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 6 ], lJulian );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 10 ], lMillisec );
|
||||
@@ -2383,11 +2383,63 @@ static void s_fileCommit( PHB_FILE pFile )
|
||||
|
||||
static HB_BOOL s_fileConfigure( PHB_FILE pFile, int iIndex, PHB_ITEM pValue )
|
||||
{
|
||||
HB_SYMBOL_UNUSED( pFile );
|
||||
HB_SYMBOL_UNUSED( iIndex );
|
||||
HB_SYMBOL_UNUSED( pValue );
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
|
||||
return HB_FALSE;
|
||||
if( s_fileConLock( pFile->conn ) )
|
||||
{
|
||||
HB_BYTE msgbuf[ NETIO_MSGLEN ];
|
||||
HB_SIZE itmSize = 0;
|
||||
char * itmData = NULL;
|
||||
|
||||
if( pValue )
|
||||
itmData = hb_itemSerialize( pValue, HB_SERIALIZE_NUMSIZE, &itmSize );
|
||||
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 0 ], NETIO_CONFIGURE );
|
||||
HB_PUT_LE_UINT16( &msgbuf[ 4 ], pFile->fd );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 6 ], itmSize );
|
||||
HB_PUT_LE_UINT32( &msgbuf[ 10 ], iIndex );
|
||||
memset( msgbuf + 14, '\0', sizeof( msgbuf ) - 14 );
|
||||
|
||||
hb_itemClear( pValue );
|
||||
|
||||
if( s_fileSendMsg( pFile->conn, msgbuf, itmData, itmSize, HB_TRUE, HB_FALSE ) )
|
||||
{
|
||||
HB_ERRCODE errCode = ( HB_ERRCODE ) HB_GET_LE_UINT32( &msgbuf[ 12 ] );
|
||||
HB_SIZE nResult = HB_GET_LE_UINT32( &msgbuf[ 4 ] ), nRecv = 0;
|
||||
|
||||
fResult = HB_GET_LE_UINT32( &msgbuf[ 8 ] ) != 0;
|
||||
if( nResult > 0 )
|
||||
{
|
||||
char * buffer = ( char * ) hb_xgrab( nResult );
|
||||
const char * data = buffer;
|
||||
|
||||
nRecv = s_fileRecvAll( pFile->conn, buffer, ( long ) nResult );
|
||||
if( nRecv == nResult && pValue )
|
||||
{
|
||||
PHB_ITEM pResult = hb_itemDeserialize( &data, &nResult );
|
||||
|
||||
if( pResult )
|
||||
{
|
||||
hb_itemMove( pValue, pResult );
|
||||
hb_itemRelease( pResult );
|
||||
}
|
||||
}
|
||||
hb_xfree( buffer );
|
||||
}
|
||||
hb_fsSetError( errCode );
|
||||
if( nRecv != nResult )
|
||||
{
|
||||
pFile->conn->errcode = hb_socketGetError();
|
||||
hb_errRT_NETIO( EG_CORRUPTION, 1015, 0, NULL, HB_ERR_FUNCNAME );
|
||||
fResult = HB_FALSE;
|
||||
}
|
||||
}
|
||||
if( itmData )
|
||||
hb_xfree( itmData );
|
||||
s_fileConUnlock( pFile->conn );
|
||||
}
|
||||
|
||||
return fResult;
|
||||
}
|
||||
|
||||
static HB_FHANDLE s_fileHandle( PHB_FILE pFile )
|
||||
@@ -2412,10 +2464,10 @@ static const HB_FILE_FUNCS * s_fileMethods( void )
|
||||
s_fileDirSpace,
|
||||
s_fileDirectory,
|
||||
|
||||
s_fileGetFileTime,
|
||||
s_fileSetFileTime,
|
||||
s_fileGetAttr,
|
||||
s_fileSetAttr,
|
||||
s_fileTimeGet,
|
||||
s_fileTimeSet,
|
||||
s_fileAttrGet,
|
||||
s_fileAttrSet,
|
||||
|
||||
s_fileLink,
|
||||
s_fileLinkSym,
|
||||
|
||||
@@ -782,7 +782,7 @@ HB_FUNC( NETIO_SERVER )
|
||||
HB_ERRCODE errCode = 0, errFsCode;
|
||||
long len = 0, size, size2;
|
||||
long lJulian, lMillisec;
|
||||
int iFileNo, iStreamID, iResult;
|
||||
int iFileNo, iStreamID, iIndex, iResult;
|
||||
HB_FATTR ulAttr;
|
||||
HB_U32 uiMsg;
|
||||
HB_USHORT uiFlags;
|
||||
@@ -1028,8 +1028,8 @@ HB_FUNC( NETIO_SERVER )
|
||||
}
|
||||
break;
|
||||
|
||||
case NETIO_SETATTR:
|
||||
case NETIO_GETATTR:
|
||||
case NETIO_ATTRSET:
|
||||
case NETIO_ATTRGET:
|
||||
size = HB_GET_LE_UINT16( &msgbuf[ 4 ] );
|
||||
ulAttr = HB_GET_LE_UINT32( &msgbuf[ 6 ] );
|
||||
if( size <= 0 )
|
||||
@@ -1047,9 +1047,9 @@ HB_FUNC( NETIO_SERVER )
|
||||
|
||||
if( ! pszName )
|
||||
errCode = NETIO_ERR_WRONG_FILE_PATH;
|
||||
else if( ! ( uiMsg == NETIO_SETATTR ?
|
||||
hb_fileSetAttr( pszName, ulAttr ) :
|
||||
hb_fileGetAttr( pszName, &ulAttr ) ) )
|
||||
else if( ! ( uiMsg == NETIO_ATTRSET ?
|
||||
hb_fileAttrSet( pszName, ulAttr ) :
|
||||
hb_fileAttrGet( pszName, &ulAttr ) ) )
|
||||
errCode = s_srvFsError();
|
||||
else
|
||||
{
|
||||
@@ -1061,8 +1061,8 @@ HB_FUNC( NETIO_SERVER )
|
||||
}
|
||||
break;
|
||||
|
||||
case NETIO_SETFTIME:
|
||||
case NETIO_GETFTIME:
|
||||
case NETIO_FTIMESET:
|
||||
case NETIO_FTIMEGET:
|
||||
size = HB_GET_LE_UINT16( &msgbuf[ 4 ] );
|
||||
lJulian = HB_GET_LE_UINT32( &msgbuf[ 6 ] );
|
||||
lMillisec = HB_GET_LE_UINT32( &msgbuf[ 10 ] );
|
||||
@@ -1081,9 +1081,9 @@ HB_FUNC( NETIO_SERVER )
|
||||
|
||||
if( ! pszName )
|
||||
errCode = NETIO_ERR_WRONG_FILE_PATH;
|
||||
else if( ! ( uiMsg == NETIO_SETFTIME ?
|
||||
hb_fileSetFileTime( pszName, lJulian, lMillisec ) :
|
||||
hb_fileGetFileTime( pszName, &lJulian, &lMillisec ) ) )
|
||||
else if( ! ( uiMsg == NETIO_FTIMESET ?
|
||||
hb_fileTimeSet( pszName, lJulian, lMillisec ) :
|
||||
hb_fileTimeGet( pszName, &lJulian, &lMillisec ) ) )
|
||||
errCode = s_srvFsError();
|
||||
else
|
||||
{
|
||||
@@ -1145,6 +1145,77 @@ HB_FUNC( NETIO_SERVER )
|
||||
hb_xfree( szExt );
|
||||
break;
|
||||
|
||||
case NETIO_CONFIGURE:
|
||||
iFileNo = HB_GET_LE_UINT16( &msgbuf[ 4 ] );
|
||||
size = HB_GET_LE_UINT32( &msgbuf[ 6 ] );
|
||||
iIndex = HB_GET_LE_INT32( &msgbuf[ 10 ] );
|
||||
if( size < 0 )
|
||||
errCode = NETIO_ERR_WRONG_PARAM;
|
||||
else
|
||||
{
|
||||
if( size >= ( long ) ( sizeof( buffer ) - NETIO_MSGLEN ) )
|
||||
ptr = msg = ( HB_BYTE * ) hb_xgrab( size + NETIO_MSGLEN );
|
||||
if( s_srvRecvAll( conn, msg, size ) != size )
|
||||
errCode = NETIO_ERR_READ;
|
||||
else
|
||||
{
|
||||
pFile = s_srvFileGet( conn, iFileNo );
|
||||
if( pFile == NULL )
|
||||
errCode = NETIO_ERR_WRONG_FILE_HANDLE;
|
||||
else
|
||||
{
|
||||
PHB_ITEM pValue = NULL;
|
||||
|
||||
if( size > 0 )
|
||||
{
|
||||
const char * data = ( const char * ) msg;
|
||||
HB_SIZE nSize = size;
|
||||
|
||||
pValue = hb_itemDeserialize( &data, &nSize );
|
||||
if( ! pValue || nSize != 0 )
|
||||
errCode = NETIO_ERR_WRONG_PARAM;
|
||||
}
|
||||
if( errCode == 0 )
|
||||
{
|
||||
char * itmData = NULL;
|
||||
HB_SIZE itmSize = 0;
|
||||
|
||||
iResult = hb_fileConfigure( pFile, iIndex, pValue ) ? 1 : 0;
|
||||
if( pValue )
|
||||
itmData = hb_itemSerialize( pValue, HB_SERIALIZE_NUMSIZE, &itmSize );
|
||||
|
||||
if( itmSize <= sizeof( buffer ) - NETIO_MSGLEN )
|
||||
msg = buffer;
|
||||
else if( ! ptr || itmSize > ( HB_SIZE ) size - NETIO_MSGLEN )
|
||||
{
|
||||
if( ptr )
|
||||
hb_xfree( ptr );
|
||||
ptr = msg = ( HB_BYTE * ) hb_xgrab( itmSize + NETIO_MSGLEN );
|
||||
}
|
||||
else
|
||||
msg = ptr;
|
||||
|
||||
if( itmData )
|
||||
{
|
||||
memcpy( msg + NETIO_MSGLEN, itmData, itmSize );
|
||||
hb_xfree( itmData );
|
||||
}
|
||||
len = ( long ) itmSize;
|
||||
|
||||
errFsCode = hb_fsError();
|
||||
HB_PUT_LE_UINT32( &msg[ 0 ], uiMsg );
|
||||
HB_PUT_LE_UINT32( &msg[ 4 ], len );
|
||||
HB_PUT_LE_UINT32( &msg[ 8 ], iResult );
|
||||
HB_PUT_LE_UINT32( &msg[ 12 ], errFsCode );
|
||||
memset( msg + 12, '\0', NETIO_MSGLEN - 12 );
|
||||
}
|
||||
if( pValue )
|
||||
hb_itemRelease( pValue );
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case NETIO_READ:
|
||||
case NETIO_READAT:
|
||||
iFileNo = HB_GET_LE_UINT16( &msgbuf[ 4 ] );
|
||||
@@ -1320,6 +1391,14 @@ HB_FUNC( NETIO_SERVER )
|
||||
}
|
||||
break;
|
||||
|
||||
case NETIO_COMMIT:
|
||||
iFileNo = HB_GET_LE_UINT16( &msgbuf[ 4 ] );
|
||||
pFile = s_srvFileGet( conn, iFileNo );
|
||||
if( pFile )
|
||||
hb_fileCommit( pFile );
|
||||
fNoAnswer = HB_TRUE;
|
||||
break;
|
||||
|
||||
case NETIO_CLOSE:
|
||||
iFileNo = HB_GET_LE_UINT16( &msgbuf[ 4 ] );
|
||||
pFile = s_srvFileFree( conn, iFileNo );
|
||||
@@ -1333,14 +1412,6 @@ HB_FUNC( NETIO_SERVER )
|
||||
}
|
||||
break;
|
||||
|
||||
case NETIO_COMMIT:
|
||||
iFileNo = HB_GET_LE_UINT16( &msgbuf[ 4 ] );
|
||||
pFile = s_srvFileGet( conn, iFileNo );
|
||||
if( pFile )
|
||||
hb_fileCommit( pFile );
|
||||
fNoAnswer = HB_TRUE;
|
||||
break;
|
||||
|
||||
case NETIO_SRVCLOSE:
|
||||
iStreamID = HB_GET_LE_INT32( &msgbuf[ 4 ] );
|
||||
if( iStreamID && conn->mutex && hb_threadMutexLock( conn->mutex ) )
|
||||
|
||||
@@ -878,6 +878,40 @@ DYNAMIC hb_UTF8ToStrBox
|
||||
DYNAMIC hb_ValToExp
|
||||
DYNAMIC hb_ValToStr
|
||||
DYNAMIC hb_Version
|
||||
DYNAMIC HB_vfAttrGet
|
||||
DYNAMIC HB_vfAttrSet
|
||||
DYNAMIC HB_vfClose
|
||||
DYNAMIC HB_vfCommit
|
||||
DYNAMIC HB_vfConfig
|
||||
DYNAMIC HB_vfCopyFile
|
||||
DYNAMIC HB_vfDirectory
|
||||
DYNAMIC HB_vfDirExists
|
||||
DYNAMIC HB_vfDirMake
|
||||
DYNAMIC HB_vfDirRemove
|
||||
DYNAMIC HB_vfDirSpace
|
||||
DYNAMIC HB_vfEof
|
||||
DYNAMIC HB_vfErase
|
||||
DYNAMIC HB_vfExists
|
||||
DYNAMIC HB_vfFlush
|
||||
DYNAMIC HB_vfHandle
|
||||
DYNAMIC HB_vfLink
|
||||
DYNAMIC HB_vfLinkRead
|
||||
DYNAMIC HB_vfLinkSym
|
||||
DYNAMIC HB_vfLock
|
||||
DYNAMIC HB_vfLockTest
|
||||
DYNAMIC HB_vfOpen
|
||||
DYNAMIC HB_vfRead
|
||||
DYNAMIC HB_vfReadAt
|
||||
DYNAMIC HB_vfRename
|
||||
DYNAMIC HB_vfSeek
|
||||
DYNAMIC HB_vfSize
|
||||
DYNAMIC HB_vfTempFile
|
||||
DYNAMIC HB_vfTimeGet
|
||||
DYNAMIC HB_vfTimeSet
|
||||
DYNAMIC HB_vfTrunc
|
||||
DYNAMIC HB_vfUnlock
|
||||
DYNAMIC HB_vfWrite
|
||||
DYNAMIC HB_vfWriteAt
|
||||
DYNAMIC hb_WAEval
|
||||
DYNAMIC hb_WildMatch
|
||||
DYNAMIC hb_WildMatchI
|
||||
|
||||
@@ -322,10 +322,10 @@ extern HB_EXPORT HB_WCHAR * hb_fsNameConvU16( const char * pszFileName );
|
||||
double ( * DirSpace ) ( const char * pszDirName, HB_USHORT uiType );
|
||||
PHB_ITEM ( * Directory ) ( const char * pszDirSpec, const char * pszAttr );
|
||||
|
||||
HB_BOOL ( * GetFileTime ) ( const char * pszFileName, long * plJulian, long * plMillisec );
|
||||
HB_BOOL ( * SetFileTime ) ( const char * pszFileName, long lJulian, long lMillisec );
|
||||
HB_BOOL ( * GetAttr ) ( const char * pszFileName, HB_FATTR * pulAttr );
|
||||
HB_BOOL ( * SetAttr ) ( const char * pszFileName, HB_FATTR ulAttr );
|
||||
HB_BOOL ( * TimeGet ) ( const char * pszFileName, long * plJulian, long * plMillisec );
|
||||
HB_BOOL ( * TimeSet ) ( const char * pszFileName, long lJulian, long lMillisec );
|
||||
HB_BOOL ( * AttrGet ) ( const char * pszFileName, HB_FATTR * pulAttr );
|
||||
HB_BOOL ( * AttrSet ) ( const char * pszFileName, HB_FATTR ulAttr );
|
||||
|
||||
HB_BOOL ( * Link ) ( const char * pszExisting, const char * pszNewName );
|
||||
HB_BOOL ( * LinkSym ) ( const char * pszTarget, const char * pszNewName );
|
||||
@@ -368,10 +368,10 @@ extern HB_EXPORT HB_BOOL hb_fileDirRemove ( const char * pszDirName );
|
||||
extern HB_EXPORT double hb_fileDirSpace ( const char * pszDirName, HB_USHORT uiType );
|
||||
extern HB_EXPORT PHB_ITEM hb_fileDirectory ( const char * pszDirSpec, const char * pszAttr );
|
||||
|
||||
extern HB_EXPORT HB_BOOL hb_fileGetFileTime( const char * pszFileName, long * plJulian, long * plMillisec );
|
||||
extern HB_EXPORT HB_BOOL hb_fileSetFileTime( const char * pszFileName, long lJulian, long lMillisec );
|
||||
extern HB_EXPORT HB_BOOL hb_fileGetAttr ( const char * pszFileName, HB_FATTR * pulAttr );
|
||||
extern HB_EXPORT HB_BOOL hb_fileSetAttr ( const char * pszFileName, HB_FATTR ulAttr );
|
||||
extern HB_EXPORT HB_BOOL hb_fileTimeGet ( const char * pszFileName, long * plJulian, long * plMillisec );
|
||||
extern HB_EXPORT HB_BOOL hb_fileTimeSet ( const char * pszFileName, long lJulian, long lMillisec );
|
||||
extern HB_EXPORT HB_BOOL hb_fileAttrGet ( const char * pszFileName, HB_FATTR * pulAttr );
|
||||
extern HB_EXPORT HB_BOOL hb_fileAttrSet ( const char * pszFileName, HB_FATTR ulAttr );
|
||||
|
||||
extern HB_EXPORT HB_BOOL hb_fileLink ( const char * pszExisting, const char * pszNewName );
|
||||
extern HB_EXPORT HB_BOOL hb_fileLinkSym ( const char * pszTarget, const char * pszNewName );
|
||||
|
||||
@@ -206,8 +206,8 @@ C_SOURCES := \
|
||||
valtostr.c \
|
||||
valtype.c \
|
||||
version.c \
|
||||
vfile.c \
|
||||
word.c \
|
||||
xfile.c \
|
||||
xhelp.c \
|
||||
xsavescr.c \
|
||||
|
||||
|
||||
@@ -1029,42 +1029,42 @@ PHB_ITEM hb_fileDirectory( const char * pszDirSpec, const char * pszAttr )
|
||||
return hb_fsDirectory( pszDirSpec, pszAttr );
|
||||
}
|
||||
|
||||
HB_BOOL hb_fileGetFileTime( const char * pszFileName, long * plJulian, long * plMillisec )
|
||||
HB_BOOL hb_fileTimeGet( const char * pszFileName, long * plJulian, long * plMillisec )
|
||||
{
|
||||
int i = s_fileFindDrv( pszFileName );
|
||||
|
||||
if( i >= 0 )
|
||||
return s_pFileTypes[ i ]->GetFileTime( pszFileName, plJulian, plMillisec );
|
||||
return s_pFileTypes[ i ]->TimeGet( pszFileName, plJulian, plMillisec );
|
||||
|
||||
return hb_fsGetFileTime( pszFileName, plJulian, plMillisec );
|
||||
}
|
||||
|
||||
HB_BOOL hb_fileSetFileTime( const char * pszFileName, long lJulian, long lMillisec )
|
||||
HB_BOOL hb_fileTimeSet( const char * pszFileName, long lJulian, long lMillisec )
|
||||
{
|
||||
int i = s_fileFindDrv( pszFileName );
|
||||
|
||||
if( i >= 0 )
|
||||
return s_pFileTypes[ i ]->SetFileTime( pszFileName, lJulian, lMillisec );
|
||||
return s_pFileTypes[ i ]->TimeSet( pszFileName, lJulian, lMillisec );
|
||||
|
||||
return hb_fsSetFileTime( pszFileName, lJulian, lMillisec );
|
||||
}
|
||||
|
||||
HB_BOOL hb_fileGetAttr( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
HB_BOOL hb_fileAttrGet( const char * pszFileName, HB_FATTR * pulAttr )
|
||||
{
|
||||
int i = s_fileFindDrv( pszFileName );
|
||||
|
||||
if( i >= 0 )
|
||||
return s_pFileTypes[ i ]->GetAttr( pszFileName, pulAttr );
|
||||
return s_pFileTypes[ i ]->AttrGet( pszFileName, pulAttr );
|
||||
|
||||
return hb_fsGetAttr( pszFileName, pulAttr );
|
||||
}
|
||||
|
||||
HB_BOOL hb_fileSetAttr( const char * pszFileName, HB_FATTR ulAttr )
|
||||
HB_BOOL hb_fileAttrSet( const char * pszFileName, HB_FATTR ulAttr )
|
||||
{
|
||||
int i = s_fileFindDrv( pszFileName );
|
||||
|
||||
if( i >= 0 )
|
||||
return s_pFileTypes[ i ]->SetAttr( pszFileName, ulAttr );
|
||||
return s_pFileTypes[ i ]->AttrSet( pszFileName, ulAttr );
|
||||
|
||||
return hb_fsSetAttr( pszFileName, ulAttr );
|
||||
}
|
||||
|
||||
@@ -105,8 +105,8 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest )
|
||||
{
|
||||
HB_FATTR ulAttr;
|
||||
|
||||
if( hb_fileGetAttr( pszSource, &ulAttr ) )
|
||||
hb_fileSetAttr( pszDest, ulAttr );
|
||||
if( hb_fileAttrGet( pszSource, &ulAttr ) )
|
||||
hb_fileAttrSet( pszDest, ulAttr );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -106,8 +106,8 @@ static void hb_fileReturn( PHB_FILE pFile )
|
||||
hb_ret();
|
||||
}
|
||||
|
||||
/* HB_XEXISTS( <cFileName>, [ @<cDestFileName> ] ) -> <lOK> */
|
||||
HB_FUNC( HB_XEXISTS )
|
||||
/* HB_VFEXISTS( <cFileName>, [ @<cDestFileName> ] ) -> <lOK> */
|
||||
HB_FUNC( HB_VFEXISTS )
|
||||
{
|
||||
const char * pszFileName = hb_parc( 1 );
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
@@ -133,8 +133,8 @@ HB_FUNC( HB_XEXISTS )
|
||||
hb_retl( fResult );
|
||||
}
|
||||
|
||||
/* HB_XERASE( <cFileName> ) -> <nResult> */
|
||||
HB_FUNC( HB_XERASE )
|
||||
/* HB_VFERASE( <cFileName> ) -> <nResult> */
|
||||
HB_FUNC( HB_VFERASE )
|
||||
{
|
||||
const char * pszFile = hb_parc( 1 );
|
||||
HB_ERRCODE uiError = 3;
|
||||
@@ -151,8 +151,8 @@ HB_FUNC( HB_XERASE )
|
||||
hb_retni( iResult );
|
||||
}
|
||||
|
||||
/* HB_XRENAME( <cFileSrc>, <cFileDst> ) -> <nResult> */
|
||||
HB_FUNC( HB_XRENAME )
|
||||
/* HB_VFRENAME( <cFileSrc>, <cFileDst> ) -> <nResult> */
|
||||
HB_FUNC( HB_VFRENAME )
|
||||
{
|
||||
const char * szFileOld = hb_parc( 1 ),
|
||||
* szFileNew = hb_parc( 2 );
|
||||
@@ -170,8 +170,8 @@ HB_FUNC( HB_XRENAME )
|
||||
hb_retni( iResult );
|
||||
}
|
||||
|
||||
/* HB_XCOPYFILE( <cFileSrc>, <cFileDst> ) -> <nResult> */
|
||||
HB_FUNC( HB_XCOPYFILE )
|
||||
/* HB_VFCOPYFILE( <cFileSrc>, <cFileDst> ) -> <nResult> */
|
||||
HB_FUNC( HB_VFCOPYFILE )
|
||||
{
|
||||
const char * pszSource = hb_parc( 1 ),
|
||||
* pszDestin = hb_parc( 2 );
|
||||
@@ -189,8 +189,8 @@ HB_FUNC( HB_XCOPYFILE )
|
||||
hb_retni( iResult );
|
||||
}
|
||||
|
||||
/* HB_XDIREXISTS( <cDirName> ) -> <lExists> */
|
||||
HB_FUNC( HB_XDIREXISTS )
|
||||
/* HB_VFDIREXISTS( <cDirName> ) -> <lExists> */
|
||||
HB_FUNC( HB_VFDIREXISTS )
|
||||
{
|
||||
const char * pszDirName = hb_parc( 1 );
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
@@ -206,8 +206,8 @@ HB_FUNC( HB_XDIREXISTS )
|
||||
hb_retl( fResult );
|
||||
}
|
||||
|
||||
/* HB_XDIRMAKE( <cDirName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_XDIRMAKE )
|
||||
/* HB_VFDIRMAKE( <cDirName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_VFDIRMAKE )
|
||||
{
|
||||
const char * pszDirName = hb_parc( 1 );
|
||||
HB_ERRCODE uiError = 2;
|
||||
@@ -224,8 +224,8 @@ HB_FUNC( HB_XDIRMAKE )
|
||||
hb_retni( iResult );
|
||||
}
|
||||
|
||||
/* HB_XDIRREMOVE( <cDirName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_XDIRREMOVE )
|
||||
/* HB_VFDIRREMOVE( <cDirName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_VFDIRREMOVE )
|
||||
{
|
||||
const char * pszDirName = hb_parc( 1 );
|
||||
HB_ERRCODE uiError = 2;
|
||||
@@ -242,15 +242,15 @@ HB_FUNC( HB_XDIRREMOVE )
|
||||
hb_retni( iResult );
|
||||
}
|
||||
|
||||
/* HB_XDIRECTORY( [ <cDirSpec> ], [ <cAttr> ] ) -> <aDirectory> */
|
||||
HB_FUNC( HB_XDIRECTORY )
|
||||
/* HB_VFDIRECTORY( [ <cDirSpec> ], [ <cAttr> ] ) -> <aDirectory> */
|
||||
HB_FUNC( HB_VFDIRECTORY )
|
||||
{
|
||||
hb_itemReturnRelease( hb_fileDirectory( hb_parc( 1 ), hb_parc( 2 ) ) );
|
||||
hb_fsSetFError( hb_fsError() );
|
||||
}
|
||||
|
||||
/* HB_XDIRSPACE( <cDirName>, [ <nInfoType> ] ) -> <nFreeSpace> */
|
||||
HB_FUNC( HB_XDIRSPACE )
|
||||
/* HB_VFDIRSPACE( <cDirName>, [ <nInfoType> ] ) -> <nFreeSpace> */
|
||||
HB_FUNC( HB_VFDIRSPACE )
|
||||
{
|
||||
HB_USHORT uiType = ( HB_USHORT ) hb_parnidef( 2, HB_DISK_AVAIL );
|
||||
|
||||
@@ -258,31 +258,31 @@ HB_FUNC( HB_XDIRSPACE )
|
||||
hb_fsSetFError( hb_fsError() );
|
||||
}
|
||||
|
||||
/* HB_XGETATTR( <cFileName>, @<nAttr> ) -> <lOK> */
|
||||
HB_FUNC( HB_XGETATTR )
|
||||
/* HB_VFATTRGET( <cFileName>, @<nAttr> ) -> <lOK> */
|
||||
HB_FUNC( HB_VFATTRGET )
|
||||
{
|
||||
HB_FATTR nAttr = 0;
|
||||
|
||||
hb_retl( hb_fileGetAttr( hb_parcx( 1 ), &nAttr ) );
|
||||
hb_retl( hb_fileAttrGet( hb_parcx( 1 ), &nAttr ) );
|
||||
hb_fsSetFError( hb_fsError() );
|
||||
|
||||
hb_stornl( nAttr, 2 );
|
||||
}
|
||||
|
||||
/* HB_XSETATTR( <cFileName>, <nAttr> ) -> <lOK> */
|
||||
HB_FUNC( HB_XSETATTR )
|
||||
/* HB_VFATTRSET( <cFileName>, <nAttr> ) -> <lOK> */
|
||||
HB_FUNC( HB_VFATTRSET )
|
||||
{
|
||||
hb_retl( hb_fileSetAttr( hb_parcx( 1 ), ( HB_FATTR ) hb_parnl( 2 ) ) );
|
||||
hb_retl( hb_fileAttrSet( hb_parcx( 1 ), ( HB_FATTR ) hb_parnl( 2 ) ) );
|
||||
hb_fsSetFError( hb_fsError() );
|
||||
}
|
||||
|
||||
/* HB_XGETDATETIME( <cFileName>, @<tsDateTime> ) -> <lOK> */
|
||||
HB_FUNC( HB_XGETDATETIME )
|
||||
/* HB_VFTIMEGET( <cFileName>, @<tsDateTime> ) -> <lOK> */
|
||||
HB_FUNC( HB_VFTIMEGET )
|
||||
{
|
||||
long lJulian, lMillisec;
|
||||
HB_BOOL fOK;
|
||||
|
||||
fOK = hb_fileGetFileTime( hb_parcx( 1 ), &lJulian, &lMillisec );
|
||||
fOK = hb_fileTimeGet( hb_parcx( 1 ), &lJulian, &lMillisec );
|
||||
hb_fsSetFError( hb_fsError() );
|
||||
|
||||
if( fOK )
|
||||
@@ -315,8 +315,8 @@ HB_FUNC( HB_XGETDATETIME )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XSETDATETIME( <cFileName>, <tsDateTime> ) -> <lOK> */
|
||||
HB_FUNC( HB_XSETDATETIME )
|
||||
/* HB_VFTIMESET( <cFileName>, <tsDateTime> ) -> <lOK> */
|
||||
HB_FUNC( HB_VFTIMESET )
|
||||
{
|
||||
long lDate = -1, lTime = -1;
|
||||
|
||||
@@ -334,12 +334,12 @@ HB_FUNC( HB_XSETDATETIME )
|
||||
}
|
||||
}
|
||||
|
||||
hb_retl( hb_fileSetFileTime( hb_parcx( 1 ), lDate, lTime ) );
|
||||
hb_retl( hb_fileTimeSet( hb_parcx( 1 ), lDate, lTime ) );
|
||||
hb_fsSetFError( hb_fsError() );
|
||||
}
|
||||
|
||||
/* HB_XLINK( <cExistingFileName>, <cNewFileName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_XLINK )
|
||||
/* HB_VFLINK( <cExistingFileName>, <cNewFileName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_VFLINK )
|
||||
{
|
||||
const char * pszExisting = hb_parc( 1 ), * pszNewFile = hb_parc( 2 );
|
||||
HB_ERRCODE uiError = 2;
|
||||
@@ -356,8 +356,8 @@ HB_FUNC( HB_XLINK )
|
||||
hb_retni( iResult );
|
||||
}
|
||||
|
||||
/* HB_XLINKSYM( <cTargetFileName>, <cNewFileName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_XLINKSYM )
|
||||
/* HB_VFLINKSYM( <cTargetFileName>, <cNewFileName> ) -> <nSuccess> */
|
||||
HB_FUNC( HB_VFLINKSYM )
|
||||
{
|
||||
const char * pszTarget = hb_parc( 1 ), * pszNewFile = hb_parc( 2 );
|
||||
HB_ERRCODE uiError = 2;
|
||||
@@ -374,8 +374,8 @@ HB_FUNC( HB_XLINKSYM )
|
||||
hb_retni( iResult );
|
||||
}
|
||||
|
||||
/* HB_XLINKREAD( <cFileName> ) -> <cDestFileName> | "" */
|
||||
HB_FUNC( HB_XLINKREAD )
|
||||
/* HB_VFLINKREAD( <cFileName> ) -> <cDestFileName> | "" */
|
||||
HB_FUNC( HB_VFLINKREAD )
|
||||
{
|
||||
const char * pszFile = hb_parc( 1 );
|
||||
char * pszResult = NULL;
|
||||
@@ -391,8 +391,8 @@ HB_FUNC( HB_XLINKREAD )
|
||||
hb_retc_buffer( pszResult );
|
||||
}
|
||||
|
||||
/* HB_XOPEN( [@]<cFileName>, [ <nModeAttr> ] ) -> <pHandle> | NIL */
|
||||
HB_FUNC( HB_XOPEN )
|
||||
/* HB_VFOPEN( [@]<cFileName>, [ <nModeAttr> ] ) -> <pHandle> | NIL */
|
||||
HB_FUNC( HB_VFOPEN )
|
||||
{
|
||||
const char * pszFile = hb_parc( 1 );
|
||||
|
||||
@@ -425,8 +425,8 @@ HB_FUNC( HB_XOPEN )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XCLOSE( <pHandle> ) -> <lOK> */
|
||||
HB_FUNC( HB_XCLOSE )
|
||||
/* HB_VFCLOSE( <pHandle> ) -> <lOK> */
|
||||
HB_FUNC( HB_VFCLOSE )
|
||||
{
|
||||
PHB_FILE * pFilePtr = hb_fileParamPtr( 1 );
|
||||
|
||||
@@ -440,8 +440,8 @@ HB_FUNC( HB_XCLOSE )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XLOCK( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <lOK> */
|
||||
HB_FUNC( HB_XLOCK )
|
||||
/* HB_VFLOCK( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <lOK> */
|
||||
HB_FUNC( HB_VFLOCK )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -463,8 +463,8 @@ HB_FUNC( HB_XLOCK )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XUNLOCK( <pHandle>, <nStart>, <nLen> ) -> <lOK> */
|
||||
HB_FUNC( HB_XUNLOCK )
|
||||
/* HB_VFUNLOCK( <pHandle>, <nStart>, <nLen> ) -> <lOK> */
|
||||
HB_FUNC( HB_VFUNLOCK )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -486,8 +486,8 @@ HB_FUNC( HB_XUNLOCK )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XLOCKTEST( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <nPID> | 0 (nolock) | -1 (err) */
|
||||
HB_FUNC( HB_XLOCKTEST )
|
||||
/* HB_VFLOCKTEST( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <nPID> | 0 (nolock) | -1 (err) */
|
||||
HB_FUNC( HB_VFLOCKTEST )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -509,8 +509,8 @@ HB_FUNC( HB_XLOCKTEST )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XREAD( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nTimeOut> ] ) -> <nRead> */
|
||||
HB_FUNC( HB_XREAD )
|
||||
/* HB_VFREAD( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nTimeOut> ] ) -> <nRead> */
|
||||
HB_FUNC( HB_VFREAD )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -540,8 +540,8 @@ HB_FUNC( HB_XREAD )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XWRITE( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nTimeOut> ] ) -> <nWritten> */
|
||||
HB_FUNC( HB_XWRITE )
|
||||
/* HB_VFWRITE( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nTimeOut> ] ) -> <nWritten> */
|
||||
HB_FUNC( HB_VFWRITE )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -571,8 +571,8 @@ HB_FUNC( HB_XWRITE )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XREADAT( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nAtOffset> ] ) -> <nRead> */
|
||||
HB_FUNC( HB_XREADAT )
|
||||
/* HB_VFREADAT( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nAtOffset> ] ) -> <nRead> */
|
||||
HB_FUNC( HB_VFREADAT )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -603,8 +603,8 @@ HB_FUNC( HB_XREADAT )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XWRITEAT( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nAtOffset> ] ) -> <nWritten> */
|
||||
HB_FUNC( HB_XWRITEAT )
|
||||
/* HB_VFWRITEAT( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nAtOffset> ] ) -> <nWritten> */
|
||||
HB_FUNC( HB_VFWRITEAT )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -635,8 +635,8 @@ HB_FUNC( HB_XWRITEAT )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XSEEK( <pHandle>, <nOffset>, [ <nWhence> ] ) -> <nOffset> */
|
||||
HB_FUNC( HB_XSEEK )
|
||||
/* HB_VFSEEK( <pHandle>, <nOffset>, [ <nWhence> ] ) -> <nOffset> */
|
||||
HB_FUNC( HB_VFSEEK )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -657,8 +657,8 @@ HB_FUNC( HB_XSEEK )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XTRUNC( <pHandle>, [ <nAtOffset> ] ) -> <lOK> */
|
||||
HB_FUNC( HB_XTRUNC )
|
||||
/* HB_VFTRUNC( <pHandle>, [ <nAtOffset> ] ) -> <lOK> */
|
||||
HB_FUNC( HB_VFTRUNC )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -669,8 +669,8 @@ HB_FUNC( HB_XTRUNC )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XSIZE( <pHandle> ) -> <nSize> */
|
||||
HB_FUNC( HB_XSIZE )
|
||||
/* HB_VFSIZE( <pHandle> ) -> <nSize> */
|
||||
HB_FUNC( HB_VFSIZE )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -681,8 +681,8 @@ HB_FUNC( HB_XSIZE )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XEOF( <pHandle> ) -> <lEOF> */
|
||||
HB_FUNC( HB_XEOF )
|
||||
/* HB_VFEOF( <pHandle> ) -> <lEOF> */
|
||||
HB_FUNC( HB_VFEOF )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -693,8 +693,8 @@ HB_FUNC( HB_XEOF )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XFLUSH( <pHandle>, [ <lDirtyOnly> ] ) -> NIL */
|
||||
HB_FUNC( HB_XFLUSH )
|
||||
/* HB_VFFLUSH( <pHandle>, [ <lDirtyOnly> ] ) -> NIL */
|
||||
HB_FUNC( HB_VFFLUSH )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -705,8 +705,8 @@ HB_FUNC( HB_XFLUSH )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XCOMMIT( <pHandle> ) -> NIL */
|
||||
HB_FUNC( HB_XCOMMIT )
|
||||
/* HB_VFCOMMIT( <pHandle> ) -> NIL */
|
||||
HB_FUNC( HB_VFCOMMIT )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -717,8 +717,8 @@ HB_FUNC( HB_XCOMMIT )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XCONFIG( <pHandle>, <nSet>, [ <nParam> ] ) -> <nResult> */
|
||||
HB_FUNC( HB_XCONFIG )
|
||||
/* HB_VFCONFIG( <pHandle>, <nSet>, [ <nParam> ] ) -> <nResult> */
|
||||
HB_FUNC( HB_VFCONFIG )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -737,8 +737,8 @@ HB_FUNC( HB_XCONFIG )
|
||||
}
|
||||
}
|
||||
|
||||
/* HB_XHANDLE( <pHandle> ) -> <nOsHandle> */
|
||||
HB_FUNC( HB_XHANDLE )
|
||||
/* HB_VFHANDLE( <pHandle> ) -> <nOsHandle> */
|
||||
HB_FUNC( HB_VFHANDLE )
|
||||
{
|
||||
PHB_FILE pFile = hb_fileParam( 1 );
|
||||
|
||||
@@ -746,8 +746,8 @@ HB_FUNC( HB_XHANDLE )
|
||||
hb_retnint( ( HB_NHANDLE ) hb_fileHandle( pFile ) );
|
||||
}
|
||||
|
||||
/* HB_XTEMPFILE( @<cFileName>, [ <cDir> ], [ <cPrefix> ], [ <cExt> ], [ <nAttr> ] ) -> <pHandle> | NIL */
|
||||
HB_FUNC( HB_XTEMPFILE )
|
||||
/* HB_VFTEMPFILE( @<cFileName>, [ <cDir> ], [ <cPrefix> ], [ <cExt> ], [ <nAttr> ] ) -> <pHandle> | NIL */
|
||||
HB_FUNC( HB_VFTEMPFILE )
|
||||
{
|
||||
char szName[ HB_PATH_MAX ];
|
||||
|
||||
Reference in New Issue
Block a user