|
From: Rodrigo D. <cu...@uo...> - 2002-02-19 21:55:35
|
Johann Deneux wrote:
> On Sun, 17 Feb 2002, Rodrigo Damazio wrote:
>
>> interoperability, why couldn't other languages handle structs??
>>
>
> I don't know if all languages have the notion of structures, and if the=
y
> do, their implementation may be binary-incompatible with C.
> These are hypothetical issues, I don't know much about Perl, Python, Ru=
by
> and other languages people like.
> Another problem is that every time we touch a structure, every=20
> application using libff must be recompiled.
> If we hide the structures, recompilation is only necessary when changin=
g
> the function prototypes.
>
I get your point...how about using both ways?? Having the structs,=20
and if the calling language can't handle them directly, it can just use=20
the manipulation functions, whereas in C and similars which can handle=20
structs, it can be made a lot easier...or perhaps we even should make=20
this a C-only version and write wrappers for Perl and other=20
languages...I've seen a few libraries which do that...
>> - Perhaps we should treat compound effects the same way we=20
>> treat effects - that would not only make it easier to use, but would=20
>> also give us the possibility to build an effect hierarchy...
>> - About effect IDs, how about keeping it in the struct=20
>> itself?? That'd make it a bit easier for updating effects...
>>
>> Also, about ff_error, I'm in doubt whether we should return it=20
>> in all functions, or should return pointers directly(and upon an=20
>> error, return NULL)...that would allow for something like this:
>>
>> eff =3D FF_create_constant(dir, mag, FF_create_envelope(bla bla),=20
>> FF_create_trigger(bla bla), FF_create_time(bla bla), flags);
>> instead of having to create each of these individually and setting=20
>> all their parameters...
>>
>
> Why not. But then we cannot return error codes. The user only knows if =
it
> worked/failed, but has no hint why.
>
Can't we use something like errno for the errors?? That's what I=20
thought...or even a function FF_get_error...although you may be right...
Rodrigo
--=20
*******************************
* Rodrigo Damazio *
* *************************** *
* cu...@uo... *
* rod...@po... *
* ICQ: #3560450 *
* http://www.vros.com/cuddly/ *
* *************************** *
* Engenharia da Computa=E7=E3o *
* Escola Polit=E9cnica *
* USP - S=E3o Paulo *
*******************************
|