19990808-03:00 GMT+1

This commit is contained in:
Viktor Szakats
1999-08-08 01:23:23 +00:00
parent 66544e3957
commit 8b3948e715
23 changed files with 837 additions and 797 deletions

View File

@@ -1,3 +1,54 @@
19990808-03:00 GMT+1 Victor Szel <info@szelvesz.hu>
* source/rtl/codebloc.c
source/rtl/itemapi.c
source/vm/hvm.c
include/extend.h
! hb_Codeblock*() -> hb_codeblock*()
* source/rtl/codebloc.c
source/rtl/itemapi.c
source/rtl/memvars.c
source/vm/hvm.c
include/extend.h
! hb_Memvar*() -> hb_memvar*()
* source/vm/hvm.c
! Fixed and updated declaration list for HARBOUR functions.
* source/rdd/dbcmd.c
source/rtl/arrays.c
source/rtl/classes.c
source/rtl/do.c
source/rtl/errorapi.c
source/rtl/itemapi.c
source/rtl/transfrm.c
source/runner/runner.c
source/vm/hvm.c
source/vm/initsymb.c
include/ctoharb.h
include/hb_vmpub.h
* All function belonging to the vm renamed to hb_vm*()
* source/tools/debug.c
! Some functions made static.
* source/vm/hvm.c
% Some variable declarations moved to the block which uses it.
* source/vm/hvm.c
include/ctoharb.h
* PushLogical(), PopLogical() uses BOOL instead of int.
* source/vm/hvm.c
include/extend.h
include/ctoharb.h
* declarations belonging to the vm moved to ctoharb.h
* declarations belonging to extend moved to extend.h (ulMemory* variables)
* source/rtl/console.c
source/rtl/copyfile.c
source/tools/debug.c
! Removed #include "ctoharb.h"
* source/rtl/gt/gtwin.c
! Fixed warning about missing parenthesis.
* include/ctoharb.h
! #include "extend.h"
* source/runner/runner.c
! HB_HB_RUN -> HB_MAIN - So it now works with Win32/GCC.
(this change belongs to 19990807-22:55 GMT+1)
19990808-17:25 EDT Paul Tucker <ptucker@sympatico.ca>
* makefile.vc
+ debug.lib
@@ -70,7 +121,7 @@
* tests/working/Makefile
-debugger
+cursrtst
+ tests/working\cursrtst.prg
+ tests/working/cursrtst.prg
19990808-15:00 EDT Paul Tucker <ptucker@sympatico.ca>
* makefile.vc
@@ -141,7 +192,7 @@
199908.07-12:03 GMT+3 Alexander Kresin
* makefile.b32
* added 'source\debug' to .prg path for build32.bat to work
* added 'source/debug' to .prg path for build32.bat to work
19990807-9:38 GMT+1 Antonio Linares <alinares@fivetech.com>
* tests/working/hb32.bat
@@ -219,7 +270,7 @@ Fri Aug 06 20:04:05 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
+ Added support for HB_P_MODULENAME opcode
19990806-18:00 WIB Andi Jahja
* source\rt;\menuto.prg
* source/rtl/menuto.prg
- added error checker
19990806-10:48 GMT+1 Victor Szel <info@szelvesz.hu>

View File

@@ -27,22 +27,95 @@
#ifndef HB_CTOHARB_H_
#define HB_CTOHARB_H_
/* Calling Harbour from C code */
#include "extend.h"
/* executing Harbour code from C */
extern void Message( PHB_SYMB );
extern void PushSymbol( PHB_SYMB pSym ); /* pushes a function pointer onto the stack */
extern void Push( PHB_ITEM pItem ); /* pushes any item to the stack */
extern void PushNil( void ); /* in this case it places nil at self */
/* parameters should come here using Push...() */
extern void PushNumber( double dNumber, WORD wDec ); /* pushes a number on to the stack and decides if it is integer, long or double */
extern void PushInteger( int iNumber );
extern void PushLong( long lNumber );
extern void PushDouble( double dNumber, WORD wDec );
extern void PushString( char * szText, ULONG length ); /* pushes a string on to the stack */
extern void PushLogical( int iTrueFalse ); /* pushes a logical value onto the stack */
extern void PushSymbol( PHB_SYMB );
extern void Do( WORD wParams ); /* invokes the virtual machine */
extern void Function( WORD wParams ); /* invokes the virtual machine */
/* Harbour virtual machine functions */
extern void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
extern void hb_vmProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbols initialization */
#ifdef HARBOUR_OBJ_GENERATION
extern void hb_vmProcessObjSymbols ( void ); /* process Harbour generated OBJ symbols */
#endif
extern void hb_vmDoInitStatics( void ); /* executes all _INITSTATICS functions */
extern void hb_vmDoInitFunctions( int argc, char * argv[] ); /* executes all defined PRGs INIT functions */
extern void hb_vmDoExitFunctions( void ); /* executes all defined PRGs EXIT functions */
extern void hb_vmReleaseLocalSymbols( void ); /* releases the memory of the local symbols linked list */
/* PCode functions */
extern void hb_vmAnd( void ); /* performs the logical AND on the latest two values, removes them and leaves result on the stack */
extern void hb_vmArrayAt( void ); /* pushes an array element to the stack, removing the array and the index from the stack */
extern void hb_vmArrayPut( void ); /* sets an array value and pushes the value on to the stack */
extern void hb_vmDec( void ); /* decrements the latest numeric value on the stack */
extern void hb_vmDimArray( WORD wDimensions ); /* generates a wDimensions Array and initialize those dimensions from the stack values */
extern void hb_vmDivide( void ); /* divides the latest two values on the stack, removes them and leaves the result */
extern void hb_vmDo( WORD WParams ); /* invoke the virtual machine */
extern HARBOUR hb_vmDoBlock( void ); /* executes a codeblock */
extern void hb_vmDuplicate( void ); /* duplicates the latest value on the stack */
extern void hb_vmDuplTwo( void ); /* duplicates the latest two value on the stack */
extern void hb_vmEndBlock( void ); /* copies the last codeblock pushed value into the return value */
extern void hb_vmEqual( BOOL bExact ); /* checks if the two latest values on the stack are equal, removes both and leaves result */
extern void hb_vmForTest( void ); /* test for end condition of for */
extern void hb_vmFrame( BYTE bLocals, BYTE bParams ); /* increases the stack pointer for the amount of locals and params suplied */
extern void hb_vmFuncPtr( void ); /* pushes a function address pointer. Removes the symbol from the satck */
extern void hb_vmFunction( WORD wParams ); /* executes a function saving its result */
extern void hb_vmGenArray( WORD wElements ); /* generates a wElements Array and fills it from the stack values */
extern void hb_vmGreater( void ); /* checks if the latest - 1 value is greater than the latest, removes both and leaves result */
extern void hb_vmGreaterEqual( void ); /* checks if the latest - 1 value is greater than or equal the latest, removes both and leaves result */
extern void hb_vmInc( void ); /* increment the latest numeric value on the stack */
extern void hb_vmInstring( void ); /* check whether string 1 is contained in string 2 */
extern void hb_vmLess( void ); /* checks if the latest - 1 value is less than the latest, removes both and leaves result */
extern void hb_vmLessEqual( void ); /* checks if the latest - 1 value is less than or equal the latest, removes both and leaves result */
extern void hb_vmLocalName( WORD wLocal, char * szLocalName ); /* locals and parameters index and name information for the debugger */
extern void hb_vmMessage( PHB_SYMB pSymMsg ); /* sends a message to an object */
extern void hb_vmMinus( void ); /* substracts the latest two values on the stack, removes them and leaves the result */
extern void hb_vmModuleName( char * szModuleName ); /* PRG and function name information for the debugger */
extern void hb_vmModulus( void ); /* calculates the modulus of latest two values on the stack, removes them and leaves the result */
extern void hb_vmMult( void ); /* multiplies the latest two values on the stack, removes them and leaves the result */
extern void hb_vmNegate( void ); /* negates (-) the latest value on the stack */
extern void hb_vmNot( void ); /* changes the latest logical value on the stack */
extern void hb_vmNotEqual( void ); /* checks if the two latest values on the stack are not equal, removes both and leaves result */
extern void hb_vmOperatorCall( PHB_ITEM, PHB_ITEM, char *); /* call an overloaded operator */
extern void hb_vmOr( void ); /* performs the logical OR on the latest two values, removes them and leaves result on the stack */
extern void hb_vmPlus( void ); /* sums the latest two values on the stack, removes them and leaves the result */
extern long hb_vmPopDate( void ); /* pops the stack latest value and returns its date value as a LONG */
extern void hb_vmPopDefStat( WORD wStatic ); /* pops the stack latest value onto a static as default init */
extern double hb_vmPopDouble( WORD * ); /* pops the stack latest value and returns its double numeric format value */
extern void hb_vmPopLocal( SHORT wLocal ); /* pops the stack latest value onto a local */
extern BOOL hb_vmPopLogical( void ); /* pops the stack latest value and returns its logical value */
extern void hb_vmPopMemvar( PHB_SYMB ); /* pops a value of memvar variable */
extern double hb_vmPopNumber( void ); /* pops the stack latest value and returns its numeric value */
extern void hb_vmPopParameter( PHB_SYMB, BYTE ); /* creates a PRIVATE variable and sets it with parameter's value */
extern void hb_vmPopStatic( WORD wStatic ); /* pops the stack latest value onto a static */
extern void hb_vmPower( void ); /* power the latest two values on the stack, removes them and leaves the result */
extern void hb_vmPush( PHB_ITEM pItem ); /* pushes a generic item onto the stack */
extern void hb_vmPushBlock( BYTE * pCode, PHB_SYMB pSymbols ); /* creates a codeblock */
extern void hb_vmPushDate( LONG lDate ); /* pushes a long date onto the stack */
extern void hb_vmPushDouble( double lNumber, WORD wDec ); /* pushes a double number onto the stack */
extern void hb_vmPushLocal( SHORT iLocal ); /* pushes the containts of a local onto the stack */
extern void hb_vmPushLocalByRef( SHORT iLocal ); /* pushes a local by refrence onto the stack */
extern void hb_vmPushLogical( BOOL bValue ); /* pushes a logical value onto the stack */
extern void hb_vmPushLong( long lNumber ); /* pushes a long number onto the stack */
extern void hb_vmPushMemvar( PHB_SYMB ); /* pushes a value of memvar variable */
extern void hb_vmPushMemvarByRef( PHB_SYMB ); /* pushes a reference to a memvar variable */
extern void hb_vmPushNil( void ); /* in this case it places nil at self */
extern void hb_vmPushNumber( double dNumber, WORD wDec ); /* pushes a number on to the stack and decides if it is integer, long or double */
extern void hb_vmPushStatic( WORD wStatic ); /* pushes the containts of a static onto the stack */
extern void hb_vmPushStaticByRef( WORD iLocal ); /* pushes a static by refrence onto the stack */
extern void hb_vmPushString( char * szText, ULONG length ); /* pushes a string on to the stack */
extern void hb_vmPushSymbol( PHB_SYMB pSym ); /* pushes a function pointer onto the stack */
extern void hb_vmPushInteger( int iNumber ); /* pushes a integer number onto the stack */
extern void hb_vmRetValue( void ); /* pops the latest stack value into stack.Return */
extern void hb_vmSFrame( PHB_SYMB pSym ); /* sets the statics frame for a function */
extern void hb_vmStatics( PHB_SYMB pSym ); /* increases the the global statics array to hold a PRG statics */
/* stack management functions */
extern void hb_stackDec( void ); /* pops an item from the stack without clearing it's contents */
extern void hb_stackPop( void ); /* pops an item from the stack */
extern void hb_stackFree( void ); /* releases all memory used by the stack */
extern void hb_stackPush( void ); /* pushes an item on to the stack */
extern void hb_stackInit( void ); /* initializes the stack */
extern void hb_stackShow( void ); /* show the types of the items on the stack for debugging purposes */
#define STACK_INITHB_ITEMS 100
#define STACK_EXPANDHB_ITEMS 20
#endif /* HB_CTOHARB_H_ */

View File

@@ -61,9 +61,6 @@ typedef struct
#define FS_MEMVAR 0x80
#define FS_ALLOCATED (-1)
extern void VirtualMachine( BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbols initialization */
/* items types */
#define IT_NIL 0x0000
#define IT_INTEGER 0x0002
@@ -283,6 +280,11 @@ extern void hb_xfree( void * pMem ); /* frees memory */
extern void * hb_xrealloc( void * pMem, ULONG lSize ); /* reallocates memory */
extern ULONG hb_xsize( void * pMem ); /* returns the size of an allocated memory block */
extern ULONG ulMemoryBlocks; /* memory blocks used */
extern ULONG ulMemoryMaxBlocks; /* maximum number of used memory blocks */
extern ULONG ulMemoryConsumed; /* memory size consumed */
extern ULONG ulMemoryMaxConsumed; /* memory max size consumed */
/* array management */
extern void hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ); /* creates a new array */
extern void hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ); /* retrieves an item */
@@ -332,26 +334,26 @@ extern void hb_dynsymRelease( void ); /* releases the memory of the
extern PHB_SYMB hb_symbolNew( char * szName );
/* Codeblock management */
extern HB_CODEBLOCK_PTR hb_CodeblockNew( BYTE *, WORD, WORD *, PHB_SYMB );
extern void hb_CodeblockDelete( PHB_ITEM );
extern PHB_ITEM hb_CodeblockGetVar( PHB_ITEM, LONG );
extern PHB_ITEM hb_CodeblockGetRef( PHB_ITEM, PHB_ITEM );
extern void hb_CodeblockEvaluate( PHB_ITEM );
extern void hb_CodeblockCopy( PHB_ITEM, PHB_ITEM );
extern HB_CODEBLOCK_PTR hb_codeblockNew( BYTE *, WORD, WORD *, PHB_SYMB );
extern void hb_codeblockDelete( PHB_ITEM );
extern PHB_ITEM hb_codeblockGetVar( PHB_ITEM, LONG );
extern PHB_ITEM hb_codeblockGetRef( PHB_ITEM, PHB_ITEM );
extern void hb_codeblockEvaluate( PHB_ITEM );
extern void hb_codeblockCopy( PHB_ITEM, PHB_ITEM );
/* memvars subsystem */
extern HB_HANDLE hb_MemvarValueNew( PHB_ITEM, int );
extern HB_VALUE_PTR * hb_MemvarValueBaseAddress( void );
extern void hb_MemvarsInit( void );
extern void hb_MemvarsRelease( void );
extern void hb_MemvarValueIncRef( HB_HANDLE );
extern void hb_MemvarValueDecRef( HB_HANDLE );
extern void hb_MemvarSetValue( PHB_SYMB, HB_ITEM_PTR );
extern void hb_MemvarGetValue( HB_ITEM_PTR, PHB_SYMB );
extern void hb_MemvarGetRefer( HB_ITEM_PTR, PHB_SYMB );
extern void hb_MemvarNewSymbol( PHB_SYMB );
extern ULONG hb_MemvarGetPrivatesBase( void );
extern void hb_MemvarSetPrivatesBase( ULONG );
extern HB_HANDLE hb_memvarValueNew( PHB_ITEM, int );
extern HB_VALUE_PTR * hb_memvarValueBaseAddress( void );
extern void hb_memvarsInit( void );
extern void hb_memvarsRelease( void );
extern void hb_memvarValueIncRef( HB_HANDLE );
extern void hb_memvarValueDecRef( HB_HANDLE );
extern void hb_memvarSetValue( PHB_SYMB, HB_ITEM_PTR );
extern void hb_memvarGetValue( HB_ITEM_PTR, PHB_SYMB );
extern void hb_memvarGetRefer( HB_ITEM_PTR, PHB_SYMB );
extern void hb_memvarNewSymbol( PHB_SYMB );
extern ULONG hb_memvarGetPrivatesBase( void );
extern void hb_memvarSetPrivatesBase( ULONG );
extern char * hb_setColor( char * );

View File

@@ -76,7 +76,7 @@ typedef struct
PHB_DYNS pDynSym; /* pointer to its dynamic symbol if defined */
} HB_SYMB, * PHB_SYMB;
extern void VirtualMachine( BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
extern void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols ); /* invokes the virtual machine */
/* Harbour Functions scope (SYMBOLSCOPE) */
#define FS_PUBLIC 0x00

View File

@@ -29,7 +29,7 @@
#ifndef HB_INIT_H_
#define HB_INIT_H_
extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbols initialization */
extern void hb_vmProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbols initialization */
#ifdef HARBOUR_STRICT_ANSI_C
@@ -39,7 +39,7 @@ extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbo
#define HB_INIT_SYMBOLS_END( func ) }; \
void func( void ) \
{ \
ProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
hb_vmProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
}
#define HB_CALL_ON_STARTUP_BEGIN( func ) func( void ) {
@@ -54,7 +54,7 @@ extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbo
#define HB_INIT_SYMBOLS_END( func ) }; \
void __attribute__ ((constructor)) func( void ) \
{ \
ProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
hb_vmProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
}
@@ -72,7 +72,7 @@ extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbo
#define HB_INIT_SYMBOLS_END( func ) }; \
void func( void ) \
{ \
ProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
hb_vmProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
}
#define HB_CALL_ON_STARTUP_BEGIN( func ) \
@@ -88,7 +88,7 @@ extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbo
#define HB_INIT_SYMBOLS_END( func ) }; \
int func( void ) \
{ \
ProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
hb_vmProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
return 1; \
}; \
static int static_int_##func = func()
@@ -107,7 +107,7 @@ extern void ProcessSymbols( PHB_SYMB pSymbols, WORD wSymbols ); /* statics symbo
#define HB_INIT_SYMBOLS_END( func ) }; \
static int func( void ) \
{ \
ProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
hb_vmProcessSymbols( symbols, sizeof( symbols ) / sizeof( HB_SYMB ) ); \
return 1; \
}; \
static int static_int_##func = func()

View File

@@ -7,10 +7,10 @@ ROOT = ../
DIRS=\
hbpp \
compiler \
debug \
rtl \
vm \
rdd \
debug \
tools \
include $(ROOT)config/dir.cf

View File

@@ -2930,7 +2930,7 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag
fprintf( yyc, "/* %05li */", lPCodePos );
fprintf( yyc, " HB_P_ENDPROC };\n\n" );
fprintf( yyc, " VirtualMachine( pcode, symbols );\n}\n\n" );
fprintf( yyc, " hb_vmExecute( pcode, symbols );\n}\n\n" );
pFunc = pFunc->pNext;
}

View File

@@ -29,8 +29,8 @@
#include "errorapi.h"
#include "rddapi.h"
#include "set.h"
#include "rddsys.ch"
#include "ctoharb.h"
#include "rddsys.ch"
#include "set.ch"
#define HARBOUR_MAX_RDD_DRIVERNAME_LENGTH 32
@@ -204,11 +204,11 @@ static int hb_rddRegister( char * szDriver, USHORT uiType )
pRddNewNode->uiType = uiType;
/* Call <szDriver>_GETFUNCTABLE() */
PushSymbol( pGetFuncTable->pSymbol );
PushNil();
PushLong( ( long ) &pRddNewNode->uiFunctions );
PushLong( ( long ) &pRddNewNode->pTable );
Do( 2 );
hb_vmPushSymbol( pGetFuncTable->pSymbol );
hb_vmPushNil();
hb_vmPushLong( ( long ) &pRddNewNode->uiFunctions );
hb_vmPushLong( ( long ) &pRddNewNode->pTable );
hb_vmDo( 2 );
if ( hb_parni( -1 ) != SUCCESS )
{
hb_xfree( pRddNewNode ); /* Delete de new RDD node */
@@ -817,7 +817,7 @@ HARBOUR HB_DBUSEAREA( void )
/* Need more space? */
SELF_STRUCTSIZE( ( AREAP ) pCurrArea->pArea, &uiSize );
if( uiSize > sizeof( AREA ) ) /* Size of Area changed */
pCurrArea->pArea = ( AREAP ) hb_xrealloc( pCurrArea->pArea, uiSize );
pCurrArea->pArea = ( AREAP ) hb_xrealloc( pCurrArea->pArea, uiSize );
pRddNode->uiAreaSize = uiSize; /* Update the size of WorkArea */
}
@@ -880,12 +880,12 @@ HARBOUR HB_DBUSEAREA( void )
{
if( ( ( AREAP ) pAreaNode->pArea )->uiArea > uiCurrArea )
{
/* Insert the new WorkArea node */
pCurrArea->pPrev = pAreaNode->pPrev;
pCurrArea->pNext = pAreaNode;
pAreaNode->pPrev = pCurrArea;
if( pCurrArea->pPrev )
pCurrArea->pPrev->pNext = pCurrArea;
/* Insert the new WorkArea node */
pCurrArea->pPrev = pAreaNode->pPrev;
pCurrArea->pNext = pAreaNode;
pAreaNode->pPrev = pCurrArea;
if( pCurrArea->pPrev )
pCurrArea->pPrev->pNext = pCurrArea;
}
pAreaNode = pAreaNode->pNext;
}

View File

@@ -459,10 +459,10 @@ int hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, ULONG ulStart, ULONG ulCount
if ( pValue->type == IT_BLOCK )
{
PushSymbol( &symEval );
Push( pValue );
Push( pItem );
Do( 1 );
hb_vmPushSymbol( &symEval );
hb_vmPush( pValue );
hb_vmPush( pItem );
hb_vmDo( 1 );
if ( stack.Return.item.asLogical.value )
iRet = 1;
}
@@ -531,11 +531,11 @@ void hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, ULONG ulStart, ULONG ulCoun
{
PHB_ITEM pItem = pBaseArray->pItems + ulStart;
PushSymbol( &symEval );
Push( bBlock );
Push( pItem );
PushNumber( (double)(ulStart + 1), 0 );
Do( 2 );
hb_vmPushSymbol( &symEval );
hb_vmPush( bBlock );
hb_vmPush( pItem );
hb_vmPushNumber( (double)(ulStart + 1), 0 );
hb_vmDo( 2 );
}
}
else

View File

@@ -614,12 +614,12 @@ static HARBOUR EvalInline( void )
hb_arrayGet( pClasses[ wClass - 1 ].pInlines, pMethod->wData, &block );
PushSymbol( &symEval );
Push( &block );
Push( stack.pBase + 1 ); /* Push self */
hb_vmPushSymbol( &symEval );
hb_vmPush( &block );
hb_vmPush( stack.pBase + 1 ); /* Push self */
for( w = 1; w <= hb_pcount(); w++ )
Push( hb_param( w, IT_ANY ) );
Do( hb_pcount() + 1 ); /* Self is also an argument */
hb_vmPush( hb_param( w, IT_ANY ) );
hb_vmDo( hb_pcount() + 1 ); /* Self is also an argument */
hb_itemClear( &block ); /* Release block */
}
@@ -849,12 +849,12 @@ HARBOUR HB_OSEND(void)
if( pMessage && pObject ) /* Object & message passed */
{
Push( pObject ); /* Push object */
Message( hb_dynsymGet( pMessage->item.asString.value )->pSymbol );
hb_vmPush( pObject ); /* Push object */
hb_vmMessage( hb_dynsymGet( pMessage->item.asString.value )->pSymbol );
/* Push char symbol as message */
for( w = 3; w <= hb_pcount(); w++ ) /* Push arguments on stack */
Push( hb_param( w, IT_ANY ) );
Do( hb_pcount()-2 ); /* Execute message */
hb_vmPush( hb_param( w, IT_ANY ) );
hb_vmDo( hb_pcount()-2 ); /* Execute message */
}
else
{
@@ -994,9 +994,9 @@ HARBOUR HB___INSTSUPER( void )
pDynSym = hb_dynsymFind( pString->item.asString.value );
if( pDynSym ) /* Find function */
{
PushSymbol( pDynSym->pSymbol ); /* Push function name */
PushNil();
Function( 0 ); /* Execute super class */
hb_vmPushSymbol( pDynSym->pSymbol ); /* Push function name */
hb_vmPushNil();
hb_vmFunction( 0 ); /* Execute super class */
if( !IS_OBJECT( &stack.Return ) )
{

View File

@@ -37,6 +37,7 @@
#include <string.h>
#include "extend.h"
#include "ctoharb.h"
#include "itemapi.h"
/* Uncomment this to trace codeblocks activity
@@ -53,7 +54,7 @@
* Note: pLocalPosTable cannot be used if wLocals is ZERO
*
*/
HB_CODEBLOCK_PTR hb_CodeblockNew( BYTE * pBuffer,
HB_CODEBLOCK_PTR hb_codeblockNew( BYTE * pBuffer,
WORD wLocals,
WORD *pLocalPosTable,
PHB_SYMB pSymbols )
@@ -96,14 +97,14 @@ HB_CODEBLOCK_PTR hb_CodeblockNew( BYTE * pBuffer,
* pool so it can be shared by codeblocks
*/
hMemvar =hb_MemvarValueNew( pLocal, FALSE );
hMemvar =hb_memvarValueNew( pLocal, FALSE );
pLocal->type =IT_BYREF | IT_MEMVAR;
pLocal->item.asMemvar.itemsbase =hb_MemvarValueBaseAddress();
pLocal->item.asMemvar.itemsbase =hb_memvarValueBaseAddress();
pLocal->item.asMemvar.offset =0;
pLocal->item.asMemvar.value =hMemvar;
hb_MemvarValueIncRef( pLocal->item.asMemvar.value );
hb_memvarValueIncRef( pLocal->item.asMemvar.value );
memcpy( pCBlock->pLocals + w, pLocal, sizeof(HB_ITEM) );
}
else
@@ -114,7 +115,7 @@ HB_CODEBLOCK_PTR hb_CodeblockNew( BYTE * pBuffer,
/* Increment the reference counter so this value will not be
* released if other codeblock will be deleted
*/
hb_MemvarValueIncRef( pLocal->item.asMemvar.value );
hb_memvarValueIncRef( pLocal->item.asMemvar.value );
memcpy( pCBlock->pLocals + w, pLocal, sizeof(HB_ITEM) );
}
@@ -143,7 +144,7 @@ HB_CODEBLOCK_PTR hb_CodeblockNew( BYTE * pBuffer,
/* Delete a codeblock
*/
void hb_CodeblockDelete( HB_ITEM_PTR pItem )
void hb_codeblockDelete( HB_ITEM_PTR pItem )
{
HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value;
#ifdef CODEBLOCKDEBUG
@@ -158,7 +159,7 @@ void hb_CodeblockDelete( HB_ITEM_PTR pItem )
WORD w = 0;
while( w < pCBlock->wLocals )
{
hb_MemvarValueDecRef( pCBlock->pLocals[ w ].item.asMemvar.value );
hb_memvarValueDecRef( pCBlock->pLocals[ w ].item.asMemvar.value );
++w;
}
hb_xfree( pCBlock->pLocals );
@@ -179,18 +180,18 @@ void hb_CodeblockDelete( HB_ITEM_PTR pItem )
* (The codeblock can only see the static variables defined in a module
* where the codeblock was created)
*/
void hb_CodeblockEvaluate( HB_ITEM_PTR pItem )
void hb_codeblockEvaluate( HB_ITEM_PTR pItem )
{
int iStatics = stack.iStatics;
stack.iStatics = pItem->item.asBlock.statics;
VirtualMachine( pItem->item.asBlock.value->pCode, pItem->item.asBlock.value->pSymbols );
hb_vmExecute( pItem->item.asBlock.value->pCode, pItem->item.asBlock.value->pSymbols );
stack.iStatics = iStatics;
}
/* Get local variable referenced in a codeblock
*/
PHB_ITEM hb_CodeblockGetVar( PHB_ITEM pItem, LONG iItemPos )
PHB_ITEM hb_codeblockGetVar( PHB_ITEM pItem, LONG iItemPos )
{
HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value;
/* local variables accessed in a codeblock are always stored as reference */
@@ -199,7 +200,7 @@ PHB_ITEM hb_CodeblockGetVar( PHB_ITEM pItem, LONG iItemPos )
/* Get local variable passed by reference
*/
PHB_ITEM hb_CodeblockGetRef( PHB_ITEM pItem, PHB_ITEM pRefer )
PHB_ITEM hb_codeblockGetRef( PHB_ITEM pItem, PHB_ITEM pRefer )
{
HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value;
@@ -210,7 +211,7 @@ PHB_ITEM hb_CodeblockGetRef( PHB_ITEM pItem, PHB_ITEM pRefer )
* TODO: check if such simple pointer coping will allow to evaluate
* codeblocks recursively
*/
void hb_CodeblockCopy( PHB_ITEM pDest, PHB_ITEM pSource )
void hb_codeblockCopy( PHB_ITEM pDest, PHB_ITEM pSource )
{
pDest->item.asBlock.value =pSource->item.asBlock.value;
pDest->item.asBlock.value->lCounter++;

View File

@@ -49,7 +49,6 @@
#include "hbsetup.h"
#include "extend.h"
#include "itemapi.h"
#include "ctoharb.h"
#include "init.h"
#include "dates.h"
#include "set.h"

View File

@@ -25,7 +25,6 @@
#include "itemapi.h"
#include "extend.h"
#include "errorapi.h"
#include "ctoharb.h"
#include "filesys.h"
#include "init.h"

View File

@@ -50,11 +50,11 @@ HARBOUR HB_DO( void )
{
int i;
PushSymbol( pDynSym->pSymbol );
PushNil();
hb_vmPushSymbol( pDynSym->pSymbol );
hb_vmPushNil();
for( i = 2; i <= hb_pcount(); i++ )
Push( hb_param( i, IT_ANY ) );
Do( hb_pcount() - 1 );
hb_vmPush( hb_param( i, IT_ANY ) );
hb_vmDo( hb_pcount() - 1 );
}
else
hb_errorRT_BASE( EG_NOFUNC, 1001, NULL, pItem->item.asString.value );
@@ -63,21 +63,21 @@ HARBOUR HB_DO( void )
{
int i;
PushSymbol( &symEval );
Push( pItem );
hb_vmPushSymbol( &symEval );
hb_vmPush( pItem );
for( i = 2; i <= hb_pcount(); i++ )
Push( hb_param( i, IT_ANY ) );
Do( hb_pcount() - 1 );
hb_vmPush( hb_param( i, IT_ANY ) );
hb_vmDo( hb_pcount() - 1 );
}
else if( IS_SYMBOL(pItem) )
{
int i;
PushSymbol( pItem->item.asSymbol.value );
PushNil();
hb_vmPushSymbol( pItem->item.asSymbol.value );
hb_vmPushNil();
for( i = 2; i <= hb_pcount(); i++ )
Push( hb_param( i, IT_ANY ) );
Do( hb_pcount() - 1 );
hb_vmPush( hb_param( i, IT_ANY ) );
hb_vmDo( hb_pcount() - 1 );
}
else
hb_errorRT_BASE( EG_ARG, 3012, NULL, "DO" );

View File

@@ -32,9 +32,9 @@ PHB_ITEM hb_errNew( void )
{
PHB_ITEM pReturn = hb_itemNew( NULL );
PushSymbol( hb_dynsymGet( "ERRORNEW" )->pSymbol );
PushNil();
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "ERRORNEW" )->pSymbol );
hb_vmPushNil();
hb_vmDo( 0 );
hb_itemCopy( pReturn, &stack.Return );
@@ -63,10 +63,10 @@ WORD hb_errLaunch( PHB_ITEM pError )
exit( 1 );
}
PushSymbol( &symEval );
Push( &errorBlock );
Push( pError );
Do( 1 );
hb_vmPushSymbol( &symEval );
hb_vmPush( &errorBlock );
hb_vmPush( pError );
hb_vmDo( 1 );
/* TODO: Handle the canSubstitute case somehow */
/* Clipper doesn't document the case where canSubstitute is set */
@@ -107,155 +107,155 @@ void hb_errRelease( PHB_ITEM pError )
char * hb_errGetDescription( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "DESCRIPTION" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "DESCRIPTION" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asString.value;
}
PHB_ITEM hb_errPutDescription( PHB_ITEM pError, char * szDescription )
{
PushSymbol( hb_dynsymGet( "_DESCRIPTION" )->pSymbol );
Push( pError );
PushString( szDescription, strlen( szDescription ) );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_DESCRIPTION" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szDescription, strlen( szDescription ) );
hb_vmDo( 1 );
return pError;
}
char * hb_errGetFileName( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "FILENAME" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "FILENAME" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asString.value;
}
PHB_ITEM hb_errPutFileName( PHB_ITEM pError, char * szFileName )
{
PushSymbol( hb_dynsymGet( "_FILENAME" )->pSymbol );
Push( pError );
PushString( szFileName, strlen( szFileName ) );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_FILENAME" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szFileName, strlen( szFileName ) );
hb_vmDo( 1 );
return pError;
}
USHORT hb_errGetGenCode( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "GENCODE" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "GENCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asInteger.value;
}
PHB_ITEM hb_errPutGenCode( PHB_ITEM pError, USHORT uiGenCode )
{
PushSymbol( hb_dynsymGet( "_GENCODE" )->pSymbol );
Push( pError );
PushInteger( uiGenCode );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_GENCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiGenCode );
hb_vmDo( 1 );
return pError;
}
char * hb_errGetOperation( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "OPERATION" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "OPERATION" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asString.value;
}
PHB_ITEM hb_errPutOperation( PHB_ITEM pError, char * szOperation )
{
PushSymbol( hb_dynsymGet( "_OPERATION" )->pSymbol );
Push( pError );
PushString( szOperation, strlen( szOperation ) );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_OPERATION" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szOperation, strlen( szOperation ) );
hb_vmDo( 1 );
return pError;
}
USHORT hb_errGetOsCode( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "OSCODE" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "OSCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asInteger.value;
}
PHB_ITEM hb_errPutOsCode( PHB_ITEM pError, USHORT uiOsCode )
{
PushSymbol( hb_dynsymGet( "_OSCODE" )->pSymbol );
Push( pError );
PushInteger( uiOsCode );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_OSCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiOsCode );
hb_vmDo( 1 );
return pError;
}
USHORT hb_errGetSeverity( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "SEVERITY" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "SEVERITY" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asInteger.value;
}
PHB_ITEM hb_errPutSeverity( PHB_ITEM pError, USHORT uiSeverity )
{
PushSymbol( hb_dynsymGet( "_SEVERITY" )->pSymbol );
Push( pError );
PushInteger( uiSeverity );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_SEVERITY" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiSeverity );
hb_vmDo( 1 );
return pError;
}
USHORT hb_errGetSubCode( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "SUBCODE" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "SUBCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asInteger.value;
}
PHB_ITEM hb_errPutSubCode( PHB_ITEM pError, USHORT uiSubCode )
{
PushSymbol( hb_dynsymGet( "_SUBCODE" )->pSymbol );
Push( pError );
PushInteger( uiSubCode );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_SUBCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiSubCode );
hb_vmDo( 1 );
return pError;
}
char * hb_errGetSubSystem( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "SUBSYSTEM" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "SUBSYSTEM" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asString.value;
}
PHB_ITEM hb_errPutSubSystem( PHB_ITEM pError, char * szSubSystem )
{
PushSymbol( hb_dynsymGet( "_SUBSYSTEM" )->pSymbol );
Push( pError );
PushString( szSubSystem, strlen( szSubSystem ) );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_SUBSYSTEM" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szSubSystem, strlen( szSubSystem ) );
hb_vmDo( 1 );
return pError;
}
USHORT hb_errGetTries( PHB_ITEM pError )
{
PushSymbol( hb_dynsymGet( "TRIES" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "TRIES" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
return stack.Return.item.asInteger.value;
}
PHB_ITEM hb_errPutTries( PHB_ITEM pError, USHORT uiTries )
{
PushSymbol( hb_dynsymGet( "_TRIES" )->pSymbol );
Push( pError );
PushInteger( uiTries );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_TRIES" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiTries );
hb_vmDo( 1 );
return pError;
}
@@ -265,25 +265,25 @@ USHORT hb_errGetFlags( PHB_ITEM pError )
/* ; */
PushSymbol( hb_dynsymGet( "CANRETRY" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "CANRETRY" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
if (stack.Return.item.asLogical.value) uiFlags |= EF_CANRETRY;
/* ; */
PushSymbol( hb_dynsymGet( "CANSUBSTITUTE" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "CANSUBSTITUTE" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
if (stack.Return.item.asLogical.value) uiFlags |= EF_CANSUBSTITUTE;
/* ; */
PushSymbol( hb_dynsymGet( "CANDEFAULT" )->pSymbol );
Push( pError );
Do( 0 );
hb_vmPushSymbol( hb_dynsymGet( "CANDEFAULT" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
if (stack.Return.item.asLogical.value) uiFlags |= EF_CANDEFAULT;
@@ -294,24 +294,24 @@ USHORT hb_errGetFlags( PHB_ITEM pError )
PHB_ITEM hb_errPutFlags( PHB_ITEM pError, USHORT uiFlags )
{
PushSymbol( hb_dynsymGet( "_CANRETRY" )->pSymbol );
Push( pError );
PushLogical( uiFlags & EF_CANRETRY );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_CANRETRY" )->pSymbol );
hb_vmPush( pError );
hb_vmPushLogical( uiFlags & EF_CANRETRY );
hb_vmDo( 1 );
/* ; */
PushSymbol( hb_dynsymGet( "_CANSUBSTITUTE" )->pSymbol );
Push( pError );
PushLogical( uiFlags & EF_CANSUBSTITUTE );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_CANSUBSTITUTE" )->pSymbol );
hb_vmPush( pError );
hb_vmPushLogical( uiFlags & EF_CANSUBSTITUTE );
hb_vmDo( 1 );
/* ; */
PushSymbol( hb_dynsymGet( "_CANDEFAULT" )->pSymbol );
Push( pError );
PushLogical( uiFlags & EF_CANDEFAULT );
Do( 1 );
hb_vmPushSymbol( hb_dynsymGet( "_CANDEFAULT" )->pSymbol );
hb_vmPush( pError );
hb_vmPushLogical( uiFlags & EF_CANDEFAULT );
hb_vmDo( 1 );
/* ; */

View File

@@ -433,7 +433,7 @@ void hb_gt_DispBegin(void)
&srWin); /* screen buffer rectangle to read from */
/* store current handle */
if( HStealth = INVALID_HANDLE_VALUE )
if( ( HStealth = INVALID_HANDLE_VALUE ) )
{
HStealth = CreateConsoleScreenBuffer(
GENERIC_READ | GENERIC_WRITE, /* Access flag */

View File

@@ -86,21 +86,21 @@ PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo )
{
if( IS_STRING( pEvalInfo->pItems[ 0 ] ) )
{
PushSymbol( hb_dynsymGet( hb_itemGetC( pEvalInfo->pItems[ 0 ] ) )->pSymbol );
PushNil();
hb_vmPushSymbol( hb_dynsymGet( hb_itemGetC( pEvalInfo->pItems[ 0 ] ) )->pSymbol );
hb_vmPushNil();
while( w < (HB_EVAL_PARAM_MAX_ + 1) && pEvalInfo->pItems[ w ] )
Push( pEvalInfo->pItems[ w++ ] );
Do( w - 1 );
hb_vmPush( pEvalInfo->pItems[ w++ ] );
hb_vmDo( w - 1 );
pResult = hb_itemNew( 0 );
hb_itemCopy( pResult, &stack.Return );
}
else if( IS_BLOCK( pEvalInfo->pItems[ 0 ] ) )
{
PushSymbol( &symEval );
Push( pEvalInfo->pItems[ 0 ] );
hb_vmPushSymbol( &symEval );
hb_vmPush( pEvalInfo->pItems[ 0 ] );
while( w < (HB_EVAL_PARAM_MAX_ + 1) && pEvalInfo->pItems[ w ] )
Push( pEvalInfo->pItems[ w++ ] );
Do( w - 1 );
hb_vmPush( pEvalInfo->pItems[ w++ ] );
hb_vmDo( w - 1 );
pResult = hb_itemNew( 0 );
hb_itemCopy( pResult, &stack.Return );
}
@@ -406,10 +406,10 @@ void hb_itemClear( PHB_ITEM pItem )
}
else if( IS_BLOCK( pItem ) )
{
hb_CodeblockDelete( pItem );
hb_codeblockDelete( pItem );
}
else if( IS_MEMVAR( pItem ) )
hb_MemvarValueDecRef( pItem->item.asMemvar.value );
hb_memvarValueDecRef( pItem->item.asMemvar.value );
pItem->type = IT_NIL;
}
@@ -441,11 +441,11 @@ void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
else if( IS_BLOCK( pSource ) )
{
hb_CodeblockCopy( pDest, pSource );
hb_codeblockCopy( pDest, pSource );
}
else if( IS_MEMVAR( pSource ) )
{
hb_MemvarValueIncRef( pSource->item.asMemvar.value );
hb_memvarValueIncRef( pSource->item.asMemvar.value );
}
}
@@ -460,20 +460,20 @@ PHB_ITEM hb_itemUnRef( PHB_ITEM pItem )
{
HB_VALUE_PTR pValue;
pValue =*(pItem->item.asMemvar.itemsbase) + pItem->item.asMemvar.offset +
pItem->item.asMemvar.value;
pItem =&pValue->item;
pValue = *(pItem->item.asMemvar.itemsbase) + pItem->item.asMemvar.offset +
pItem->item.asMemvar.value;
pItem = &pValue->item;
}
else
{
if( pItem->item.asRefer.value >= 0 )
pItem =*(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset +
pItem->item.asRefer.value;
pItem = *(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset +
pItem->item.asRefer.value;
else
{
/* local variable referenced in a codeblock
*/
pItem =hb_CodeblockGetRef( *(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset,
pItem = hb_codeblockGetRef( *(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset,
pItem );
}
}

View File

@@ -60,11 +60,11 @@ static HB_VALUE_PTR _globalTable = NULL;
#define MEMVARDEBUG
*/
static void hb_MemvarCreateFromItem( PHB_ITEM, BYTE, PHB_ITEM );
static void hb_MemvarCreateFromDynSymbol( PHB_DYNS, BYTE, PHB_ITEM );
static void hb_MemvarAddPrivate( PHB_DYNS );
static void hb_memvarCreateFromItem( PHB_ITEM, BYTE, PHB_ITEM );
static void hb_memvarCreateFromDynSymbol( PHB_DYNS, BYTE, PHB_ITEM );
static void hb_memvarAddPrivate( PHB_DYNS );
void hb_MemvarsInit( void )
void hb_memvarsInit( void )
{
_globalTable = (HB_VALUE_PTR) hb_xgrab( sizeof(HB_VALUE) * TABLE_INITHB_VALUE );
_globalTableSize = TABLE_INITHB_VALUE;
@@ -77,7 +77,7 @@ void hb_MemvarsInit( void )
}
void hb_MemvarsRelease( void )
void hb_memvarsRelease( void )
{
ULONG ulCnt = _globalLastFree;
@@ -103,7 +103,7 @@ void hb_MemvarsRelease( void )
/*
* This function base address of values table
*/
HB_VALUE_PTR *hb_MemvarValueBaseAddress( void )
HB_VALUE_PTR *hb_memvarValueBaseAddress( void )
{
return &_globalTable;
}
@@ -125,7 +125,7 @@ HB_VALUE_PTR *hb_MemvarValueBaseAddress( void )
* handle to variable memory or fails
*
*/
HB_HANDLE hb_MemvarValueNew( HB_ITEM_PTR pSource, int iTrueMemvar )
HB_HANDLE hb_memvarValueNew( HB_ITEM_PTR pSource, int iTrueMemvar )
{
HB_VALUE_PTR pValue;
HB_HANDLE hValue = 1; /* handle 0 is reserved */
@@ -198,7 +198,7 @@ HB_HANDLE hb_MemvarValueNew( HB_ITEM_PTR pSource, int iTrueMemvar )
* an exit from the function/procedure)
*
*/
static void hb_MemvarAddPrivate( PHB_DYNS pDynSym )
static void hb_memvarAddPrivate( PHB_DYNS pDynSym )
{
/* Allocate the value from the end of table
*/
@@ -216,7 +216,7 @@ static void hb_MemvarAddPrivate( PHB_DYNS pDynSym )
/*
* This function returns current PRIVATE variables stack base
*/
ULONG hb_MemvarGetPrivatesBase( void )
ULONG hb_memvarGetPrivatesBase( void )
{
ULONG ulBase = _privateStackBase;
_privateStackBase =_privateStackCnt;
@@ -227,7 +227,7 @@ ULONG hb_MemvarGetPrivatesBase( void )
* This function releases PRIVATE variables created after passed base
*
*/
void hb_MemvarSetPrivatesBase( ULONG ulBase )
void hb_memvarSetPrivatesBase( ULONG ulBase )
{
HB_HANDLE hVar, hOldValue;
@@ -236,7 +236,7 @@ void hb_MemvarSetPrivatesBase( ULONG ulBase )
--_privateStackCnt;
hVar =_privateStack[ _privateStackCnt ]->hMemvar;
hOldValue =_globalTable[ hVar ].hPrevMemvar;
hb_MemvarValueDecRef( hVar );
hb_memvarValueDecRef( hVar );
/*
* Restore previous value for variables that were overridden
*/
@@ -249,7 +249,7 @@ void hb_MemvarSetPrivatesBase( ULONG ulBase )
* This function increases the number of references to passed global value
*
*/
void hb_MemvarValueIncRef( HB_HANDLE hValue )
void hb_memvarValueIncRef( HB_HANDLE hValue )
{
#ifdef MEMVARDEBUG
if( hValue < 1 || hValue > _globalTableSize )
@@ -271,7 +271,7 @@ void hb_MemvarValueIncRef( HB_HANDLE hValue )
* If it is the last reference then this value is deleted.
*
*/
void hb_MemvarValueDecRef( HB_HANDLE hValue )
void hb_memvarValueDecRef( HB_HANDLE hValue )
{
HB_VALUE_PTR pValue;
@@ -317,7 +317,7 @@ void hb_MemvarValueDecRef( HB_HANDLE hValue )
}
}
/* This can happen if for example PUBLIC variable holds a codeblock with
* detached variable. When hb_MemvarsRelease() is called then detached
* detached variable. When hb_memvarsRelease() is called then detached
* variable can be released before the codeblock. So if the codeblock
* will be released later then it will try to release again this detached
* variable.
@@ -334,7 +334,7 @@ void hb_MemvarValueDecRef( HB_HANDLE hValue )
* pItem - value to store in memvar
*
*/
void hb_MemvarSetValue( PHB_SYMB pMemvarSymb, HB_ITEM_PTR pItem )
void hb_memvarSetValue( PHB_SYMB pMemvarSymb, HB_ITEM_PTR pItem )
{
PHB_DYNS pDyn;
@@ -358,14 +358,14 @@ void hb_MemvarSetValue( PHB_SYMB pMemvarSymb, HB_ITEM_PTR pItem )
{
/* assignment to undeclared memvar - PRIVATE is assumed
*/
hb_MemvarCreateFromDynSymbol( pDyn, VS_PRIVATE, pItem );
hb_memvarCreateFromDynSymbol( pDyn, VS_PRIVATE, pItem );
}
}
else
hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName );
}
void hb_MemvarGetValue( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
void hb_memvarGetValue( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
{
PHB_DYNS pDyn;
@@ -393,7 +393,7 @@ void hb_MemvarGetValue( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName );
}
void hb_MemvarGetRefer( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
void hb_memvarGetRefer( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
{
PHB_DYNS pDyn;
@@ -433,7 +433,7 @@ void hb_MemvarGetRefer( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
* or NULL
*
*/
static void hb_MemvarCreateFromItem( PHB_ITEM pMemvar, BYTE bScope, PHB_ITEM pValue )
static void hb_memvarCreateFromItem( PHB_ITEM pMemvar, BYTE bScope, PHB_ITEM pValue )
{
PHB_DYNS pDynVar;
@@ -446,10 +446,10 @@ static void hb_MemvarCreateFromItem( PHB_ITEM pMemvar, BYTE bScope, PHB_ITEM pVa
hb_errorRT_BASE( EG_ARG, 3008, NULL, "&" );
if( pDynVar )
hb_MemvarCreateFromDynSymbol( pDynVar, bScope, pValue );
hb_memvarCreateFromDynSymbol( pDynVar, bScope, pValue );
}
static void hb_MemvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITEM pValue )
static void hb_memvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITEM pValue )
{
if( bScope & VS_PUBLIC )
{
@@ -458,7 +458,7 @@ static void hb_MemvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITE
*/
if( ! pDynVar->hMemvar )
{
pDynVar->hMemvar = hb_MemvarValueNew( pValue, TRUE );
pDynVar->hMemvar = hb_memvarValueNew( pValue, TRUE );
if( !pValue )
{
/* new PUBLIC variable - initialize it to .F.
@@ -476,12 +476,12 @@ static void hb_MemvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITE
*/
HB_HANDLE hCurrentValue =pDynVar->hMemvar;
pDynVar->hMemvar = hb_MemvarValueNew( pValue, TRUE );
pDynVar->hMemvar = hb_memvarValueNew( pValue, TRUE );
_globalTable[ pDynVar->hMemvar ].hPrevMemvar =hCurrentValue;
/* Add this variable to the PRIVATE variables stack
*/
hb_MemvarAddPrivate( pDynVar );
hb_memvarAddPrivate( pDynVar );
}
}
@@ -489,7 +489,7 @@ static void hb_MemvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITE
* It also restores the value that was hidden if there is another
* PRIVATE variable with the same name.
*/
void hb_MemvarRelease( HB_ITEM_PTR pMemvar )
void hb_memvarRelease( HB_ITEM_PTR pMemvar )
{
ULONG ulBase = _privateStackCnt;
PHB_DYNS pDynVar;
@@ -526,7 +526,7 @@ void hb_MemvarRelease( HB_ITEM_PTR pMemvar )
* procedure only.
* The scope of released variables are specified using passed name's mask
*/
void hb_MemvarReleaseWithMask( char *szMask, BOOL bInclude )
void hb_memvarReleaseWithMask( char *szMask, BOOL bInclude )
{
ULONG ulBase = _privateStackCnt;
PHB_DYNS pDynVar;
@@ -612,12 +612,12 @@ HARBOUR HB___MVPUBLIC( void )
for( j=1; j<=ulLen; j++ )
{
hb_arrayGet( pMemvar, j, &VarItem );
hb_MemvarCreateFromItem( &VarItem, VS_PUBLIC, NULL );
hb_memvarCreateFromItem( &VarItem, VS_PUBLIC, NULL );
hb_itemClear( &VarItem );
}
}
else
hb_MemvarCreateFromItem( pMemvar, VS_PUBLIC, NULL );
hb_memvarCreateFromItem( pMemvar, VS_PUBLIC, NULL );
}
}
}
@@ -680,12 +680,12 @@ HARBOUR HB___MVPRIVATE( void )
for( j=1; j<=ulLen; j++ )
{
hb_arrayGet( pMemvar, j, &VarItem );
hb_MemvarCreateFromItem( &VarItem, VS_PRIVATE, NULL );
hb_memvarCreateFromItem( &VarItem, VS_PRIVATE, NULL );
hb_itemClear( &VarItem );
}
}
else
hb_MemvarCreateFromItem( pMemvar, VS_PRIVATE, NULL );
hb_memvarCreateFromItem( pMemvar, VS_PRIVATE, NULL );
}
}
}
@@ -749,12 +749,12 @@ HARBOUR HB___MVXRELEASE( void )
for( j=1; j<=ulLen; j++ )
{
hb_arrayGet( pMemvar, j, &VarItem );
hb_MemvarRelease( &VarItem );
hb_memvarRelease( &VarItem );
hb_itemClear( &VarItem );
}
}
else
hb_MemvarRelease( pMemvar );
hb_memvarRelease( pMemvar );
}
}
}
@@ -814,7 +814,7 @@ HARBOUR HB___MVRELEASE( void )
if( pMask->item.asString.value[ 0 ] == '*' )
bIncludeVar =TRUE; /* delete all memvar variables */
hb_MemvarReleaseWithMask( pMask->item.asString.value, bIncludeVar );
hb_memvarReleaseWithMask( pMask->item.asString.value, bIncludeVar );
}
}
}

View File

@@ -220,18 +220,18 @@ char *NumPicture( char *szPic, long lPic, int iPicFlags, double dValue,
bEmpty = !dPush && ( iPicFlags & PF_EMPTY ); /* Suppress 0 */
PushSymbol ( hb_dynsymGet( "STR" )->pSymbol ); /* Push STR function */
PushNil (); /* Function call. No object */
hb_vmPushSymbol ( hb_dynsymGet( "STR" )->pSymbol ); /* Push STR function */
hb_vmPushNil (); /* Function call. No object */
PushDouble ( dPush, iDecimals ); /* Push value to transform */
hb_vmPushDouble ( dPush, iDecimals ); /* Push value to transform */
if( !iWidth ) /* Width calculated ?? */
{
iWidth = iOrigWidth; /* Push original width */
iDecimals = iOrigDec; /* Push original decimals */
}
PushInteger( iWidth ); /* Push numbers width */
PushInteger( iDecimals ); /* Push decimals */
Function( 3 ); /* 3 Parameters */
hb_vmPushInteger( iWidth ); /* Push numbers width */
hb_vmPushInteger( iDecimals ); /* Push decimals */
hb_vmFunction( 3 ); /* 3 Parameters */
pItem = &stack.Return;
if( IS_STRING( pItem ) ) /* Is it a string */
{

View File

@@ -212,28 +212,28 @@ HARBOUR HB_MAIN( void )
{
if( (pSymRead[ ul ].cScope & (FS_INIT|FS_EXIT)) == FS_INIT )
{
PushSymbol( pSymRead + ul );
PushNil();
hb_vmPushSymbol( pSymRead + ul );
hb_vmPushNil();
for( i = 0; i < (hb_pcount() - 1); i++ )
Push( hb_param( i + 2, IT_ANY ) );
hb_vmPush( hb_param( i + 2, IT_ANY ) );
/* Push other cmdline params*/
Do( hb_pcount() - 1 ); /* Run init function */
hb_vmDo( hb_pcount() - 1 ); /* Run init function */
}
}
PushSymbol( pSymRead );
PushNil();
hb_vmPushSymbol( pSymRead );
hb_vmPushNil();
for( i = 0; i < (hb_pcount() - 1); i++ )
Push( hb_param( i + 2, IT_ANY ) ); /* Push other cmdline params*/
Do( hb_pcount() - 1 ); /* Run the thing !!! */
hb_vmPush( hb_param( i + 2, IT_ANY ) ); /* Push other cmdline params*/
hb_vmDo( hb_pcount() - 1 ); /* Run the thing !!! */
for( ul = 0; ul < ulSymbols; ul++ ) /* Check EXIT functions */
{
if( ( pSymRead[ ul ].cScope & FS_INITEXIT ) == FS_EXIT )
{
PushSymbol( pSymRead + ul );
PushNil();
Do( 0 ); /* Run exit function */
hb_vmPushSymbol( pSymRead + ul );
hb_vmPushNil();
hb_vmDo( 0 ); /* Run exit function */
pSymRead[ ul ].cScope = pSymRead[ ul ].cScope & (~FS_EXIT);
/* Exit function cannot be
handled by main in hvm.c */

View File

@@ -38,7 +38,6 @@
* $End$ */
#include "extend.h"
#include "ctoharb.h"
#include "itemapi.h"
PHB_ITEM ArrayClone( PHB_ITEM );
@@ -78,7 +77,7 @@ HARBOUR HB___STATIC(void)
* $FuncName$ AddToArray( <pItem>, <pReturn>, <wPos> )
* $Description$ Add <pItem> to array <pReturn> at pos <wPos>
* $End$ */
void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, WORD wPos )
static void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, WORD wPos )
{
PHB_ITEM pTemp;
@@ -104,7 +103,7 @@ void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, WORD wPos )
* $FuncName$ <nVars> __GlobalStackLen()
* $Description$ Returns the length of the global stack
* $End$ */
WORD GlobalStackLen( void )
static WORD GlobalStackLen( void )
{
PHB_ITEM pItem;
WORD nCount = 0;
@@ -143,7 +142,7 @@ HARBOUR HB___AGLOBALSTACK(void)
* $FuncName$ <nVars> __StackLen()
* $Description$ Returns the length of the stack of the calling function
* $End$ */
WORD StackLen( void )
static WORD StackLen( void )
{
PHB_ITEM pItem;
PHB_ITEM pBase = stack.pItems + stack.pBase->item.asSymbol.stackbase;

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,7 @@
#include "hbsetup.h"
#include "extend.h"
#include "hbdefs.h"
#include "ctoharb.h"
#include "initsymd.h"
HARBOUR HB_AADD( void );
@@ -145,5 +146,5 @@ void InitSymbolTable( void )
/*
* The system symbol table with runtime functions HAVE TO be called last
*/
ProcessSymbols( symbols, sizeof(symbols)/sizeof( HB_SYMB ) );
hb_vmProcessSymbols( symbols, sizeof(symbols)/sizeof( HB_SYMB ) );
}