From d4111b2b0a0c6ddd83083ea881c20caae8a09735 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 22 Mar 2000 15:35:35 +0000 Subject: [PATCH] 20000322-16:33 GMT+1 Victor Szakats --- harbour/ChangeLog | 49 +++++++++++ harbour/{include => contrib/hbclip}/hbclip.ch | 16 +--- harbour/contrib/hbclip/hbclip.prg | 52 ++++++++++++ harbour/contrib/hbclip/hbcolind.c | 85 +++++++++++++++++++ harbour/contrib/hbclip/hbkeyput.prg | 43 ++++++++++ harbour/contrib/hbclip/hbshadow.prg | 40 +++++++++ harbour/contrib/hbclip/hbstod.c | 43 ++++++++++ harbour/contrib/hbclip/hbvaltoc.prg | 48 +++++++++++ harbour/contrib/hbclip/make_clp.bat | 24 ++++++ harbour/contrib/hbclip/readme.txt | 22 +++++ harbour/include/hbapifs.h | 1 - harbour/makefile.bc | 23 +++-- harbour/makefile.vc | 22 ++++- harbour/source/rtl/diskspac.c | 18 ++-- harbour/source/tools/Makefile | 1 - harbour/source/tools/io.c | 37 -------- harbour/tests/tstdspac.prg | 10 ++- 17 files changed, 459 insertions(+), 75 deletions(-) rename harbour/{include => contrib/hbclip}/hbclip.ch (76%) create mode 100644 harbour/contrib/hbclip/hbclip.prg create mode 100644 harbour/contrib/hbclip/hbcolind.c create mode 100644 harbour/contrib/hbclip/hbkeyput.prg create mode 100644 harbour/contrib/hbclip/hbshadow.prg create mode 100644 harbour/contrib/hbclip/hbstod.c create mode 100644 harbour/contrib/hbclip/hbvaltoc.prg create mode 100644 harbour/contrib/hbclip/make_clp.bat create mode 100644 harbour/contrib/hbclip/readme.txt delete mode 100644 harbour/source/tools/io.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 82d050c682..63961ed400 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,52 @@ +20000322-16:33 GMT+1 Victor Szakats + + - include/hbclip.ch + + contrib/hbclip/hbclip.ch + + contrib/hbclip/hbclip.lib + + contrib/hbclip/hbclip.prg + + contrib/hbclip/hbcolind.c + + contrib/hbclip/hbkeyput.prg + + contrib/hbclip/hbshadow.prg + + contrib/hbclip/hbstod.c + + contrib/hbclip/hbvaltoc.prg + + contrib/hbclip/make_clp.bat + + contrib/hbclip/readme.txt + + + Harbour Compatibility Library for CA-Clipper 5.x/'87 contribution + started. + + STOD(), HB_VALTOSTR(), HB_KEYPUT(), HB_COLORINDEX() functions added. + + Some functions from hbclip.ch also added to the library so that the + the library (HBCLIP.LIB) can be used with Clipper Summer '87. + + Header file from Harbour include dir moved here. + + * makefile.bc + makefile.vc + + Some user notes added about configuration. + + - source/tools/io.c + * include/hbapifs.h + source/rtl/diskspac.c + source/tools/Makefile + tests/tstdspac.prg + makefile.bc + makefile.vc + - Removed the internal function hb_fsDiskSpace() (the reason is that + this internal function may actually throw a Harbour runtime error.) + - Removed CD(), MD(), RD(), DISK*() from TOOLS. + + You can use these macros to access the removed functions: + (This will require HB_COMPAT_C53 and #include "fileio.ch") + + #define CD( d ) DIRCHANGE( d ) + #define MD( d ) MAKEDIR( d ) + #define RD( d ) DIRREMOVE( d ) + #define DISKUSED( d ) DISKSPACE( d, HB_DISK_USED ) + #define DISKFREE( d ) DISKSPACE( d, HB_DISK_FREE ) + #define DISKFULL( d ) DISKSPACE( d, HB_DISK_TOTAL ) + + * source/rtl/dir.c + * Some minor cleanup (CVSd in the previous session) + 20000322-13:30 GMT+1 Victor Szakats * source/rtl/diskspac.c ! Workaround for GCC/Win32 (Cygwin and Mingw32). diff --git a/harbour/include/hbclip.ch b/harbour/contrib/hbclip/hbclip.ch similarity index 76% rename from harbour/include/hbclip.ch rename to harbour/contrib/hbclip/hbclip.ch index 64d88b147f..bf1d7d4650 100644 --- a/harbour/include/hbclip.ch +++ b/harbour/contrib/hbclip/hbclip.ch @@ -3,7 +3,7 @@ */ /* - * Harbour Project source code: + * Harbour Compatibility Library for CA-Cl*pper source code: * Header file to help compile Harbour source files with Clipper * * Copyright 1999 Paul Tucker @@ -48,23 +48,15 @@ #ifndef HB_CLIP_CH_ #define HB_CLIP_CH_ +/* TODO: Rewrite as much of these in C or Clipper */ + #xtranslate HB_ARGCHECK( ) => ( .F. ) #xtranslate HB_ARGSTRING( ) => "" #xtranslate HB_ARGC() => 0 #xtranslate HB_ARGV( ) => "" -#xtranslate HB_PVALUE( ) => NIL -#xtranslate HB_OSNEWLINE() => ( Chr( 13 ) + Chr( 10 ) ) -#xtranslate HB_SHADOW => dbgShadow -#xtranslate HB_COLORINDEX( [, ] ) => "" -#xtranslate HB_STOD( ) => CToD( "" ) #xtranslate HB_FNAMESPLIT( ) => NIL #xtranslate HB_FNAMEMERGE( [, [, [, ]]] ) => "" -#xtranslate HB_KEYPUT( ) => NIL -#xtranslate HB_ANSITOOEM( ) => ( s ) -#xtranslate HB_OEMTOANSI( ) => ( s ) -#xtranslate HB_VALTOSTR( ) => "" -#xtranslate HB_TRACESTATE( [] ) => 0 -#xtranslate HB_TRACELEVEL( [] ) => 0 +#xtranslate HB_PVALUE( ) => NIL #xtranslate HB_SETKEYGET( [][, ] ) => NIL #xtranslate HB_SETKEYSAVE( [] ) => ( {} ) #xtranslate HB_SETKEYCHECK( [, [, [, ]]] ) => ( .F. ) diff --git a/harbour/contrib/hbclip/hbclip.prg b/harbour/contrib/hbclip/hbclip.prg new file mode 100644 index 0000000000..c10ea5ce05 --- /dev/null +++ b/harbour/contrib/hbclip/hbclip.prg @@ -0,0 +1,52 @@ +/* + * $Id$ + */ + +/* + * Harbour Compatibility Library for CA-Cl*pper source code: + * Some simple and dummy functions (to use instead of hbclip.ch) + * + * Copyright 2000 Victor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +/* Dummy or simple functions */ + +FUNCTION HB_OSNEWLINE() + RETURN Chr( 13 ) + Chr( 10 ) + +FUNCTION HB_ANSITOOEM( cString ) + RETURN cString + +FUNCTION HB_OEMTOANSI( cString ) + RETURN cString + +FUNCTION HB_TRACESTATE( nValue ) + RETURN 0 + +FUNCTION HB_TRACELEVEL( nValue ) + RETURN 0 + diff --git a/harbour/contrib/hbclip/hbcolind.c b/harbour/contrib/hbclip/hbcolind.c new file mode 100644 index 0000000000..5dcb43fd5e --- /dev/null +++ b/harbour/contrib/hbclip/hbcolind.c @@ -0,0 +1,85 @@ +/* + * $Id$ + */ + +/* + * Harbour Compatibility Library for CA-Cl*pper source code: + * HB_COLORINDEX() function + * + * Copyright 1999 Victor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +#include "extend.h" + +CLIPPER HB_COLORIN( void ) +{ + if( ISCHAR( 1 ) && ISNUM( 2 ) ) + { + char * pszColor = _parc( 1 ); + USHORT uiColorPos; + USHORT uiColorLen; + USHORT uiColorIndex = ( USHORT ) _parni( 2 ); + + /* Skip the given number of commas */ + + for( uiColorPos = 0 ; pszColor[ uiColorPos ] != '\0' && uiColorIndex > 0 ; uiColorPos++ ) + { + if( pszColor[ uiColorPos ] == ',' ) + uiColorIndex--; + } + + /* if found, continue */ + + if( uiColorIndex == 0 ) + { + /* Skip the spaces after the comma */ + + while( pszColor[ uiColorPos ] == ' ' ) uiColorPos++; + + /* Search for next comma or end of string */ + + uiColorLen = 0; + + while( pszColor[ uiColorPos + uiColorLen ] != '\0' && + pszColor[ uiColorPos + uiColorLen ] != ',' ) uiColorLen++; + + /* Skip the trailing spaces */ + + while( uiColorLen > 0 && + pszColor[ uiColorPos + uiColorLen - 1 ] == ' ' ) uiColorLen--; + + /* Return the string */ + + _retclen( pszColor + uiColorPos, uiColorLen ); + } + else + _retc( "" ); + } + else + _retc( "" ); +} + diff --git a/harbour/contrib/hbclip/hbkeyput.prg b/harbour/contrib/hbclip/hbkeyput.prg new file mode 100644 index 0000000000..35a425da5f --- /dev/null +++ b/harbour/contrib/hbclip/hbkeyput.prg @@ -0,0 +1,43 @@ +/* + * $Id$ + */ + +/* + * Harbour Compatibility Library for CA-Cl*pper source code: + * HB_KEYPUT() function + * + * Copyright 2000 Victor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +/* NOTE: This one will reset the keyboard buffer, while Harbour not. */ +/* NOTE: This one will not allow certain keycodes which are fine in Harbour. */ + +PROCEDURE HB_KEYPUT( nKey ) + + KEYBOARD Chr( nKey ) + + RETURN diff --git a/harbour/contrib/hbclip/hbshadow.prg b/harbour/contrib/hbclip/hbshadow.prg new file mode 100644 index 0000000000..2ba49b9171 --- /dev/null +++ b/harbour/contrib/hbclip/hbshadow.prg @@ -0,0 +1,40 @@ +/* + * $Id$ + */ + +/* + * Harbour Compatibility Library for CA-Cl*pper source code: + * HB_SHADOW() function + * + * Copyright 2000 Victor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +/* NOTE: You can also use the header file */ + +FUNCTION HB_SHADOW( t, l, b, r, a ) + RETURN dbgShadow( t, l, b, r, a ) + diff --git a/harbour/contrib/hbclip/hbstod.c b/harbour/contrib/hbclip/hbstod.c new file mode 100644 index 0000000000..b18381de7d --- /dev/null +++ b/harbour/contrib/hbclip/hbstod.c @@ -0,0 +1,43 @@ +/* + * $Id$ + */ + +/* + * Harbour Compatibility Library for CA-Cl*pper source code: + * STOD() function + * + * Copyright 2000 Victor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +#include "extend.h" + +CLIPPER STOD( void ) +{ + /* The length check is a fix to avoid buggy behaviour of _retds() */ + _retds( ( ISCHAR( 1 ) && _parclen( 1 ) == 8 ) ? _parc( 1 ) : " " ); +} + diff --git a/harbour/contrib/hbclip/hbvaltoc.prg b/harbour/contrib/hbclip/hbvaltoc.prg new file mode 100644 index 0000000000..6984c70d8c --- /dev/null +++ b/harbour/contrib/hbclip/hbvaltoc.prg @@ -0,0 +1,48 @@ +/* + * $Id$ + */ + +/* + * Harbour Compatibility Library for CA-Cl*pper source code: + * HB_VALTOSTR() function + * + * Copyright 2000 Victor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) with other files to produce + * an executable, this does not by itself cause the resulting executable + * to be covered by the GNU General Public License. Your use of that + * executable is in no way restricted on account of linking the HRL + * and/or HVM code into it. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +FUNCTION HB_VALTOSTR( xValue ) + LOCAL cType := ValType( xValue ) + + DO CASE + CASE cType $ "CM" ; RETURN xValue + CASE cType == "D" ; RETURN CToD( xValue ) + CASE cType == "N" ; RETURN Str( xValue ) + CASE cType == "L" ; RETURN iif( xValue, ".T.", ".F." ) + CASE cType == "U" ; RETURN "NIL" + ENDCASE + + RETURN "" + diff --git a/harbour/contrib/hbclip/make_clp.bat b/harbour/contrib/hbclip/make_clp.bat new file mode 100644 index 0000000000..62b4ea2589 --- /dev/null +++ b/harbour/contrib/hbclip/make_clp.bat @@ -0,0 +1,24 @@ +@echo off +rem +rem $Id$ +rem + +clipper hbclip.prg /n +clipper hbkeyput.prg /n +clipper hbshadow.prg /n +clipper hbvaltoc.prg /n + +c:\devl\msc\bin\cl /c /AL /Zl /Oalt /Gs /W3 hbcolind.c +c:\devl\msc\bin\cl /c /AL /Zl /Oalt /Gs /W3 hbstod.c + +del hbclip.lib + +lib hbclip -+ hbclip.obj ,, +lib hbclip -+ hbkeyput.obj ,, +lib hbclip -+ hbshadow.obj ,, +lib hbclip -+ hbvaltoc.obj ,, +lib hbclip -+ hbcolind.obj ,, +lib hbclip -+ hbstod.obj ,, + +del hbclip.bak +del *.obj diff --git a/harbour/contrib/hbclip/readme.txt b/harbour/contrib/hbclip/readme.txt new file mode 100644 index 0000000000..59df41ffa9 --- /dev/null +++ b/harbour/contrib/hbclip/readme.txt @@ -0,0 +1,22 @@ +/* + * $Id$ + */ + +Harbour Compatibility Library (HCL) for CA-Clipper 5.x/'87 +========================================================== + +The goal of this library and header file is to provide some level +of compatibility for Harbour code when compiled with CA-Clipper. + +You will require Microsoft C 5.1 or 8.x and CA-Clipper to compile +and build this library. + +Use MAKE_CLP.BAT to build the library. + +Later on add HBCLIP.LIB to your link script. + +Optionally on CA-Clipper 5.x you may want to #include "hbclip.ch" to +your source files. + +Victor Szakats + diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 6d4522ab13..71f0393719 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -90,7 +90,6 @@ 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 ); diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 8b142b1177..4ac0d37f39 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -2,10 +2,26 @@ # $Id$ # -# makefile for Borland C/C++ compilers +# +# Makefile for Harbour Project for Borland C/C++ 3.x, 4.x, 5.x compilers +# +# +# NOTE: You can use these envvars to configure the make process: +# (note that these are all optional) +# +# CFLAGS - Extra C compiler options for libraries and for +# executables +# CLIBFLAGS - Extra C compiler options for the libraries +# HARBOURFLAGS - Extra Harbour compiler options +# HB_GT_LIB - To override the default GT driver +# (search for HB_GT_LIBS for a list) +# + +# # NOTE: "echo." intentionally used instead of "echo", to avoid conflicts # with external commands named echo. +# !if $d(B16) @@ -283,7 +299,6 @@ TOOLS_LIB_OBJS = \ $(OBJ_DIR)\dates2.obj \ $(OBJ_DIR)\dbftools.obj \ $(OBJ_DIR)\hb_f.obj \ - $(OBJ_DIR)\io.obj \ $(OBJ_DIR)\mathx.obj \ $(OBJ_DIR)\strasint.obj \ $(OBJ_DIR)\strcount.obj \ @@ -1556,10 +1571,6 @@ $(OBJ_DIR)\html.obj : $(OBJ_DIR)\html.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(TOOLS_LIB) -+$@,, -$(OBJ_DIR)\io.obj : $(TOOLS_DIR)\io.c - $(CC) $(CLIBFLAGS) -o$@ $** - tlib $(TOOLS_LIB) -+$@,, - $(OBJ_DIR)\mathx.obj : $(TOOLS_DIR)\mathx.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(TOOLS_LIB) -+$@,, diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 64a103b756..68d5837ddd 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -3,7 +3,23 @@ # # -# Makefile for Harbour project for Microsoft Visual C (32 bits) +# Makefile for Harbour Project for Microsoft Visual C (32 bits) +# + +# +# NOTE: You can use these envvars to configure the make process: +# (note that these are all optional) +# +# CFLAGS - Extra C compiler options for libraries and for +# executables +# CLIBFLAGS - Extra C compiler options for the libraries +# HARBOURFLAGS - Extra Harbour compiler options +# HB_GT_LIB - To override the default GT driver +# (search for HB_GT_LIBS for a list) +# DO_HBRUNJAV - Defines this if you want HBRUNJAV.DLL to be built. +# (you must have a JDK installed for this) +# + # # Notes about this makefile: # @@ -330,7 +346,6 @@ TOOLS_LIB_OBJS = \ $(OBJ_DIR)\dates2.obj \ $(OBJ_DIR)\dbftools.obj \ $(OBJ_DIR)\hb_f.obj \ - $(OBJ_DIR)\io.obj \ $(OBJ_DIR)\mathx.obj \ $(OBJ_DIR)\strasint.obj \ $(OBJ_DIR)\strcount.obj \ @@ -647,8 +662,9 @@ $(HBRUN_EXE) : \ !ifdef DO_HBRUNJAV # -# To compile this you must have a JDK installed +# HBRUNJAV.DLL rules (to compile this you must have a JDK installed) # + $(HBRUNJAV_DLL) : $(HBRUN_DIR)\runjava.c $(CC) $(CFLAGS) -Fo$(OBJ_DIR)\ $(HBRUN_DIR)\runjava.c -o $(HBRUNJAV_DLL) /link-dll $(LIBS) -del $(BIN_DIR)\runjava.exp diff --git a/harbour/source/rtl/diskspac.c b/harbour/source/rtl/diskspac.c index b423c8c7a9..0ab022ec87 100644 --- a/harbour/source/rtl/diskspac.c +++ b/harbour/source/rtl/diskspac.c @@ -58,8 +58,13 @@ #include #endif -double hb_fsDiskSpace( USHORT uiDrive, USHORT uiType ) +/* NOTE: The second parameter is a Harbour extension, check fileio.ch for + the possible values. */ + +HB_FUNC( DISKSPACE ) { + USHORT uiDrive = ISNUM( 1 ) ? hb_parni( 1 ) : 0; + USHORT uiType = ISNUM( 2 ) ? hb_parni( 2 ) : HB_DISK_AVAIL; double dSpace = 0.0; #if defined(HB_OS_DOS) || defined(__WATCOMC__) @@ -239,15 +244,6 @@ double hb_fsDiskSpace( USHORT uiDrive, USHORT uiType ) #endif - return dSpace; -} - -/* NOTE: The second parameter is a Harbour extension, check fileio.ch for - the possible values. */ - -HB_FUNC( DISKSPACE ) -{ - hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, - ISNUM( 2 ) ? hb_parni( 2 ) : HB_DISK_AVAIL ), -1, 0 ); + hb_retnlen( dSpace, -1, 0 ); } diff --git a/harbour/source/tools/Makefile b/harbour/source/tools/Makefile index 236550cd01..b1789b28a8 100644 --- a/harbour/source/tools/Makefile +++ b/harbour/source/tools/Makefile @@ -20,7 +20,6 @@ C_SOURCES=\ dates2.c \ dbftools.c \ hb_f.c \ - io.c \ mathx.c \ strasint.c \ strcount.c \ diff --git a/harbour/source/tools/io.c b/harbour/source/tools/io.c deleted file mode 100644 index cbe4624f4b..0000000000 --- a/harbour/source/tools/io.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * $Id$ - */ - -#include "hbapi.h" -#include "hbapifs.h" - -HB_FUNC( CD ) -{ - hb_retni( ISCHAR( 1 ) ? hb_fsChDir( ( BYTE * ) hb_parc( 1 ) ) : 0 ); -} - -HB_FUNC( MD ) -{ - hb_retni( ISCHAR( 1 ) ? hb_fsMkDir( ( BYTE * ) hb_parc( 1 ) ) : 0 ); -} - -HB_FUNC( RD ) -{ - hb_retni( ISCHAR( 1 ) ? hb_fsRmDir( ( BYTE * ) hb_parc( 1 ) ) : 0 ); -} - -HB_FUNC( DISKUSED ) -{ - hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_USED ), -1, 0 ); -} - -HB_FUNC( DISKFREE ) -{ - hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_FREE ), -1, 0 ); -} - -HB_FUNC( DISKFULL ) -{ - hb_retnlen( hb_fsDiskSpace( ISNUM( 1 ) ? hb_parni( 1 ) : 0, HB_DISK_TOTAL ), -1, 0 ); -} - diff --git a/harbour/tests/tstdspac.prg b/harbour/tests/tstdspac.prg index da8b544a13..db7807a9fe 100644 --- a/harbour/tests/tstdspac.prg +++ b/harbour/tests/tstdspac.prg @@ -21,6 +21,7 @@ This test program placed in the public domain */ +#include "fileio.ch" proc main( cDisk ) if empty( cDisk ) @@ -28,8 +29,9 @@ proc main( cDisk ) Endif cDisk := Val( cDisk ) -? "Bytes available on disk: " + Transform( diskspace(cDisk),"999,999,999,999") -? "Bytes available for use: " + Transform( diskfree(cDisk),"999,999,999,999") -? " Bytes used: " + Transform( diskused(cDisk),"999,999,999,999") -? " Total bytes on disk "+PadL(cDisk,2)+": " + Transform( diskFull(cDisk),"999,999,999,999") +? "Bytes available on disk: " + Transform( diskspace(cDisk, HB_DISK_FREE ),"999,999,999,999") +? "Bytes available for use: " + Transform( diskspace(cDisk, HB_DISK_AVAIL ),"999,999,999,999") +? " Bytes used: " + Transform( diskspace(cDisk, HB_DISK_USED ),"999,999,999,999") +? " Total bytes on disk "+PadL(cDisk,2)+": " + Transform( diskspace(cDisk, HB_DISK_TOTAL ),"999,999,999,999") + return