20000322-02:25 GMT+1 Victor Szakats <info@szelvesz.hu>
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
20000322-02:25 GMT+1 Victor Szakats <info@szelvesz.hu>
|
||||
* include/fileio.ch
|
||||
include/hbapi.h
|
||||
include/hbapifs.h
|
||||
source/rtl/diskspac.c
|
||||
source/tools/io.c
|
||||
* hb_DiskSpace() renamed to hb_fsDiskSpace() and moved the FS API header.
|
||||
* HB_DISK_* constants moved to fileio.ch
|
||||
+ Added a new parameter to the Harbour level DISKSPACE() function to
|
||||
enable access to the new features. This is a Harbour extenstion.
|
||||
! DISKSPACE() (and the IO.C versions) use hb_retnlen() instead of
|
||||
hb_retnd().
|
||||
! CD(), RD(), MD() are now using the FS API, so they are now working
|
||||
on more platforms.
|
||||
|
||||
20000321-19:58 EST Paul Tucker <ptucker@sympatico.ca>
|
||||
* source/rtl/diskspac.c
|
||||
* Borland does not see the unnamed struct that is part of ULARGE_INT.
|
||||
@@ -23,7 +38,7 @@
|
||||
* DiskSpace() calls hb_diskSpace()
|
||||
* source/tools/io.c
|
||||
* DiskFree(), DiskUsed, DiskFull() now call hb_DiskSpace()
|
||||
* include/hbapi.c
|
||||
* include/hbapi.h
|
||||
+ #define HB_DISK_....
|
||||
+ declaration for hb_DiskSpace()
|
||||
! Disk...() functions return a double.
|
||||
@@ -208,7 +223,8 @@
|
||||
source/rtl/stuff.c
|
||||
source/rtl/word.c
|
||||
- Superfluous #includes removed.
|
||||
20000320-23:00 GMT-3 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
|
||||
20000320-23:00 GMT-3 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
samples/cccppc/*.*
|
||||
! Removed contents from the CCCPPC dir
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
typedef PHB_ITEM ITEM;
|
||||
#ifndef CLIPPERDEFS
|
||||
typedef double XDOUBLE;
|
||||
typedef double XDOUBLE;
|
||||
#endif
|
||||
|
||||
/* Compatible defines */
|
||||
@@ -56,6 +56,8 @@ typedef double XDOUBLE;
|
||||
#define ALIAS IT_ALIAS
|
||||
#define MPTR IT_BYREF /* or'ed with type when passed by reference */
|
||||
#define MEMO IT_MEMO
|
||||
/* NOTE: CA-Cl*pper bug: WORD will conflict with the typedef with the same
|
||||
name in clipdefs.h [vszakats] */
|
||||
#define WORD ( IT_INTEGER | IT_LONG )
|
||||
#define ARRAY IT_ARRAY
|
||||
#define BLOCK IT_BLOCK
|
||||
@@ -92,3 +94,4 @@ typedef double XDOUBLE;
|
||||
#define _stornl hb_stornl
|
||||
|
||||
#endif /* _EXTEND_API */
|
||||
|
||||
|
||||
@@ -85,4 +85,11 @@
|
||||
/* File system error codes */
|
||||
#define F_ERROR ( -1 ) /* Unspecified error */
|
||||
|
||||
/* DISKSPACE() types */
|
||||
#define HB_DISK_FREE 1
|
||||
#define HB_DISK_AVAIL 2
|
||||
#define HB_DISK_TOTAL 4
|
||||
#define HB_DISK_USED 8
|
||||
|
||||
#endif /* _FILEIO_CH */
|
||||
|
||||
|
||||
@@ -97,13 +97,6 @@
|
||||
#define PCOUNT hb_pcount()
|
||||
#define ALENGTH( n ) hb_parinfa( n, 0 )
|
||||
|
||||
/* used by DiskSpace(), etc. */
|
||||
#define HB_DISK_FREE 1
|
||||
#define HB_DISK_AVAIL 2
|
||||
#define HB_DISK_TOTAL 4
|
||||
#define HB_DISK_USED 8
|
||||
extern double hb_DiskSpace( USHORT, USHORT );
|
||||
|
||||
/* forward declarations */
|
||||
struct _HB_CODEBLOCK;
|
||||
struct _HB_BASEARRAY;
|
||||
|
||||
@@ -86,6 +86,7 @@ extern BYTE * hb_fsCurDir ( USHORT uiDrive );
|
||||
extern USHORT hb_fsCurDirBuff ( USHORT uiDrive, BYTE * pbyBuffer, ULONG ulLen );
|
||||
extern BYTE hb_fsCurDrv ( void );
|
||||
extern int hb_fsDelete ( BYTE * pszFileName );
|
||||
extern double hb_fsDiskSpace ( USHORT uiDrive, USHORT uiType );
|
||||
extern USHORT hb_fsError ( void );
|
||||
extern BOOL hb_fsFile ( BYTE * pszFileName );
|
||||
extern ULONG hb_fsFSize ( BYTE * pszFileName, BOOL bUseDirEntry );
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
#include <dos.h>
|
||||
#endif
|
||||
|
||||
double hb_DiskSpace( USHORT uiDrive, USHORT uiType )
|
||||
double hb_fsDiskSpace( USHORT uiDrive, USHORT uiType )
|
||||
{
|
||||
double dSpace = 0.0;
|
||||
|
||||
@@ -93,6 +93,7 @@ double hb_DiskSpace( USHORT uiDrive, USHORT uiType )
|
||||
( double ) disk.bytes_per_sector );
|
||||
break;
|
||||
}
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
dSpace -= ( double ) disk.avail_clusters *
|
||||
( double ) disk.sectors_per_cluster *
|
||||
@@ -157,15 +158,15 @@ double hb_DiskSpace( USHORT uiDrive, USHORT uiType )
|
||||
|
||||
dSpace = ( double ) i64RetVal.u.HighPart +
|
||||
( double ) i64RetVal.u.HighPart *
|
||||
( double ) 0xffffffff ;
|
||||
dSpace += ( double ) i64RetVal.u.LowPart ;
|
||||
( double ) 0xFFFFFFFF;
|
||||
dSpace += ( double ) i64RetVal.u.LowPart;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
{
|
||||
dSpace -= ( double ) i64FreeBytes.u.HighPart +
|
||||
( double ) i64FreeBytes.u.HighPart *
|
||||
( double ) 0xffffffff ;
|
||||
dSpace -= ( double ) i64FreeBytes.u.LowPart ;
|
||||
( double ) 0xFFFFFFFF;
|
||||
dSpace -= ( double ) i64FreeBytes.u.LowPart;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,8 +219,12 @@ double hb_DiskSpace( USHORT uiDrive, USHORT uiType )
|
||||
return dSpace;
|
||||
}
|
||||
|
||||
/* NOTE: The second parameter is a Harbour extension, check fileio.ch for
|
||||
the possible values. */
|
||||
|
||||
HB_FUNC( DISKSPACE )
|
||||
{
|
||||
hb_retnd( hb_DiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_AVAIL ));
|
||||
hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0,
|
||||
ISNUM( 2 ) ? hb_parni( 2 ) : HB_DISK_AVAIL ), -1, 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -3,53 +3,35 @@
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
#if defined(HB_OS_DOS)
|
||||
#include <dos.h>
|
||||
#include <dir.h>
|
||||
#include <bios.h>
|
||||
#endif
|
||||
#include "hbapifs.h"
|
||||
|
||||
HB_FUNC( CD )
|
||||
{
|
||||
#if defined(HB_OS_DOS)
|
||||
hb_retni( ISCHAR( 1 ) ? chdir( hb_parc( 1 ) ) : 0 );
|
||||
#else
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
hb_retni( ISCHAR( 1 ) ? hb_fsChDir( ( BYTE * ) hb_parc( 1 ) ) : 0 );
|
||||
}
|
||||
|
||||
HB_FUNC( MD )
|
||||
{
|
||||
#if defined(HB_OS_DOS)
|
||||
hb_retni( ISCHAR( 1 ) ? mkdir( hb_parc( 1 ) ) : 0 );
|
||||
#else
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
hb_retni( ISCHAR( 1 ) ? hb_fsMkDir( ( BYTE * ) hb_parc( 1 ) ) : 0 );
|
||||
}
|
||||
|
||||
HB_FUNC( RD )
|
||||
{
|
||||
#if defined(HB_OS_DOS)
|
||||
hb_retni( ISCHAR( 1 ) ? rmdir( hb_parc( 1 ) ) : 0 );
|
||||
#else
|
||||
hb_retni( 0 );
|
||||
#endif
|
||||
hb_retni( ISCHAR( 1 ) ? hb_fsRmDir( ( BYTE * ) hb_parc( 1 ) ) : 0 );
|
||||
}
|
||||
|
||||
HB_FUNC( DISKUSED )
|
||||
{
|
||||
hb_retnd( hb_DiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_USED ));
|
||||
hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_USED ), -1, 0 );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( DISKFREE )
|
||||
{
|
||||
hb_retnd( hb_DiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_FREE ));
|
||||
hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_FREE ), -1, 0 );
|
||||
}
|
||||
|
||||
|
||||
HB_FUNC( DISKFULL )
|
||||
{
|
||||
hb_retnd( hb_DiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_TOTAL ));
|
||||
hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_TOTAL ), -1, 0 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user