From ac8580b4d011fd8d79661883942e061f956decdd Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 5 Oct 1999 22:52:01 +0000 Subject: [PATCH] 19991006-00:32 GMT+1 --- harbour/ChangeLog | 73 +++++-- harbour/doc/funclist.txt | 1 + harbour/include/extend.h | 9 +- harbour/include/hbextern.ch | 16 +- harbour/source/debug/debugger.prg | 52 ++--- harbour/source/rdd/dbcmd.c | 120 +++++------ harbour/source/rtl/arrays.c | 4 +- harbour/source/rtl/classes.c | 4 +- harbour/source/rtl/console.c | 34 ++- harbour/source/rtl/do.c | 4 +- harbour/source/rtl/itemapi.c | 4 +- harbour/source/rtl/menuto.prg | 36 ++-- harbour/source/rtl/setkey.prg | 26 +-- harbour/source/rtl/tclass.prg | 222 ++++++++++---------- harbour/source/rtl/terror.prg | 39 ++-- harbour/source/runner/stdalone/external.prg | 16 +- harbour/source/tools/fileread.prg | 4 +- harbour/source/vm/debug.c | 70 ++---- harbour/source/vm/hvm.c | 60 ++++-- harbour/tests/debugtst.prg | 22 +- 20 files changed, 441 insertions(+), 375 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a37380ca5b..e2101e3403 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,44 @@ +19991006-00:32 GMT+1 Victor Szel + * include/extend.h + source/vm/debug.c + source/vm/hvm.c + * aStatics made static, prefixed with "s_" + __vmVarSGet(), __vmVarSList moved to hvm.c from debug.c + * source/vm/debug.c + include/hbextern.ch + source/runner/stdalone/external.prg + source/debug/debugger.prg + tests/debugtst.prg + * __APARAM -> __vmParLList + __GETLOCAL -> __vmVarLGet + __STATIC -> __vmVarSGet + __ASTATIC -> __vmVarSList + __GLOBALSTACKLEN -> __vmStkGCount + __AGLOBALSTACK -> __vmStkGList + __STACKLEN -> __vmStkLCount + __ASTACK -> __vmStkLList + Functions renamed. + * source/rdd/dbcmd.c + + zeros changed to NULL/'\0' + * source/debug/debugger.prg + source/rtl/menuto.prg + source/rtl/setkey.prg + source/rtl/tclass.prg + source/rtl/terror.prg + source/tools/fileread.prg + + static var names prefixed with "s_" in all .PRG modules. + * source/rtl/console.c + doc/funclist.txt + + DISPOUTAT() undocumented Clipper function added. + * include/extend.h + source/rtl/arrays.c + source/rtl/classes.c + source/rtl/do.c + source/rtl/itemapi.c + source/vm/hvm.c + * symEval -> hb_g_symEval + Global variable prefixed with "hb_g_". + 19991005-17:30 EDT Paul Tucker * makefile.vc + source/rtl/mlcount @@ -58,7 +99,7 @@ Tue Oct 05 14:44:16 1999 Gonzalo A. Diethelm source/compiler/harbour.y * HB_P_GENARRAY -> HB_P_ARRAYGEN * HB_P_DIMARRAY -> HB_P_ARRAYDIM - !! WARNING !! Please rebuild all .PRG files, since the pcode values have + !! WARNING !! Please rebuild all .PRG files, since the pcode values have changed. * include/hbver.h + Revision set to "a" @@ -76,17 +117,17 @@ Tue Oct 05 14:44:16 1999 Gonzalo A. Diethelm make_tpl.* config/win32/* moved to config/w32/* * The GNU platform name for Windows 32bit has changed to "w32" from - "win32", the only reason is that the new one is shorter. This way all the - paths will be shorter, and the binary release filenames will be also + "win32", the only reason is that the new one is shorter. This way all the + paths will be shorter, and the binary release filenames will be also shorter. - Please update your GNU make starter batch files to use w32 instead of + Please update your GNU make starter batch files to use w32 instead of win32 in HB_ARCHITECTURE. 19991005-13:59 GMT+1 Victor Szel * source/compiler/harbour.y source/pp/stdalone/hbpp.c - + Added closing \n to the help text, to make it appear OK under some + + Added closing \n to the help text, to make it appear OK under some shells. (Thanks to Dave Pearson) * source/compiler/harbour.c - isatty() removed. (Thanks to Dave Pearson) @@ -107,19 +148,19 @@ Tue Oct 05 14:44:16 1999 Gonzalo A. Diethelm 19991005-12:30 GMT+2 Ryszard Glab *source/compiler/harbour.y - * changed some rules to correctly handle the following syntax: - LOCAL cbVar:={|| cbVar} - (the cbVar inside a codeblock is correctly considered a local - variable instead of memvar variable) - * corrected usage info to print LF at the end of message + * changed some rules to correctly handle the following syntax: + LOCAL cbVar:={|| cbVar} + (the cbVar inside a codeblock is correctly considered a local + variable instead of memvar variable) + * corrected usage info to print LF at the end of message 19991005-08:36 GMT+1 Victor Szel * source/vm/main*.c source/vm/Makefile include/ctoharb.h ! Some cleanup on the new main() functions. - (using header file, fixed CVS headers, added copyright header, removed a TODO, - TO DO -> TODO, Hungarian notation, global var name, 0 -> NULL, + (using header file, fixed CVS headers, added copyright header, removed a TODO, + TO DO -> TODO, Hungarian notation, global var name, 0 -> NULL, added to GNU makefile, std main return value missing.) * makefile.b40 (removed) makefile.b32 @@ -130,7 +171,7 @@ Tue Oct 05 14:44:16 1999 Gonzalo A. Diethelm *.b?? hbpplib.b32 (removed) + Further uniformized. - + hbpp.exe make process uncommented from make_b16.bat. + + hbpp.exe make process uncommented from make_b16.bat. We will see how it works. + hbpplib.b32 incorporated into hbpp.b32 - hbpp.b16 (removed) @@ -204,9 +245,9 @@ Tue Oct 05 14:44:16 1999 Gonzalo A. Diethelm Mon Oct 04 12:52:42 1999 Gonzalo A. Diethelm - * tests/working/Makefile: - Added missing '\' after db_brows.ch. - Changed spaces to tabs. + * tests/working/Makefile: + Added missing '\' after db_brows.ch. + Changed spaces to tabs. 19991004-18:42 GMT+1 Victor Szel * include/classes.ch -> include/hbclass.ch diff --git a/harbour/doc/funclist.txt b/harbour/doc/funclist.txt index d1b7e3307c..b48317b729 100644 --- a/harbour/doc/funclist.txt +++ b/harbour/doc/funclist.txt @@ -98,6 +98,7 @@ DISPBOX ;R; DISPCOUNT ;S; DISPEND ;S; DISPOUT ;R; +DISPOUTAT ;R; DOSERROR ;S; DOW ;R; DTOC ;R; diff --git a/harbour/include/extend.h b/harbour/include/extend.h index 0b74fe9c32..88812449fe 100644 --- a/harbour/include/extend.h +++ b/harbour/include/extend.h @@ -139,7 +139,7 @@ struct hb_struLong struct hb_struMemvar { - struct _HB_VALUE * *itemsbase; + struct _HB_VALUE ** itemsbase; LONG offset; LONG value; }; @@ -151,7 +151,7 @@ struct hb_struPointer struct hb_struRefer { - struct _HB_ITEM * *itemsbase; + struct _HB_ITEM ** itemsbase; LONG offset; LONG value; }; @@ -236,9 +236,8 @@ typedef USHORT ERRCODE; #define SUCCESS 0 #define FAILURE 1 -extern STACK stack; -extern HB_SYMB symEval; -extern HB_ITEM aStatics; +extern STACK stack; +extern HB_SYMB hb_g_symEval; /* Extend API */ extern char * hb_parc( int iParam, ... ); /* retrieve a string parameter */ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index ea0c71df78..447336accb 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -45,14 +45,14 @@ EXTERNAL __ARGV // //symbols from file: vm\debug.c // -EXTERNAL __ASTATIC -EXTERNAL __STATIC -EXTERNAL __GLOBALSTACKLEN -EXTERNAL __AGLOBALSTACK -EXTERNAL __STACKLEN -EXTERNAL __ASTACK -EXTERNAL __APARAM -EXTERNAL __GETLOCAL +EXTERNAL __VMPARLLIST +EXTERNAL __VMVARLGET +EXTERNAL __VMVARSGET +EXTERNAL __VMVARSLIST +EXTERNAL __VMSTKGCOUNT +EXTERNAL __VMSTKGLIST +EXTERNAL __VMSTKLCOUNT +EXTERNAL __VMSTKLLIST // //symbols from file: vm\dynsym.c // diff --git a/harbour/source/debug/debugger.prg b/harbour/source/debug/debugger.prg index 642005228e..90b4bcc350 100644 --- a/harbour/source/debug/debugger.prg +++ b/harbour/source/debug/debugger.prg @@ -45,51 +45,51 @@ #xcommand SEPARATOR => TDbMenu():AddItem( TDbMenuItem():New( "-" ) ) #xcommand ENDMENU => ATail( TDbMenu():aMenus ):Build() -static oDebugger -static lExit := .F. +static s_oDebugger +static s_lExit := .F. function __dbgEntry( uParam1, uParam2 ) // debugger entry point do case case ValType( uParam1 ) == "C" // called from hvm.c hb_vmModuleName() - if ! lExit - if oDebugger == nil - oDebugger = TDebugger():New() - oDebugger:Activate( uParam1 ) + if ! s_lExit + if s_oDebugger == nil + s_oDebugger = TDebugger():New() + s_oDebugger:Activate( uParam1 ) else - oDebugger:ShowCode( uParam1 ) + s_oDebugger:ShowCode( uParam1 ) endif endif case ValType( uParam1 ) == "N" // called from hvm.c hb_vmDebuggerShowLines() - if oDebugger != nil + if s_oDebugger != nil if PCount() == 2 // called from hvm.c hb_vmDebuggerLocalName() - AAdd( oDebugger:aVars, { uParam2, "Local", uParam1 } ) - if oDebugger:oBrwVars != nil - oDebugger:oBrwVars:RefreshAll() + AAdd( s_oDebugger:aVars, { uParam2, "Local", uParam1 } ) + if s_oDebugger:oBrwVars != nil + s_oDebugger:oBrwVars:RefreshAll() endif return nil endif - if oDebugger:lGo - oDebugger:lGo = ! oDebugger:IsBreakPoint( uParam1 ) + if s_oDebugger:lGo + s_oDebugger:lGo = ! s_oDebugger:IsBreakPoint( uParam1 ) endif - if oDebugger:lGo + if s_oDebugger:lGo DispBegin() DispBegin() - oDebugger:SaveAppStatus() - oDebugger:RestoreAppStatus() + s_oDebugger:SaveAppStatus() + s_oDebugger:RestoreAppStatus() DispEnd() DispEnd() else - oDebugger:SaveAppStatus() - oDebugger:GoToLine( uParam1 ) - oDebugger:HandleEvent() + s_oDebugger:SaveAppStatus() + s_oDebugger:GoToLine( uParam1 ) + s_oDebugger:HandleEvent() endif endif otherwise // called from hvm.c hb_vmDebuggerEndProc() - if oDebugger != nil - oDebugger:EndProc() + if s_oDebugger != nil + s_oDebugger:EndProc() endif endcase @@ -193,8 +193,8 @@ METHOD HandleEvent() CLASS TDebugger case nKey == K_ESC ::RestoreAppStatus() - oDebugger := nil - lExit := .T. + s_oDebugger := nil + s_lExit := .T. DispEnd() ::Exit() @@ -392,9 +392,9 @@ METHOD ShowVars() CLASS TDebugger nWidth = ::oWndVars:nWidth() - 1 ::oBrwVars:AddColumn( TBColumnNew( "", { || AllTrim( Str( n ) ) + ") " + ; PadR( ::aVars[ n ][ 1 ] + " <" + ::aVars[ n ][ 2 ] + ", " + ; - If( ::aVars[ n ][ 2 ] == "Local", ValType( __GetLocal( 6, ::aVars[ n ][ 3 ] ) ),; + If( ::aVars[ n ][ 2 ] == "Local", ValType( __vmVarLGet( 6, ::aVars[ n ][ 3 ] ) ),; "" ) + ">:" + If( ::aVars[ n ][ 2 ] == "Local",; - " Class " + __GetLocal( 6, ::aVars[ n ][ 3 ] ):ClassName(), "" ),; + " Class " + __vmVarLGet( 6, ::aVars[ n ][ 3 ] ):ClassName(), "" ),; ::oWndVars:nWidth() - 5 ) } ) ) ::oBrwVars:ForceStable() endif @@ -1173,5 +1173,5 @@ function BuildMenu( oDebugger ) // Builds the debugger pulldown menu return oMenu Function AltD() -lExit := .F. + s_lExit := .F. return NIL diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index 0212e8b9d2..cc3974b0a7 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -124,13 +124,13 @@ HARBOUR HB_RLOCK( void ); HARBOUR HB_SELECT( void ); HARBOUR HB_USED( void ); -static char * szDefDriver = 0; /* Default RDD name */ -static USHORT uiCurrArea = 1; /* Selectd area */ -static LPRDDNODE pRddList = 0; /* Registered RDD's */ -static BOOL bNetError = FALSE; /* Error on Networked environments */ +static char * szDefDriver = NULL; /* Default RDD name */ +static USHORT uiCurrArea = 1; /* Selectd area */ +static LPRDDNODE pRddList = NULL; /* Registered RDD's */ +static BOOL bNetError = FALSE; /* Error on Networked environments */ -static LPAREANODE pWorkAreas = 0; /* WorkAreas */ -static LPAREANODE pCurrArea = 0; /* Pointer to a selectd and valid area */ +static LPAREANODE pWorkAreas = NULL; /* WorkAreas */ +static LPAREANODE pCurrArea = NULL; /* Pointer to a selectd and valid area */ /* @@ -241,7 +241,7 @@ static ERRCODE FieldInfo( AREAP pArea, USHORT uiIndex, USHORT uiType, PHB_ITEM p case DBS_TYPE: szType[ 0 ] = pField->uiType; - szType[ 1 ] = 0; + szType[ 1 ] = '\0'; hb_itemPutC( pItem, szType ); return SUCCESS; @@ -329,7 +329,7 @@ static ERRCODE Open( AREAP pArea, LPDBOPENINFO pOpenInfo ) pArea->atomAlias = hb_dynsymGet( ( char * ) pOpenInfo->atomAlias ); if( ( ( PHB_DYNS ) pArea->atomAlias )->hArea ) { - hb_errRT_DBCMD( EG_DUPALIAS, 1011, 0, ( char * ) pOpenInfo->atomAlias ); + hb_errRT_DBCMD( EG_DUPALIAS, 1011, NULL, ( char * ) pOpenInfo->atomAlias ); return FAILURE; } @@ -496,8 +496,8 @@ static void hb_rddCloseAll( void ) hb_xfree( pCurrArea ); } uiCurrArea = 1; - pCurrArea = 0; - pWorkAreas = 0; + pCurrArea = NULL; + pWorkAreas = NULL; } static LPRDDNODE hb_rddFindNode( char * szDriver, USHORT * uiIndex ) @@ -520,7 +520,7 @@ static LPRDDNODE hb_rddFindNode( char * szDriver, USHORT * uiIndex ) } if( uiIndex ) * uiIndex = 0; - return 0; + return NULL; } static int hb_rddRegister( char * szDriver, USHORT uiType ) @@ -598,7 +598,7 @@ static void hb_rddSelectFirstAvailable( void ) uiCurrArea++; pAreaNode = pAreaNode->pNext; } - pCurrArea = 0; /* Selected WorkArea must be created */ + pCurrArea = NULL; /* Selected WorkArea must be created */ } ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, BYTE * szDrvName ) @@ -670,7 +670,7 @@ ERRCODE hb_rddSelectWorkAreaNumber( int iArea ) } pAreaNode = pAreaNode->pNext; } - pCurrArea = 0; /* Selected WorkArea is closed */ + pCurrArea = NULL; /* Selected WorkArea is closed */ return FAILURE; } @@ -1004,7 +1004,7 @@ HARBOUR HB_DBAPPEND( void ) bNetError = ( SELF_APPEND( ( AREAP ) pCurrArea->pArea, bUnLockAll ) == FAILURE ); } else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBAPPEND" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBAPPEND" ); } HARBOUR HB_DBCLOSEALL( void ) @@ -1021,7 +1021,7 @@ HARBOUR HB_DBCLOSEAREA( void ) SELF_RELEASE( ( AREAP ) pCurrArea->pArea ); if( pWorkAreas == pCurrArea ) /* Empty list */ - pWorkAreas = 0; + pWorkAreas = NULL; else { if( pCurrArea->pPrev ) @@ -1032,7 +1032,7 @@ HARBOUR HB_DBCLOSEAREA( void ) hb_xfree( pCurrArea->pArea ); hb_xfree( pCurrArea ); - pCurrArea = 0; + pCurrArea = NULL; } HARBOUR HB_DBCOMMIT( void ) @@ -1040,7 +1040,7 @@ HARBOUR HB_DBCOMMIT( void ) if( pCurrArea ) SELF_FLUSH( ( AREAP ) pCurrArea->pArea ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBCOMMIT" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBCOMMIT" ); } HARBOUR HB_DBCOMMITALL( void ) @@ -1070,7 +1070,7 @@ HARBOUR HB_DBCREATE( void ) pStruct = hb_param( 2 , IT_ARRAY ); if( ( strlen( szFileName) == 0 ) || !pStruct || !pStruct->item.asArray.value->ulLen ) { - hb_errRT_DBCMD( EG_ARG, 1014, 0, "DBCREATE" ); + hb_errRT_DBCMD( EG_ARG, 1014, NULL, "DBCREATE" ); return; } @@ -1079,13 +1079,13 @@ HARBOUR HB_DBCREATE( void ) pFieldDesc = pStruct->item.asArray.value->pItems + uiSize; if( pFieldDesc->item.asArray.value->ulLen != 4 ) { - hb_errRT_DBCMD( EG_ARG, 1014, 0, "DBCREATE" ); + hb_errRT_DBCMD( EG_ARG, 1014, NULL, "DBCREATE" ); return; } if( strlen( hb_arrayGetCPtr( pFieldDesc, 1 ) ) == 0 ) { - hb_errRT_DBCMD( EG_ARG, 1014, 0, "DBCREATE" ); + hb_errRT_DBCMD( EG_ARG, 1014, NULL, "DBCREATE" ); return; } } @@ -1101,7 +1101,7 @@ HARBOUR HB_DBCREATE( void ) pRddNode = hb_rddFindNode( szDriver, &uiRddID ) ; if( !pRddNode ) { - hb_errRT_DBCMD( EG_ARG, 1015, 0, "DBCREATE" ); + hb_errRT_DBCMD( EG_ARG, 1015, NULL, "DBCREATE" ); return; } @@ -1127,7 +1127,7 @@ HARBOUR HB_DBCREATE( void ) strcpy( szFileName, hb_parc( 1 ) ); if( !pFileName->szExtension ) { - pFileExt = hb_itemPutC( 0, "" ); + pFileExt = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pTempArea, DBI_TABLEEXT, pFileExt ); strcat( szFileName, pFileExt->item.asString.value ); hb_itemRelease( pFileExt ); @@ -1137,9 +1137,9 @@ HARBOUR HB_DBCREATE( void ) if( SELF_CREATE( ( AREAP ) pTempArea, &pInfo ) == SUCCESS && pTempArea->lpExtendInfo->fHasMemo ) { - pFileExt = hb_itemPutC( 0, "" ); + pFileExt = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pTempArea, DBI_MEMOEXT, pFileExt ); - szFileName[ 0 ] = 0; + szFileName[ 0 ] = '\0'; if( pFileName->szPath ) strcat( szFileName, pFileName->szPath ); strcat( szFileName, pFileName->szName ); @@ -1160,7 +1160,7 @@ HARBOUR HB_DBDELETE( void ) if( pCurrArea ) SELF_DELETE( ( AREAP ) pCurrArea->pArea ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBDELETE" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBDELETE" ); } HARBOUR HB_DBGOBOTTOM( void ) @@ -1168,7 +1168,7 @@ HARBOUR HB_DBGOBOTTOM( void ) if( pCurrArea ) SELF_GOBOTTOM( ( AREAP ) pCurrArea->pArea ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBGOBOTTOM" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBGOBOTTOM" ); } HARBOUR HB_DBGOTO( void ) @@ -1177,13 +1177,13 @@ HARBOUR HB_DBGOTO( void ) if( !pCurrArea ) { - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBGOTOP" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBGOTOP" ); return; } pItem = hb_param( 1, IT_ANY ); if( !pItem ) - hb_errRT_DBCMD( EG_ARG, 1003, 0, "DBGOTO" ); + hb_errRT_DBCMD( EG_ARG, 1003, NULL, "DBGOTO" ); else SELF_GOTOID( ( AREAP ) pCurrArea->pArea, pItem ); } @@ -1193,7 +1193,7 @@ HARBOUR HB_DBGOTOP( void ) if( pCurrArea ) SELF_GOTOP( ( AREAP ) pCurrArea->pArea ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBGOTOP" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBGOTOP" ); } HARBOUR HB_DBRECALL( void ) @@ -1201,7 +1201,7 @@ HARBOUR HB_DBRECALL( void ) if( pCurrArea ) SELF_RECALL( ( AREAP ) pCurrArea->pArea ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBRECALL" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBRECALL" ); } HARBOUR HB_DBRLOCK( void ) @@ -1216,7 +1216,7 @@ HARBOUR HB_DBRLOCK( void ) SELF_LOCK( ( AREAP ) pCurrArea->pArea, &pLockInfo ); } else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBRLOCK" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBRLOCK" ); hb_retl( pLockInfo.fResult ); } @@ -1229,7 +1229,7 @@ HARBOUR HB_DBRLOCKLIST( void ) if( pCurrArea ) SELF_INFO( ( AREAP ) pCurrArea->pArea, DBI_GETLOCKARRAY, pList ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBRLOCKLIST" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBRLOCKLIST" ); hb_itemReturn( pList ); hb_itemRelease( pList ); @@ -1240,7 +1240,7 @@ HARBOUR HB_DBRUNLOCK( void ) if( pCurrArea ) SELF_UNLOCK( ( AREAP ) pCurrArea->pArea, hb_parnl( 1 ) ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBRUNLOCK" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBRUNLOCK" ); } HARBOUR HB_DBSELECTAREA( void ) @@ -1254,7 +1254,7 @@ HARBOUR HB_DBSELECTAREA( void ) szAlias = hb_parc( 1 ); if( ( uiNewArea = hb_rddSelect( szAlias ) ) == 0 ) { - hb_errRT_BASE( EG_NOALIAS, 1002, 0, szAlias ); + hb_errRT_BASE( EG_NOALIAS, 1002, NULL, szAlias ); return; } } @@ -1276,7 +1276,7 @@ HARBOUR HB_DBSELECTAREA( void ) } pAreaNode = pAreaNode->pNext; } - pCurrArea = 0; /* Selected WorkArea is closed */ + pCurrArea = NULL; /* Selected WorkArea is closed */ } HARBOUR HB_DBSETDRIVER( void ) @@ -1296,7 +1296,7 @@ HARBOUR HB_DBSKIP( void ) SELF_SKIP( ( AREAP ) pCurrArea->pArea, lToSkip ); } else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBSKIP" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBSKIP" ); } HARBOUR HB_DBSTRUCT( void ) @@ -1363,7 +1363,7 @@ HARBOUR HB_DBTABLEEXT( void ) hb_retc( "" ); else { - pItem = hb_itemPutC( 0, "" ); + pItem = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pTempArea, DBI_TABLEEXT, pItem ); hb_retc( pItem->item.asString.value ); hb_itemRelease( pItem ); @@ -1373,7 +1373,7 @@ HARBOUR HB_DBTABLEEXT( void ) } else { - pItem = hb_itemPutC( 0, "" ); + pItem = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pCurrArea->pArea, DBI_TABLEEXT, pItem ); hb_retc( pItem->item.asString.value ); hb_itemRelease( pItem ); @@ -1385,7 +1385,7 @@ HARBOUR HB_DBUNLOCK( void ) if( pCurrArea ) SELF_RAWLOCK( ( AREAP ) pCurrArea->pArea, FILE_UNLOCK, 0 ); else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "DBUNLOCK" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "DBUNLOCK" ); } HARBOUR HB_DBUNLOCKALL( void ) @@ -1421,7 +1421,7 @@ HARBOUR HB_DBUSEAREA( void ) SELF_RELEASE( ( AREAP ) pCurrArea->pArea ); if( pWorkAreas == pCurrArea ) /* Empty list */ - pWorkAreas = 0; + pWorkAreas = NULL; else { if( pCurrArea->pPrev ) @@ -1432,7 +1432,7 @@ HARBOUR HB_DBUSEAREA( void ) hb_xfree( pCurrArea->pArea ); hb_xfree( pCurrArea ); - pCurrArea = 0; + pCurrArea = NULL; } hb_rddCheck(); @@ -1446,14 +1446,14 @@ HARBOUR HB_DBUSEAREA( void ) pRddNode = hb_rddFindNode( szDriver, &uiRddID ); if( !pRddNode ) { - hb_errRT_DBCMD( EG_ARG, 1015, 0, "DBUSEAREA" ); + hb_errRT_DBCMD( EG_ARG, 1015, NULL, "DBUSEAREA" ); return; } szFileName = hb_parc( 3 ); if( strlen( szFileName ) == 0 ) { - hb_errRT_DBCMD( EG_ARG, 1005, 0, "DBUSEAREA" ); + hb_errRT_DBCMD( EG_ARG, 1005, NULL, "DBUSEAREA" ); return; } @@ -1489,8 +1489,8 @@ HARBOUR HB_DBUSEAREA( void ) ( ( AREAP ) pCurrArea->pArea )->rddID = uiRddID; - pCurrArea->pPrev = 0; - pCurrArea->pNext = 0; + pCurrArea->pPrev = NULL; + pCurrArea->pNext = NULL; SELF_NEW( ( AREAP ) pCurrArea->pArea ); @@ -1498,7 +1498,7 @@ HARBOUR HB_DBUSEAREA( void ) strcpy( szFileName, hb_parc( 3 ) ); if( !pFileName->szExtension ) { - pFileExt = hb_itemPutC( 0, "" ); + pFileExt = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pCurrArea->pArea, DBI_TABLEEXT, pFileExt ); strcat( szFileName, pFileExt->item.asString.value ); hb_itemRelease( pFileExt ); @@ -1516,15 +1516,15 @@ HARBOUR HB_DBUSEAREA( void ) hb_xfree( pCurrArea ); hb_xfree( szFileName ); hb_xfree( pFileName ); - pCurrArea = 0; + pCurrArea = NULL; return; } if( ( ( AREAP ) pCurrArea->pArea )->lpExtendInfo->fHasMemo ) { - pFileExt = hb_itemPutC( 0, "" ); + pFileExt = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pCurrArea->pArea, DBI_MEMOEXT, pFileExt ); - szFileName[ 0 ] = 0; + szFileName[ 0 ] = '\0'; if( pFileName->szPath ) strcat( szFileName, pFileName->szPath ); strcat( szFileName, pFileName->szName ); @@ -1539,7 +1539,7 @@ HARBOUR HB_DBUSEAREA( void ) hb_xfree( pCurrArea ); hb_xfree( szFileName ); hb_xfree( pFileName ); - pCurrArea = 0; + pCurrArea = NULL; return; } } @@ -1606,7 +1606,7 @@ HARBOUR HB_FIELDGET( void ) PHB_ITEM pItem; USHORT uiField; - pItem = hb_itemNew( 0 ); + pItem = hb_itemNew( NULL ); uiField = hb_parni( 1 ); if( pCurrArea && uiField ) @@ -1634,7 +1634,7 @@ HARBOUR HB_FIELDNAME( void ) hb_xfree( szName ); return; } - hb_errRT_DBCMD( EG_ARG, 1009, 0, "FIELDNAME" ); + hb_errRT_DBCMD( EG_ARG, 1009, NULL, "FIELDNAME" ); } } hb_retc( "" ); @@ -1696,7 +1696,7 @@ HARBOUR HB_FLOCK( void ) SELF_LOCK( ( AREAP ) pCurrArea->pArea, &pLockInfo ); } else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "FLOCK" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "FLOCK" ); hb_retl( pLockInfo.fResult ); } @@ -1718,7 +1718,7 @@ HARBOUR HB_HEADER( void ) hb_retni( 0 ); else { - pRecSize = hb_itemNew( 0 ); + pRecSize = hb_itemNew( NULL ); SELF_INFO( ( AREAP ) pCurrArea->pArea, DBI_GETHEADERSIZE, pRecSize ); hb_itemReturn( pRecSize ); hb_itemRelease( pRecSize ); @@ -1742,7 +1742,7 @@ HARBOUR HB_LOCK( void ) SELF_LOCK( ( AREAP ) pCurrArea->pArea, &pLockInfo ); } else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "LOCK" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "LOCK" ); hb_retl( pLockInfo.fResult ); } @@ -1771,7 +1771,7 @@ HARBOUR HB_RDDLIST( void ) hb_rddCheck(); hb_arrayNew( &stack.Return, 0 ); - pName = hb_itemNew( 0 ); + pName = hb_itemNew( NULL ); pRddNode = pRddList; uiType = hb_parni( 1 ); /* 0 all types of RDD's */ while( pRddNode ) @@ -1797,7 +1797,7 @@ HARBOUR HB_RDDNAME( void ) } else { - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "RDDNAME" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "RDDNAME" ); hb_retc( "" ); } } @@ -1884,7 +1884,7 @@ HARBOUR HB_RECSIZE( void ) hb_retni( 0 ); else { - pRecSize = hb_itemNew( 0 ); + pRecSize = hb_itemNew( NULL ); SELF_INFO( ( AREAP ) pCurrArea->pArea, DBI_GETRECSIZE, pRecSize ); hb_itemReturn( pRecSize ); hb_itemRelease( pRecSize ); @@ -1907,7 +1907,7 @@ HARBOUR HB_RLOCK( void ) hb_itemRelease( pRecNo ); } else - hb_errRT_DBCMD( EG_NOTABLE, 2001, 0, "RLOCK" ); + hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, "RLOCK" ); hb_retl( pLockInfo.fResult ); } @@ -1925,6 +1925,6 @@ HARBOUR HB_SELECT( void ) HARBOUR HB_USED( void ) { - hb_retl( pCurrArea ? TRUE : FALSE ); + hb_retl( pCurrArea != NULL ); } diff --git a/harbour/source/rtl/arrays.c b/harbour/source/rtl/arrays.c index 0ccf2d2d04..3fdaabff44 100644 --- a/harbour/source/rtl/arrays.c +++ b/harbour/source/rtl/arrays.c @@ -462,7 +462,7 @@ ULONG hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, ULONG * pulStart, ULONG * { for( ulStart--; ulCount > 0; ulCount--, ulStart++ ) { - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( pValue ); hb_vmPush( pBaseArray->pItems + ulStart ); hb_vmDo( 1 ); @@ -562,7 +562,7 @@ BOOL hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, ULONG * pulStart, ULONG * p { PHB_ITEM pItem = pBaseArray->pItems + ulStart; - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( bBlock ); hb_vmPush( pItem ); hb_vmPushNumber( ( double ) ( ulStart + 1 ), 0 ); diff --git a/harbour/source/rtl/classes.c b/harbour/source/rtl/classes.c index d5f8523292..35095116ce 100644 --- a/harbour/source/rtl/classes.c +++ b/harbour/source/rtl/classes.c @@ -954,7 +954,7 @@ static HARBOUR hb___msgEvalInline( void ) hb_arrayGet( s_pClasses[ uiClass - 1 ].pInlines, s_pMethod->uiData, &block ); - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( &block ); hb_vmPush( stack.pBase + 1 ); /* Push self */ for( uiParam = 1; uiParam <= hb_pcount(); uiParam++ ) @@ -976,7 +976,7 @@ static HARBOUR hb___msgEval( void ) { USHORT uiParam; - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( stack.pBase + 1 ); /* Push block */ for( uiParam = 1; uiParam <= hb_pcount(); uiParam++ ) hb_vmPush( hb_param( uiParam, IT_ANY ) ); diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 9e5757f568..719bfb616a 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -49,6 +49,7 @@ * * Copyright 1999 Victor Szel * hb_consoleGetNewLine() + * HB_DISPOUTAT() * HB_SETPOSBS() * HB_DISPBOX() (GT version) * HB_DISPBEGIN() @@ -693,7 +694,7 @@ HARBOUR HB_DEVOUT( void ) /* writes a single value to the current device (screen } } -HARBOUR HB_DISPOUT( void ) /* writes a single value to the current device (screen or printer), but is not affected by SET ALTERNATE */ +HARBOUR HB_DISPOUT( void ) /* writes a single value to the screen, but is not affected by SET ALTERNATE */ { if( hb_pcount() >= 1 ) { @@ -717,6 +718,35 @@ HARBOUR HB_DISPOUT( void ) /* writes a single value to the current device (scree } } +/* Undocumented Clipper function */ + +HARBOUR HB_DISPOUTAT( void ) /* writes a single value to the screen at speficic position, but is not affected by SET ALTERNATE */ +{ + if( hb_pcount() >= 3 ) + { + /* NOTE: Clipper does no checks here. */ + hb_setpos( hb_parni( 1 ), hb_parni( 2 ) ); + +#ifdef HARBOUR_USE_GTAPI + if( ISCHAR( 4 ) ) + { + char szOldColor[ CLR_STRLEN ]; + + hb_gtGetColorStr( szOldColor ); + hb_gtSetColorStr( hb_parc( 2 ) ); + + hb_out( 3, hb_dispout ); + + hb_gtSetColorStr( szOldColor ); + } + else + hb_out( 3, hb_dispout ); +#else + hb_out( 3, hb_devout ); +#endif + } +} + HARBOUR HB___EJECT( void ) /* Ejects the current page from the printer */ { if( hb_stricmp( hb_set.HB_SET_DEVICE, "PRINTER" ) == 0 && hb_set_printhan != FS_ERROR ) @@ -1134,7 +1164,7 @@ HARBOUR HB_SETBLINK( void ) HARBOUR HB_SETMODE( void ) { #ifdef HARBOUR_USE_GTAPI - hb_retl( hb_gtSetMode( ISNUM( 1 ) ? hb_parni( 1 ) : ( hb_gtMaxRow() + 1 ), + hb_retl( hb_gtSetMode( ISNUM( 1 ) ? hb_parni( 1 ) : ( hb_gtMaxRow() + 1 ), ISNUM( 2 ) ? hb_parni( 2 ) : ( hb_gtMaxCol() + 1 ) ) == 0 ); #else hb_retl( FALSE ); diff --git a/harbour/source/rtl/do.c b/harbour/source/rtl/do.c index 68a20272cb..4811c23a19 100644 --- a/harbour/source/rtl/do.c +++ b/harbour/source/rtl/do.c @@ -112,7 +112,7 @@ HARBOUR HB_DO( void ) { USHORT uiParam; - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( pItem ); for( uiParam = 2; uiParam <= uiPCount; uiParam++ ) hb_vmPush( hb_param( uiParam, IT_ANY ) ); @@ -155,7 +155,7 @@ HARBOUR HB_EVAL( void ) { USHORT uiParam; - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( pItem ); for( uiParam = 2; uiParam <= uiPCount; uiParam++ ) hb_vmPush( hb_param( uiParam, IT_ANY ) ); diff --git a/harbour/source/rtl/itemapi.c b/harbour/source/rtl/itemapi.c index cd0237e367..31b6228e1d 100644 --- a/harbour/source/rtl/itemapi.c +++ b/harbour/source/rtl/itemapi.c @@ -124,7 +124,7 @@ PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo ) } else if( IS_BLOCK( pEvalInfo->pItems[ 0 ] ) ) { - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( pEvalInfo->pItems[ 0 ] ); while( uiParam <= pEvalInfo->paramCount ) hb_vmPush( pEvalInfo->pItems[ uiParam++ ] ); @@ -209,7 +209,7 @@ PHB_ITEM hb_itemDo( PHB_ITEM pItem, USHORT uiPCount, PHB_ITEM pItemArg1, ... ) va_list va; va_start( va, pItemArg1 ); - hb_vmPushSymbol( &symEval ); + hb_vmPushSymbol( &hb_g_symEval ); hb_vmPush( pItem ); if( uiPCount >= 1 ) hb_vmPush( pItemArg1 ); for( uiParam = 2; uiParam <= uiPCount; uiParam++ ) diff --git a/harbour/source/rtl/menuto.prg b/harbour/source/rtl/menuto.prg index 448e2fb0e5..02d58b9c1c 100644 --- a/harbour/source/rtl/menuto.prg +++ b/harbour/source/rtl/menuto.prg @@ -30,22 +30,22 @@ #include "hbmemvar.ch" #include "setcurs.ch" -static aLevel := {} -static nPointer := 1 +static s_aLevel := {} +static s_nPointer := 1 function __AtPrompt( nCol, nRow, cPrompt, cMsg ) - if nPointer < 1 - nPointer := 1 + if s_nPointer < 1 + s_nPointer := 1 endif // add the current level empty array. - do while len( aLevel ) < nPointer - aadd( aLevel, {} ) + do while len( s_aLevel ) < s_nPointer + aadd( s_aLevel, {} ) enddo // add to the static array - aadd( aLevel[ nPointer ], { nCol, nRow, cPrompt, cMsg } ) + aadd( s_aLevel[ s_nPointer ], { nCol, nRow, cPrompt, cMsg } ) // put this prompt on the screen right now setpos( nCol, nRow ) @@ -83,15 +83,15 @@ function __MenuTo( bBlock, cVariable ) // if no prompts were defined, exit with 0 - if nPointer < 1 .or. nPointer > len( aLevel ) + if s_nPointer < 1 .or. s_nPointer > len( s_aLevel ) n := 0 else - nPointer ++ + s_nPointer ++ - nArrLen := len( aLevel[ nPointer - 1 ] ) + nArrLen := len( s_aLevel[ s_nPointer - 1 ] ) // put choice in a valid range @@ -124,7 +124,7 @@ function __MenuTo( bBlock, cVariable ) dispout( space( len( xMsg ) ) ) endif - xMsg := aLevel[ nPointer - 1, n, 4 ] + xMsg := s_aLevel[ s_nPointer - 1, n, 4 ] // Code Block messages ( yes, they are documented! ) if ISBLOCK( xMsg ) @@ -152,8 +152,8 @@ function __MenuTo( bBlock, cVariable ) endif // highlight the prompt - setpos( aLevel[ nPointer - 1, n, 1 ], aLevel[ nPointer - 1, n, 2 ] ) - dispout( aLevel[ nPointer - 1, n, 3 ] ) + setpos( s_aLevel[ s_nPointer - 1, n, 1 ], s_aLevel[ s_nPointer - 1, n, 2 ] ) + dispout( s_aLevel[ s_nPointer - 1, n, 3 ] ) if Set( _SET_INTENSITY ) ColorSelect( CLR_STANDARD ) @@ -207,7 +207,7 @@ function __MenuTo( bBlock, cVariable ) otherwise // did user hit a hot key? for y := 1 to nArrLen - if upper( left( ltrim( aLevel[ nPointer - 1, y, 3 ] ), 1 ) ) == upper( chr( nKey ) ) + if upper( left( ltrim( s_aLevel[ s_nPointer - 1, y, 3 ] ), 1 ) ) == upper( chr( nKey ) ) n := y lExit := .T. exit @@ -216,8 +216,8 @@ function __MenuTo( bBlock, cVariable ) endcase if n <> 0 - setpos( aLevel[ nPointer - 1, q, 1 ], aLevel[ nPointer - 1, q, 2 ] ) - dispout( aLevel[ nPointer - 1, q, 3 ] ) + setpos( s_aLevel[ s_nPointer - 1, q, 1 ], s_aLevel[ s_nPointer - 1, q, 2 ] ) + dispout( s_aLevel[ s_nPointer - 1, q, 3 ] ) endif enddo @@ -225,8 +225,8 @@ function __MenuTo( bBlock, cVariable ) ReadVar( cSaveReadVar ) SetCursor( nSaveCursor ) - nPointer -- - asize( aLevel, nPointer - 1 ) + s_nPointer -- + asize( s_aLevel, s_nPointer - 1 ) endif diff --git a/harbour/source/rtl/setkey.prg b/harbour/source/rtl/setkey.prg index 03acad9f28..f28028c7c4 100644 --- a/harbour/source/rtl/setkey.prg +++ b/harbour/source/rtl/setkey.prg @@ -50,7 +50,7 @@ #define BLOCK 2 #define CONDITION 3 -static aSetKeys := {} // holds array of hot-key id, code-block, activation-block +static s_aSetKeys := {} // holds array of hot-key id, code-block, activation-block /* $DOC$ * $FUNCNAME$ @@ -105,14 +105,14 @@ Function SetKey( anKey, bBlock, bCondition ) aEval( anKey, {|x| setKey( x, bBlock, bCondition ) } ) elseif ISNUMBER( anKey ) .and. anKey <> 0 - if ( nFound := aScan( aSetKeys, {|x| x[ KEY ] == anKey } ) ) == 0 + if ( nFound := aScan( s_aSetKeys, {|x| x[ KEY ] == anKey } ) ) == 0 if ISBLOCK( bBlock ) - aAdd( aSetKeys, { anKey, bBlock, bCondition } ) + aAdd( s_aSetKeys, { anKey, bBlock, bCondition } ) endif else - aKey := aSetKeys[ nFound ] + aKey := s_aSetKeys[ nFound ] if aKey[ CONDITION ] == NIL .or. eval( aKey[ CONDITION ], anKey ) bReturn := aKey[ BLOCK ] @@ -124,7 +124,7 @@ Function SetKey( anKey, bBlock, bCondition ) aKey[ CONDITION ] := bCondition elseif pcount() > 1 .and. bBlock == NIL - aSize( aDel( aSetKeys, nFound ), len( aSetKeys ) - 1 ) + aSize( aDel( s_aSetKeys, nFound ), len( s_aSetKeys ) - 1 ) endif @@ -172,12 +172,12 @@ Function HB_SetKeyGet( nKey, bCondition ) local nFound if ISNUMBER( nKey ) .and. nKey <> 0 - if ( nFound := aScan( aSetKeys, {|x| x[ KEY ] == nKey } ) ) == 0 + if ( nFound := aScan( s_aSetKeys, {|x| x[ KEY ] == nKey } ) ) == 0 bCondition := NIL else - bCondition := aSetKeys[ nFound, CONDITION ] - return aSetKeys[ nFound, BLOCK ] + bCondition := s_aSetKeys[ nFound, CONDITION ] + return s_aSetKeys[ nFound, BLOCK ] endif @@ -222,14 +222,14 @@ return NIL //bReturn * $END$ */ Function HB_SetKeySave( OldKeys ) - local aReturn := aClone( aSetKeys ) + local aReturn := aClone( s_aSetKeys ) if pcount() != 0 .or. ISARRAY( OldKeys ) if OldKeys == NIL - aSetKeys := {} + s_aSetKeys := {} else - aSetKeys := aClone( OldKeys ) + s_aSetKeys := aClone( OldKeys ) endif @@ -287,8 +287,8 @@ return aReturn Function HB_SetKeyCheck( nKey, p1, p2, p3 ) local nFound, aKey, bBlock - if ( nFound := aScan( aSetKeys, {|x| x[ KEY ] == nKey } ) ) > 0 - aKey := aSetKeys[ nFound ] + if ( nFound := aScan( s_aSetKeys, {|x| x[ KEY ] == nKey } ) ) > 0 + aKey := s_aSetKeys[ nFound ] bBLock := aKey[ BLOCK ] if aKey[ CONDITION ] == NIL .or. eval( aKey[ CONDITION ], nKey ) diff --git a/harbour/source/rtl/tclass.prg b/harbour/source/rtl/tclass.prg index d947d89f2e..0e048bdf69 100644 --- a/harbour/source/rtl/tclass.prg +++ b/harbour/source/rtl/tclass.prg @@ -52,84 +52,84 @@ //----------------------------------------------------------------------------// -function TClass() +FUNCTION TClass() - static hClass := 0 + STATIC s_hClass := NIL - if hClass == 0 - hClass = __clsNew( "TCLASS", 10 ) + IF s_hClass == NIL + s_hClass := __clsNew( "TCLASS", 10 ) - __clsAddMsg( hClass, "New", @New(), MET_METHOD ) - __clsAddMsg( hClass, "Create", @Create(), MET_METHOD ) - __clsAddMsg( hClass, "AddData", @AddData(), MET_METHOD ) - __clsAddMsg( hClass, "AddClassData", @AddClassData(), MET_METHOD ) - __clsAddMsg( hClass, "AddInline", @AddInline(), MET_METHOD ) - __clsAddMsg( hClass, "AddMethod", @AddMethod(), MET_METHOD ) - __clsAddMsg( hClass, "AddVirtual", @AddVirtual(), MET_METHOD ) - __clsAddMsg( hClass, "Instance", @Instance(), MET_METHOD ) - __clsAddMsg( hClass, "SetInit", @SetInit(), MET_METHOD ) - __clsAddMsg( hClass, "SetType", @SetType(), MET_METHOD ) + __clsAddMsg( s_hClass, "New", @New(), MET_METHOD ) + __clsAddMsg( s_hClass, "Create", @Create(), MET_METHOD ) + __clsAddMsg( s_hClass, "AddData", @AddData(), MET_METHOD ) + __clsAddMsg( s_hClass, "AddClassData", @AddClassData(), MET_METHOD ) + __clsAddMsg( s_hClass, "AddInline", @AddInline(), MET_METHOD ) + __clsAddMsg( s_hClass, "AddMethod", @AddMethod(), MET_METHOD ) + __clsAddMsg( s_hClass, "AddVirtual", @AddVirtual(), MET_METHOD ) + __clsAddMsg( s_hClass, "Instance", @Instance(), MET_METHOD ) + __clsAddMsg( s_hClass, "SetInit", @SetInit(), MET_METHOD ) + __clsAddMsg( s_hClass, "SetType", @SetType(), MET_METHOD ) - __clsAddMsg( hClass, "hClass", 1, MET_DATA ) - __clsAddMsg( hClass, "_hClass", 1, MET_DATA ) - __clsAddMsg( hClass, "cName", 2, MET_DATA ) - __clsAddMsg( hClass, "_cName", 2, MET_DATA ) - __clsAddMsg( hClass, "aDatas", 3, MET_DATA ) - __clsAddMsg( hClass, "_aDatas", 3, MET_DATA ) - __clsAddMsg( hClass, "aMethods", 4, MET_DATA ) - __clsAddMsg( hClass, "_aMethods", 4, MET_DATA ) - __clsAddMsg( hClass, "aClsDatas", 5, MET_DATA ) - __clsAddMsg( hClass, "_aClsDatas", 5, MET_DATA ) - __clsAddMsg( hClass, "aInlines", 6, MET_DATA ) - __clsAddMsg( hClass, "_aInlines", 6, MET_DATA ) - __clsAddMsg( hClass, "aVirtuals", 7, MET_DATA ) - __clsAddMsg( hClass, "_aVirtuals", 7, MET_DATA ) - __clsAddMsg( hClass, "cSuper", 8, MET_DATA ) - __clsAddMsg( hClass, "_cSuper", 8, MET_DATA ) - __clsAddMsg( hClass, "uInit", 9, MET_DATA ) - __clsAddMsg( hClass, "_uInit", 9, MET_DATA ) - __clsAddMsg( hClass, "cType", 10, MET_DATA ) - __clsAddMsg( hClass, "_cType", 10, MET_DATA ) - endif + __clsAddMsg( s_hClass, "hClass", 1, MET_DATA ) + __clsAddMsg( s_hClass, "_hClass", 1, MET_DATA ) + __clsAddMsg( s_hClass, "cName", 2, MET_DATA ) + __clsAddMsg( s_hClass, "_cName", 2, MET_DATA ) + __clsAddMsg( s_hClass, "aDatas", 3, MET_DATA ) + __clsAddMsg( s_hClass, "_aDatas", 3, MET_DATA ) + __clsAddMsg( s_hClass, "aMethods", 4, MET_DATA ) + __clsAddMsg( s_hClass, "_aMethods", 4, MET_DATA ) + __clsAddMsg( s_hClass, "aClsDatas", 5, MET_DATA ) + __clsAddMsg( s_hClass, "_aClsDatas", 5, MET_DATA ) + __clsAddMsg( s_hClass, "aInlines", 6, MET_DATA ) + __clsAddMsg( s_hClass, "_aInlines", 6, MET_DATA ) + __clsAddMsg( s_hClass, "aVirtuals", 7, MET_DATA ) + __clsAddMsg( s_hClass, "_aVirtuals", 7, MET_DATA ) + __clsAddMsg( s_hClass, "cSuper", 8, MET_DATA ) + __clsAddMsg( s_hClass, "_cSuper", 8, MET_DATA ) + __clsAddMsg( s_hClass, "uInit", 9, MET_DATA ) + __clsAddMsg( s_hClass, "_uInit", 9, MET_DATA ) + __clsAddMsg( s_hClass, "cType", 10, MET_DATA ) + __clsAddMsg( s_hClass, "_cType", 10, MET_DATA ) + ENDIF -return __clsInst( hClass ) + RETURN __clsInst( s_hClass ) //----------------------------------------------------------------------------// -static function New( cClassName, cSuper ) +STATIC FUNCTION New( cClassName, cSuper ) - local Self := QSelf() + LOCAL Self := QSelf() - ::cName = Upper( cClassName ) - ::aDatas = {} - ::aMethods = {} - ::aClsDatas = {} - ::aInlines = {} - ::aVirtuals = {} - if ISCHARACTER( cSuper ) - ::cSuper = cSuper - endif + ::cName := Upper( cClassName ) + ::aDatas := {} + ::aMethods := {} + ::aClsDatas := {} + ::aInlines := {} + ::aVirtuals := {} + IF ISCHARACTER( cSuper ) + ::cSuper := cSuper + ENDIF -return Self + RETURN Self //----------------------------------------------------------------------------// -static function Create() +STATIC FUNCTION Create() - local Self := QSelf() - local n - local nLen - local nLenDatas := Len( ::aDatas ) - local nDataBegin := 0 - local nClassBegin := 0 - local hClass - local hSuper - local ahSuper := {} + LOCAL Self := QSelf() + LOCAL n + LOCAL nLen + LOCAL nLenDatas := Len( ::aDatas ) + LOCAL nDataBegin := 0 + LOCAL nClassBegin := 0 + LOCAL hClass + LOCAL hSuper + LOCAL ahSuper := {} - if ::cSuper == NIL + IF ::cSuper == NIL hClass := __clsNew( ::cName, nLenDatas ) - else // Single inheritance + ELSE // Single inheritance hSuper := __clsInstSuper( Upper( ::cSuper ) ) hClass := __clsNew( ::cName, nLenDatas, hSuper ) // Add class casts @@ -138,121 +138,121 @@ static function Create() nDataBegin := __cls_CntData( hSuper ) // Get offset for new DATAs nClassBegin := __cls_CntClsData( hSuper ) // Get offset for new ClassData - endif + ENDIF - ::hClass = hClass + ::hClass := hClass - for n = 1 to nLenDatas + FOR n := 1 TO nLenDatas __clsAddMsg( hClass, ::aDatas[ n ][ DATA_SYMBOL ], n + nDataBegin, MET_DATA, ; ::aDatas[ n ][ DATA_VALUE ] ) __clsAddMsg( hClass, "_" + ::aDatas[ n ][ DATA_SYMBOL ], n + nDataBegin, MET_DATA ) - next + NEXT - nLen = Len( ::aMethods ) - for n = 1 to nLen + nLen := Len( ::aMethods ) + FOR n := 1 TO nLen __clsAddMsg( hClass, ::aMethods[ n ][ 1 ], ::aMethods[ n ][ 2 ], MET_METHOD ) - next + NEXT - nLen = Len( ::aClsDatas ) - for n = 1 to nLen + nLen := Len( ::aClsDatas ) + FOR n := 1 TO nLen __clsAddMsg( hClass, ::aClsDatas[ n ], n + nClassBegin, MET_CLASSDATA ) __clsAddMsg( hClass, "_" + ::aClsDatas[ n ], n + nClassBegin, MET_CLASSDATA ) - next + NEXT - nLen = Len( ::aInlines ) - for n = 1 to nLen + nLen := Len( ::aInlines ) + FOR n := 1 TO nLen __clsAddMsg( hClass, ::aInlines[ n ][ 1 ], ::aInlines[ n ][ 2 ],; MET_INLINE ) - next + NEXT // __clsAddMsg( hClass, Upper( ::cName ), {|self|self}, MET_INLINE ) // Useful? - nLen = Len( ::aVirtuals ) - for n = 1 to nLen + nLen := Len( ::aVirtuals ) + FOR n := 1 TO nLen __clsAddMsg( hClass, ::aVirtuals[ n ], n, MET_VIRTUAL ) - next + NEXT -return nil + RETURN NIL //----------------------------------------------------------------------------// -static function Instance() +STATIC FUNCTION Instance() - local Self := QSelf() + LOCAL Self := QSelf() -return __clsInst( ::hClass ) + RETURN __clsInst( ::hClass ) //----------------------------------------------------------------------------// -static function AddData( cData, xInit ) /* xInit is initializer */ +STATIC FUNCTION AddData( cData, xInit ) /* xInit is initializer */ - local Self := QSelf() + LOCAL Self := QSelf() - if ::uInit != nil - xInit = ::uInit - endif + IF ::uInit != NIL + xInit := ::uInit + ENDIF - AAdd( ::aDatas, { cData, xInit } ) + aAdd( ::aDatas, { cData, xInit } ) -return nil + RETURN NIL //----------------------------------------------------------------------------// -static function AddClassData( cData ) +STATIC FUNCTION AddClassData( cData ) - local Self := QSelf() + LOCAL Self := QSelf() - AAdd( ::aClsDatas, cData ) + aAdd( ::aClsDatas, cData ) -return nil + RETURN NIL //----------------------------------------------------------------------------// -static function AddInline( cMethod, bCode ) +STATIC FUNCTION AddInline( cMethod, bCode ) - local Self := QSelf() + LOCAL Self := QSelf() - AAdd( ::aInlines, { cMethod, bCode } ) + aAdd( ::aInlines, { cMethod, bCode } ) -return nil + RETURN NIL //----------------------------------------------------------------------------// -static function AddMethod( cMethod, nFuncPtr ) +STATIC FUNCTION AddMethod( cMethod, nFuncPtr ) - local Self := QSelf() + LOCAL Self := QSelf() - AAdd( ::aMethods, { cMethod, nFuncPtr } ) + aAdd( ::aMethods, { cMethod, nFuncPtr } ) -return nil + RETURN NIL //----------------------------------------------------------------------------// -static function AddVirtual( cMethod ) +STATIC FUNCTION AddVirtual( cMethod ) - local Self := QSelf() + LOCAL Self := QSelf() - AAdd( ::aVirtuals, cMethod ) + aAdd( ::aVirtuals, cMethod ) -return nil + RETURN NIL //----------------------------------------------------------------------------// -static function SetInit( uValue ) +STATIC FUNCTION SetInit( uValue ) - local Self := QSelf() + LOCAL Self := QSelf() - ::uInit = uValue + ::uInit := uValue -return nil + RETURN NIL //----------------------------------------------------------------------------// -static function SetType( cType ) +STATIC FUNCTION SetType( cType ) - local Self := QSelf() + LOCAL Self := QSelf() - ::cType = cType + ::cType := cType -return nil + RETURN NIL //----------------------------------------------------------------------------// diff --git a/harbour/source/rtl/terror.prg b/harbour/source/rtl/terror.prg index 52193450d7..6f58895d9c 100644 --- a/harbour/source/rtl/terror.prg +++ b/harbour/source/rtl/terror.prg @@ -38,30 +38,29 @@ FUNCTION ErrorNew() - STATIC oClass + STATIC s_oClass - IF oClass == NIL + IF s_oClass == NIL + s_oClass := TClass():New( "ERROR" ) - oClass := TClass():New( "ERROR" ) + s_oClass:AddData( "Args" , 0 ) + s_oClass:AddData( "CanDefault" , .F. ) + s_oClass:AddData( "CanRetry" , .F. ) + s_oClass:AddData( "CanSubstitute", .F. ) + s_oClass:AddData( "Cargo" ) + s_oClass:AddData( "Description" , "" ) + s_oClass:AddData( "FileName" , "" ) + s_oClass:AddData( "GenCode" , 0 ) + s_oClass:AddData( "Operation" , "" ) + s_oClass:AddData( "OsCode" , 0 ) + s_oClass:AddData( "Severity" , 0 ) + s_oClass:AddData( "SubCode" , 0 ) + s_oClass:AddData( "SubSystem" , "" ) + s_oClass:AddData( "Tries" , 0 ) - oClass:AddData( "Args" , 0 ) - oClass:AddData( "CanDefault" , .F. ) - oClass:AddData( "CanRetry" , .F. ) - oClass:AddData( "CanSubstitute", .F. ) - oClass:AddData( "Cargo" ) - oClass:AddData( "Description" , "" ) - oClass:AddData( "FileName" , "" ) - oClass:AddData( "GenCode" , 0 ) - oClass:AddData( "Operation" , "" ) - oClass:AddData( "OsCode" , 0 ) - oClass:AddData( "Severity" , 0 ) - oClass:AddData( "SubCode" , 0 ) - oClass:AddData( "SubSystem" , "" ) - oClass:AddData( "Tries" , 0 ) - - oClass:Create() + s_oClass:Create() ENDIF - RETURN oClass:Instance() + RETURN s_oClass:Instance() diff --git a/harbour/source/runner/stdalone/external.prg b/harbour/source/runner/stdalone/external.prg index ea0c71df78..447336accb 100644 --- a/harbour/source/runner/stdalone/external.prg +++ b/harbour/source/runner/stdalone/external.prg @@ -45,14 +45,14 @@ EXTERNAL __ARGV // //symbols from file: vm\debug.c // -EXTERNAL __ASTATIC -EXTERNAL __STATIC -EXTERNAL __GLOBALSTACKLEN -EXTERNAL __AGLOBALSTACK -EXTERNAL __STACKLEN -EXTERNAL __ASTACK -EXTERNAL __APARAM -EXTERNAL __GETLOCAL +EXTERNAL __VMPARLLIST +EXTERNAL __VMVARLGET +EXTERNAL __VMVARSGET +EXTERNAL __VMVARSLIST +EXTERNAL __VMSTKGCOUNT +EXTERNAL __VMSTKGLIST +EXTERNAL __VMSTKLCOUNT +EXTERNAL __VMSTKLLIST // //symbols from file: vm\dynsym.c // diff --git a/harbour/source/tools/fileread.prg b/harbour/source/tools/fileread.prg index 5a2049e82d..a94f8950b4 100644 --- a/harbour/source/tools/fileread.prg +++ b/harbour/source/tools/fileread.prg @@ -323,7 +323,7 @@ LOCAL oSelf := Qself() RETURN oSelf:nError STATIC FUNCTION f_error_msg( cText ) -STATIC cAction := {"on", "creating object for", "opening", "reading from", "closing"} +STATIC s_cAction := {"on", "creating object for", "opening", "reading from", "closing"} LOCAL oSelf := Qself() LOCAL cMessage, nTemp // Has an error been recorded? @@ -337,6 +337,6 @@ LOCAL cMessage, nTemp ELSE nTemp := oSelf:nLastOp + 1 END IF - cMessage := IF( EMPTY( cText ), "", cText ) + "Error " + ALLTRIM( STR( oSelf:nError ) ) + " " + cAction[ nTemp ] + " " + oSelf:cFile + cMessage := IF( EMPTY( cText ), "", cText ) + "Error " + ALLTRIM( STR( oSelf:nError ) ) + " " + s_cAction[ nTemp ] + " " + oSelf:cFile END IF RETURN cMessage diff --git a/harbour/source/vm/debug.c b/harbour/source/vm/debug.c index d883aeea5a..803d7da3c5 100644 --- a/harbour/source/vm/debug.c +++ b/harbour/source/vm/debug.c @@ -4,7 +4,7 @@ /* * Harbour Project source code: - * Debugging functions for LOCAL and STATIC variables + * Debugging functions for LOCAL, STATIC variables and the stack * * Copyright 1999 Eddie Runia * www - http://www.harbour-project.org @@ -33,44 +33,9 @@ * */ -/* $Doc$ - * $Description$ Debug functions. - * $Requirement$ source\rtl\itemapi.c (1999/05/04) - * $Date$ 1999/05/06 - * $End$ */ - #include "extend.h" #include "itemapi.h" -/* $Doc$ - * $FuncName$ __aStatic() - * $Description$ Return the statics array - * - * Please aClone before assignments - * $End$ */ -HARBOUR HB___ASTATIC( void ) -{ - PHB_ITEM pStatics = hb_arrayClone( &aStatics ); - - hb_itemCopy( &stack.Return, pStatics ); - hb_itemRelease( pStatics ); -} - - -/* $Doc$ - * $FuncName$ __Static() - * $Description$ Return a specified statics - * $End$ */ -HARBOUR HB___STATIC( void ) -{ - USHORT uiStatic = hb_parni( 1 ); - PHB_ITEM pStatic = aStatics.item.asArray.value->pItems + - stack.iStatics + uiStatic - 1; - - hb_itemReturn( pStatic ); -} - - /* $Doc$ * $FuncName$ AddToArray( , , ) * $Description$ Add to array at pos @@ -97,10 +62,10 @@ static void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, ULONG ulPos ) /* $Doc$ - * $FuncName$ __GlobalStackLen() + * $FuncName$ __vmStkGCount() * $Description$ Returns the length of the global stack * $End$ */ -static USHORT GlobalStackLen( void ) +static USHORT hb_stackLenGlobal( void ) { PHB_ITEM pItem; USHORT uiCount = 0; @@ -110,22 +75,22 @@ static USHORT GlobalStackLen( void ) return uiCount; } -HARBOUR HB___GLOBALSTACKLEN( void ) +HARBOUR HB___VMSTKGCOUNT( void ) { - hb_retni( GlobalStackLen() ); + hb_retni( hb_stackLenGlobal() ); } /* $Doc$ - * $FuncName$ __aGlobalStack() + * $FuncName$ __vmStkGList() * $Description$ Returns the global stack * $End$ */ -HARBOUR HB___AGLOBALSTACK( void ) +HARBOUR HB___VMSTKGLIST( void ) { PHB_ITEM pReturn; PHB_ITEM pItem; - USHORT uiLen = GlobalStackLen(); + USHORT uiLen = hb_stackLenGlobal(); USHORT uiPos = 1; pReturn = hb_itemArrayNew( uiLen ); /* Create a transfer array */ @@ -139,7 +104,7 @@ HARBOUR HB___AGLOBALSTACK( void ) /* $Doc$ - * $FuncName$ __StackLen() + * $FuncName$ __vmStkLCount() * $Description$ Returns the length of the stack of the calling function * $End$ */ static USHORT StackLen( void ) @@ -153,14 +118,14 @@ static USHORT StackLen( void ) return uiCount; } -HARBOUR HB___STACKLEN( void ) +HARBOUR HB___VMSTKLCOUNT( void ) { hb_retni( StackLen() ); } /* $Doc$ - * $FuncName$ __aStack() + * $FuncName$ __vmStkLList() * $Description$ Returns the stack of the calling function * "[]" Means symbol. * @@ -170,7 +135,7 @@ HARBOUR HB___STACKLEN( void ) * [x+1 .. y] Locals * [y+1 ..] Pushed data * $End$ */ -HARBOUR HB___ASTACK( void ) +HARBOUR HB___VMSTKLLIST( void ) { PHB_ITEM pReturn; PHB_ITEM pItem; @@ -188,13 +153,13 @@ HARBOUR HB___ASTACK( void ) /* $Doc$ - * $FuncName$ __aParam() + * $FuncName$ __vmParLGet() * $Description$ Returns the passed parameters of the calling function * $End$ */ /* TODO : put bLocals / bParams */ /* somewhere for declared parameters */ /* and locals */ -HARBOUR HB___APARAM( void ) +HARBOUR HB___VMPARLLIST( void ) { PHB_ITEM pReturn; PHB_ITEM pItem; @@ -215,12 +180,12 @@ HARBOUR HB___APARAM( void ) /* -------------------------------------------------------------------------- */ /* $DOC$ * $FUNCNAME$ - * __GETLOCAL() + * __VMVARLGET() * $CATEGORY$ * Variable management * $ONELINER$ * $SYNTAX$ - * __GETLOCAL( , ) + * __VMVARLGET( , ) * $ARGUMENTS$ * Is the procedure level, same as used in ProcName() * and ProcLine(), from which a local variable containts is going to @@ -239,7 +204,7 @@ HARBOUR HB___APARAM( void ) * $END$ */ -HARBOUR HB___GETLOCAL( void ) +HARBOUR HB___VMVARLGET( void ) { int iLevel = hb_parni( 1 ) + 1; PHB_ITEM pBase = stack.pBase; @@ -249,3 +214,4 @@ HARBOUR HB___GETLOCAL( void ) hb_itemReturn( pBase + 1 + hb_parni( 2 ) ); } + diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 4fb0f1d422..300410c711 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -41,6 +41,10 @@ * HB_WORD() * HB___XHELP() * + * Copyright 1999 Eddie Runia + * HB___VMVARSGET() + * HB___VMVARSLIST() + * * See doc/license.txt for licensing terms. * */ @@ -194,9 +198,9 @@ extern POBJSYMBOLS HB_FIRSTSYMBOL, HB_LASTSYMBOL; /* virtual machine state */ -STACK stack; -HB_SYMB symEval = { "__EVAL", FS_PUBLIC, hb_vmDoBlock, 0 }; /* symbol to evaluate codeblocks */ -HB_ITEM aStatics; /* Harbour array to hold all application statics variables */ +STACK stack; +HB_SYMB hb_g_symEval = { "__EVAL", FS_PUBLIC, hb_vmDoBlock, 0 }; /* symbol to evaluate codeblocks */ +HB_ITEM s_aStatics; /* Harbour array to hold all application statics variables */ static BOOL s_bDebugging = FALSE; static BOOL s_bDebugShowLines = FALSE; /* update source code line on the debugger display */ @@ -235,13 +239,13 @@ void hb_vmInit( void ) HB_DEBUG( "hb_vmInit\n" ); /* initialize internal data structures */ - aStatics.type = IT_NIL; + s_aStatics.type = IT_NIL; stack.Return.type = IT_NIL; hb_xinit(); hb_errInit(); hb_stackInit(); - hb_dynsymNew( &symEval ); /* initialize dynamic symbol for evaluating codeblocks */ + hb_dynsymNew( &hb_g_symEval ); /* initialize dynamic symbol for evaluating codeblocks */ hb_setInitialize(); /* initialize Sets */ hb_consoleInitialize(); /* initialize Console */ hb_memvarsInit(); @@ -328,7 +332,7 @@ void hb_vmQuit( void ) hb_stackPop(); hb_itemClear( &stack.Return ); - hb_arrayRelease( &aStatics ); + hb_arrayRelease( &s_aStatics ); hb_rddShutDown(); hb_errExit(); hb_clsReleaseAll(); @@ -2180,7 +2184,7 @@ void hb_vmDo( USHORT uiParams ) if( ! IS_NIL( pSelf ) ) /* are we sending a message ? */ { - if( pSym == &( symEval ) && IS_BLOCK( pSelf ) ) + if( pSym == &( hb_g_symEval ) && IS_BLOCK( pSelf ) ) pFunc = pSym->pFunPtr; /* __EVAL method = function */ else pFunc = hb_objGetMethod( pSelf, pSym ); @@ -2306,18 +2310,18 @@ static void hb_vmStatics( PHB_SYMB pSym ) /* initializes the global aStatics arr { USHORT uiStatics = hb_vmPopNumber(); - if( IS_NIL( &aStatics ) ) + if( IS_NIL( &s_aStatics ) ) { pSym->pFunPtr = NULL; /* statics frame for this PRG */ - hb_arrayNew( &aStatics, uiStatics ); + hb_arrayNew( &s_aStatics, uiStatics ); } else { - pSym->pFunPtr = ( PHB_FUNC )hb_arrayLen( &aStatics ); - hb_arraySize( &aStatics, hb_arrayLen( &aStatics ) + uiStatics ); + pSym->pFunPtr = ( PHB_FUNC ) hb_arrayLen( &s_aStatics ); + hb_arraySize( &s_aStatics, hb_arrayLen( &s_aStatics ) + uiStatics ); } - HB_DEBUG2( "Statics %li\n", hb_arrayLen( &aStatics ) ); + HB_DEBUG2( "Statics %li\n", hb_arrayLen( &s_aStatics ) ); } static void hb_vmEndBlock( void ) @@ -2574,7 +2578,7 @@ static void hb_vmPushLocalByRef( SHORT iLocal ) static void hb_vmPushStatic( USHORT uiStatic ) { - PHB_ITEM pStatic = aStatics.item.asArray.value->pItems + stack.iStatics + uiStatic - 1; + PHB_ITEM pStatic = s_aStatics.item.asArray.value->pItems + stack.iStatics + uiStatic - 1; if( IS_BYREF( pStatic ) ) hb_itemCopy( stack.pPos, hb_itemUnRef( pStatic ) ); @@ -2591,7 +2595,7 @@ static void hb_vmPushStaticByRef( USHORT uiStatic ) /* we store the offset instead of a pointer to support a dynamic stack */ stack.pPos->item.asRefer.value = uiStatic - 1; stack.pPos->item.asRefer.offset = stack.iStatics; - stack.pPos->item.asRefer.itemsbase = &aStatics.item.asArray.value->pItems; + stack.pPos->item.asRefer.itemsbase = &s_aStatics.item.asArray.value->pItems; hb_stackPush(); HB_DEBUG2( "hb_vmPushStaticByRef %i\n", uiStatic ); @@ -2775,7 +2779,7 @@ static void hb_vmPopStatic( USHORT uiStatic ) PHB_ITEM pStatic; hb_stackDec(); - pStatic = aStatics.item.asArray.value->pItems + stack.iStatics + uiStatic - 1; + pStatic = s_aStatics.item.asArray.value->pItems + stack.iStatics + uiStatic - 1; if( IS_BYREF( pStatic ) ) hb_itemCopy( hb_itemUnRef( pStatic ), stack.pPos ); @@ -3456,3 +3460,29 @@ HARBOUR HB___XHELP( void ) } } +/* $Doc$ + * $FuncName$ __vmVarSGet() + * $Description$ Return the statics array + * + * Please aClone before assignments + * $End$ */ +HARBOUR HB___VMVARSGET( void ) +{ + PHB_ITEM pStatics = hb_arrayClone( &s_aStatics ); + + hb_itemCopy( &stack.Return, pStatics ); + hb_itemRelease( pStatics ); +} + +/* $Doc$ + * $FuncName$ __vmVarSList() + * $Description$ Return a specified statics + * $End$ */ +HARBOUR HB___VMVARSLIST( void ) +{ + USHORT uiStatic = hb_parni( 1 ); + PHB_ITEM pStatic = s_aStatics.item.asArray.value->pItems + + stack.iStatics + uiStatic - 1; + + hb_itemReturn( pStatic ); +} diff --git a/harbour/tests/debugtst.prg b/harbour/tests/debugtst.prg index ff27b694b3..0412d45238 100644 --- a/harbour/tests/debugtst.prg +++ b/harbour/tests/debugtst.prg @@ -50,16 +50,16 @@ function Main() QOut( "-DEBUG Functions-") QOut( "-Statics-" ) - Debug( __aStatic() ) + Debug( __vmVarSList() ) QOut( "-Global Stack-" ) - Debug ( __aGlobalStack() ) + Debug ( __vmStkGList() ) QOut( "-Local Stack-" ) - Debug ( __aStack() ) + Debug ( __vmStkLList() ) QOut( "-Parameters-" ) - Debug ( __aParam() ) + Debug ( __vmParLList() ) Pause() @@ -84,19 +84,19 @@ function FuncSecond( nParam, cParam, uParam ) QOut() QOut( "-Statics-" ) - Debug ( __aStatic() ) + Debug ( __vmVarSList() ) QOut() - QOut( "-Global Stack- Len=", __GlobalStackLen() ) - Debug ( __aGlobalStack() ) + QOut( "-Global Stack- Len=", __vmStkGCount() ) + Debug ( __vmStkGList() ) QOut() - QOut( "-Local Stack- Len=", __StackLen() ) - xStack := Debug ( __aStack() ) + QOut( "-Local Stack- Len=", __vmStkLCount() ) + xStack := Debug ( __vmStkLList() ) QOut() QOut( "-Parameters-" ) - xParam := Debug( __aParam() ) + xParam := Debug( __vmParLList() ) if xParam[ xStack[ 7 ] ] == "Hello" QOut( ":-)" ) endif @@ -226,7 +226,7 @@ return nil static function Transfer( x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 /* etc */ ) local self := QSelf() - local aParam := __aParam() + local aParam := __vmParLList() local nLen := PCount() local xRet local xData