2006-06-20 13:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbapicls.h
  * harbour/source/vm/classes.c
    + added hb_objHasMesage( PHB_ITEM pObject, PHB_DYNS pMessage )
    + added hb_objGetpMethod() for backward binary compatibility with FWH
    * hidden for 3-rd party users hb_objGetMethod() and hb_objPopSuperCast()
      If for some reason 3-rd party code will need these methods please
      tell me in which case and I'll add necessary functions. Please
      try to not use any non-public function. I strongly prefer to
      add new public functions for which we will know that they are used
      by 3-rd party code then create problems with binary compatibility
      after updating local HVM functions.
This commit is contained in:
Przemyslaw Czerpak
2006-06-20 11:36:43 +00:00
parent d3bb5f0317
commit 96229354ab
3 changed files with 42 additions and 3 deletions

View File

@@ -8,6 +8,19 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
* changed default codepage to OEM
2006-06-20 17:22 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
! fixed memory leak when CLASSSEL() message was sent to non object
item
2006-06-20 14:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
* harbour/source/vm/classes.c
! fixed typo in function name should be hb_objHasMessage()
2006-06-20 13:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
* harbour/source/vm/classes.c
+ added hb_objHasMesage( PHB_ITEM pObject, PHB_DYNS pMessage )

View File

@@ -94,15 +94,20 @@ extern void hb_clsIsClassRef( void ); /* classes.c - mark all class in
extern BOOL hb_clsIsParent( USHORT uiClass, char * szParentName ); /* is a class handle inherited from szParentName Class ? */
/* object management */
#ifdef _HB_API_INTERNAL_
extern PHB_SYMB hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pSymMsg, BOOL * pfPopSuper ); /* returns the method pointer of an object class */
extern void hb_objPopSuperCast( PHB_ITEM pObject ); /* clean super casting if necessary */
#endif
extern BOOL hb_objHasOperator( PHB_ITEM pObject, USHORT uiOperator );
extern BOOL hb_objOperatorCall( USHORT uiOperator, HB_ITEM_PTR pResult, PHB_ITEM pObject, PHB_ITEM pMsgArg );
extern USHORT hb_objGetClass( PHB_ITEM pItem ); /* get object class handle */
extern char * hb_objGetClsName( PHB_ITEM pObject ); /* retrieves an object class name */
extern char * hb_objGetRealClsName( PHB_ITEM pObject, char * szString ); /* retrieves an object class name for a specific message */
extern PHB_SYMB hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pSymMsg, BOOL * pfPopSuper ); /* returns the method pointer of an object class */
extern void hb_objPopSuperCast( PHB_ITEM pObject ); /* clean super casting if necessary */
extern BOOL hb_objHasMsg( PHB_ITEM pObject, char * szString ); /* returns TRUE/FALSE whether szString is an existing message for object */
extern BOOL hb_objHasMsg( PHB_ITEM pObject, char * szString ); /* returns TRUE/FALSE whether szString is an existing message for object */
extern BOOL hb_objHasMesage( PHB_ITEM pObject, PHB_DYNS pMessage );
extern void hb_objSendMsg( PHB_ITEM pObj, char *sMsg, ULONG ulArg, ... );
#ifndef HB_NO_PROFILER

View File

@@ -952,6 +952,27 @@ PHB_SYMB hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage, BOOL * pfPopSuper
return NULL;
}
/*
* return TRUE if object has a given message
*/
BOOL hb_objHasMesage( PHB_ITEM pObject, PHB_DYNS pMessage )
{
return hb_objGetMethod( pObject, pMessage->pSymbol, NULL ) != NULL;
}
/*
* This function is only for backward binary compatibility
* It will be removed in the future so please do not use it.
* Use hb_objHasMesage() instead.
*/
#if defined(__cplusplus)
extern "C" BOOL hb_objGetpMethod( PHB_ITEM pObject, PHB_SYMB pMessage );
#endif
BOOL hb_objGetpMethod( PHB_ITEM pObject, PHB_SYMB pMessage )
{
return hb_objGetMethod( pObject, pMessage, NULL ) != NULL;
}
static PHB_SYMB hb_objFuncParam( int iParam )
{
PHB_ITEM pItem = hb_param( iParam, HB_IT_SYMBOL );