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.
This commit is contained in:
@@ -8,6 +8,72 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 )
|
||||
|
||||
|
||||
@@ -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
|
||||
=============================
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
|
||||
#ifndef HB_APIGT_H_
|
||||
#define HB_APIGT_H_
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
HB_EXTERN_BEGIN
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -100,9 +100,9 @@ HB_FUNC( HB_ZLIBVERSION )
|
||||
}
|
||||
|
||||
/*
|
||||
* HB_COMPRESSBOUND( <cData> | <nDataLen> ) -> <nMaxCompressLen>
|
||||
* HB_ZCOMPRESSBOUND( <cData> | <nDataLen> ) -> <nMaxCompressLen>
|
||||
*/
|
||||
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( <cCompressedData> ) -> <nUnCompressedDataLen> or 0 on error
|
||||
* HB_ZUNCOMPRESSLEN( <cCompressedData> ) -> <nUnCompressedDataLen> 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( <cData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>], [<nLevel>] )
|
||||
* HB_ZCOMPRESS( <cData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>], [<nLevel>] )
|
||||
* => <cCompressedData> 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( <cCompressedData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>] )
|
||||
* HB_ZUNCOMPRESS( <cCompressedData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>] )
|
||||
* => <cUnCompressedData> 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 );
|
||||
|
||||
@@ -53,11 +53,11 @@
|
||||
* The following functions are added Feb 01,2002 by
|
||||
* Alexander Kresin <alex@belacy.belgorod.su>
|
||||
*
|
||||
* __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( <cFile> [, xParam1 [, xParamN ] ] ) -> return value.
|
||||
HB_HRBRUN( <cFile> [, 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 );
|
||||
}
|
||||
|
||||
@@ -178,8 +178,6 @@ BAD_PRG_SOURCES=\
|
||||
objarr.prg \
|
||||
objasign.prg \
|
||||
rtfclass.prg \
|
||||
spawn.prg \
|
||||
spawn2.prg \
|
||||
statics1.prg \
|
||||
statics2.prg \
|
||||
stripem.prg \
|
||||
|
||||
@@ -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 <eddie@runia.com>
|
||||
// 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
|
||||
@@ -1,35 +0,0 @@
|
||||
//NOTEST
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
|
||||
//
|
||||
// Spawn2 called from Spawn
|
||||
//
|
||||
// Function should be static to avoid collision with Spawn/Main
|
||||
//
|
||||
// Written by Eddie Runia <eddie@runia.com>
|
||||
// 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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
/* ********************************************************************** */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user