Re: [AD] Custom packfiles

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sunday 02 January 2005 02:22, Elias Pschernig wrote:
> If it is, some things can be easier for users:
> 
> pack_fopen_vtable(tcp_vtable, "192.168.0.1:1234");
> pack_fopen_vtable(gz_vtable, "blah.txt.gz");

I like the idea behind this, but I don't like the idea of the user having 
to pass a pointer to a vtable. As far as I'm concerned, the user should 
have no reason to even be aware that Allegro uses vtables... this is also 
consistent with the current API.
I'd prefer something like (don't pay too much attention at the *_ex name 
I'm using here, it's just for illustrative purposes):
PACKFILE *pf_tcp = pack_fopen_ex(PF_TCP, "192.168.0.1:1234");
PACKFILE *pf_gz = pack_fopen_ex(PF_GZ, "blah.txt.gz");

Of course, this is problematic if PF_TCP and PF_GZ are implemented as 
numerical constants because having them provided by addons is going to be 
a pain in that case. No reason they can't be pointers to a vtable though, 
or in other words,
#define PF_TCP &tcp_vtable
#define PF_GZ &gz_vtable

I guess I just prefer to hide the term vtable from the user in this 
case. :)

Anyway, just my thoughts on the matter.

Evert





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/