From 77e2a41f97c63cf4b2169ff477695f20832b3b55 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 22 Nov 2005 09:34:29 +0000 Subject: [PATCH] 2005-11-22 10:31 UTC+0100 Viktor Szakats (viktor.szakats/syenar.hu) * source/rtl/symbol.prg * source/vm/dynsym.c * include/hbextern.ch ! Moved and renamed two functions from BEGINDUMP to their proper place. GETSYMBOLPOINTER() -> __DYNSGETPOINTER() GETSYMBOLNAME() -> __DYNSGETNAME() + Added the two functions to hbextern.ch + TOFIX added to symbol.prg to remove the remaining one C function inside BEGINDUMP. (Antonio, can you take a look?) --- harbour/ChangeLog | 12 ++++++++++ harbour/include/hbextern.ch | 2 ++ harbour/source/rtl/symbol.prg | 44 ++++------------------------------- harbour/source/vm/dynsym.c | 12 ++++++++++ 4 files changed, 30 insertions(+), 40 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 80b24427cb..6be15b0c51 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,18 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ * fixed <-x-> match marker +2005-11-22 10:31 UTC+0100 Viktor Szakats (viktor.szakats/syenar.hu) + * source/rtl/symbol.prg + * source/vm/dynsym.c + * include/hbextern.ch + ! Moved and renamed two functions from BEGINDUMP to their + proper place. + GETSYMBOLPOINTER() -> __DYNSGETPOINTER() + GETSYMBOLNAME() -> __DYNSGETNAME() + + Added the two functions to hbextern.ch + + TOFIX added to symbol.prg to remove the remaining one C + function inside BEGINDUMP. (Antonio, can you take a look?) + 2005-11-22 10:08 UTC+0100 Viktor Szakats (viktor.szakats/syenar.hu) * doc/en/hb_apifs.txt ! Fixed doc for hb_fsSetDevMode() diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index d47b95ae9e..8221bfda15 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -359,6 +359,8 @@ EXTERNAL HB_WILDMATCH EXTERNAL HB_CLOCKS2SECS EXTERNAL HB_MATHERRMODE EXTERNAL HB_MATHERRORBLOCK +EXTERNAL __DYNSGETPOINTER +EXTERNAL __DYNSGETNAME /* CA-Cl*pper compatible internal functions */ diff --git a/harbour/source/rtl/symbol.prg b/harbour/source/rtl/symbol.prg index b406f8fc2a..94d627f3cf 100644 --- a/harbour/source/rtl/symbol.prg +++ b/harbour/source/rtl/symbol.prg @@ -50,32 +50,6 @@ * */ -/* uncomment this section for a working sample - -// Class(y) Class Symbol documentation is located at: -// http://www.clipx.net/ng/classy/ngdebc.php - -function Main() - - local oSym := Symbol():New( "QOUT" ) - - ? "Now test the :Exec() method" - - oSym:Exec( "This string is being printed by QOUT" ) - oSym:Exec( "which is being invoked by the :Exec()" ) - oSym:Exec( "method in the Symbol class." ) - - ? - ? "symbol name: ", oSym:name - - ? "Comparing QOut symbol with xOut symbol" - ? oSym:IsEqual( Symbol():New( "xOut" ) ) - - ? "done!" - ? - -return nil */ - #include "hbclass.ch" CLASS Symbol @@ -91,13 +65,13 @@ CLASS Symbol METHOD _name( cName ) VIRTUAL // name simulates a read-only DATA so it // can't be assigned - METHOD name() INLINE GetSymbolName( ::nSym ) // retrieves the symbol name + METHOD name() INLINE __DynSGetName( ::nSym ) // retrieves the symbol name ENDCLASS METHOD New( cSymName ) CLASS Symbol - ::nSym = GetSymbolPointer( cSymName ) + ::nSym = __DynSGetPointer( cSymName ) return Self @@ -111,21 +85,11 @@ return .f. #pragma BEGINDUMP +/* TOFIX: Not to use BEGINDUMP in Harbour core code. Move SYMBOL_EXEC to symbolc.c */ + #include #include -HB_FUNC( GETSYMBOLPOINTER ) -{ - hb_retptr( hb_dynsymGet( hb_parc( 1 ) ) ); -} - -HB_FUNC( GETSYMBOLNAME ) -{ - PHB_DYNS pDynSym = ( PHB_DYNS ) hb_parptr( 1 ); - - hb_retc( ( pDynSym != NULL ? pDynSym->pSymbol->szName : "" ) ); -} - HB_FUNC( SYMBOL_EXEC ) { PHB_ITEM pSelf = hb_param( 0, HB_IT_OBJECT ); /* we retrieve Self */ diff --git a/harbour/source/vm/dynsym.c b/harbour/source/vm/dynsym.c index 50d62e0c7a..ea0821b170 100644 --- a/harbour/source/vm/dynsym.c +++ b/harbour/source/vm/dynsym.c @@ -416,3 +416,15 @@ HB_FUNC( __DYNSGETPRF ) /* profiler: It returns an array with a function or proc } #endif + +HB_FUNC( __DYNSGETPOINTER ) +{ + hb_retptr( hb_dynsymGet( hb_parc( 1 ) ) ); +} + +HB_FUNC( __DYNSGETNAME ) +{ + PHB_DYNS pDynSym = ( PHB_DYNS ) hb_parptr( 1 ); + + hb_retc( ( pDynSym != NULL ? pDynSym->pSymbol->szName : "" ) ); +}