SF.net SVN: harbour-project:[17637] trunk/harbour

66 views
Skip to first unread message

vsza...@users.sourceforge.net

unread,
Jun 13, 2012, 10:16:52 AM6/13/12
to harbou...@googlegroups.com
Revision: 17637
http://harbour-project.svn.sourceforge.net/harbour-project/?rev=17637&view=rev
Author: vszakats
Date: 2012-06-13 14:16:52 +0000 (Wed, 13 Jun 2012)
Log Message:
-----------
2012-06-13 16:16 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbplist
+ contrib/hbamf
+ contrib/hbamf/amf.h
+ contrib/hbamf/amfdec.c
+ contrib/hbamf/amfenc.c
+ contrib/hbamf/amfstdio.c
+ contrib/hbamf/hbamf.hbc
+ contrib/hbamf/hbamf.hbp
+ contrib/hbamf/hbamf.hbx
+ contrib/hbamf/hbcls.c
+ contrib/hbamf/hbref.c
+ contrib/hbamf/issues.txt
+ contrib/hbamf/readme.txt
+ contrib/hbamf/tests
+ contrib/hbamf/tests/hbmk.hbm
+ contrib/hbamf/tests/tstendin.prg
+ added AMF3 encoder/decoder
work of Aleksander Czajczynski and Ilina Stoilkovska
(with minor additions of mine: build file
cleanup, some C level formatting/comment cleanup, C++
fixes)
; NOTE: this is only the pure AMF3 encoder/decoder,
and doesn't include websocket layers
; TODO: adding license

* utils/hbmk2/hbmk2.prg
* minor in comments

Modified Paths:
--------------
trunk/harbour/ChangeLog
trunk/harbour/contrib/hbplist
trunk/harbour/utils/hbmk2/hbmk2.prg

Added Paths:
-----------
trunk/harbour/contrib/hbamf/
trunk/harbour/contrib/hbamf/amf.h
trunk/harbour/contrib/hbamf/amfdec.c
trunk/harbour/contrib/hbamf/amfenc.c
trunk/harbour/contrib/hbamf/amfstdio.c
trunk/harbour/contrib/hbamf/hbamf.hbc
trunk/harbour/contrib/hbamf/hbamf.hbp
trunk/harbour/contrib/hbamf/hbamf.hbx
trunk/harbour/contrib/hbamf/hbcls.c
trunk/harbour/contrib/hbamf/hbref.c
trunk/harbour/contrib/hbamf/issues.txt
trunk/harbour/contrib/hbamf/readme.txt
trunk/harbour/contrib/hbamf/tests/
trunk/harbour/contrib/hbamf/tests/hbmk.hbm
trunk/harbour/contrib/hbamf/tests/tstendin.prg

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Mindaugas Kavaliauskas

unread,
Jun 13, 2012, 10:43:15 AM6/13/12
to harbou...@googlegroups.com
Hi,


On 2012.06.13 17:16, vsza...@users.sourceforge.net wrote:
> + added AMF3 encoder/decoder


hbcls.c and hbref.c contains internal amf functions. hbref.c function is
used in amfenc.c only, so I suggest to move it to this module and make
it static.

hbcls.c functions are used in both amfenc.c and amfdec.c. I suggest to
add some "_amf" prefix. Starting with underscore may help to understand
it is internal function, "amf" prefix will give a hint of function origin.

Hint: /include/hbdefs.h contains HB_GET_LE_DOUBLE() and co. Maybe
something can be used in amf.


Regards,
Mindaugas

Viktor Szakáts

unread,
Jun 13, 2012, 4:25:30 PM6/13/12
to harbou...@googlegroups.com
Hi Mindaugas,

On Wed, Jun 13, 2012 at 4:43 PM, Mindaugas Kavaliauskas
<dbt...@dbtopas.lt> wrote:
> Hi,
>
>
> On 2012.06.13 17:16, vsza...@users.sourceforge.net wrote:
>>
>>     + added AMF3 encoder/decoder
>
>
>
> hbcls.c and hbref.c contains internal amf functions. hbref.c function is
> used in amfenc.c only, so I suggest to move it to this module and make it
> static.
>
> hbcls.c functions are used in both amfenc.c and amfdec.c. I suggest to add
> some "_amf" prefix. Starting with underscore may help to understand it is
> internal function, "amf" prefix will give a hint of function origin.

Thanks, noticed but forgot to make it before committing.
Will do it in next commit.

> Hint: /include/hbdefs.h contains HB_GET_LE_DOUBLE() and co. Maybe something
> can be used in amf.


--
Viktor

Aleksander Czajczynski

unread,
Jun 15, 2012, 4:44:35 AM6/15/12
to harbou...@googlegroups.com
On 2012-06-13 22:25, Viktor Szakáts wrote:
On 2012.06.13 17:16, vsza...@users.sourceforge.net wrote:
    
    + added AMF3 encoder/decoder
      

hbcls.c and hbref.c contains internal amf functions. hbref.c function is
used in amfenc.c only, so I suggest to move it to this module and make it
static.

hbcls.c functions are used in both amfenc.c and amfdec.c. I suggest to add
some "_amf" prefix. Starting with underscore may help to understand it is
internal function, "amf" prefix will give a hint of function origin.
    
Thanks, noticed but forgot to make it before committing.
Will do it in next commit.
  

Thank you for cleanups and commiting.

There is one thing left with current state, the .c code uses ObjAMF class which was declared inside amfiosrv.prg. It's used for dynamic object emulation on Harbour side. In ECMAScript derivatives like JavaScript and ActionScript one can define properties for this kind of object dynamically, so to not lose this datatype information I created such class. There may be case-sensitivity problem however, because properties defined in Harbour will be uppercased - object messages are visibile to the code like that. Harbour wouldn't be of course case-sensitive at this, but every ECMAScript remote endpoint would be. I personally use all uppercase property names in ECMAScript code to ensure interoperability.

Harbour's
   oObj := ObjAMF():New()
   oObj:property := "x"
becomes
   o.PROPERTY;
after deserialization.

While
   o := new Object();
   o.property = "x";
after deserialization in Harbour won't be reachable using object interface, but still the information is stored, and there'll be no data loss after subsequent reserialization.

Using dynamic objects is not obligatory in all scenarios, but for example Adobe Flex data controls rely heavy on ArrayCollections, which are essentially arrays of dynamic objects. So with Harbour as data provider such functionality is neccesary.


Hint: /include/hbdefs.h contains HB_GET_LE_DOUBLE() and co. Maybe something
can be used in amf.
Noted. I'll make tests later.


Yes, i'm now more aware of macros available in Harbour tree, than at the time of writing these routines, and it can be used in case of .

Regards, AC

Massimo Belgrano

unread,
Jun 17, 2012, 5:16:28 AM6/17/12
to harbou...@googlegroups.com
When will be done a  websocket  library from  Aleksander Czajczynski  code?

Revision: 17637
         http://harbour-project.svn.sourceforge.net/harbour-project/?rev=17637&view=rev
Author:   vszakats
Date:     2012-06-13 14:16:52 +0000 (Wed, 13 Jun 2012)
Log Message:
-----------
2012-06-13 16:16 UTC+0200 Viktor Szakats (harbour syenar.net)
   + added AMF3 encoder/decoder
     work of Aleksander Czajczynski and Ilina Stoilkovska
     (with minor additions of mine: build file
     cleanup, some C level formatting/comment cleanup, C++
     fixes)
   ; NOTE: this is only the pure AMF3 encoder/decoder,
           and doesn't include websocket layers

--
Massimo Belgrano

Aleksander Czajczynski

unread,
Jun 17, 2012, 9:25:28 AM6/17/12
to harbou...@googlegroups.com
On 2012-06-17 11:16, Massimo Belgrano wrote:
> When will be done a websocket library from Aleksander Czajczynski
> code?
>
Massimo, we discussed with Viktor that WebSocket functionality library
shouldn't rely on AMF serialization alone, but rather it should be
separate library, "hbws" with switchable/pluggable serialization method,
to be a sensible proposition into Harbour tree.

Basically it means that current AMFWS_SERVER() function from demos i've
shown should not inherit from AMFIO_SERVER(), but rather on some yet not
created WS_SERVER(). I'll work on this, but really can't answer when it
will be satisfying.

Regards, Aleksander Czajczynski

Massimo Belgrano

unread,
Jun 17, 2012, 9:38:55 AM6/17/12
to harbou...@googlegroups.com
Thanks for clarification  Aleksander



2012/6/17 Aleksander Czajczynski <h...@fki.pl>



--
Massimo Belgrano


Reply all
Reply to author
Forward
0 new messages