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:
Viktor Szakats
2012-06-15 09:01:56 +00:00
parent 9493a734f2
commit 5969f97d7f
7 changed files with 86 additions and 3 deletions

View File

@@ -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

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -17,3 +17,5 @@ amfenc.c
amfdec.c
amfstdio.c
hbcls.c
hbamfobj.prg

View File

@@ -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>

View 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

View File

@@ -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. ;