19990819-02:15 GMT+1
This commit is contained in:
@@ -1,3 +1,74 @@
|
||||
19990819-02:15 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
* source/hbpp/hbpplib.c
|
||||
! OurMalloc -> _xgrab
|
||||
* source/compiler/genobj32.c
|
||||
! "_VirtualMachine" -> "_hb_vmExecute"
|
||||
* source/rtl/arrays.c
|
||||
source/rtl/console.c
|
||||
source/rtl/dates.c
|
||||
source/rtl/inkey.c
|
||||
source/rtl/math.c
|
||||
source/rtl/strings.c
|
||||
source/rtl/transfrm.c
|
||||
source/vm/hvm.c
|
||||
! Commented out those symbol registration line, which are already included
|
||||
in source/vm/initsymb.c
|
||||
* source/vm/dynsym.c
|
||||
* Some variable declaration moved to the block where it's used.
|
||||
* Some 0 (zero) changed to NULL and '\0'
|
||||
* source/rdd/dbcmd.c
|
||||
! extern HARBOUR functions declared as extern.
|
||||
* source/rtl/classes.c
|
||||
! __msg*() function names changed to hb___msg*(), to avoid the
|
||||
leading underscores.
|
||||
* Many variable declaration moved to the block where it's used.
|
||||
! Some (5?) potential GPFs fixed when the string/block parameter was
|
||||
omitted.
|
||||
* BYTE changed to BOOL in one place.
|
||||
! Added proper (commented out) error description to three runtime errors.
|
||||
* source/rtl/extend.c
|
||||
* Some 0 (zero) changed to NULL and '\0'
|
||||
* include/inkey.ch
|
||||
! Typo fixed.
|
||||
* include/extend.h
|
||||
source/rtl/arrays.c
|
||||
source/rtl/classes.c
|
||||
* BASEARRAY/wSuperCast changed to bSuperCase, type changed to BOOL.
|
||||
* source/vm/hvm.c
|
||||
source/vm/initsymb.c
|
||||
source/tools/io.c
|
||||
source/runner/runner.c
|
||||
source/rtl/codebloc.c
|
||||
source/rtl/console.c
|
||||
source/rtl/dates.c
|
||||
source/rtl/dir.c
|
||||
source/rtl/extend.c
|
||||
source/rtl/filesys.c
|
||||
source/rtl/fm.c
|
||||
source/rtl/inkey.c
|
||||
source/rtl/langapi.c
|
||||
source/rtl/memvars.c
|
||||
source/rtl/msgxxx.c
|
||||
source/rtl/set.c
|
||||
source/rtl/strings.c
|
||||
source/compiler/harbour.y
|
||||
% Removed all #includes which are always included indirectly via
|
||||
extend.h
|
||||
* include/extend.h
|
||||
* changed inclusion order of hbsetup.h and hbdefs.h, so that
|
||||
hbsetup.h is included first.
|
||||
* source/vm/initsymb.c
|
||||
source/compiler/harbour.y
|
||||
- DO removed from here. (since it's non standard Clipper)
|
||||
* source/vm/initsymb.c
|
||||
- STOD removed from here. (since it's non standard Clipper)
|
||||
* made all HARBOUR prototypes extern.
|
||||
- #include "init.h" removed.
|
||||
+ #include "initsymd.h" guarded with HARBOUR_STRICT_ANSI_C
|
||||
+ INKEY, PCOL, PROW address filled with proper value instead of NULL.
|
||||
* include/memvars.ch
|
||||
* Really small correction.
|
||||
|
||||
19990818-19:20 EDT David G. Holm <dholm@jsd-llc.com>
|
||||
* source/vm/hvm.c
|
||||
* Added TODO: comment to indicate that the divide by zero check
|
||||
@@ -112,7 +183,7 @@
|
||||
source/rtl/filesys.c
|
||||
source/rtl/strings.c
|
||||
+ Standard name registration method added (hvm.c).
|
||||
! Completed init tables so that all declared Harbour function get
|
||||
! Completed init tables so that all declared Harbour function get
|
||||
registered.
|
||||
|
||||
* include/run_exp.h
|
||||
@@ -146,19 +217,19 @@
|
||||
19990817-20:35 GMT+2 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*source/compiler/harbour.y
|
||||
* corrected code used to generate HB_P_ENDPROC - the declared
|
||||
length of function/procedure is now equal to the number of bytes
|
||||
written into HRB file - some comments added
|
||||
* corrected code used to generate HB_P_ENDPROC - the declared
|
||||
length of function/procedure is now equal to the number of bytes
|
||||
written into HRB file - some comments added
|
||||
|
||||
*source/runner/runner.c
|
||||
* corrected reading of function/procedure body (it was trying to
|
||||
read (size+1) bytes)
|
||||
* the MAIN procedure is defined if HARBOUR_START_PROCEDURE is
|
||||
defined - the runner works with GCC/Linux now
|
||||
* corrected code used to call (_INITSTATIC) function - inside
|
||||
this function there is no access to passed parameters then
|
||||
there is no need to pass them - static variables can be
|
||||
initialized using literal values only
|
||||
* corrected reading of function/procedure body (it was trying to
|
||||
read (size+1) bytes)
|
||||
* the MAIN procedure is defined if HARBOUR_START_PROCEDURE is
|
||||
defined - the runner works with GCC/Linux now
|
||||
* corrected code used to call (_INITSTATIC) function - inside
|
||||
this function there is no access to passed parameters then
|
||||
there is no need to pass them - static variables can be
|
||||
initialized using literal values only
|
||||
|
||||
19990817-20:14 GMT+1 Victor Szel <info@szelvesz.hu>
|
||||
* tests/working/Makefile
|
||||
|
||||
@@ -31,8 +31,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "hbdefs.h"
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "hbdefs.h"
|
||||
#include "hb_vmpub.h"
|
||||
|
||||
#ifdef HARBOUR_STRICT_CLIPPER_COMPATIBILITY
|
||||
@@ -175,7 +176,7 @@ typedef struct _HB_BASEARRAY
|
||||
ULONG ulLen; /* number of items in the array */
|
||||
WORD wHolders; /* number of holders of this array */
|
||||
WORD wClass; /* offset to the classes base if it is an object */
|
||||
WORD wSuperCast; /* is it a super cast ? */
|
||||
BOOL bSuperCast; /* is it a super cast ? */
|
||||
} BASEARRAY, * PBASEARRAY, * BASEARRAY_PTR;
|
||||
|
||||
/* stack managed by the virtual machine */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* NOTE: Keystroke descriptions marked with an asterick (*) are only */
|
||||
/* NOTE: Keystroke descriptions marked with an asterisk (*) are only */
|
||||
/* available on enhanced keyboards (those with more than 84 keys) */
|
||||
|
||||
#ifndef _INKEY_CH
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
*/
|
||||
|
||||
/* NOTE: This file is also used by C code. */
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ static BYTE prgFunction[] = { 0x68, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x
|
||||
0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x83, 0xC4, 0x08, 0xC3 };
|
||||
|
||||
static char * * externNames = 0;
|
||||
WORD wExternals = 1; /* _VirtualMachine is always added */
|
||||
WORD wExternals = 1; /* _hb_vmExecute is always added */
|
||||
|
||||
void GenObj32( char * szObjFileName, char * szFileName )
|
||||
{
|
||||
@@ -274,7 +274,7 @@ static void GenerateCodeSegment( FILE * hObjFile )
|
||||
0x54, 2 ); /* Data pcode location */
|
||||
|
||||
Fixup( hObjFile, 0xA4, ( w * sizeof( prgFunction ) ) + 11,
|
||||
0x56, 1 ); /* External: _VirtualMachine */
|
||||
0x56, 1 ); /* External: _hb_vmExecute */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ static void GenerateExternals( FILE * hObjFile )
|
||||
{
|
||||
externNames = ( char * * ) OurMalloc( sizeof( char * ) * ( wExternals + 2 ) );
|
||||
w = 1;
|
||||
externNames[ 0 ] = "_VirtualMachine";
|
||||
externNames[ 0 ] = "_hb_vmExecute";
|
||||
|
||||
pFunc = funcalls.pFirst;
|
||||
while( pFunc )
|
||||
|
||||
@@ -42,10 +42,8 @@
|
||||
#include <limits.h>
|
||||
#include <malloc.h> /* required for allocating and freeing memory */
|
||||
#include <ctype.h>
|
||||
#include "hbsetup.h" /* main configuration file */
|
||||
#include "extend.h"
|
||||
#include "pcode.h" /* pcode values */
|
||||
#include "hbdefs.h" /* our defined types */
|
||||
#include "compiler.h"
|
||||
#include "hberrors.h"
|
||||
#include "hbpp.h"
|
||||
@@ -351,7 +349,6 @@ static const char * _szReservedFun[] = {
|
||||
"DAY" ,
|
||||
"DELETED" ,
|
||||
"DEVPOS" ,
|
||||
"DO" ,
|
||||
"DOW" ,
|
||||
"DTOC" ,
|
||||
"DTOS" ,
|
||||
|
||||
@@ -104,7 +104,8 @@ void GenWarning( char* _szWarnings[], char cPrefix, int iWarning, char * szWarni
|
||||
{
|
||||
if( _bWarnings && iWarning < WARN_ASSIGN_SUSPECT ) /* TODO: add switch to set level */
|
||||
{
|
||||
char * szLine = ( char * ) OurMalloc( 160 ); /*2 lines of text */
|
||||
/* char * szLine = ( char * ) OurMalloc( 160 ); */ /*2 lines of text */
|
||||
char * szLine = ( char * ) _xgrab( 160 ); /*2 lines of text */
|
||||
/* printf( "\r%s(%i) ", files.pLast->szFileName, iLine ); */
|
||||
printf( "Warning %c%i ", cPrefix, iWarning );
|
||||
sprintf( szLine, _szWarnings[ iWarning - 1 ], szWarning1, szWarning2 );
|
||||
|
||||
@@ -57,11 +57,15 @@ typedef struct _AREANODE
|
||||
|
||||
typedef AREANODE * LPAREANODE;
|
||||
|
||||
extern HARBOUR HB_DBF( void );
|
||||
extern HARBOUR HB_SDF( void );
|
||||
extern HARBOUR HB_DELIM( void );
|
||||
extern HARBOUR HB_RDDSYS( void );
|
||||
|
||||
HARBOUR HB_BOF( void );
|
||||
HARBOUR HB_DBCLOSEALL( void );
|
||||
HARBOUR HB_DBCLOSEAREA( void );
|
||||
HARBOUR HB_DBCREATE( void );
|
||||
HARBOUR HB_DBF( void );
|
||||
HARBOUR HB_DBGOBOTTOM( void );
|
||||
HARBOUR HB_DBGOTO( void );
|
||||
HARBOUR HB_DBGOTOP( void );
|
||||
@@ -70,7 +74,6 @@ HARBOUR HB_DBSETDRIVER( void );
|
||||
HARBOUR HB_DBSKIP( void );
|
||||
HARBOUR HB_DBTABLEEXT( void );
|
||||
HARBOUR HB_DBUSEAREA( void );
|
||||
HARBOUR HB_DELIM( void );
|
||||
HARBOUR HB_EOF( void );
|
||||
HARBOUR HB_FCOUNT( void );
|
||||
HARBOUR HB_FIELDGET( void );
|
||||
@@ -82,10 +85,8 @@ HARBOUR HB_RDDNAME( void );
|
||||
HARBOUR HB_RDDREGISTER( void );
|
||||
HARBOUR HB_RDDSETDEFAULT( void );
|
||||
HARBOUR HB_RDDSHUTDOWN( void );
|
||||
HARBOUR HB_RDDSYS( void );
|
||||
HARBOUR HB_RECCOUNT( void );
|
||||
HARBOUR HB_RECNO( void );
|
||||
HARBOUR HB_SDF( void );
|
||||
HARBOUR HB_USED( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( dbCmd__InitSymbols )
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
You can contact me at: alinares@fivetech.com
|
||||
*/
|
||||
|
||||
#include "itemapi.h"
|
||||
#include "extend.h"
|
||||
#include "itemapi.h"
|
||||
#include "errorapi.h"
|
||||
#include "langapi.h"
|
||||
#include "ctoharb.h"
|
||||
#include "init.h"
|
||||
#include "dates.h"
|
||||
#include "init.h"
|
||||
|
||||
HARBOUR HB_AADD(void);
|
||||
HARBOUR HB_ACLONE(void);
|
||||
@@ -44,7 +44,9 @@ HARBOUR HB_ASORT(void);
|
||||
HARBOUR HB_ATAIL(void);
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( Arrays__InitSymbols )
|
||||
#if 0
|
||||
{ "AADD", FS_PUBLIC, HB_AADD , 0 },
|
||||
#endif
|
||||
{ "ACLONE", FS_PUBLIC, HB_ACLONE , 0 },
|
||||
{ "ACOPY", FS_PUBLIC, HB_ACOPY , 0 },
|
||||
{ "ADEL", FS_PUBLIC, HB_ADEL , 0 },
|
||||
@@ -172,10 +174,10 @@ void hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */
|
||||
else
|
||||
pBaseArray->pItems = 0;
|
||||
|
||||
pBaseArray->ulLen = ulLen;
|
||||
pBaseArray->wHolders = 1;
|
||||
pBaseArray->wClass = 0;
|
||||
pBaseArray->wSuperCast = FALSE;
|
||||
pBaseArray->ulLen = ulLen;
|
||||
pBaseArray->wHolders = 1;
|
||||
pBaseArray->wClass = 0;
|
||||
pBaseArray->bSuperCast = FALSE;
|
||||
|
||||
for( ul = 0; ul < ulLen; ul++ )
|
||||
( pBaseArray->pItems + ul )->type = IT_NIL;
|
||||
@@ -544,7 +546,7 @@ void hb_arrayRelease( PHB_ITEM pArray )
|
||||
ULONG ul, ulLen = hb_arrayLen( pArray );
|
||||
PBASEARRAY pBaseArray = pArray->item.asArray.value;
|
||||
|
||||
if( !pBaseArray->wSuperCast )
|
||||
if( !pBaseArray->bSuperCast )
|
||||
{
|
||||
for ( ul = 0; ul < ulLen; ul ++ )
|
||||
hb_itemClear( pBaseArray->pItems + ul );
|
||||
@@ -652,13 +654,13 @@ HARBOUR HB_ARRAY( void )
|
||||
if ( iParCount > 0 )
|
||||
{
|
||||
int tmp;
|
||||
BOOL lError = FALSE;
|
||||
BOOL bError = FALSE;
|
||||
|
||||
for ( tmp = 1; tmp <= iParCount; tmp++ )
|
||||
{
|
||||
if ( !ISNUM( tmp ) )
|
||||
{
|
||||
lError = TRUE;
|
||||
bError = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -668,7 +670,7 @@ HARBOUR HB_ARRAY( void )
|
||||
}
|
||||
}
|
||||
|
||||
if ( lError )
|
||||
if ( bError )
|
||||
hb_ret();
|
||||
else
|
||||
hb_arrayNew( &stack.Return, hb_parnl( 1 ) );
|
||||
|
||||
@@ -83,17 +83,6 @@ static PHB_DYNS msgClassSel = 0;
|
||||
|
||||
/* All functions contained in classes.c */
|
||||
|
||||
static HARBOUR __msgClsH( void );
|
||||
static HARBOUR __msgClsName( void );
|
||||
static HARBOUR __msgClsSel( void );
|
||||
static HARBOUR __msgSuper( void );
|
||||
static HARBOUR __msgEvalInline( void );
|
||||
static HARBOUR __msgVirtual( void );
|
||||
static HARBOUR __msgGetClsData( void );
|
||||
static HARBOUR __msgSetClsData( void );
|
||||
static HARBOUR __msgGetData( void );
|
||||
static HARBOUR __msgSetData( void );
|
||||
|
||||
static void hb_clsDictRealloc( PCLASS pClass );
|
||||
static void hb_clsRelease( PCLASS );
|
||||
void hb_clsReleaseAll( void );
|
||||
@@ -102,6 +91,17 @@ static void hb_clsRelease( PCLASS );
|
||||
PHB_FUNC hb_objGetMethod( PHB_ITEM, PHB_SYMB );
|
||||
ULONG hb_objHasMsg( PHB_ITEM pObject, char *szString );
|
||||
|
||||
static HARBOUR hb___msgClsH( void );
|
||||
static HARBOUR hb___msgClsName( void );
|
||||
static HARBOUR hb___msgClsSel( void );
|
||||
static HARBOUR hb___msgSuper( void );
|
||||
static HARBOUR hb___msgEvalInline( void );
|
||||
static HARBOUR hb___msgVirtual( void );
|
||||
static HARBOUR hb___msgGetClsData( void );
|
||||
static HARBOUR hb___msgSetClsData( void );
|
||||
static HARBOUR hb___msgGetData( void );
|
||||
static HARBOUR hb___msgSetData( void );
|
||||
|
||||
HARBOUR HB___CLSNEW( void );
|
||||
HARBOUR HB___CLSINST( void );
|
||||
HARBOUR HB___CLSINSTSUPER( void );
|
||||
@@ -119,20 +119,20 @@ static void hb_clsRelease( PCLASS );
|
||||
|
||||
/* All function contained in matching objfunc.prg */
|
||||
|
||||
extern HARBOUR HB___OBJGETMSGLIST( void );
|
||||
extern HARBOUR HB___OBJGETMETHODLIST( void );
|
||||
extern HARBOUR HB___OBJGETVALUELIST( void );
|
||||
extern HARBOUR HB___OBJSETVALUELIST( void );
|
||||
extern HARBOUR HB___OBJHASDATA( void );
|
||||
extern HARBOUR HB___OBJHASMETHOD( void );
|
||||
extern HARBOUR HB___OBJADDDATA( void );
|
||||
extern HARBOUR HB___OBJADDINLINE( void );
|
||||
extern HARBOUR HB___OBJADDMETHOD( void );
|
||||
extern HARBOUR HB___OBJDELDATA( void );
|
||||
extern HARBOUR HB___OBJDELINLINE( void );
|
||||
extern HARBOUR HB___OBJDELMETHOD( void );
|
||||
extern HARBOUR HB___OBJMODINLINE( void );
|
||||
extern HARBOUR HB___OBJMODMETHOD( void );
|
||||
extern HARBOUR HB___OBJGETMSGLIST( void );
|
||||
extern HARBOUR HB___OBJGETMETHODLIST( void );
|
||||
extern HARBOUR HB___OBJGETVALUELIST( void );
|
||||
extern HARBOUR HB___OBJSETVALUELIST( void );
|
||||
extern HARBOUR HB___OBJHASDATA( void );
|
||||
extern HARBOUR HB___OBJHASMETHOD( void );
|
||||
extern HARBOUR HB___OBJADDDATA( void );
|
||||
extern HARBOUR HB___OBJADDINLINE( void );
|
||||
extern HARBOUR HB___OBJADDMETHOD( void );
|
||||
extern HARBOUR HB___OBJDELDATA( void );
|
||||
extern HARBOUR HB___OBJDELINLINE( void );
|
||||
extern HARBOUR HB___OBJDELMETHOD( void );
|
||||
extern HARBOUR HB___OBJMODINLINE( void );
|
||||
extern HARBOUR HB___OBJMODMETHOD( void );
|
||||
|
||||
/* Exported symbols of both classes.c and objfunc.prg */
|
||||
|
||||
@@ -187,21 +187,21 @@ HB_INIT_SYMBOLS_END( Classes__InitSymbols )
|
||||
*/
|
||||
HARBOUR HB___CLSADDMSG(void)
|
||||
{
|
||||
WORD wClass = hb_parnl( 1 );
|
||||
WORD wType = hb_parni( 4 );
|
||||
WORD wAt, wMask;
|
||||
|
||||
PHB_ITEM pInit = hb_param( 5, IT_ANY );
|
||||
PCLASS pClass;
|
||||
PHB_DYNS pMessage;
|
||||
PMETHOD pNewMeth;
|
||||
WORD wClass = hb_parnl( 1 );
|
||||
|
||||
if( wClass && wClass <= wClasses )
|
||||
{
|
||||
pClass = &pClasses[ wClass - 1 ];
|
||||
pMessage = hb_dynsymGet( hb_parc( 2 ) );
|
||||
wAt = ( ( ( unsigned ) pMessage ) % pClass->wHashKey ) * BUCKET;
|
||||
wMask = pClass->wHashKey * BUCKET;
|
||||
PCLASS pClass = &pClasses[ wClass - 1 ];
|
||||
PHB_DYNS pMessage = hb_dynsymGet( hb_parc( 2 ) );
|
||||
WORD wType = hb_parni( 4 );
|
||||
WORD wAt = ( ( ( unsigned ) pMessage ) % pClass->wHashKey ) * BUCKET;
|
||||
WORD wMask = pClass->wHashKey * BUCKET;
|
||||
PMETHOD pNewMeth;
|
||||
|
||||
if ( wType == MET_INLINE && hb_param( 3, IT_BLOCK ) == NULL )
|
||||
{
|
||||
hb_errRT_BASE(EG_ARG, 3000, NULL, "__CLSADDMSG");
|
||||
}
|
||||
|
||||
if( pClass->wMethods > ( pClass->wHashKey * BUCKET * 2/3 ) )
|
||||
hb_clsDictRealloc( pClass );
|
||||
@@ -228,10 +228,13 @@ HARBOUR HB___CLSADDMSG(void)
|
||||
case MET_DATA:
|
||||
pNewMeth->wData = hb_parnl( 3 );
|
||||
if( pMessage->pSymbol->szName[ 0 ] == '_' )
|
||||
pNewMeth->pFunction = __msgSetData;
|
||||
pNewMeth->pFunction = hb___msgSetData;
|
||||
else
|
||||
{
|
||||
pNewMeth->pFunction = __msgGetData;
|
||||
PHB_ITEM pInit = hb_param( 5, IT_ANY );
|
||||
|
||||
pNewMeth->pFunction = hb___msgGetData;
|
||||
|
||||
if( pInit && !IS_NIL( pInit )) /* Initializer found */
|
||||
{
|
||||
pNewMeth->pInitValue = hb_itemNew( NULL );
|
||||
@@ -246,26 +249,27 @@ HARBOUR HB___CLSADDMSG(void)
|
||||
hb_arraySize( pClass->pClassDatas, hb_parnl( 3 ) );
|
||||
|
||||
if( pMessage->pSymbol->szName[ 0 ] == '_' )
|
||||
pNewMeth->pFunction = __msgSetClsData;
|
||||
pNewMeth->pFunction = hb___msgSetClsData;
|
||||
else
|
||||
pNewMeth->pFunction = __msgGetClsData;
|
||||
pNewMeth->pFunction = hb___msgGetClsData;
|
||||
break;
|
||||
|
||||
case MET_INLINE:
|
||||
|
||||
pNewMeth->wData = hb_arrayLen( pClass->pInlines ) + 1;
|
||||
hb_arraySize( pClass->pInlines, pNewMeth->wData );
|
||||
hb_arraySet( pClass->pInlines, pNewMeth->wData,
|
||||
hb_param( 3, IT_BLOCK ) );
|
||||
pNewMeth->pFunction = __msgEvalInline;
|
||||
pNewMeth->pFunction = hb___msgEvalInline;
|
||||
break;
|
||||
|
||||
case MET_VIRTUAL:
|
||||
pNewMeth->pFunction = __msgVirtual;
|
||||
pNewMeth->pFunction = hb___msgVirtual;
|
||||
break;
|
||||
|
||||
case MET_SUPER:
|
||||
pNewMeth->wData = hb_parnl( 3 );
|
||||
pNewMeth->pFunction = __msgSuper;
|
||||
pNewMeth->pFunction = hb___msgSuper;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -288,9 +292,7 @@ HARBOUR HB___CLSADDMSG(void)
|
||||
HARBOUR HB___CLSNEW(void)
|
||||
{
|
||||
WORD wSuper = hb_parni( 3 ); /* Super class present */
|
||||
WORD wSize;
|
||||
PCLASS pNewCls;
|
||||
PCLASS pSprCls;
|
||||
|
||||
if( pClasses )
|
||||
pClasses = ( PCLASS ) hb_xrealloc( pClasses,
|
||||
@@ -304,7 +306,8 @@ HARBOUR HB___CLSNEW(void)
|
||||
|
||||
if( wSuper )
|
||||
{
|
||||
pSprCls = pClasses + wSuper - 1;
|
||||
PCLASS pSprCls = pClasses + wSuper - 1;
|
||||
WORD wSize;
|
||||
|
||||
pNewCls->wDataFirst = pSprCls->wDatas;
|
||||
pNewCls->wDatas = pSprCls->wDatas + hb_parni(2);
|
||||
@@ -346,24 +349,17 @@ HARBOUR HB___CLSNEW(void)
|
||||
*/
|
||||
HARBOUR HB___CLSDELMSG(void)
|
||||
{
|
||||
PHB_ITEM pString = hb_param( 2, IT_STRING );
|
||||
PHB_SYMB pMessage = hb_dynsymGet( pString->item.asString.value )->pSymbol;
|
||||
PHB_DYNS pMsg = pMessage->pDynSym;
|
||||
PCLASS pClass;
|
||||
|
||||
WORD wClass = hb_parni( 1 );
|
||||
WORD wAt;
|
||||
WORD wLimit;
|
||||
WORD wMask;
|
||||
PHB_ITEM pString = hb_param( 2, IT_STRING );
|
||||
|
||||
PHB_FUNC pFunc;
|
||||
|
||||
if( wClass && wClass <= wClasses )
|
||||
if( wClass && wClass <= wClasses && pString )
|
||||
{
|
||||
pClass = pClasses + wClass - 1;
|
||||
wAt = ( ( ( unsigned ) pMsg ) % pClass->wHashKey ) * BUCKET;
|
||||
wMask = pClass->wHashKey * BUCKET;
|
||||
wLimit = wAt ? ( wAt - 1 ) : ( wMask - 1 );
|
||||
PCLASS pClass = pClasses + wClass - 1;
|
||||
PHB_SYMB pMessage = hb_dynsymGet( pString->item.asString.value )->pSymbol;
|
||||
PHB_DYNS pMsg = pMessage->pDynSym;
|
||||
WORD wAt = ( ( ( unsigned ) pMsg ) % pClass->wHashKey ) * BUCKET;
|
||||
WORD wMask = pClass->wHashKey * BUCKET;
|
||||
WORD wLimit = wAt ? ( wAt - 1 ) : ( wMask - 1 );
|
||||
|
||||
while( ( wAt != wLimit ) &&
|
||||
( pClass->pMethods[ wAt ].pMessage &&
|
||||
@@ -376,8 +372,9 @@ HARBOUR HB___CLSDELMSG(void)
|
||||
|
||||
if( wAt != wLimit )
|
||||
{ /* Requested method found */
|
||||
pFunc = pClass->pMethods[ wAt ].pFunction;
|
||||
if( pFunc == __msgEvalInline ) /* INLINE method deleted */
|
||||
PHB_FUNC pFunc = pClass->pMethods[ wAt ].pFunction;
|
||||
|
||||
if( pFunc == hb___msgEvalInline ) /* INLINE method deleted */
|
||||
{
|
||||
hb_arrayDel( pClass->pInlines, pClass->pMethods[ wAt ].wData );
|
||||
/* Delete INLINE block */
|
||||
@@ -406,7 +403,7 @@ HARBOUR HB___CLSDELMSG(void)
|
||||
*
|
||||
* Returns class handle of <obj>
|
||||
*/
|
||||
static HARBOUR __msgClsH( void )
|
||||
static HARBOUR hb___msgClsH( void )
|
||||
{
|
||||
hb_retni( ( stack.pBase + 1 )->item.asArray.value->wClass );
|
||||
}
|
||||
@@ -419,19 +416,18 @@ static HARBOUR __msgClsH( void )
|
||||
*/
|
||||
HARBOUR HB___CLSINST(void)
|
||||
{
|
||||
WORD wClass = hb_parni( 1 );
|
||||
WORD wAt, wLimit;
|
||||
PCLASS pClass;
|
||||
PMETHOD pMeth;
|
||||
WORD wClass = hb_parni( 1 );
|
||||
|
||||
if( wClass <= wClasses )
|
||||
{
|
||||
pClass = pClasses + ( wClass - 1 );
|
||||
PCLASS pClass = pClasses + ( wClass - 1 );
|
||||
WORD wAt;
|
||||
WORD wLimit = pClass->wHashKey * BUCKET;
|
||||
PMETHOD pMeth = pClass->pMethods; /* Initialize DATA */
|
||||
|
||||
hb_arrayNew( &stack.Return, pClass->wDatas );
|
||||
stack.Return.item.asArray.value->wClass = wClass;
|
||||
|
||||
pMeth = pClass->pMethods; /* Initialize DATA */
|
||||
wLimit = pClass->wHashKey * BUCKET;
|
||||
|
||||
for( wAt = 0; wAt < wLimit; wAt++, pMeth++ )
|
||||
if( pMeth->pInitValue )
|
||||
hb_itemArrayPut( &stack.Return, pMeth->wData, pMeth->pInitValue );
|
||||
@@ -447,24 +443,17 @@ HARBOUR HB___CLSINST(void)
|
||||
*/
|
||||
HARBOUR HB___CLSMODMSG(void)
|
||||
{
|
||||
PHB_ITEM pString = hb_param( 2, IT_STRING );
|
||||
PHB_SYMB pMessage = hb_dynsymGet( pString->item.asString.value )->pSymbol;
|
||||
PHB_DYNS pMsg = pMessage->pDynSym;
|
||||
PCLASS pClass;
|
||||
|
||||
WORD wClass = hb_parni( 1 );
|
||||
WORD wAt;
|
||||
WORD wLimit;
|
||||
WORD wMask;
|
||||
PHB_ITEM pString = hb_param( 2, IT_STRING );
|
||||
|
||||
PHB_FUNC pFunc;
|
||||
|
||||
if( wClass && wClass <= wClasses )
|
||||
if( wClass && wClass <= wClasses && pString )
|
||||
{
|
||||
pClass = pClasses + wClass - 1;
|
||||
wAt = ( ( ( unsigned ) pMsg ) % pClass->wHashKey ) * BUCKET;
|
||||
wMask = pClass->wHashKey * BUCKET;
|
||||
wLimit = wAt ? ( wAt - 1 ) : ( wMask - 1 );
|
||||
PCLASS pClass = pClasses + wClass - 1;
|
||||
PHB_SYMB pMessage = hb_dynsymGet( pString->item.asString.value )->pSymbol;
|
||||
PHB_DYNS pMsg = pMessage->pDynSym;
|
||||
WORD wAt = ( ( ( unsigned ) pMsg ) % pClass->wHashKey ) * BUCKET;
|
||||
WORD wMask = pClass->wHashKey * BUCKET;
|
||||
WORD wLimit = wAt ? ( wAt - 1 ) : ( wMask - 1 );
|
||||
|
||||
while( ( wAt != wLimit ) &&
|
||||
( pClass->pMethods[ wAt ].pMessage &&
|
||||
@@ -477,14 +466,20 @@ HARBOUR HB___CLSMODMSG(void)
|
||||
|
||||
if( wAt != wLimit )
|
||||
{ /* Requested method found */
|
||||
pFunc = pClass->pMethods[ wAt ].pFunction;
|
||||
if( pFunc == __msgEvalInline ) /* INLINE method changed */
|
||||
hb_arraySet( pClass->pInlines, pClass->pMethods[ wAt ].wData,
|
||||
hb_param( 3, IT_BLOCK ) );
|
||||
else if( ( pFunc == __msgSetData ) || ( pFunc == __msgGetData ) )
|
||||
PHB_FUNC pFunc = pClass->pMethods[ wAt ].pFunction;
|
||||
|
||||
if( pFunc == hb___msgEvalInline ) /* INLINE method changed */
|
||||
{
|
||||
PHB_ITEM pBlock = hb_param( 3, IT_BLOCK );
|
||||
|
||||
if ( pBlock == NULL )
|
||||
hb_errRT_BASE(EG_ARG, 3000, NULL, "__CLSMODMSG");
|
||||
else
|
||||
hb_arraySet( pClass->pInlines, pClass->pMethods[ wAt ].wData, pBlock );
|
||||
}
|
||||
else if( ( pFunc == hb___msgSetData ) || ( pFunc == hb___msgGetData ) )
|
||||
{ /* Not allowed for DATA */
|
||||
/*hb_errPutDescription(pError, "__clsModMsg: Cannot modify a DATA item");*/
|
||||
hb_errRT_BASE(EG_ARG, 3004, NULL, "__CLSMODMSG");
|
||||
hb_errRT_BASE(EG_ARG, 3004, "Cannot modify a DATA item", "__CLSMODMSG");
|
||||
}
|
||||
else /* Modify METHOD */
|
||||
pClass->pMethods[ wAt ].pFunction = ( PHB_FUNC ) hb_parnl( 3 );
|
||||
@@ -498,7 +493,7 @@ HARBOUR HB___CLSMODMSG(void)
|
||||
*
|
||||
* Return class name of <obj>. Can also be used for all types.
|
||||
*/
|
||||
static HARBOUR __msgClsName( void )
|
||||
static HARBOUR hb___msgClsName( void )
|
||||
{
|
||||
PHB_ITEM pItemRef;
|
||||
|
||||
@@ -519,16 +514,15 @@ static HARBOUR __msgClsName( void )
|
||||
HARBOUR HB___OBJGETCLSNAME(void)
|
||||
{
|
||||
PHB_ITEM pObject = hb_param( 0, IT_OBJECT );
|
||||
WORD wClass;
|
||||
|
||||
if( pObject && pObject->item.asArray.value->wClass )
|
||||
{
|
||||
wClass = pObject->item.asArray.value->wClass;
|
||||
WORD wClass = pObject->item.asArray.value->wClass;
|
||||
hb_retc( pClasses[ wClass - 1 ].szName );
|
||||
}
|
||||
else
|
||||
{
|
||||
wClass = hb_parni( 1 );
|
||||
WORD wClass = hb_parni( 1 );
|
||||
if( wClass <= wClasses )
|
||||
hb_retc( pClasses[ wClass - 1 ].szName );
|
||||
else
|
||||
@@ -542,47 +536,43 @@ HARBOUR HB___OBJGETCLSNAME(void)
|
||||
*
|
||||
* Returns all the messages in <obj>
|
||||
*/
|
||||
static HARBOUR __msgClsSel(void)
|
||||
static HARBOUR hb___msgClsSel(void)
|
||||
{
|
||||
WORD wClass = IS_ARRAY( stack.pBase + 1 ) ?
|
||||
( stack.pBase + 1 )->item.asArray.value->wClass : 0;
|
||||
/* Get class word */
|
||||
WORD wLimit; /* Number of Hash keys */
|
||||
WORD wAt;
|
||||
WORD wPos = 0;
|
||||
PCLASS pClass;
|
||||
PHB_DYNS pMessage;
|
||||
PHB_ITEM pReturn = hb_itemNew( NULL );
|
||||
PHB_ITEM pItem;
|
||||
PHB_ITEM pItemRef;
|
||||
|
||||
if( ( ! wClass ) && IS_BYREF( stack.pBase + 1 ) )
|
||||
{ /* Variables by reference */
|
||||
pItemRef = hb_itemUnRef( stack.pBase + 1 );
|
||||
PHB_ITEM pItemRef = hb_itemUnRef( stack.pBase + 1 );
|
||||
if( IS_ARRAY( pItemRef ) )
|
||||
wClass = pItemRef->item.asArray.value->wClass;
|
||||
}
|
||||
|
||||
if( wClass && wClass <= wClasses )
|
||||
{
|
||||
pClass = &pClasses[ wClass - 1 ];
|
||||
wLimit = pClass->wHashKey * BUCKET;
|
||||
PCLASS pClass = &pClasses[ wClass - 1 ];
|
||||
WORD wLimit = pClass->wHashKey * BUCKET; /* Number of Hash keys */
|
||||
WORD wPos = 0;
|
||||
WORD wAt;
|
||||
|
||||
hb_itemRelease( pReturn );
|
||||
pReturn = hb_itemArrayNew( pClass->wMethods );
|
||||
/* Create a transfer array */
|
||||
for( wAt = 0; wAt < wLimit ; wAt++ )
|
||||
{
|
||||
pMessage = ( PHB_DYNS ) pClass->pMethods[ wAt ].pMessage;
|
||||
PHB_DYNS pMessage = ( PHB_DYNS ) pClass->pMethods[ wAt ].pMessage;
|
||||
if( pMessage ) /* Hash Entry used ? */
|
||||
{
|
||||
pItem = hb_itemPutC( NULL, pMessage->pSymbol->szName );
|
||||
PHB_ITEM pItem = hb_itemPutC( NULL, pMessage->pSymbol->szName );
|
||||
/* Add to array */
|
||||
hb_itemArrayPut( pReturn, ++wPos, pItem );
|
||||
hb_itemRelease( pItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
hb_itemReturn ( pReturn );
|
||||
hb_itemReturn( pReturn );
|
||||
hb_itemRelease( pReturn );
|
||||
}
|
||||
|
||||
@@ -607,7 +597,7 @@ static void hb_clsDictRealloc( PCLASS pClass )
|
||||
*
|
||||
* Internal function executed for inline methods
|
||||
*/
|
||||
static HARBOUR __msgEvalInline( void )
|
||||
static HARBOUR hb___msgEvalInline( void )
|
||||
{
|
||||
HB_ITEM block;
|
||||
WORD wClass = ( stack.pBase + 1 )->item.asArray.value->wClass;
|
||||
@@ -691,7 +681,7 @@ char * hb_objGetClsName( PHB_ITEM pObject )
|
||||
*
|
||||
* Internal function to return a CLASSDATA
|
||||
*/
|
||||
static HARBOUR __msgGetClsData( void )
|
||||
static HARBOUR hb___msgGetClsData( void )
|
||||
{
|
||||
WORD wClass = ( stack.pBase + 1 )->item.asArray.value->wClass;
|
||||
WORD wIndex = pMethod->wData;
|
||||
@@ -707,7 +697,7 @@ static HARBOUR __msgGetClsData( void )
|
||||
*
|
||||
* Internal function to return a DATA
|
||||
*/
|
||||
static HARBOUR __msgGetData( void )
|
||||
static HARBOUR hb___msgGetData( void )
|
||||
{
|
||||
PHB_ITEM pObject = stack.pBase + 1;
|
||||
WORD wIndex = pMethod->wData;
|
||||
@@ -726,9 +716,7 @@ static HARBOUR __msgGetData( void )
|
||||
*/
|
||||
PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage )
|
||||
{
|
||||
WORD wAt, wLimit, wMask;
|
||||
WORD wClass;
|
||||
PCLASS pClass;
|
||||
PHB_DYNS pMsg = pMessage->pDynSym;
|
||||
|
||||
if( pObject->type == IT_OBJECT )
|
||||
@@ -746,10 +734,10 @@ PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage )
|
||||
|
||||
if( wClass && wClass <= wClasses )
|
||||
{
|
||||
pClass = &pClasses[ wClass - 1 ];
|
||||
wAt = ( ( ( unsigned ) pMsg ) % pClass->wHashKey ) * BUCKET;
|
||||
wMask = pClass->wHashKey * BUCKET;
|
||||
wLimit = wAt ? ( wAt - 1 ) : ( wMask - 1 );
|
||||
PCLASS pClass = &pClasses[ wClass - 1 ];
|
||||
WORD wAt = ( ( ( unsigned ) pMsg ) % pClass->wHashKey ) * BUCKET;
|
||||
WORD wMask = pClass->wHashKey * BUCKET;
|
||||
WORD wLimit = wAt ? ( wAt - 1 ) : ( wMask - 1 );
|
||||
|
||||
pMethod = 0; /* Current method pointer */
|
||||
|
||||
@@ -765,17 +753,18 @@ PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage )
|
||||
wAt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if( pMsg == msgClassName )
|
||||
return __msgClsName;
|
||||
return hb___msgClsName;
|
||||
|
||||
else if( pMsg == msgClassH )
|
||||
return __msgClsH;
|
||||
return hb___msgClsH;
|
||||
|
||||
else if( pMsg == msgClassSel )
|
||||
return __msgClsSel;
|
||||
return hb___msgClsSel;
|
||||
|
||||
else if( pMsg == msgEval )
|
||||
return __msgEvalInline;
|
||||
return hb___msgEvalInline;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -802,8 +791,8 @@ ULONG hb_objHasMsg( PHB_ITEM pObject, char *szString )
|
||||
*/
|
||||
HARBOUR HB___OBJHASMSG(void)
|
||||
{
|
||||
PHB_ITEM pObject = hb_param( 1, IT_OBJECT );
|
||||
PHB_ITEM pString = hb_param( 2, IT_STRING );
|
||||
PHB_ITEM pObject = hb_param( 1, IT_OBJECT );
|
||||
PHB_ITEM pString = hb_param( 2, IT_STRING );
|
||||
|
||||
if( pObject && pString )
|
||||
hb_retl( hb_objHasMsg( pObject, pString->item.asString.value ) != 0 );
|
||||
@@ -821,7 +810,7 @@ HARBOUR HB___OBJHASMSG(void)
|
||||
*/
|
||||
HARBOUR HB___OBJCLONE( void )
|
||||
{
|
||||
PHB_ITEM pSrcObject = hb_param( 1, IT_OBJECT );
|
||||
PHB_ITEM pSrcObject = hb_param( 1, IT_OBJECT );
|
||||
|
||||
if ( pSrcObject )
|
||||
{
|
||||
@@ -846,10 +835,11 @@ HARBOUR HB___OBJSENDMSG(void)
|
||||
{
|
||||
PHB_ITEM pObject = hb_param( 1, IT_OBJECT );
|
||||
PHB_ITEM pMessage = hb_param( 2, IT_STRING );
|
||||
WORD w;
|
||||
|
||||
if( pMessage && pObject ) /* Object & message passed */
|
||||
{
|
||||
WORD w;
|
||||
|
||||
hb_vmPush( pObject ); /* Push object */
|
||||
hb_vmMessage( hb_dynsymGet( pMessage->item.asString.value )->pSymbol );
|
||||
/* Push char symbol as message */
|
||||
@@ -872,11 +862,9 @@ HARBOUR HB___OBJSENDMSG(void)
|
||||
static void hb_clsRelease( PCLASS pClass )
|
||||
{
|
||||
WORD wAt;
|
||||
WORD wLimit;
|
||||
PMETHOD pMeth;
|
||||
WORD wLimit = pClass->wHashKey * BUCKET;
|
||||
PMETHOD pMeth = pClass->pMethods;
|
||||
|
||||
wLimit = pClass->wHashKey * BUCKET;
|
||||
pMeth = pClass->pMethods;
|
||||
for( wAt = 0; wAt < wLimit; wAt++, pMeth++ ) /* Release initializers */
|
||||
if( pMeth->pInitValue && pMeth->wData > pClass->wDataFirst )
|
||||
hb_itemRelease( pMeth->pInitValue );
|
||||
@@ -911,7 +899,7 @@ void hb_clsReleaseAll( void )
|
||||
*
|
||||
* Internal function to cast to a super method
|
||||
*/
|
||||
static HARBOUR __msgSuper( void )
|
||||
static HARBOUR hb___msgSuper( void )
|
||||
{
|
||||
PHB_ITEM pObject = stack.pBase + 1;
|
||||
PHB_ITEM pSuper = (PHB_ITEM) hb_xgrab( sizeof( HB_ITEM ) );
|
||||
@@ -926,7 +914,7 @@ static HARBOUR __msgSuper( void )
|
||||
|
||||
pNewBase->wClass = wSuperCls;
|
||||
pNewBase->wHolders = 1; /* New item is returned */
|
||||
pNewBase->wSuperCast = TRUE; /* Do not dispose pItems !! */
|
||||
pNewBase->bSuperCast = TRUE; /* Do not dispose pItems !! */
|
||||
/* A bit dirty, but KISS. */
|
||||
hb_itemCopy( &stack.Return, pSuper );
|
||||
hb_itemRelease( pSuper );
|
||||
@@ -938,7 +926,7 @@ static HARBOUR __msgSuper( void )
|
||||
*
|
||||
* Internal function to set a CLASSDATA
|
||||
*/
|
||||
static HARBOUR __msgSetClsData( void )
|
||||
static HARBOUR hb___msgSetClsData( void )
|
||||
{
|
||||
WORD wClass = ( stack.pBase + 1 )->item.asArray.value->wClass;
|
||||
PHB_ITEM pReturn = stack.pBase + 2;
|
||||
@@ -957,7 +945,7 @@ static HARBOUR __msgSetClsData( void )
|
||||
*
|
||||
* Internal function to set a DATA
|
||||
*/
|
||||
static HARBOUR __msgSetData( void )
|
||||
static HARBOUR hb___msgSetData( void )
|
||||
{
|
||||
PHB_ITEM pObject = stack.pBase + 1;
|
||||
PHB_ITEM pReturn = stack.pBase + 2;
|
||||
@@ -972,7 +960,7 @@ static HARBOUR __msgSetData( void )
|
||||
|
||||
|
||||
/* No comment :-) */
|
||||
static HARBOUR __msgVirtual( void )
|
||||
static HARBOUR hb___msgVirtual( void )
|
||||
{
|
||||
hb_ret();
|
||||
}
|
||||
@@ -986,38 +974,37 @@ static HARBOUR __msgVirtual( void )
|
||||
HARBOUR HB___CLSINSTSUPER( void )
|
||||
{
|
||||
PHB_ITEM pString = hb_param( 1, IT_STRING );
|
||||
PHB_DYNS pDynSym;
|
||||
BYTE bFound = FALSE;
|
||||
WORD w;
|
||||
BOOL bFound = FALSE;
|
||||
|
||||
if( pString )
|
||||
{
|
||||
pDynSym = hb_dynsymFind( pString->item.asString.value );
|
||||
PHB_DYNS pDynSym = hb_dynsymFind( pString->item.asString.value );
|
||||
|
||||
if( pDynSym ) /* Find function */
|
||||
{
|
||||
WORD w;
|
||||
|
||||
hb_vmPushSymbol( pDynSym->pSymbol ); /* Push function name */
|
||||
hb_vmPushNil();
|
||||
hb_vmFunction( 0 ); /* Execute super class */
|
||||
|
||||
if( !IS_OBJECT( &stack.Return ) )
|
||||
{
|
||||
/* hb_errPutDescription(pError, "INSTSUPER : Super class does not return an object"); */
|
||||
hb_errRT_BASE(EG_ARG, 3002, NULL, "__CLSINSTSUPER");
|
||||
hb_errRT_BASE(EG_ARG, 3002, "Super class does not return an object", "__CLSINSTSUPER");
|
||||
}
|
||||
|
||||
for( w = 0; !bFound && w < wClasses; w++ )
|
||||
{ /* Locate the entry */
|
||||
if( !hb_stricmp( pString->item.asString.value, pClasses[ w ].szName ) )
|
||||
{
|
||||
hb_retni( w + 1 ); /* Entry + 1 = __msgClsH */
|
||||
hb_retni( w + 1 ); /* Entry + 1 = hb___msgClsH */
|
||||
bFound = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* hb_errPutDescription(pError, "INSTSUPER : Cannot find super class"); */
|
||||
hb_errRT_BASE(EG_ARG, 3003, NULL, "__CLSINSTSUPER");
|
||||
hb_errRT_BASE(EG_ARG, 3003, "Cannot find super class", "__CLSINSTSUPER");
|
||||
}
|
||||
}
|
||||
if( !bFound )
|
||||
@@ -1032,7 +1019,7 @@ HARBOUR HB___CLSINSTSUPER( void )
|
||||
*/
|
||||
HARBOUR HB___CLS_CNTCLSDATA(void)
|
||||
{
|
||||
WORD wClass = hb_parnl( 1 );
|
||||
WORD wClass = hb_parnl( 1 );
|
||||
|
||||
if( wClass )
|
||||
{
|
||||
@@ -1066,7 +1053,9 @@ HARBOUR HB___CLS_DECDATA(void)
|
||||
WORD wClass = hb_parnl( 1 );
|
||||
|
||||
if( wClass )
|
||||
{
|
||||
hb_retni( pClasses[ wClass - 1 ].wDatas-- );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1080,6 +1069,8 @@ HARBOUR HB___CLS_INCDATA(void)
|
||||
WORD wClass = hb_parnl( 1 );
|
||||
|
||||
if( wClass )
|
||||
{
|
||||
hb_retni( ++pClasses[ wClass - 1 ].wDatas );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
/* The Harbour implementation of codeblocks */
|
||||
|
||||
#include <string.h>
|
||||
#include "extend.h"
|
||||
#include "ctoharb.h"
|
||||
#include "itemapi.h"
|
||||
|
||||
@@ -40,19 +40,17 @@
|
||||
|
||||
/* Harbour Project source code
|
||||
http://www.Harbour-Project.org/
|
||||
The following function is Copyright 1999 Victor Szel <info@szelvesz.hu>:
|
||||
The following functions are Copyright 1999 Victor Szel <info@szelvesz.hu>:
|
||||
HB___COLORINDEX().
|
||||
HB___COLORINVERT().
|
||||
See doc/hdr_tpl.txt, Version 1.2 or later, for licensing terms.
|
||||
*/
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "extend.h"
|
||||
#include "itemapi.h"
|
||||
#include "init.h"
|
||||
#include "dates.h"
|
||||
#include "set.h"
|
||||
#include "inkey.h"
|
||||
#include "init.h"
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#include <unistd.h>
|
||||
@@ -108,14 +106,19 @@ HARBOUR HB_QQOUT( void );
|
||||
HARBOUR HB___COLORINDEX( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( Console__InitSymbols )
|
||||
{ "__ACCEPT" , FS_PUBLIC, HB___ACCEPT , 0 },
|
||||
{ "__EJECT" , FS_PUBLIC, HB___EJECT , 0 },
|
||||
#if 0
|
||||
{ "COL" , FS_PUBLIC, HB_COL , 0 },
|
||||
{ "ROW" , FS_PUBLIC, HB_ROW , 0 },
|
||||
{ "DEVPOS" , FS_PUBLIC, HB_DEVPOS , 0 },
|
||||
{ "PCOL" , FS_PUBLIC, HB_PCOL , 0 },
|
||||
{ "PROW" , FS_PUBLIC, HB_PROW , 0 },
|
||||
{ "SETPOS" , FS_PUBLIC, HB_SETPOS , 0 },
|
||||
#endif
|
||||
{ "__ACCEPT" , FS_PUBLIC, HB___ACCEPT , 0 },
|
||||
{ "__EJECT" , FS_PUBLIC, HB___EJECT , 0 },
|
||||
{ "DBGSHADOW" , FS_PUBLIC, HB_DBGSHADOW , 0 },
|
||||
{ "DEVOUT" , FS_PUBLIC, HB_DEVOUT , 0 },
|
||||
{ "DEVOUTPICT" , FS_PUBLIC, HB_DEVOUTPICT , 0 },
|
||||
{ "DEVPOS" , FS_PUBLIC, HB_DEVPOS , 0 },
|
||||
{ "DISPBEGIN" , FS_PUBLIC, HB_DISPBEGIN , 0 },
|
||||
{ "DISPBOX" , FS_PUBLIC, HB_DISPBOX , 0 },
|
||||
{ "DISPCOUNT" , FS_PUBLIC, HB_DISPCOUNT , 0 },
|
||||
@@ -127,14 +130,11 @@ HB_INIT_SYMBOLS_BEGIN( Console__InitSymbols )
|
||||
{ "NOSNOW" , FS_PUBLIC, HB_NOSNOW , 0 },
|
||||
{ "OUTERR" , FS_PUBLIC, HB_OUTERR , 0 },
|
||||
{ "OUTSTD" , FS_PUBLIC, HB_OUTSTD , 0 },
|
||||
{ "PCOL" , FS_PUBLIC, HB_PCOL , 0 },
|
||||
{ "PROW" , FS_PUBLIC, HB_PROW , 0 },
|
||||
{ "RESTSCREEN" , FS_PUBLIC, HB_RESTSCREEN , 0 },
|
||||
{ "SCROLL" , FS_PUBLIC, HB_SCROLL , 0 },
|
||||
{ "SAVESCREEN" , FS_PUBLIC, HB_SAVESCREEN , 0 },
|
||||
{ "SETCURSOR" , FS_PUBLIC, HB_SETCURSOR , 0 },
|
||||
{ "SETBLINK" , FS_PUBLIC, HB_SETBLINK , 0 },
|
||||
{ "SETPOS" , FS_PUBLIC, HB_SETPOS , 0 },
|
||||
{ "SETPRC" , FS_PUBLIC, HB_SETPRC , 0 },
|
||||
{ "SHADOW" , FS_PUBLIC, HB_SHADOW , 0 },
|
||||
{ "QOUT" , FS_PUBLIC, HB_QOUT , 0 },
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
You can contact me at: andij@aonlippo.co.id
|
||||
*/
|
||||
|
||||
#include "itemapi.h"
|
||||
#include "extend.h"
|
||||
#include "itemapi.h"
|
||||
#include "errorapi.h"
|
||||
#include "filesys.h"
|
||||
#include "init.h"
|
||||
|
||||
@@ -35,13 +35,13 @@
|
||||
* hb_dow(), HB_DOW()
|
||||
*/
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "extend.h"
|
||||
#include "init.h"
|
||||
#include "errorapi.h"
|
||||
#include "itemapi.h"
|
||||
#include "set.h"
|
||||
#include "dates.h"
|
||||
#include "init.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(__DJGPP__)
|
||||
@@ -69,6 +69,7 @@ HARBOUR HB_TIME( void );
|
||||
HARBOUR HB_YEAR( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( Dates__InitSymbols )
|
||||
#if 0
|
||||
{ "CDOW" , FS_PUBLIC, HB_CDOW , 0 },
|
||||
{ "CMONTH" , FS_PUBLIC, HB_CMONTH , 0 },
|
||||
{ "CTOD" , FS_PUBLIC, HB_CTOD , 0 },
|
||||
@@ -79,9 +80,10 @@ HB_INIT_SYMBOLS_BEGIN( Dates__InitSymbols )
|
||||
{ "DTOS" , FS_PUBLIC, HB_DTOS , 0 },
|
||||
{ "MONTH" , FS_PUBLIC, HB_MONTH , 0 },
|
||||
{ "SECONDS" , FS_PUBLIC, HB_SECONDS , 0 },
|
||||
{ "STOD" , FS_PUBLIC, HB_STOD , 0 },
|
||||
{ "TIME" , FS_PUBLIC, HB_TIME , 0 },
|
||||
{ "YEAR" , FS_PUBLIC, HB_YEAR , 0 }
|
||||
{ "YEAR" , FS_PUBLIC, HB_YEAR , 0 },
|
||||
#endif
|
||||
{ "STOD" , FS_PUBLIC, HB_STOD , 0 }
|
||||
HB_INIT_SYMBOLS_END( Dates__InitSymbols )
|
||||
#if ! defined(__GNUC__)
|
||||
#pragma startup Dates__InitSymbols
|
||||
|
||||
@@ -20,10 +20,8 @@
|
||||
#define INCL_DOSERRORS
|
||||
#endif
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "extend.h"
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "extend.h"
|
||||
#include "itemapi.h"
|
||||
#include "init.h"
|
||||
|
||||
@@ -46,6 +44,10 @@
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) || defined( _MSC_VER )
|
||||
#include <sys/stat.h>
|
||||
#include <share.h>
|
||||
|
||||
@@ -22,11 +22,10 @@
|
||||
You can contact me at: alinares@fivetech.com
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "set.h"
|
||||
#include "extend.h"
|
||||
#include "dates.h"
|
||||
#include "itemapi.h"
|
||||
#include "set.h"
|
||||
#include "dates.h"
|
||||
|
||||
PHB_ITEM hb_param( int iParam, WORD wMask )
|
||||
{
|
||||
@@ -38,7 +37,7 @@ PHB_ITEM hb_param( int iParam, WORD wMask )
|
||||
if( iParam == -1 )
|
||||
wType = stack.Return.type;
|
||||
else if( iParam < -1 )
|
||||
return 0;
|
||||
return NULL;
|
||||
else
|
||||
wType = ( stack.pBase + 1 + iParam )->type;
|
||||
|
||||
@@ -47,7 +46,7 @@ PHB_ITEM hb_param( int iParam, WORD wMask )
|
||||
if( iParam == -1 )
|
||||
pLocal = &stack.Return;
|
||||
else if( iParam < -1 )
|
||||
return 0;
|
||||
return NULL;
|
||||
else
|
||||
pLocal = stack.pBase + 1 + iParam;
|
||||
|
||||
@@ -57,9 +56,9 @@ PHB_ITEM hb_param( int iParam, WORD wMask )
|
||||
return pLocal;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char * hb_parc( int iParam, ... )
|
||||
@@ -206,7 +205,7 @@ char * hb_pards( int iParam, ... )
|
||||
if( wArrayIndex )
|
||||
{
|
||||
hb_arrayGetDate( pItem, wArrayIndex, stack.szDate );
|
||||
stack.szDate[ 8 ] = 0;
|
||||
stack.szDate[ 8 ] = '\0';
|
||||
|
||||
return stack.szDate;
|
||||
}
|
||||
@@ -219,7 +218,7 @@ char * hb_pards( int iParam, ... )
|
||||
|
||||
hb_dateDecode( pItem->item.asDate.value, &lDay, &lMonth, &lYear );
|
||||
hb_dateStrPut( stack.szDate, lDay, lMonth, lYear );
|
||||
stack.szDate[ 8 ] = 0;
|
||||
stack.szDate[ 8 ] = '\0';
|
||||
|
||||
return stack.szDate; /* this guaranties good behavior when multithreading */
|
||||
}
|
||||
@@ -473,7 +472,7 @@ void hb_retclen( char * szText, ULONG ulLen )
|
||||
stack.Return.item.asString.length = ulLen;
|
||||
stack.Return.item.asString.value = ( char * ) hb_xgrab( ulLen + 1 );
|
||||
memcpy( stack.Return.item.asString.value, szText, ulLen );
|
||||
stack.Return.item.asString.value[ ulLen ] = 0;
|
||||
stack.Return.item.asString.value[ ulLen ] = '\0';
|
||||
}
|
||||
|
||||
void hb_retds( char * szDate ) /* szDate must have yyyymmdd format */
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "extend.h"
|
||||
#include "init.h"
|
||||
#include "filesys.h"
|
||||
#include "errorapi.h"
|
||||
#include "init.h"
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
#include <mingw32/share.h>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef __MPW__
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "extend.h"
|
||||
#include "errorapi.h"
|
||||
|
||||
|
||||
@@ -74,11 +74,10 @@
|
||||
#define DOS_REGS REGS
|
||||
#endif
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "errorapi.h"
|
||||
#include "extend.h"
|
||||
#include "init.h"
|
||||
#include "errorapi.h"
|
||||
#include "inkey.h"
|
||||
#include "init.h"
|
||||
|
||||
HARBOUR HB___KEYBOARD( void );
|
||||
HARBOUR HB_INKEY( void );
|
||||
@@ -86,8 +85,10 @@ HARBOUR HB_LASTKEY( void );
|
||||
HARBOUR HB_NEXTKEY( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( INKEY__InitSymbols )
|
||||
{ "__KEYBOARD", FS_PUBLIC, HB___KEYBOARD, 0 },
|
||||
#if 0
|
||||
{ "INKEY" , FS_PUBLIC, HB_INKEY , 0 },
|
||||
#endif
|
||||
{ "__KEYBOARD", FS_PUBLIC, HB___KEYBOARD, 0 },
|
||||
{ "LASTKEY" , FS_PUBLIC, HB_LASTKEY , 0 },
|
||||
{ "NEXTKEY" , FS_PUBLIC, HB_NEXTKEY , 0 },
|
||||
HB_INIT_SYMBOLS_END( INKEY__InitSymbols )
|
||||
|
||||
@@ -33,8 +33,7 @@
|
||||
their web site at http://www.gnu.org/).
|
||||
*/
|
||||
|
||||
#include "hbdefs.h"
|
||||
#include "hbsetup.h"
|
||||
#include "extend.h"
|
||||
#include "langapi.h"
|
||||
|
||||
static HB_LANG langEN =
|
||||
|
||||
@@ -25,15 +25,17 @@ HARBOUR HB_ROUND( void );
|
||||
HARBOUR HB_SQRT( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( Math__InitSymbols )
|
||||
#if 0
|
||||
{ "HB_ABS" , FS_PUBLIC, HB_ABS , 0 },
|
||||
{ "HB_EXP" , FS_PUBLIC, HB_EXP , 0 },
|
||||
{ "HB_INT" , FS_PUBLIC, HB_INT , 0 },
|
||||
{ "HB_LOG" , FS_PUBLIC, HB_LOG , 0 },
|
||||
{ "HB_MAX" , FS_PUBLIC, HB_MAX , 0 },
|
||||
{ "HB_MIN" , FS_PUBLIC, HB_MIN , 0 },
|
||||
{ "HB_MOD" , FS_PUBLIC, HB_MOD , 0 },
|
||||
{ "HB_ROUND" , FS_PUBLIC, HB_ROUND , 0 },
|
||||
{ "HB_SQRT" , FS_PUBLIC, HB_SQRT , 0 }
|
||||
{ "HB_SQRT" , FS_PUBLIC, HB_SQRT , 0 },
|
||||
#endif
|
||||
{ "HB_MOD" , FS_PUBLIC, HB_MOD , 0 }
|
||||
HB_INIT_SYMBOLS_END( Math__InitSymbols )
|
||||
#if ! defined(__GNUC__)
|
||||
#pragma startup Math__InitSymbols
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "extend.h"
|
||||
#include "itemapi.h"
|
||||
#include "errorapi.h"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "hbdefs.h"
|
||||
#include "hbsetup.h"
|
||||
|
||||
#if defined(HARBOUR_LANGUAGE_EU)
|
||||
|
||||
@@ -160,17 +160,18 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include "extend.h"
|
||||
#include "init.h"
|
||||
#include "errorapi.h"
|
||||
#include <fcntl.h>
|
||||
#ifndef __MPW__
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include "extend.h"
|
||||
#include "errorapi.h"
|
||||
#include "set.h"
|
||||
#include "inkey.h"
|
||||
#include <errno.h>
|
||||
#include "init.h"
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0 /* O_BINARY not defined on Linux */
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
You can contact me at: alinares@fivetech.com
|
||||
*/
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "dates.h"
|
||||
#include "extend.h"
|
||||
#include "init.h"
|
||||
#include "itemapi.h"
|
||||
#include "errorapi.h"
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "extend.h"
|
||||
#include "dates.h"
|
||||
#include "itemapi.h"
|
||||
#include "errorapi.h"
|
||||
#include "set.h"
|
||||
#include "init.h"
|
||||
|
||||
#ifdef HARBOUR_STRICT_CLIPPER_COMPATIBILITY
|
||||
static double infinity = 0;
|
||||
@@ -70,33 +70,35 @@ HARBOUR HB_UPPER( void );
|
||||
HARBOUR HB_VAL( void );
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( Strings__InitSymbols )
|
||||
{ "ALLTRIM" , FS_PUBLIC, HB_ALLTRIM , 0 },
|
||||
#if 0
|
||||
{ "ASC" , FS_PUBLIC, HB_ASC , 0 },
|
||||
{ "AT" , FS_PUBLIC, HB_AT , 0 },
|
||||
{ "CHR" , FS_PUBLIC, HB_CHR , 0 },
|
||||
{ "LEFT" , FS_PUBLIC, HB_LEFT , 0 },
|
||||
{ "LOWER" , FS_PUBLIC, HB_LOWER , 0 },
|
||||
{ "LTRIM" , FS_PUBLIC, HB_LTRIM , 0 },
|
||||
{ "REPLICATE" , FS_PUBLIC, HB_REPLICATE , 0 },
|
||||
{ "RTRIM" , FS_PUBLIC, HB_RTRIM , 0 },
|
||||
{ "SPACE" , FS_PUBLIC, HB_SPACE , 0 },
|
||||
{ "STR" , FS_PUBLIC, HB_STR , 0 },
|
||||
{ "SUBSTR" , FS_PUBLIC, HB_SUBSTR , 0 },
|
||||
{ "TRIM" , FS_PUBLIC, HB_TRIM , 0 },
|
||||
{ "UPPER" , FS_PUBLIC, HB_UPPER , 0 },
|
||||
{ "VAL" , FS_PUBLIC, HB_VAL , 0 },
|
||||
#endif
|
||||
{ "ALLTRIM" , FS_PUBLIC, HB_ALLTRIM , 0 },
|
||||
{ "ISALPHA" , FS_PUBLIC, HB_ISALPHA , 0 },
|
||||
{ "ISDIGIT" , FS_PUBLIC, HB_ISDIGIT , 0 },
|
||||
{ "ISUPPER" , FS_PUBLIC, HB_ISUPPER , 0 },
|
||||
{ "ISLOWER" , FS_PUBLIC, HB_ISLOWER , 0 },
|
||||
{ "LEFT" , FS_PUBLIC, HB_LEFT , 0 },
|
||||
{ "LOWER" , FS_PUBLIC, HB_LOWER , 0 },
|
||||
{ "LTRIM" , FS_PUBLIC, HB_LTRIM , 0 },
|
||||
{ "PAD" , FS_PUBLIC, HB_PAD , 0 },
|
||||
{ "PADC" , FS_PUBLIC, HB_PADC , 0 },
|
||||
{ "PADL" , FS_PUBLIC, HB_PADL , 0 },
|
||||
{ "PADR" , FS_PUBLIC, HB_PADR , 0 },
|
||||
{ "RAT" , FS_PUBLIC, HB_RAT , 0 },
|
||||
{ "REPLICATE" , FS_PUBLIC, HB_REPLICATE , 0 },
|
||||
{ "RIGHT" , FS_PUBLIC, HB_RIGHT , 0 },
|
||||
{ "RTRIM" , FS_PUBLIC, HB_RTRIM , 0 },
|
||||
{ "SPACE" , FS_PUBLIC, HB_SPACE , 0 },
|
||||
{ "STR" , FS_PUBLIC, HB_STR , 0 },
|
||||
{ "STRTRAN" , FS_PUBLIC, HB_STRTRAN , 0 },
|
||||
{ "STUFF" , FS_PUBLIC, HB_STUFF , 0 },
|
||||
{ "SUBSTR" , FS_PUBLIC, HB_SUBSTR , 0 },
|
||||
{ "TRIM" , FS_PUBLIC, HB_TRIM , 0 },
|
||||
{ "UPPER" , FS_PUBLIC, HB_UPPER , 0 },
|
||||
{ "VAL" , FS_PUBLIC, HB_VAL , 0 }
|
||||
{ "STUFF" , FS_PUBLIC, HB_STUFF , 0 }
|
||||
HB_INIT_SYMBOLS_END( Strings__InitSymbols )
|
||||
#if ! defined(__GNUC__)
|
||||
#pragma startup Strings__InitSymbols
|
||||
|
||||
@@ -56,7 +56,9 @@ HARBOUR HB_TRANSFORM( void );
|
||||
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( Transfrm__InitSymbols )
|
||||
#if 0
|
||||
{ "TRANSFORM" , FS_PUBLIC, HB_TRANSFORM , 0 }
|
||||
#endif
|
||||
HB_INIT_SYMBOLS_END( Transfrm__InitSymbols )
|
||||
#if ! defined(__GNUC__)
|
||||
#pragma startup Transfrm__InitSymbols
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
* 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "extend.h"
|
||||
#include "pcode.h"
|
||||
#include "errorapi.h"
|
||||
#include "ctoharb.h"
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
*/
|
||||
|
||||
#include "extend.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef __DOS__
|
||||
#include <dos.h>
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct
|
||||
PHB_DYNS pDynSym; /* Pointer to dynamic symbol */
|
||||
} DYNHB_ITEM, * PDYNHB_ITEM, * DYNHB_ITEM_PTR;
|
||||
|
||||
static PDYNHB_ITEM pDynItems = 0; /* Pointer to dynamic items */
|
||||
static PDYNHB_ITEM pDynItems = NULL; /* Pointer to dynamic items */
|
||||
static WORD wDynSymbols = 0; /* Number of symbols present */
|
||||
static WORD wClosestDynSym = 0;
|
||||
/* Closest symbol for match. hb_dynsymFind() will search for the name. */
|
||||
@@ -66,7 +66,6 @@ PHB_SYMB hb_symbolNew( char * szName ) /* Create a new symbol */
|
||||
PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol ) /* creates a new dynamic symbol */
|
||||
{
|
||||
PHB_DYNS pDynSym = hb_dynsymFind( pSymbol->szName ); /* Find position */
|
||||
WORD w;
|
||||
|
||||
if( pDynSym ) /* If name exists */
|
||||
{
|
||||
@@ -88,6 +87,8 @@ PHB_DYNS hb_dynsymNew( PHB_SYMB pSymbol ) /* creates a new dynamic symbol */
|
||||
|
||||
if( wClosestDynSym <= wDynSymbols ) /* Closest < current !! */
|
||||
{ /* Here it goes :-) */
|
||||
WORD w;
|
||||
|
||||
for( w = 0; w < ( wDynSymbols - wClosestDynSym ); w++ )
|
||||
memcpy( &pDynItems[ wDynSymbols - w ],
|
||||
&pDynItems[ wDynSymbols - w - 1 ], sizeof( DYNHB_ITEM ) );
|
||||
@@ -120,7 +121,7 @@ PHB_DYNS hb_dynsymGet( char * szName ) /* finds and creates a symbol if not fou
|
||||
hb_strupr( szUprName ); /* turn it uppercase */
|
||||
|
||||
/* if( strlen( szUprName ) > 10 )
|
||||
szUprName[ 10 ] = 0; keeps this here for 10 chars /c compatibility mode */
|
||||
szUprName[ 10 ] = '\0'; keeps this here for 10 chars /c compatibility mode */
|
||||
|
||||
pDynSym = hb_dynsymFind( szUprName );
|
||||
if( ! pDynSym ) /* Does it exists ? */
|
||||
@@ -133,17 +134,15 @@ PHB_DYNS hb_dynsymGet( char * szName ) /* finds and creates a symbol if not fou
|
||||
|
||||
PHB_DYNS hb_dynsymFind( char * szName )
|
||||
{
|
||||
WORD wFirst = 0, wLast = wDynSymbols, wMiddle = wLast / 2;
|
||||
|
||||
if( ! pDynItems )
|
||||
{
|
||||
pDynItems = ( PDYNHB_ITEM ) hb_xgrab( sizeof( DYNHB_ITEM ) ); /* Grab array */
|
||||
pDynItems->pDynSym = ( PHB_DYNS ) hb_xgrab( sizeof( HB_DYNS ) );
|
||||
/* Always grab a first symbol. Never an empty bucket. *<1>* */
|
||||
pDynItems->pDynSym->hMemvar = 0;
|
||||
pDynItems->pDynSym->pSymbol = 0;
|
||||
pDynItems->pDynSym->pFunPtr = 0;
|
||||
return 0;
|
||||
pDynItems->pDynSym->pSymbol = NULL;
|
||||
pDynItems->pDynSym->pFunPtr = NULL;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{ /* Classic Tree Insert Sort Mechanism
|
||||
@@ -163,6 +162,11 @@ PHB_DYNS hb_dynsymFind( char * szName )
|
||||
* Only the last part of the array is going to be searched.
|
||||
* Go to (1)
|
||||
*/
|
||||
|
||||
WORD wFirst = 0;
|
||||
WORD wLast = wDynSymbols;
|
||||
WORD wMiddle = wLast / 2;
|
||||
|
||||
wClosestDynSym = wMiddle; /* Start in the middle */
|
||||
|
||||
while( wFirst < wLast )
|
||||
@@ -185,7 +189,7 @@ PHB_DYNS hb_dynsymFind( char * szName )
|
||||
wMiddle = wFirst + ( ( wLast - wFirst ) / 2 );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void hb_dynsymEval( PHB_DYNS_FUNC pFunction )
|
||||
@@ -193,8 +197,8 @@ void hb_dynsymEval( PHB_DYNS_FUNC pFunction )
|
||||
BOOL bCont = TRUE;
|
||||
WORD i;
|
||||
|
||||
for( i=0; i < wDynSymbols && bCont; i++ )
|
||||
bCont =(pFunction)( pDynItems[ i ].pDynSym );
|
||||
for( i = 0; i < wDynSymbols && bCont; i++ )
|
||||
bCont = (pFunction)( pDynItems[ i ].pDynSym );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,11 +30,7 @@
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "hbsetup.h" /* main configuration file */
|
||||
#include "extend.h"
|
||||
#include "ctoharb.h"
|
||||
#include "errorapi.h"
|
||||
@@ -64,7 +60,6 @@ HARBOUR HB_EVAL( void ); /* Evaluates a codeblock from Harbour */
|
||||
HARBOUR HB_LEN( void ); /* Evaluates a codeblock from Harbour */
|
||||
HARBOUR HB_EMPTY( void ); /* fixed entry point by now */
|
||||
HARBOUR HB_VALTYPE( void ); /* returns a string description of a value */
|
||||
|
||||
HARBOUR HB_ERRORBLOCK( void );
|
||||
HARBOUR HB_PROCNAME( void );
|
||||
HARBOUR HB_PROCLINE( void );
|
||||
@@ -120,16 +115,18 @@ BYTE bErrorLevel = 0; /* application exit errorlevel */
|
||||
#define HB_DEBUG2( x, y ) if( bHB_DEBUG ) printf( x, y )
|
||||
|
||||
HB_INIT_SYMBOLS_BEGIN( Hvm__InitSymbols )
|
||||
{ "EVAL" , FS_PUBLIC, HB_EVAL , 0 },
|
||||
#if 0
|
||||
{ "LEN" , FS_PUBLIC, HB_LEN , 0 },
|
||||
{ "EMPTY" , FS_PUBLIC, HB_EMPTY , 0 },
|
||||
{ "PCOUNT" , FS_PUBLIC, HB_PCOUNT , 0 },
|
||||
#endif
|
||||
{ "EVAL" , FS_PUBLIC, HB_EVAL , 0 },
|
||||
{ "VALTYPE" , FS_PUBLIC, HB_VALTYPE , 0 },
|
||||
{ "ERRORBLOCK" , FS_PUBLIC, HB_ERRORBLOCK , 0 },
|
||||
{ "PROCNAME" , FS_PUBLIC, HB_PROCNAME , 0 },
|
||||
{ "PROCLINE" , FS_PUBLIC, HB_PROCLINE , 0 },
|
||||
{ "__QUIT" , FS_PUBLIC, HB___QUIT , 0 },
|
||||
{ "ERRORLEVEL" , FS_PUBLIC, HB_ERRORLEVEL , 0 },
|
||||
{ "PCOUNT" , FS_PUBLIC, HB_PCOUNT , 0 },
|
||||
{ "PVALUE" , FS_PUBLIC, HB_PVALUE , 0 }
|
||||
HB_INIT_SYMBOLS_END( Hvm__InitSymbols )
|
||||
#if ! defined(__GNUC__)
|
||||
@@ -224,7 +221,7 @@ void hb_vmExecute( BYTE * pCode, PHB_SYMB pSymbols )
|
||||
WORD w = 0, wParams, wSize;
|
||||
ULONG ulPrivateBase = hb_memvarGetPrivatesBase();
|
||||
|
||||
HB_DEBUG( "VirtualMachine\n" );
|
||||
HB_DEBUG( "hb_vmExecute\n" );
|
||||
|
||||
while( ( bCode = pCode[ w ] ) != HB_P_ENDPROC && ! bQuit )
|
||||
{
|
||||
|
||||
@@ -6,58 +6,59 @@
|
||||
* Initialization of runtime support symbols
|
||||
*/
|
||||
|
||||
#include "hbsetup.h"
|
||||
#include "extend.h"
|
||||
#include "hbdefs.h"
|
||||
#include "init.h"
|
||||
#include "ctoharb.h"
|
||||
#include "initsymd.h"
|
||||
|
||||
HARBOUR HB_AADD( void );
|
||||
HARBOUR HB_ABS( void );
|
||||
HARBOUR HB_ASC( void );
|
||||
HARBOUR HB_AT( void );
|
||||
HARBOUR HB_CDOW( void );
|
||||
HARBOUR HB_CHR( void );
|
||||
HARBOUR HB_CMONTH( void );
|
||||
HARBOUR HB_COL( void );
|
||||
HARBOUR HB_CTOD( void );
|
||||
HARBOUR HB_DATE( void );
|
||||
HARBOUR HB_DAY( void );
|
||||
HARBOUR HB_DEVPOS( void );
|
||||
HARBOUR HB_DO( void );
|
||||
HARBOUR HB_DOW( void );
|
||||
HARBOUR HB_DTOC( void );
|
||||
HARBOUR HB_DTOS( void );
|
||||
HARBOUR HB_EMPTY( void );
|
||||
HARBOUR HB_EXP( void );
|
||||
HARBOUR HB_INT( void );
|
||||
HARBOUR HB_LEFT( void );
|
||||
HARBOUR HB_LEN( void );
|
||||
HARBOUR HB_LOG( void );
|
||||
HARBOUR HB_LOWER( void );
|
||||
HARBOUR HB_LTRIM( void );
|
||||
HARBOUR HB_MAX( void );
|
||||
HARBOUR HB_MIN( void );
|
||||
HARBOUR HB_MONTH( void );
|
||||
HARBOUR HB_PCOUNT( void );
|
||||
HARBOUR HB_REPLICATE( void );
|
||||
HARBOUR HB_ROW( void );
|
||||
HARBOUR HB_ROUND( void );
|
||||
HARBOUR HB_RTRIM( void );
|
||||
HARBOUR HB_SECONDS( void );
|
||||
HARBOUR HB_SETPOS( void );
|
||||
HARBOUR HB_SPACE( void );
|
||||
HARBOUR HB_SQRT( void );
|
||||
HARBOUR HB_STOD( void );
|
||||
HARBOUR HB_STR( void );
|
||||
HARBOUR HB_SUBSTR( void );
|
||||
HARBOUR HB_TIME( void );
|
||||
HARBOUR HB_TRANSFORM( void );
|
||||
HARBOUR HB_TRIM( void );
|
||||
HARBOUR HB_UPPER( void );
|
||||
HARBOUR HB_VAL( void );
|
||||
HARBOUR HB_YEAR( void );
|
||||
#ifdef HARBOUR_STRICT_ANSI_C
|
||||
#include "initsymd.h"
|
||||
#endif
|
||||
|
||||
extern HARBOUR HB_AADD( void );
|
||||
extern HARBOUR HB_ABS( void );
|
||||
extern HARBOUR HB_ASC( void );
|
||||
extern HARBOUR HB_AT( void );
|
||||
extern HARBOUR HB_CDOW( void );
|
||||
extern HARBOUR HB_CHR( void );
|
||||
extern HARBOUR HB_CMONTH( void );
|
||||
extern HARBOUR HB_COL( void );
|
||||
extern HARBOUR HB_CTOD( void );
|
||||
extern HARBOUR HB_DATE( void );
|
||||
extern HARBOUR HB_DAY( void );
|
||||
extern HARBOUR HB_DEVPOS( void );
|
||||
extern HARBOUR HB_DOW( void );
|
||||
extern HARBOUR HB_DTOC( void );
|
||||
extern HARBOUR HB_DTOS( void );
|
||||
extern HARBOUR HB_EMPTY( void );
|
||||
extern HARBOUR HB_EXP( void );
|
||||
extern HARBOUR HB_INKEY( void );
|
||||
extern HARBOUR HB_INT( void );
|
||||
extern HARBOUR HB_LEFT( void );
|
||||
extern HARBOUR HB_LEN( void );
|
||||
extern HARBOUR HB_LOG( void );
|
||||
extern HARBOUR HB_LOWER( void );
|
||||
extern HARBOUR HB_LTRIM( void );
|
||||
extern HARBOUR HB_MAX( void );
|
||||
extern HARBOUR HB_MIN( void );
|
||||
extern HARBOUR HB_MONTH( void );
|
||||
extern HARBOUR HB_PCOL( void );
|
||||
extern HARBOUR HB_PCOUNT( void );
|
||||
extern HARBOUR HB_PROW( void );
|
||||
extern HARBOUR HB_REPLICATE( void );
|
||||
extern HARBOUR HB_ROW( void );
|
||||
extern HARBOUR HB_ROUND( void );
|
||||
extern HARBOUR HB_RTRIM( void );
|
||||
extern HARBOUR HB_SECONDS( void );
|
||||
extern HARBOUR HB_SETPOS( void );
|
||||
extern HARBOUR HB_SPACE( void );
|
||||
extern HARBOUR HB_SQRT( void );
|
||||
extern HARBOUR HB_STR( void );
|
||||
extern HARBOUR HB_SUBSTR( void );
|
||||
extern HARBOUR HB_TIME( void );
|
||||
extern HARBOUR HB_TRANSFORM( void );
|
||||
extern HARBOUR HB_TRIM( void );
|
||||
extern HARBOUR HB_UPPER( void );
|
||||
extern HARBOUR HB_VAL( void );
|
||||
extern HARBOUR HB_YEAR( void );
|
||||
|
||||
static HB_SYMB symbols[] = {
|
||||
{ "AADD" , FS_PUBLIC, HB_AADD , 0 },
|
||||
@@ -75,7 +76,6 @@ static HB_SYMB symbols[] = {
|
||||
{ "DAY" , FS_PUBLIC, HB_DAY , 0 },
|
||||
{ "DELETED" , FS_PUBLIC, NULL , 0 },
|
||||
{ "DEVPOS" , FS_PUBLIC, HB_DEVPOS , 0 },
|
||||
{ "DO" , FS_PUBLIC, HB_DO , 0 },
|
||||
{ "DOW" , FS_PUBLIC, HB_DOW , 0 },
|
||||
{ "DTOC" , FS_PUBLIC, HB_DTOC , 0 },
|
||||
{ "DTOS" , FS_PUBLIC, HB_DTOS , 0 },
|
||||
@@ -86,7 +86,7 @@ static HB_SYMB symbols[] = {
|
||||
{ "FIELDNAME" , FS_PUBLIC, NULL , 0 },
|
||||
{ "FLOCK" , FS_PUBLIC, NULL , 0 },
|
||||
{ "FOUND" , FS_PUBLIC, NULL , 0 },
|
||||
{ "INKEY" , FS_PUBLIC, NULL , 0 },
|
||||
{ "INKEY" , FS_PUBLIC, HB_INKEY , 0 },
|
||||
{ "INT" , FS_PUBLIC, HB_INT , 0 },
|
||||
{ "LASTREC" , FS_PUBLIC, NULL , 0 },
|
||||
{ "LEFT" , FS_PUBLIC, HB_LEFT , 0 },
|
||||
@@ -98,9 +98,9 @@ static HB_SYMB symbols[] = {
|
||||
{ "MAX" , FS_PUBLIC, HB_MAX , 0 },
|
||||
{ "MIN" , FS_PUBLIC, HB_MIN , 0 },
|
||||
{ "MONTH" , FS_PUBLIC, HB_MONTH , 0 },
|
||||
{ "PCOL" , FS_PUBLIC, NULL , 0 },
|
||||
{ "PCOL" , FS_PUBLIC, HB_PCOL , 0 },
|
||||
{ "PCOUNT" , FS_PUBLIC, HB_PCOUNT , 0 },
|
||||
{ "PROW" , FS_PUBLIC, NULL , 0 },
|
||||
{ "PROW" , FS_PUBLIC, HB_PROW , 0 },
|
||||
{ "QSELF" , FS_PUBLIC, NULL , 0 },
|
||||
{ "RECCOUNT" , FS_PUBLIC, NULL , 0 },
|
||||
{ "RECNO" , FS_PUBLIC, NULL , 0 },
|
||||
@@ -114,7 +114,6 @@ static HB_SYMB symbols[] = {
|
||||
{ "SETPOS" , FS_PUBLIC, HB_SETPOS , 0 },
|
||||
{ "SPACE" , FS_PUBLIC, HB_SPACE , 0 },
|
||||
{ "SQRT" , FS_PUBLIC, HB_SQRT , 0 },
|
||||
{ "STOD" , FS_PUBLIC, HB_STOD , 0 },
|
||||
{ "STR" , FS_PUBLIC, HB_STR , 0 },
|
||||
{ "SUBSTR" , FS_PUBLIC, HB_SUBSTR , 0 },
|
||||
{ "TIME" , FS_PUBLIC, HB_TIME , 0 },
|
||||
|
||||
Reference in New Issue
Block a user