Re: [AD] al_for_each_fs_entry

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


On Sat 02 Aug 2014 04:07:33 PM SiegeLordEx wrote:
> On 08/02/2014 03:33 PM, beoran@xxxxxxxxxx wrote:
> > In this patch, wich is a replacement for my previous
> > beoran_al_for_each_file.diff, I propose a simple wrapper function
> > named al_for_each_fs_entry that allows easier use of
> > al_open_directory(), etc.  The function al_for_each_fs_entry will call
> > a callback and iterate over directory entries. After discussion with
> > Elias and others on the IRC channel, I decided to simplify and enhance
> > the al_for_each_filename proposal to this.
> > 
> > The function is fully documented and an example of it's use can be
> > seen in ex_dir.c .
> > I hope this is better than my previous suggestion.
> > 
> > Kind Regards,
> > 
> > B.
> 
> I'm generally in favour of this. One particular issue I have with the
> current iteration protocol (al_read_directory) is that it forces you to
> deallocate the entry every for each file, which seems inefficient for
> me. This function, on the other hand, could be implemented more
> efficiently (even if it isn't right now) in the future.
> 
> To that end, I'd prefer if the documentation didn't explain what it uses
> internally.

There is the option of passing in a static struct, but then we get stuck with 
that struct forever... That was basically the idea... Then again we could also 
have it re-use the same entry somehow. I thought the current method was less 
evil. And its disk access, so its not going to be super efficient/fast to begin 
with.

> -SL
> 
> ----------------------------------------------------------------------------
> -- Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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