RE: [AD] patch for windows NTFS file attributes |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
> The patch is ok; however, I wonder if it wouldn't be safer to
> also include every existant
> (that Allegro doesn't handle of course) and future flags in
> the mask. What do you think
> about that ?
I'd change the semantics of the arguments (and the argument list
for that matter). I've posted an example of an API I find nice,
here it is again:
int find_files(const char *pattern, int /* continue */ (*callback)(const char *filename, const struct AL_FILE_PROPERTIES *properties));
AL_FILE_PROPERTIES would be an Allegro specific structure mapping
some of the different attributes in a OS independant way.
The callback can return 0 or 1, and can set errno.
Return value of find_files could be used to detect an error in
opendir and friends.
AL_FILE_PROPERTIES could also feature a void *system_properties,
which point to an OS specific structure, for people who want that.
--
Vincent Penquerc'h
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |