2012-06-15 10:59 UTC+0200 Viktor Szakats (harbour syenar.net)
+ contrib/hbamf/hbamfobj.prg
* contrib/hbamf/amfdec.c
* contrib/hbamf/amfenc.c
* contrib/hbamf/hbamf.hbp
* contrib/hbamf/hbamf.hbx
+ added missing parts as per Aleksander's instructions.
with some renames/formatting. OBJAMF renamed to AMF_OBJ,
please review and test.
https://groups.google.com/d/msg/harbour-devel/EPdeo6zbFt8/FTd7mkyTPawJ
* utils/hbmk2/hbmk2.prg
* minor formatting
This commit is contained in:
@@ -16,6 +16,20 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-06-15 10:59 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
+ contrib/hbamf/hbamfobj.prg
|
||||
* contrib/hbamf/amfdec.c
|
||||
* contrib/hbamf/amfenc.c
|
||||
* contrib/hbamf/hbamf.hbp
|
||||
* contrib/hbamf/hbamf.hbx
|
||||
+ added missing parts as per Aleksander's instructions.
|
||||
with some renames/formatting. OBJAMF renamed to AMF_OBJ,
|
||||
please review and test.
|
||||
https://groups.google.com/d/msg/harbour-devel/EPdeo6zbFt8/FTd7mkyTPawJ
|
||||
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
* minor formatting
|
||||
|
||||
2012-06-15 10:16 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
! fixed RTE when running hbrun without parameter
|
||||
|
||||
@@ -1027,7 +1027,7 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO
|
||||
hb_arrayNew( pItem, OBJAMF_VAR_COUNT );
|
||||
/* performance TOFIX, cache class id (in context maybe)
|
||||
to not scan all classes by name everytime */
|
||||
hb_objSetClass( pItem, "OBJAMF", "OBJAMF" );
|
||||
hb_objSetClass( pItem, "AMF_OBJ", "AMF_OBJ" );
|
||||
pValue = hb_itemPutNI( NULL, OBJAMF_VER );
|
||||
hb_arraySet( pItem, OBJAMF_VAR_VER, pValue );
|
||||
hb_itemRelease( pValue );
|
||||
|
||||
@@ -814,7 +814,7 @@ static HB_BOOL amf3_encode_object( amfContext * context, PHB_ITEM pItem )
|
||||
PHB_ITEM pClass;
|
||||
|
||||
/* serialize emulated ActionScript dynamic object */
|
||||
if( strcmp( hb_clsName( hb_objGetClass( pItem ) ), "OBJAMF" ) == 0 )
|
||||
if( strcmp( hb_clsName( hb_objGetClass( pItem ) ), "AMF_OBJ" ) == 0 )
|
||||
{
|
||||
PHB_ITEM pAnonHash = hb_itemNew( NULL );
|
||||
|
||||
|
||||
@@ -17,3 +17,5 @@ amfenc.c
|
||||
amfdec.c
|
||||
amfstdio.c
|
||||
hbcls.c
|
||||
|
||||
hbamfobj.prg
|
||||
|
||||
@@ -29,6 +29,7 @@ DYNAMIC AMF3_DECODE
|
||||
DYNAMIC AMF3_ENCODE
|
||||
DYNAMIC AMF3_FROMWA
|
||||
DYNAMIC AMFSTDIO_READ
|
||||
DYNAMIC AMF_OBJ
|
||||
|
||||
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__HBAMF__REQUEST )
|
||||
#uncommand DYNAMIC <fncs,...> => EXTERNAL <fncs>
|
||||
|
||||
65
harbour/contrib/hbamf/hbamfobj.prg
Normal file
65
harbour/contrib/hbamf/hbamfobj.prg
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*******
|
||||
*
|
||||
* Ilina Stoilkovska <anili100/at/gmail.com> 2011
|
||||
* Aleksander Czajczynski <hb/at/fki.pl> 2011-2012
|
||||
*
|
||||
* Basic routines for communications using AMFIO
|
||||
* over standard IO pipes and TCP/IP
|
||||
*
|
||||
********/
|
||||
|
||||
/* internal Harbour functions used in this file */
|
||||
#xtranslate MethodName() => __GetMessage()
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
CREATE CLASS AMF_Obj
|
||||
|
||||
METHOD New( hCachedData ) CONSTRUCTOR
|
||||
ERROR HANDLER noMessage
|
||||
METHOD msgNotFound
|
||||
|
||||
PROTECTED:
|
||||
|
||||
VAR nVersion INIT 0
|
||||
VAR cRealClass
|
||||
VAR hCachedData
|
||||
VAR nRpcOid
|
||||
VAR pConnection
|
||||
VAR nID
|
||||
|
||||
EXPORTED:
|
||||
|
||||
ACCESS RealClass INLINE ::cRealClass
|
||||
ACCESS RpcOid INLINE ::nRpcOid
|
||||
|
||||
END CLASS
|
||||
|
||||
METHOD New( hCachedData ) CLASS AMF_Obj
|
||||
|
||||
::hCachedData := hCachedData
|
||||
|
||||
RETURN self
|
||||
|
||||
METHOD noMessage( ... ) CLASS AMF_Obj
|
||||
|
||||
RETURN ::msgNotFound( MethodName(), ... )
|
||||
|
||||
METHOD msgNotFound( cMessage, ... ) CLASS AMF_Obj
|
||||
|
||||
IF PCount() = 1 .AND. !( hb_BLeft( cMessage, 1 ) == "_" )
|
||||
IF ! Empty( ::hCachedData ) .AND. hb_HHasKey( ::hCachedData, cMessage )
|
||||
RETURN ::hCachedData[ cMessage ]
|
||||
ENDIF
|
||||
ELSEIF PCount() > 1 .AND. hb_BLeft( cMessage, 1 ) == "_"
|
||||
IF Empty( ::hCachedData )
|
||||
::hCachedData := { => }
|
||||
ENDIF
|
||||
RETURN ::hCachedData[ hb_BSubStr( cMessage, 2 ) ] := hb_PValue( 2 )
|
||||
ENDIF
|
||||
|
||||
RETURN NIL
|
||||
@@ -13010,7 +13010,8 @@ DYNAMIC win_regWrite
|
||||
DYNAMIC win_regDelete
|
||||
|
||||
STATIC FUNCTION __hbshell_win_reg_self( lRegister, lAllUser )
|
||||
IF ! hb_IsFunction( "__HBEXTERN__HBWIN__" ) .AND. ! hbshell_ext_load( "hbwin" )
|
||||
IF ! hb_IsFunction( "__HBEXTERN__HBWIN__" ) .AND. ;
|
||||
! hbshell_ext_load( "hbwin" )
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
IF ! hb_IsFunction( "win_regWrite" ) .OR. ;
|
||||
|
||||
Reference in New Issue
Block a user