From 8e01405ad7eeeca3d9a55b0fbff2c54182e36a4e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 9 Aug 2008 09:59:09 +0000 Subject: [PATCH] 2008-08-09 11:43 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * doc/whatsnew.txt * bin/hb-mkslib.sh ! Changed the way harbour.dylib is created on Darwin systems to support universal builds. Please review and test. ! Fixed generating links for .dylibs on Darwin. ! Removed one excessive 'cd "${OTMPDIR}"' command. (I hope this is right) ! Removed previously added $(L_USR) from Darwin dynamic lib creation command line, as the L_USR "-arch" flags (and probably others) cannot work here. ; TOFIX: 'ld: library not found for -lharbour' is still present. * include/hbsetup.h + Added autodetection for HB_OS_DARWIN (based on __APPLE__). * config/darwin/gcc.cf ! Not forcing HB_OS_DARWIN from the command-line, we're relying on the autodetection. * source/rtl/hbzlib.c * include/hbextern.ch * doc/whatsnew.txt * Harbour level functions renamed: HB_COMPRESS -> HB_ZCOMPRESS HB_COMPRESSBOUND -> HB_ZCOMPRESSBOUND HB_UNCOMPRESS -> HB_ZUNCOMPRESS HB_UNCOMPRESSLEN -> HB_ZUNCOMPRESSLEN This is to avoid collision with xhb functions with similar name but different parameter list. Please modify your programs to use the new interface. INCOMPATIBLE. * utils/hbextern/hbextern.prg * Disabled scanning C HB_FUNC functions in .prg files. * Minor formatting. * include/hbapigt.h ! Minor cosmetic. * source/vm/runner.c * include/hbextern.ch * doc/whatsnew.txt * contrib/examples/hscript/hscript.prg * utils/hbrun/hbrun.prg * Harbour level functions renamed: __HRBRUN -> HB_HRBRUN __HRBLOAD -> HB_HRBLOAD __HRBDO -> HB_HRBDO __HRBUNLOAD -> HB_HRBUNLOAD __HRBGETFU -> HB_HRBGETSYMBOL __HRBDOFU -> HB_HRBDOSYMBOL .hrb API functions moved to the documented namespace. Old function names still function, but are deprecated. Please modify your programs to use the new interface. ; NOTE: HB_DBG_*() function should I believe correctly named as __DBG*(), as they are indeed internal functions, not meant to guaranteed for final apps. We should do this cleanup in the future. * tests/Makefile - tests/spawn.prg - tests/spawn2.prg ! Removed two obsolete tests. --- harbour/ChangeLog | 66 +++++++++++++++++ harbour/bin/hb-mkslib.sh | 76 ++++++++++---------- harbour/config/darwin/gcc.cf | 2 - harbour/contrib/examples/hscript/hscript.prg | 2 +- harbour/doc/whatsnew.txt | 14 ++++ harbour/include/hbapigt.h | 1 + harbour/include/hbextern.ch | 15 ++-- harbour/include/hbsetup.h | 8 ++- harbour/source/rtl/hbzlib.c | 16 ++--- harbour/source/vm/runner.c | 56 +++++++++++---- harbour/tests/Makefile | 2 - harbour/tests/spawn.prg | 31 -------- harbour/tests/spawn2.prg | 35 --------- harbour/utils/hbextern/hbextern.prg | 21 +++--- harbour/utils/hbrun/hbrun.prg | 9 +-- 15 files changed, 206 insertions(+), 148 deletions(-) delete mode 100644 harbour/tests/spawn.prg delete mode 100644 harbour/tests/spawn2.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ceed750119..f1472b898d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,72 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-08-09 11:43 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * doc/whatsnew.txt + * bin/hb-mkslib.sh + ! Changed the way harbour.dylib is created on Darwin systems + to support universal builds. Please review and test. + ! Fixed generating links for .dylibs on Darwin. + ! Removed one excessive 'cd "${OTMPDIR}"' command. + (I hope this is right) + ! Removed previously added $(L_USR) from Darwin dynamic + lib creation command line, as the L_USR "-arch" flags + (and probably others) cannot work here. + ; TOFIX: 'ld: library not found for -lharbour' is still + present. + + * include/hbsetup.h + + Added autodetection for HB_OS_DARWIN (based on __APPLE__). + + * config/darwin/gcc.cf + ! Not forcing HB_OS_DARWIN from the command-line, + we're relying on the autodetection. + + * source/rtl/hbzlib.c + * include/hbextern.ch + * doc/whatsnew.txt + * Harbour level functions renamed: + HB_COMPRESS -> HB_ZCOMPRESS + HB_COMPRESSBOUND -> HB_ZCOMPRESSBOUND + HB_UNCOMPRESS -> HB_ZUNCOMPRESS + HB_UNCOMPRESSLEN -> HB_ZUNCOMPRESSLEN + This is to avoid collision with xhb functions + with similar name but different parameter list. + Please modify your programs to use the new interface. + INCOMPATIBLE. + + * utils/hbextern/hbextern.prg + * Disabled scanning C HB_FUNC functions in .prg files. + * Minor formatting. + + * include/hbapigt.h + ! Minor cosmetic. + + * source/vm/runner.c + * include/hbextern.ch + * doc/whatsnew.txt + * contrib/examples/hscript/hscript.prg + * utils/hbrun/hbrun.prg + * Harbour level functions renamed: + __HRBRUN -> HB_HRBRUN + __HRBLOAD -> HB_HRBLOAD + __HRBDO -> HB_HRBDO + __HRBUNLOAD -> HB_HRBUNLOAD + __HRBGETFU -> HB_HRBGETSYMBOL + __HRBDOFU -> HB_HRBDOSYMBOL + .hrb API functions moved to the documented namespace. + Old function names still function, but are deprecated. + Please modify your programs to use the new interface. + ; NOTE: HB_DBG_*() function should I believe correctly + named as __DBG*(), as they are indeed internal + functions, not meant to guaranteed for final apps. + We should do this cleanup in the future. + + * tests/Makefile + - tests/spawn.prg + - tests/spawn2.prg + ! Removed two obsolete tests. + 2008-08-08 18:28 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * bin/hb-mkslib.sh + Added $(L_USR) to Darwin dynamic lib creation command line. diff --git a/harbour/bin/hb-mkslib.sh b/harbour/bin/hb-mkslib.sh index 4103f13ec8..d77a15aef2 100755 --- a/harbour/bin/hb-mkslib.sh +++ b/harbour/bin/hb-mkslib.sh @@ -79,51 +79,53 @@ trap cleanup EXIT &>/dev/null rm -fR "${OTMPDIR}" mkdir -p "${OTMPDIR}" -cd "${OTMPDIR}" -for f in $* -do - case "${f}" in - *.o) - if [ ! -r "${dir}/${f}" ] - then - echo "cannot read file: ${f}" - exit 1 - fi - cp "${dir}/${f}" "${OTMPDIR}" || exit 1 - ;; - *.a) - if [ ! -r "${dir}/${f}" ] - then - echo "cannot read file: ${f}" - exit 1 - fi - d="${f%.a}" - d="${f##*/}" - mkdir $d - cd $d - ${CCPREFIX}ar -x "${dir}/${f}" || exit 1 - cd .. - ;; - *) - linker_options="${linker_options} ${f}" - ;; - esac -done -OBJLST=`find . -name \*.o` +if [ "${SLIB_EXT}" != ".dylib" ]; then + + cd "${OTMPDIR}" + + for f in $* + do + case "${f}" in + *.o) + if [ ! -r "${dir}/${f}" ] + then + echo "cannot read file: ${f}" + exit 1 + fi + cp "${dir}/${f}" "${OTMPDIR}" || exit 1 + ;; + *.a) + if [ ! -r "${dir}/${f}" ] + then + echo "cannot read file: ${f}" + exit 1 + fi + d="${f%.a}" + d="${f##*/}" + mkdir $d + cd $d + ${CCPREFIX}ar -x "${dir}/${f}" || exit 1 + cd .. + ;; + *) + linker_options="${linker_options} ${f}" + ;; + esac + done + OBJLST=`find . -name \*.o` +fi -cd "${OTMPDIR}" if [ "${SLIB_EXT}" = ".dylib" ]; then FULLNAME="${BASE}.${VERSION}${SLIB_EXT}" - ld -r -o "${FULLNAME}.o" $OBJLST && \ - ${CCPREFIX}gcc -dynamiclib -install_name "${BASE}.${MAJOR}${SLIB_EXT}" \ + ${CCPREFIX}libtool -dynamic -install_name "${BASE}.${MAJOR}${SLIB_EXT}" \ -compatibility_version ${MAJOR}.${MINOR} -current_version ${VERSION} \ -flat_namespace -undefined warning -multiply_defined suppress -single_module \ - -o "${FULLNAME}" "${FULLNAME}.o" ${linker_options} ${L_USR} && \ + -o "${OTMPDIR}/${FULLNAME}" $* && \ cd "${dir}" && \ mv -f "${OTMPDIR}/${FULLNAME}" "${DSTDIR}${FULLNAME}" && \ - ln -sf "${FULLNAME}" "${DSTDIR}${BASE}.${MAJOR}${SLIB_EXT}" && \ - ln -sf "${FULLNAME}" "${DSTDIR}${BASE}${SLIB_EXT}" + ln -sf "${OTMPDIR}/${FULLNAME}" "${DSTDIR}${BASE}.${MAJOR}${SLIB_EXT}" && \ + ln -sf "${OTMPDIR}/${FULLNAME}" "${DSTDIR}${BASE}${SLIB_EXT}" elif [ "${SLIB_EXT}" = ".dll" ]; then FULLNAME="${LIB_NAME}${SLIB_EXT}" if [ "$HB_COMPILER" = "cemgw" ]; then diff --git a/harbour/config/darwin/gcc.cf b/harbour/config/darwin/gcc.cf index 380686c87d..44a0d69c9d 100644 --- a/harbour/config/darwin/gcc.cf +++ b/harbour/config/darwin/gcc.cf @@ -27,8 +27,6 @@ CFLAGS = -fno-common -Wall -W # remove it if you have newer compiler version CFLAGS += -Wno-long-double -CFLAGS += -DHB_OS_DARWIN - LD = cc LD_OUT = -o diff --git a/harbour/contrib/examples/hscript/hscript.prg b/harbour/contrib/examples/hscript/hscript.prg index 99986551b6..9104ee1941 100644 --- a/harbour/contrib/examples/hscript/hscript.prg +++ b/harbour/contrib/examples/hscript/hscript.prg @@ -188,7 +188,7 @@ FUNCTION Main( cScript ) // Runs using Tugboat cFile := StrTran( Upper( cFile ), ".PRG", ".hrb" ) - __hrbRun( cFile ) + hb_hrbRun( cFile ) // Erases the HRB file FErase( cFile ) diff --git a/harbour/doc/whatsnew.txt b/harbour/doc/whatsnew.txt index b5c508bb48..c3a989487e 100644 --- a/harbour/doc/whatsnew.txt +++ b/harbour/doc/whatsnew.txt @@ -17,6 +17,7 @@ General - Deployment fixes. - harbour.dll related fixes. - MinGW bash (msys) build related fixes. +- Darwin universal build and OS X Leopard (10.5) compatibility fixes. Core ============================= @@ -49,6 +50,19 @@ Core - *nix exception handler added. - Source filename visible in stack traces. - ACHOICE() mouse support added. +- Core Harbour level ZLIB compression functions renamed as follows: + HB_COMPRESS -> HB_ZCOMPRESS + HB_COMPRESSBOUND -> HB_ZCOMPRESSBOUND + HB_UNCOMPRESS -> HB_ZUNCOMPRESS + HB_UNCOMPRESSLEN -> HB_ZUNCOMPRESSLEN +- Harbour .hrb API moved to the documented namespace as follows: + __HRBRUN -> HB_HRBRUN + __HRBLOAD -> HB_HRBLOAD + __HRBDO -> HB_HRBDO + __HRBUNLOAD -> HB_HRBUNLOAD + __HRBGETFU -> HB_HRBGETSYMBOL + __HRBDOFU -> HB_HRBDOSYMBOL + (old function names still function) Contrib ============================= diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 9773d10f8f..01fcfaa681 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -72,6 +72,7 @@ #ifndef HB_APIGT_H_ #define HB_APIGT_H_ + #include "hbapi.h" HB_EXTERN_BEGIN diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 81b877fc6e..672feb3a02 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -867,6 +867,13 @@ EXTERNAL HB_INISETCOMMENT EXTERNAL HB_INIREAD EXTERNAL HB_INIWRITE +EXTERNAL HB_HRBRUN +EXTERNAL HB_HRBDO +EXTERNAL HB_HRBLOAD +EXTERNAL HB_HRBUNLOAD +EXTERNAL HB_HRBGETSYMBOL +EXTERNAL HB_HRBDOSYMBOL + EXTERNAL HB_LIBLOAD EXTERNAL HB_LIBFREE EXTERNAL HB_LIBDO @@ -1159,10 +1166,10 @@ EXTERNAL HB_INETSETRCVBUFSIZE #endif /* __PLATFORM__DOS */ EXTERNAL HB_ZLIBVERSION -EXTERNAL HB_COMPRESS -EXTERNAL HB_COMPRESSBOUND -EXTERNAL HB_UNCOMPRESS -EXTERNAL HB_UNCOMPRESSLEN +EXTERNAL HB_ZCOMPRESS +EXTERNAL HB_ZCOMPRESSBOUND +EXTERNAL HB_ZUNCOMPRESS +EXTERNAL HB_ZUNCOMPRESSLEN EXTERNAL HB_GZOPEN EXTERNAL HB_GZDOPEN EXTERNAL HB_GZCLOSE diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index 60f2f1c8ea..d761223993 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -312,9 +312,15 @@ #endif #endif +#ifndef HB_OS_DARWIN + #if defined(__APPLE__) + #define HB_OS_DARWIN + #endif +#endif + #ifndef HB_OS_BSD #if defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( __OpenBSD__ ) || \ - defined( __APPLE__ ) || defined( HB_OS_DARWIN ) + defined( HB_OS_DARWIN ) #define HB_OS_BSD #endif #endif diff --git a/harbour/source/rtl/hbzlib.c b/harbour/source/rtl/hbzlib.c index 5007f49a5c..706bbd8ec6 100644 --- a/harbour/source/rtl/hbzlib.c +++ b/harbour/source/rtl/hbzlib.c @@ -100,9 +100,9 @@ HB_FUNC( HB_ZLIBVERSION ) } /* - * HB_COMPRESSBOUND( | ) -> + * HB_ZCOMPRESSBOUND( | ) -> */ -HB_FUNC( HB_COMPRESSBOUND ) +HB_FUNC( HB_ZCOMPRESSBOUND ) { if( ISCHAR( 1 ) ) hb_retnint( compressBound( hb_parclen( 1 ) ) ); @@ -113,9 +113,9 @@ HB_FUNC( HB_COMPRESSBOUND ) } /* - * HB_UNCOMPRESSLEN( ) -> or 0 on error + * HB_ZUNCOMPRESSLEN( ) -> or 0 on error */ -HB_FUNC( HB_UNCOMPRESSLEN ) +HB_FUNC( HB_ZUNCOMPRESSLEN ) { ULONG ulLen = hb_parclen( 1 ); @@ -123,10 +123,10 @@ HB_FUNC( HB_UNCOMPRESSLEN ) } /* - * HB_COMPRESS( , [|<@cBuffer>], [<@nResult>], [] ) + * HB_ZCOMPRESS( , [|<@cBuffer>], [<@nResult>], [] ) * => or NIL on Error */ -HB_FUNC( HB_COMPRESS ) +HB_FUNC( HB_ZCOMPRESS ) { char * szData = hb_parc( 1 ); if( szData ) @@ -186,10 +186,10 @@ HB_FUNC( HB_COMPRESS ) } /* - * HB_UNCOMPRESS( , [|<@cBuffer>], [<@nResult>] ) + * HB_ZUNCOMPRESS( , [|<@cBuffer>], [<@nResult>] ) * => or NIL on Error */ -HB_FUNC( HB_UNCOMPRESS ) +HB_FUNC( HB_ZUNCOMPRESS ) { PHB_ITEM pBuffer = ISBYREF( 2 ) ? hb_param( 2, HB_IT_STRING ) : NULL; char * szData = hb_parc( 1 ); diff --git a/harbour/source/vm/runner.c b/harbour/source/vm/runner.c index a5d75d8715..de11c3abd1 100644 --- a/harbour/source/vm/runner.c +++ b/harbour/source/vm/runner.c @@ -53,11 +53,11 @@ * The following functions are added Feb 01,2002 by * Alexander Kresin * - * __HRBLOAD() - * __HRBDO() - * __HRBUNLOAD() - * __HRBGETFU() - * __HRBDOFU() + * HB_HRBLOAD() + * HB_HRBDO() + * HB_HRBUNLOAD() + * HB_HRBGETSYMBOL() + * HB_HRBDOSYMBOL() */ #include "hbvmopt.h" @@ -604,7 +604,7 @@ static void hb_hrbReturn( PHRB_BODY pHrbBody ) } /* - __HRBRUN( [, xParam1 [, xParamN ] ] ) -> return value. + HB_HRBRUN( [, xParam1 [, xParamN ] ] ) -> return value. This program will get the data from the .hrb file and run the p-code contained in it. @@ -612,7 +612,7 @@ static void hb_hrbReturn( PHRB_BODY pHrbBody ) In due time it should also be able to collect the data from the binary/executable itself */ -HB_FUNC( __HRBRUN ) +HB_FUNC( HB_HRBRUN ) { ULONG ulLen = hb_parclen( 1 ); @@ -653,7 +653,7 @@ HB_FUNC( __HRBRUN ) hb_errRT_BASE( EG_ARG, 6103, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -HB_FUNC( __HRBLOAD ) +HB_FUNC( HB_HRBLOAD ) { ULONG ulLen = hb_parclen( 1 ); @@ -692,7 +692,7 @@ HB_FUNC( __HRBLOAD ) hb_errRT_BASE( EG_ARG, 9998, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -HB_FUNC( __HRBDO ) +HB_FUNC( HB_HRBDO ) { PHRB_BODY pHrbBody = hb_hrbParam( 1 ); @@ -719,7 +719,7 @@ HB_FUNC( __HRBDO ) hb_errRT_BASE( EG_ARG, 6104, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -HB_FUNC( __HRBUNLOAD ) +HB_FUNC( HB_HRBUNLOAD ) { PHRB_BODY * pHrbPtr = ( PHRB_BODY * ) hb_parptrGC( hb_hrb_Destructor, 1 ); @@ -737,7 +737,7 @@ HB_FUNC( __HRBUNLOAD ) hb_errRT_BASE( EG_ARG, 6105, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -HB_FUNC( __HRBGETFU ) +HB_FUNC( HB_HRBGETSYMBOL ) { PHRB_BODY pHrbBody = hb_hrbParam( 1 ); @@ -761,7 +761,7 @@ HB_FUNC( __HRBGETFU ) hb_errRT_BASE( EG_ARG, 6106, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } -HB_FUNC( __HRBDOFU ) +HB_FUNC( HB_HRBDOSYMBOL ) { PHB_ITEM pSymItem = hb_param( 1, HB_IT_SYMBOL ); @@ -781,3 +781,35 @@ HB_FUNC( __HRBDOFU ) else hb_errRT_BASE( EG_ARG, 6107, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS ); } + +/* NOTE: Deprecated compatibility functions. */ + +HB_FUNC( __HRBRUN ) +{ + HB_FUNC_EXEC( HB_HRBRUN ); +} + +HB_FUNC( __HRBLOAD ) +{ + HB_FUNC_EXEC( HB_HRBLOAD ); +} + +HB_FUNC( __HRBDO ) +{ + HB_FUNC_EXEC( HB_HRBDO ); +} + +HB_FUNC( __HRBUNLOAD ) +{ + HB_FUNC_EXEC( HB_HRBUNLOAD ); +} + +HB_FUNC( __HRBGETFU ) +{ + HB_FUNC_EXEC( HB_HRBGETSYMBOL ); +} + +HB_FUNC( __HRBDOFU ) +{ + HB_FUNC_EXEC( HB_HRBDOSYMBOL ); +} diff --git a/harbour/tests/Makefile b/harbour/tests/Makefile index 05904b9e2d..ef91e7e8eb 100644 --- a/harbour/tests/Makefile +++ b/harbour/tests/Makefile @@ -178,8 +178,6 @@ BAD_PRG_SOURCES=\ objarr.prg \ objasign.prg \ rtfclass.prg \ - spawn.prg \ - spawn2.prg \ statics1.prg \ statics2.prg \ stripem.prg \ diff --git a/harbour/tests/spawn.prg b/harbour/tests/spawn.prg deleted file mode 100644 index fdc0f7fd9c..0000000000 --- a/harbour/tests/spawn.prg +++ /dev/null @@ -1,31 +0,0 @@ -//NOTEST -// -// $Id$ -// - -// -// Spawn() -// -// This program adds a .HRB at run-time -// -// Compile Spawn2() before compiling Spawn() -// -// Should be compiled using /gHRB or stub. -// -// Written by Eddie Runia -// www - http://www.harbour-project.org -// -// Placed in the public domain -// -function Main( cRun ) - - cRun := Default( cRun, "Spawn2.hrb" ) - QOut( "We are now in spawn" ) - HB_Run( cRun ) // Load & Run program - QOut( "We are back again" ) -return nil - -function SomeWhereElse() - - QOut( "I am being called from somewhere else" ) -return nil diff --git a/harbour/tests/spawn2.prg b/harbour/tests/spawn2.prg deleted file mode 100644 index 3b42014ac6..0000000000 --- a/harbour/tests/spawn2.prg +++ /dev/null @@ -1,35 +0,0 @@ -//NOTEST -// -// $Id$ -// - -// -// Spawn2 called from Spawn -// -// Function should be static to avoid collision with Spawn/Main -// -// Written by Eddie Runia -// www - http://www.harbour-project.org -// -// Placed in the public domain -// -static function Main() - - local n := 0 - - while !Empty( ProcName( n ) ) - n++ - end - if ProcName( n - 1 ) != "HB_RUN" - QOut( "Please compile me with /gHRB" ) - QOut() - QOut( "Then : hbrun spawn" ) - else - QOut( "Hi, I am Spawn2" ) - QOut( "Let's call a function from Spawn()" ) - SomeWhereElse() - QOut( "Back to Spawn2" ) - endif -return nil - - diff --git a/harbour/utils/hbextern/hbextern.prg b/harbour/utils/hbextern/hbextern.prg index 64d8c1c465..06c7eb72ec 100644 --- a/harbour/utils/hbextern/hbextern.prg +++ b/harbour/utils/hbextern/hbextern.prg @@ -57,8 +57,8 @@ #include "fileio.ch" // Remark this line when BEGINDUMP/ENDDUMP #pragma's -// are not used anymore in Harbour core and RTL PRG files -#define PRG_CAN_HAVE_HB_FUNC +// are not used anymore in Harbour core and RTL .prg files: +// #define PRG_CAN_HAVE_HB_FUNC #ifdef __HARBOUR__ #define EOL hb_OSNewLine() @@ -75,8 +75,8 @@ #endif // List of known files which does not contain any real public function. -// (always write the UPPERCASE file name) -STATIC aSkipList := { "PROFILER.PRG" } +// (always write the LOWERCASE file name) +STATIC s_aSkipList := { "profiler.prg" } PROCEDURE MAIN() LOCAL aDirs :={ BASE_DIR + "debug", ; @@ -101,7 +101,7 @@ PROCEDURE MAIN() "// This output should be edited by hand after extraction." + EOL + EOL ) FOR i := 1 TO LEN( aDirs ) FWRITE( nOutput, EOL + "// " + REPLICATE( "-", 60 ) + EOL ) - FWRITE( nOutput, "// Files from: " +aDirs[i] + EOL + EOL ) + FWRITE( nOutput, "// Files from: " + aDirs[ i ] + EOL + EOL ) ProcessDir( nOutput, aDirs[i] + PATH_SEPARATOR + "*.c" , aDirs[ i ], .F. ) ProcessDir( nOutput, aDirs[i] + PATH_SEPARATOR + "*.prg", aDirs[ i ], .T. ) NEXT @@ -129,7 +129,7 @@ STATIC PROCEDURE ProcessFile( nOutput, cFile, lPRG ) LOCAL nH // Skip known files which does not contain any real public function - IF ASCAN( aSkipList, {|c| c $ upper( cFile ) } ) > 0 + IF ASCAN( s_aSkipList, {|c| c $ lower( cFile ) } ) > 0 RETURN ENDIF @@ -217,15 +217,14 @@ STATIC FUNCTION FReadLn( nHandle, cBuffer, nMaxLine, cDelim ) STATIC PROCEDURE WriteSymbol( nOutput, cLine ) -STATIC aNames := { "MAIN" } // Init with names you want to skip +STATIC s_aNames := { "MAIN" } // Init with names you want to skip IF len( cLine ) > 0 cLine := upper( cLine ) - IF ASCAN( aNames, {|c| c == cLine } ) == 0 - AADD( aNames, cLine ) - FWRITE( nOutput, "EXTERNAL " +cLine + EOL ) + IF ASCAN( s_aNames, {|c| c == cLine } ) == 0 + AADD( s_aNames, cLine ) + FWRITE( nOutput, "EXTERNAL " + cLine + EOL ) ENDIF ENDIF RETURN - diff --git a/harbour/utils/hbrun/hbrun.prg b/harbour/utils/hbrun/hbrun.prg index d8b8e94dbd..e66613c418 100644 --- a/harbour/utils/hbrun/hbrun.prg +++ b/harbour/utils/hbrun/hbrun.prg @@ -106,10 +106,10 @@ PROCEDURE _APPMAIN( cFile, ... ) IF cFile == NIL ERRORLEVEL( 1 ) ELSE - __hrbRun( cFile, ... ) + hb_hrbRun( cFile, ... ) ENDIF ELSE - __hrbRun( cFile, ... ) + hb_hrbRun( cFile, ... ) ENDIF ENDSWITCH ELSE @@ -276,9 +276,9 @@ STATIC PROCEDURE HB_DotExec( cCommand ) IF cHRB == NIL EVAL( ErrorBlock(), "Syntax error." ) ELSE - pHRB := __hrbLoad( cHRB ) + pHRB := hb_hrbLoad( cHRB ) IF pHrb != NIL - bBlock := __hrbDo( pHRB ) + bBlock := hb_hrbDo( pHRB ) DevPos( s_nRow, s_nCol ) Eval( bBlock ) s_nRow := Row() @@ -311,3 +311,4 @@ REQUEST HB_GT_OS2_DEFAULT #endif /* ********************************************************************** */ +