Harbour own OBJs support. I had to remove Gonzalo main() as the makefile refuses such a long command line

This commit is contained in:
Antonio Linares
1999-05-10 12:38:50 +00:00
parent 4be0900577
commit fbcac4615b

View File

@@ -1,7 +1,3 @@
/*
* $Id$
*/
/* The Harbour virtual machine */
/* Please note the following comments we may use everywhere
@@ -97,6 +93,7 @@ typedef struct _SYMBOLS
} SYMBOLS, * PSYMBOLS; /* structure to keep track of all modules symbol tables */
void ProcessSymbols( PSYMBOL pSymbols, WORD wSymbols ); /* statics symbols initialization */
void ProcessObjSymbols ( void ); /* process Harbour generated OBJ symbols */
void DoInitFunctions( int argc, char * argv[] ); /* executes all defined PRGs INIT functions */
void DoExitFunctions( void ); /* executes all defined PRGs EXIT functions */
void LogSymbols( void ); /* displays all dynamic symbols */
@@ -129,6 +126,14 @@ extern ULONG ulMemoryMaxBlocks; /* maximum number of used memory blocks */
extern ULONG ulMemoryConsumed; /* memory size consumed */
extern ULONG ulMemoryMaxConsumed; /* memory max size consumed */
typedef struct
{
WORD wSymbols; /* module local symbol table symbols amount */
PSYMBOL pSymbols; /* module local symbol table address */
} OBJSYMBOLS, * POBJSYMBOLS; /* structure used from Harbour generated OBJs */
extern POBJSYMBOLS HB_FIRSTSYMBOL, HB_LASTSYMBOL;
STACK stack;
int iHBDEBUG = 0; /* if 1 traces the virtual machine activity */
SYMBOL symEval = { "__EVAL", FS_PUBLIC, DoBlock, 0 }; /* symbol to evaluate codeblocks */
@@ -166,9 +171,11 @@ BYTE bErrorLevel = 0; /* application exit errorlevel */
StackInit();
NewDynSym( &symEval ); /* initialize dynamic symbol for evaluating codeblocks */
InitializeSets(); /* initialize Sets */
ProcessObjSymbols(); /* initialize Harbour generated OBJs symbols */
DoInitFunctions( argc, argv ); /* process defined INIT functions */
PushSymbol( pSymStart ); /* pushes first FS_PUBLIC defined symbol to the stack */
PushNil(); /* places NIL at self */
for( i = 1; i < argc; i++ ) /* places application parameters on the stack */
@@ -1765,6 +1772,13 @@ void ProcessSymbols( PSYMBOL pModuleSymbols, WORD wModuleSymbols ) /* module sym
{
PSYMBOLS pNewSymbols, pLastSymbols;
WORD w;
static int iObjChecked = 0;
if( ! iObjChecked )
{
iObjChecked = 1;
ProcessObjSymbols(); /* to asure Harbour OBJ symbols are processed first */
}
pNewSymbols = ( PSYMBOLS ) _xgrab( sizeof( SYMBOLS ) );
pNewSymbols->pModuleSymbols = pModuleSymbols;
@@ -1792,6 +1806,23 @@ void ProcessSymbols( PSYMBOL pModuleSymbols, WORD wModuleSymbols ) /* module sym
}
}
void ProcessObjSymbols( void )
{
POBJSYMBOLS pObjSymbols = ( POBJSYMBOLS ) &HB_FIRSTSYMBOL;
static int iDone = 0;
if( ! iDone )
{
iDone = 1;
while( pObjSymbols < ( POBJSYMBOLS ) ( &HB_LASTSYMBOL - 1 ) )
{
ProcessSymbols( pObjSymbols->pSymbols, pObjSymbols->wSymbols );
pObjSymbols++;
}
}
}
void ReleaseLocalSymbols( void )
{
PSYMBOLS pDestroy;