[Verse-dev] API naming

Eskil Steenberg verse-dev@blender.org
Fri, 23 Apr 2004 13:22:23 +0200


Hi

>I feel the same way about the data processing helper functions in the
>API. Compare
>
>extern void *verse_pack_method_call(uint32 param_count, const VNOParam *params, const VNOParamType *param_type);
>extern boolean verse_unpack_method_call(void *data, uint32 param_count, VNOParam *params, const VNOParamType *param_type);
>
>with:
>
>extern void *verse_audio_compress(uint32 length, VNALayerType type, void *data);
>extern void *verse_audio_uncompress(uint32 length, VNALayerType type, void *data);
>
>The latter are more properly named than the former; the two first
>really should be verse_method_call_pack() and verse_method_call_unpack()
>to fit in.
>  
>
I have no problem with that change.

>I have other questions with the functions, of course. What is the
>destination buffer, is it returned? Is it dynamically allocated and
>thus needs to be free()d by the caller at some point? Also, all
>pointers to data that are INPUT to a function, such as (I assume) the
>final "data" in the audio functions, should be declared const.
>  
>
data coming from a callback should never be freed, data from one of the 
above functions should always be freed.

Verse can not free the data when it is being used, because that prevents 
the sender form sending multiple calls whit the same data. The audio
compress / uncompress could have been completely hidden for the user , 
but then if a severe wanted to send the same data to many clients it 
would have to compress the same data many times taking up more CPU.

E