Re: [AD] Custom packfiles #2

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


On Mon, 2005-01-03 at 07:14 -0800, Chris wrote:
> Elias Pschernig wrote:
> > Heh. I guess, it really can be left to addons to provide proper open
> > functions, and therefore they need not be in the vtable.
> 
> I don't know. It just seems right to have an open function in the 
> vtable. I don't like the idea of pre-opening the file before sending it 
> to pack_fopen_vtable. Besides, all it is, is an extra 8 bytes. If the 
> open and close entries are NULL, just don't call them.. assume success.

Well, as I see it now, the addon already calls pack_fopen_vtable. So the
user simply gets back a PACKFILE * from the addon-specific open
function, and need not care about how it was created. And all of
Allegro's packfile functions will just work on that pointer (using the
vtable entries).

So, if all addons are properly done, there wouldn't be much advantage of
having a vtable entry pf_fopen(char const *filename), which would fill
in the userdata. And an entry pf_fopen(void *userdata) wouldn't work at
all I think.

-- 
Elias Pschernig





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