Re: [AD] al_for_each_fs_entry |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
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.
-SL
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |