diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3093b7fc73..57a50ef4d4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,19 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ + * 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 ) diff --git a/harbour/include/hbapicls.h b/harbour/include/hbapicls.h index c8a010089e..3cbde9d765 100644 --- a/harbour/include/hbapicls.h +++ b/harbour/include/hbapicls.h @@ -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 diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 417af54a18..c58bcbf8c9 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -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 );