20000409-03:48 GMT+1 Victor Szakats <info@szelvesz.hu>
This commit is contained in:
@@ -1,3 +1,39 @@
|
||||
20000409-03:48 GMT+1 Victor Szakats <info@szelvesz.hu>
|
||||
|
||||
* source/rtl/gtcrs/gtcrs.c
|
||||
! New functions made static
|
||||
|
||||
* source/compiler/cmdcheck.c
|
||||
* Some copyright info arrangment.
|
||||
|
||||
* source/common/hbver.c
|
||||
% hb_verCompiler() some optimizations and streamlining mainly around
|
||||
GCC flavours.
|
||||
+ MS "Visual" detection.
|
||||
|
||||
* source/vm/fm.c
|
||||
* include/hbsetup.h
|
||||
* HB_FM_STATISTICS moved to the setup header.
|
||||
|
||||
* contrib/linux/gcc.cf
|
||||
- Removed -g from the default C switches to be in sync with the other
|
||||
platforms.
|
||||
|
||||
* source/rtl/diskspac.c
|
||||
% Some code made common, platform specific code put in blocks.
|
||||
|
||||
* contrib/rdd_ads/ace32.h
|
||||
! Fix for Win32 GCC
|
||||
|
||||
* source/vm/hvm.c
|
||||
* Static and global initialization all made in the startup function.
|
||||
|
||||
* doc/whatsnew.txt
|
||||
+ Added missing version header
|
||||
|
||||
* source/rtl/strcase.c
|
||||
* Minor format.
|
||||
|
||||
20000408-14:38 DST Paul Tucker <ptucker@sympatico.ca>
|
||||
* source/rtl/strcase.c
|
||||
* some compilers impliment toupper() as a macro, so toupper( pSrc++ )
|
||||
|
||||
@@ -13,7 +13,7 @@ CC = gcc
|
||||
CC_IN = -c
|
||||
CC_OUT = -o
|
||||
CPPFLAGS = -I. -I$(HB_INC_COMPILE)
|
||||
CFLAGS = -Wall -g
|
||||
CFLAGS = -Wall
|
||||
|
||||
LD = gcc
|
||||
LD_OUT = -o
|
||||
|
||||
@@ -31,7 +31,9 @@ typedef double DOUBLE;
|
||||
#define EXTERN extern
|
||||
#define STATIC static
|
||||
|
||||
#if defined( WIN32 ) && !defined( ASANT ) && !defined( __BORLANDC__ )
|
||||
#if defined( __GNUC__ )
|
||||
#define ENTRYPOINT __attribute__ (( dllexport ))
|
||||
#elif defined( WIN32 ) && !defined( ASANT ) && !defined( __BORLANDC__ )
|
||||
#define ENTRYPOINT _declspec( dllexport ) WINAPI
|
||||
#elif defined( ASANLM ) || defined( ASANT )
|
||||
#define ENTRYPOINT
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Version 0.33 Build 33 (2000-04-07)
|
||||
|
||||
- Final cleanups on global macro and symbol names.
|
||||
(date*(), console*(), HB_FUNC())
|
||||
- DISKSPACE() enhancements
|
||||
|
||||
@@ -81,6 +81,20 @@
|
||||
*/
|
||||
/*#define HARBOUR_YYDEBUG*/
|
||||
|
||||
/* ***********************************************************************
|
||||
* If you turn this on, the memory subsystem will collect trace information
|
||||
* and several statistical data about memory management, it will show
|
||||
* these on exit if memory seem to have been leaked. The memory subsystem
|
||||
* will also do pointer checks. [vszakats]
|
||||
* This should be normally turned off in a final release.
|
||||
*
|
||||
* Note that if you turn this on, Harbour will be slighlty slower, larger
|
||||
* and will consume more memory.
|
||||
*
|
||||
* By default this is turned on.
|
||||
*/
|
||||
#define HB_FM_STATISTICS
|
||||
|
||||
/* ***********************************************************************
|
||||
* This symbol defines if we are trying to compile using GCC for OS/2
|
||||
*
|
||||
|
||||
@@ -317,6 +317,17 @@ char * hb_verCompiler( void )
|
||||
iVerMajor /= 100;
|
||||
iVerMinor = iVerMajor % 100;
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
#if (_MSC_VER >= 800)
|
||||
pszName = "Microsoft Visual C/C++";
|
||||
#else
|
||||
pszName = "Microsoft C/C++";
|
||||
#endif
|
||||
|
||||
iVerMajor = _MSC_VER / 100;
|
||||
iVerMinor = _MSC_VER % 100;
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
|
||||
pszName = "Borland C++";
|
||||
@@ -337,12 +348,6 @@ char * hb_verCompiler( void )
|
||||
iVerMajor = __TURBOC__ >> 8;
|
||||
iVerMinor = __TURBOC__ & 0xFF;
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
|
||||
pszName = "Microsoft C/C++";
|
||||
iVerMajor = _MSC_VER / 100;
|
||||
iVerMinor = _MSC_VER % 100;
|
||||
|
||||
#elif defined(__MPW__)
|
||||
|
||||
pszName = "MPW C";
|
||||
@@ -355,31 +360,18 @@ char * hb_verCompiler( void )
|
||||
iVerMajor = __WATCOMC__ / 100;
|
||||
iVerMinor = __WATCOMC__ % 100;
|
||||
|
||||
#elif defined(__DJGPP__)
|
||||
|
||||
pszName = "Delorie GCC";
|
||||
iVerMajor = __GNUC__;
|
||||
iVerMinor = __GNUC_MINOR__;
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
|
||||
pszName = "Cygnus GCC (Cygwin)";
|
||||
iVerMajor = __GNUC__;
|
||||
iVerMinor = __GNUC_MINOR__;
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
|
||||
pszName = hb_xgrab( 80 );
|
||||
sprintf( pszName, "Cygnus GCC (Mingw32 %g)", __MINGW32__ );
|
||||
iVerMajor = __GNUC__;
|
||||
iVerMinor = __GNUC_MINOR__;
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
#if defined(__EMX__)
|
||||
pszName = "GNU C/EMX C";
|
||||
#if defined(__DJGPP__)
|
||||
pszName = "Delorie GCC";
|
||||
#elif defined(__CYGWIN__)
|
||||
pszName = "Cygnus Cygwin GCC";
|
||||
#elif defined(__MINGW32__)
|
||||
pszName = "Cygnus Mingw32 GCC";
|
||||
#elif defined(__EMX__)
|
||||
pszName = "EMX GCC";
|
||||
#else
|
||||
pszName = "GNU C";
|
||||
pszName = "GCC";
|
||||
#endif
|
||||
|
||||
iVerMajor = __GNUC__;
|
||||
@@ -396,11 +388,7 @@ char * hb_verCompiler( void )
|
||||
if( pszName )
|
||||
sprintf( pszCompiler, "%s %d.%d", pszName, iVerMajor, iVerMinor );
|
||||
else
|
||||
pszCompiler[ 0 ] = '\0';
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
hb_xfree( pszName );
|
||||
#endif
|
||||
strcpy( pszCompiler, "(unknown)" );
|
||||
|
||||
return pszCompiler;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* Compiler command line and HARBOURCMD/CLIPPERCMD checking
|
||||
*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -37,13 +37,14 @@
|
||||
* The following parts are Copyright of the individual authors.
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* hb_compChkCompilerSwitch()
|
||||
* hb_compChkEnvironVar()
|
||||
* hb_compChkPaths()
|
||||
* AddSearchPath()
|
||||
*
|
||||
* Copyright 1999 Victor Szakats <info@szelvesz.hu>
|
||||
* PackDateTime()
|
||||
* hb_compChkDefineSwitch()
|
||||
* hb_compChkDefines()
|
||||
*
|
||||
* See doc/license.txt for licensing terms.
|
||||
*
|
||||
|
||||
@@ -73,261 +73,264 @@ HB_FUNC( DISKSPACE )
|
||||
USHORT uiType = ISNUM( 2 ) ? hb_parni( 2 ) : HB_DISK_AVAIL;
|
||||
double dSpace = 0.0;
|
||||
|
||||
if( uiType > HB_DISK_TOTAL )
|
||||
uiType = HB_DISK_TOTAL;
|
||||
|
||||
#if defined(HB_OS_DOS) || defined(__WATCOMC__)
|
||||
|
||||
struct diskfree_t disk;
|
||||
unsigned uiResult;
|
||||
|
||||
uiType = HB_MIN( uiType, HB_DISK_TOTAL );
|
||||
|
||||
while( ( uiResult = _dos_getdiskfree( uiDrive, &disk ) ) != 0 )
|
||||
{
|
||||
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
|
||||
|
||||
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
|
||||
but if you should wish to make it so, then or EF_CANRETRY with
|
||||
EF_CANDEFAULT above)
|
||||
*/
|
||||
|
||||
if( uiAction != E_RETRY )
|
||||
break;
|
||||
}
|
||||
|
||||
if( uiResult != 0 )
|
||||
{
|
||||
switch( uiType )
|
||||
struct diskfree_t disk;
|
||||
unsigned uiResult;
|
||||
|
||||
while( ( uiResult = _dos_getdiskfree( uiDrive, &disk ) ) != 0 )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
case HB_DISK_FREE:
|
||||
dSpace = ( double ) disk.avail_clusters *
|
||||
( double ) disk.sectors_per_cluster *
|
||||
( double ) disk.bytes_per_sector;
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
dSpace = ( double ) disk.total_clusters *
|
||||
( double ) disk.sectors_per_cluster *
|
||||
( double ) disk.bytes_per_sector;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
dSpace -= ( double ) disk.avail_clusters *
|
||||
( double ) disk.sectors_per_cluster *
|
||||
( double ) disk.bytes_per_sector;
|
||||
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
|
||||
|
||||
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
|
||||
but if you should wish to make it so, then or EF_CANRETRY with
|
||||
EF_CANDEFAULT above)
|
||||
*/
|
||||
|
||||
if( uiAction != E_RETRY )
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if( uiResult != 0 )
|
||||
{
|
||||
switch( uiType )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
case HB_DISK_FREE:
|
||||
dSpace = ( double ) disk.avail_clusters *
|
||||
( double ) disk.sectors_per_cluster *
|
||||
( double ) disk.bytes_per_sector;
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
dSpace = ( double ) disk.total_clusters *
|
||||
( double ) disk.sectors_per_cluster *
|
||||
( double ) disk.bytes_per_sector;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
dSpace -= ( double ) disk.avail_clusters *
|
||||
( double ) disk.sectors_per_cluster *
|
||||
( double ) disk.bytes_per_sector;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(HB_OS_WIN_32)
|
||||
|
||||
uiType = HB_MIN( uiType, HB_DISK_TOTAL );
|
||||
|
||||
while( TRUE )
|
||||
{
|
||||
|
||||
typedef BOOL (WINAPI *P_GDFSE)(LPCTSTR, PULARGE_INTEGER,
|
||||
PULARGE_INTEGER, PULARGE_INTEGER);
|
||||
|
||||
char szPath[ 4 ];
|
||||
P_GDFSE pGetDiskFreeSpaceEx;
|
||||
UINT uiErrMode;
|
||||
|
||||
/* Get the default drive */
|
||||
|
||||
if( uiDrive == 0 )
|
||||
while( TRUE )
|
||||
{
|
||||
USHORT uiErrorOld = hb_fsError();
|
||||
|
||||
uiDrive = hb_fsCurDrv() + 1;
|
||||
|
||||
hb_fsSetError( uiErrorOld );
|
||||
}
|
||||
|
||||
szPath[ 0 ] = uiDrive + 'A' - 1;
|
||||
szPath[ 1 ] = ':';
|
||||
szPath[ 2 ] = '\\';
|
||||
szPath[ 3 ] = '\0';
|
||||
|
||||
uiErrMode = SetErrorMode( SEM_FAILCRITICALERRORS );
|
||||
|
||||
SetLastError( 0 );
|
||||
|
||||
pGetDiskFreeSpaceEx = ( P_GDFSE ) GetProcAddress( GetModuleHandle( "kernel32.dll" ),
|
||||
"GetDiskFreeSpaceExA");
|
||||
|
||||
if( pGetDiskFreeSpaceEx )
|
||||
{
|
||||
ULARGE_INTEGER i64FreeBytesToCaller,
|
||||
i64TotalBytes,
|
||||
i64FreeBytes,
|
||||
i64RetVal;
|
||||
|
||||
if( pGetDiskFreeSpaceEx( szPath,
|
||||
( PULARGE_INTEGER ) &i64FreeBytesToCaller,
|
||||
( PULARGE_INTEGER ) &i64TotalBytes,
|
||||
( PULARGE_INTEGER ) &i64FreeBytes ) )
|
||||
typedef BOOL (WINAPI *P_GDFSE)(LPCTSTR, PULARGE_INTEGER,
|
||||
PULARGE_INTEGER, PULARGE_INTEGER);
|
||||
|
||||
char szPath[ 4 ];
|
||||
P_GDFSE pGetDiskFreeSpaceEx;
|
||||
UINT uiErrMode;
|
||||
|
||||
/* Get the default drive */
|
||||
|
||||
if( uiDrive == 0 )
|
||||
{
|
||||
switch( uiType )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
memcpy( &i64RetVal, &i64FreeBytesToCaller, sizeof( ULARGE_INTEGER ) );
|
||||
break;
|
||||
|
||||
case HB_DISK_FREE:
|
||||
memcpy( &i64RetVal, &i64FreeBytes, sizeof( ULARGE_INTEGER ) );
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
memcpy( &i64RetVal, &i64TotalBytes, sizeof( ULARGE_INTEGER ) );
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) || defined(_MSC_VER)
|
||||
|
||||
dSpace = ( double ) i64RetVal.LowPart +
|
||||
( double ) i64RetVal.HighPart +
|
||||
( double ) i64RetVal.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
{
|
||||
dSpace -= ( double ) i64FreeBytes.LowPart +
|
||||
( double ) i64FreeBytes.HighPart +
|
||||
( double ) i64FreeBytes.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* NOTE: Borland doesn't seem to deal with the un-named
|
||||
struct that is part of ULARGE_INTEGER
|
||||
[pt] */
|
||||
|
||||
dSpace = ( double ) i64RetVal.u.LowPart +
|
||||
( double ) i64RetVal.u.HighPart +
|
||||
( double ) i64RetVal.u.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
{
|
||||
dSpace -= ( double ) i64FreeBytes.u.LowPart +
|
||||
( double ) i64FreeBytes.u.HighPart +
|
||||
( double ) i64FreeBytes.u.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
#endif
|
||||
USHORT uiErrorOld = hb_fsError();
|
||||
|
||||
uiDrive = hb_fsCurDrv() + 1;
|
||||
|
||||
hb_fsSetError( uiErrorOld );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DWORD dwSectorsPerCluster;
|
||||
DWORD dwBytesPerSector;
|
||||
DWORD dwNumberOfFreeClusters;
|
||||
DWORD dwTotalNumberOfClusters;
|
||||
|
||||
|
||||
szPath[ 0 ] = uiDrive + 'A' - 1;
|
||||
szPath[ 1 ] = ':';
|
||||
szPath[ 2 ] = '\\';
|
||||
szPath[ 3 ] = '\0';
|
||||
|
||||
uiErrMode = SetErrorMode( SEM_FAILCRITICALERRORS );
|
||||
|
||||
SetLastError( 0 );
|
||||
|
||||
if( GetDiskFreeSpace( szPath,
|
||||
&dwSectorsPerCluster,
|
||||
&dwBytesPerSector,
|
||||
&dwNumberOfFreeClusters,
|
||||
&dwTotalNumberOfClusters ) )
|
||||
|
||||
pGetDiskFreeSpaceEx = ( P_GDFSE ) GetProcAddress( GetModuleHandle( "kernel32.dll" ),
|
||||
"GetDiskFreeSpaceExA");
|
||||
|
||||
if( pGetDiskFreeSpaceEx )
|
||||
{
|
||||
switch( uiType )
|
||||
ULARGE_INTEGER i64FreeBytesToCaller,
|
||||
i64TotalBytes,
|
||||
i64FreeBytes,
|
||||
i64RetVal;
|
||||
|
||||
if( pGetDiskFreeSpaceEx( szPath,
|
||||
( PULARGE_INTEGER ) &i64FreeBytesToCaller,
|
||||
( PULARGE_INTEGER ) &i64TotalBytes,
|
||||
( PULARGE_INTEGER ) &i64FreeBytes ) )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
case HB_DISK_FREE:
|
||||
dSpace = ( double ) dwNumberOfFreeClusters *
|
||||
( double ) dwSectorsPerCluster *
|
||||
( double ) dwBytesPerSector;
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
dSpace = ( double ) dwTotalNumberOfClusters *
|
||||
( double ) dwSectorsPerCluster *
|
||||
( double ) dwBytesPerSector;
|
||||
|
||||
switch( uiType )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
memcpy( &i64RetVal, &i64FreeBytesToCaller, sizeof( ULARGE_INTEGER ) );
|
||||
break;
|
||||
|
||||
case HB_DISK_FREE:
|
||||
memcpy( &i64RetVal, &i64FreeBytes, sizeof( ULARGE_INTEGER ) );
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
memcpy( &i64RetVal, &i64TotalBytes, sizeof( ULARGE_INTEGER ) );
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) || defined(_MSC_VER)
|
||||
|
||||
dSpace = ( double ) i64RetVal.LowPart +
|
||||
( double ) i64RetVal.HighPart +
|
||||
( double ) i64RetVal.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
dSpace -= ( double ) dwNumberOfFreeClusters *
|
||||
{
|
||||
dSpace -= ( double ) i64FreeBytes.LowPart +
|
||||
( double ) i64FreeBytes.HighPart +
|
||||
( double ) i64FreeBytes.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* NOTE: Borland doesn't seem to deal with the un-named
|
||||
struct that is part of ULARGE_INTEGER
|
||||
[pt] */
|
||||
|
||||
dSpace = ( double ) i64RetVal.u.LowPart +
|
||||
( double ) i64RetVal.u.HighPart +
|
||||
( double ) i64RetVal.u.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
{
|
||||
dSpace -= ( double ) i64FreeBytes.u.LowPart +
|
||||
( double ) i64FreeBytes.u.HighPart +
|
||||
( double ) i64FreeBytes.u.HighPart *
|
||||
( double ) 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DWORD dwSectorsPerCluster;
|
||||
DWORD dwBytesPerSector;
|
||||
DWORD dwNumberOfFreeClusters;
|
||||
DWORD dwTotalNumberOfClusters;
|
||||
|
||||
SetLastError( 0 );
|
||||
|
||||
if( GetDiskFreeSpace( szPath,
|
||||
&dwSectorsPerCluster,
|
||||
&dwBytesPerSector,
|
||||
&dwNumberOfFreeClusters,
|
||||
&dwTotalNumberOfClusters ) )
|
||||
{
|
||||
switch( uiType )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
case HB_DISK_FREE:
|
||||
dSpace = ( double ) dwNumberOfFreeClusters *
|
||||
( double ) dwSectorsPerCluster *
|
||||
( double ) dwBytesPerSector;
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
dSpace = ( double ) dwTotalNumberOfClusters *
|
||||
( double ) dwSectorsPerCluster *
|
||||
( double ) dwBytesPerSector;
|
||||
break;
|
||||
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
dSpace -= ( double ) dwNumberOfFreeClusters *
|
||||
( double ) dwSectorsPerCluster *
|
||||
( double ) dwBytesPerSector;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SetErrorMode( uiErrMode );
|
||||
|
||||
if( GetLastError() != 0 )
|
||||
{
|
||||
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
|
||||
|
||||
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
|
||||
but if you should wish to make it so, then or EF_CANRETRY
|
||||
with EF_CANDEFAULT above)
|
||||
*/
|
||||
|
||||
if( uiAction == E_RETRY )
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
SetErrorMode( uiErrMode );
|
||||
|
||||
if( GetLastError() != 0 )
|
||||
{
|
||||
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
|
||||
|
||||
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
|
||||
but if you should wish to make it so, then or EF_CANRETRY
|
||||
with EF_CANDEFAULT above)
|
||||
*/
|
||||
|
||||
if( uiAction == E_RETRY )
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
#elif defined(HB_OS_OS2)
|
||||
|
||||
struct _FSALLOCATE fsa;
|
||||
USHORT rc;
|
||||
|
||||
uiType = HB_MIN( uiType, HB_DISK_TOTAL );
|
||||
|
||||
/* Query level 1 info from filesystem */
|
||||
while( ( rc = DosQueryFSInfo(uiDrive, 1, &fsa, sizeof(fsa)) ) != 0 )
|
||||
{
|
||||
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
|
||||
|
||||
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
|
||||
but if you should wish to make it so, then or EF_CANRETRY with
|
||||
EF_CANDEFAULT above)
|
||||
*/
|
||||
|
||||
if( uiAction != E_RETRY )
|
||||
break;
|
||||
}
|
||||
|
||||
if(rc == 0)
|
||||
{
|
||||
switch( uiType )
|
||||
struct _FSALLOCATE fsa;
|
||||
USHORT rc;
|
||||
|
||||
/* Query level 1 info from filesystem */
|
||||
while( ( rc = DosQueryFSInfo( uiDrive, 1, &fsa, sizeof( fsa )) ) != 0 )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
case HB_DISK_FREE:
|
||||
dSpace = ( double ) fsa.cUnitAvail *
|
||||
( double ) fsa.cSectorUnit *
|
||||
( double ) fsa.cbSector;
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
dSpace = ( double ) fsa.cUnit *
|
||||
( double ) fsa.cSectorUnit *
|
||||
( double ) fsa.cbSector;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
dSpace -= ( double ) fsa.cUnitAvail *
|
||||
( double ) fsa.cSectorUnit *
|
||||
( double ) fsa.cbSector;
|
||||
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
|
||||
|
||||
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
|
||||
but if you should wish to make it so, then or EF_CANRETRY with
|
||||
EF_CANDEFAULT above)
|
||||
*/
|
||||
|
||||
if( uiAction != E_RETRY )
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if( rc == 0 )
|
||||
{
|
||||
switch( uiType )
|
||||
{
|
||||
case HB_DISK_AVAIL:
|
||||
case HB_DISK_FREE:
|
||||
dSpace = ( double ) fsa.cUnitAvail *
|
||||
( double ) fsa.cSectorUnit *
|
||||
( double ) fsa.cbSector;
|
||||
break;
|
||||
|
||||
case HB_DISK_USED:
|
||||
case HB_DISK_TOTAL:
|
||||
dSpace = ( double ) fsa.cUnit *
|
||||
( double ) fsa.cSectorUnit *
|
||||
( double ) fsa.cbSector;
|
||||
|
||||
if( uiType == HB_DISK_USED )
|
||||
dSpace -= ( double ) fsa.cUnitAvail *
|
||||
( double ) fsa.cSectorUnit *
|
||||
( double ) fsa.cbSector;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
HB_SYMBOL_UNUSED( uiDrive );
|
||||
HB_SYMBOL_UNUSED( uiType );
|
||||
{
|
||||
HB_SYMBOL_UNUSED( uiDrive );
|
||||
HB_SYMBOL_UNUSED( uiType );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@ static void gt_GetMaxRC(int* r, int* c);
|
||||
static void gt_GetRC(int* r, int* c);
|
||||
static void gt_SetRC(int r, int c);
|
||||
|
||||
void hb_gt_Add_terminfo_keymap( int, char * );
|
||||
void hb_gt_Add_keymap( int, char * );
|
||||
static void hb_gt_Add_terminfo_keymap( int, char * );
|
||||
static void hb_gt_Add_keymap( int, char * );
|
||||
|
||||
/* max number of characters in a keymapped string */
|
||||
#define HB_MAX_KEYMAP_CHARS 8
|
||||
@@ -570,7 +570,7 @@ USHORT hb_gt_DispCount()
|
||||
return s_uiDispCount;
|
||||
}
|
||||
|
||||
void hb_gt_Add_keymap( int InkeyCode, char *key_string )
|
||||
static void hb_gt_Add_keymap( int InkeyCode, char *key_string )
|
||||
{
|
||||
struct key_map_struc *keymap;
|
||||
int iLength = strlen( key_string );
|
||||
@@ -602,7 +602,7 @@ void hb_gt_Add_keymap( int InkeyCode, char *key_string )
|
||||
}
|
||||
}
|
||||
|
||||
void hb_gt_Add_terminfo_keymap( int InkeyCode, char *capname )
|
||||
static void hb_gt_Add_terminfo_keymap( int InkeyCode, char *capname )
|
||||
{
|
||||
char * code;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ char * hb_strncpyUpper( char * pDest, const char * pSource, ULONG ulLen )
|
||||
{
|
||||
/* some compilers impliment toupper as a macro, and this has side effects! */
|
||||
/* *pDest++ = toupper( *pSource++ ); */
|
||||
pDest[ulLen] = toupper( pSource[ulLen] );
|
||||
pDest[ ulLen ] = toupper( pSource[ ulLen ] );
|
||||
}
|
||||
|
||||
return pDest;
|
||||
|
||||
@@ -49,13 +49,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* NOTE: If you turn this on, the memory subsystem will collect information
|
||||
and several statistical data about memory management, it will show
|
||||
these on exit if memory seem to have been leaked.
|
||||
This should be normally turned off in a final release
|
||||
[vszakats] */
|
||||
#define HB_FM_STATISTICS
|
||||
|
||||
#define HB_OS_WIN_32_USED
|
||||
|
||||
#ifndef __MPW__
|
||||
|
||||
@@ -210,16 +210,16 @@ HB_SYMB hb_symEval = { "__EVAL", HB_FS_PUBLIC, hb_vmDoBlock, NULL }; /* symbol
|
||||
static HB_ITEM s_aStatics; /* Harbour array to hold all application statics variables */
|
||||
static PHB_SYMB s_pSymStart = NULL; /* start symbol of the application. MAIN() is not required */
|
||||
static PSYMBOLS s_pSymbols = NULL; /* to hold a linked list of all different modules symbol tables */
|
||||
static BYTE s_byErrorLevel = 0; /* application exit errorlevel */
|
||||
static BYTE s_byErrorLevel; /* application exit errorlevel */
|
||||
|
||||
static BOOL s_bDebugging = FALSE;
|
||||
static BOOL s_bDebugShowLines = FALSE; /* update source code line on the debugger display */
|
||||
static BOOL s_bDebuggerIsWorking = FALSE; /* to know when __DBGENTRY is beeing invoked */
|
||||
static BOOL s_bDebugging;
|
||||
static BOOL s_bDebugShowLines; /* update source code line on the debugger display */
|
||||
static BOOL s_bDebuggerIsWorking; /* to know when __DBGENTRY is beeing invoked */
|
||||
|
||||
/* Stores the position on the stack of current SEQUENCE envelope or 0 if no
|
||||
* SEQUENCE is active
|
||||
*/
|
||||
static LONG s_lRecoverBase = 0;
|
||||
static LONG s_lRecoverBase;
|
||||
#define HB_RECOVER_STATE -1
|
||||
#define HB_RECOVER_BASE -2
|
||||
#define HB_RECOVER_ADDRESS -3
|
||||
@@ -227,7 +227,7 @@ static LONG s_lRecoverBase = 0;
|
||||
|
||||
/* Request for some action - stop processing of opcodes
|
||||
*/
|
||||
static USHORT s_uiActionRequest = 0;
|
||||
static USHORT s_uiActionRequest;
|
||||
|
||||
/* application entry point */
|
||||
|
||||
@@ -236,7 +236,15 @@ void hb_vmInit( BOOL bStartMainProc )
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_vmInit()"));
|
||||
|
||||
/* initialize internal data structures */
|
||||
|
||||
s_aStatics.type = HB_IT_NIL;
|
||||
s_byErrorLevel = 0;
|
||||
s_bDebugging = FALSE;
|
||||
s_bDebugShowLines = FALSE;
|
||||
s_bDebuggerIsWorking = FALSE;
|
||||
s_lRecoverBase = 0;
|
||||
s_uiActionRequest = 0;
|
||||
|
||||
hb_stack.pItems = NULL; /* keep this here as it is used by fm.c */
|
||||
hb_stack.Return.type = HB_IT_NIL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user