[AD] [4.3] fshooks and stat(2) |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Currently my fshook code does whatever it can to hide the internals of its
structs from the user, giving them void pointers for handles, and only
letting the lib see the contents (and even then, its only the vtable). This
is all to reduce possiblity of ever breaking the abi or api by modifiying the
structs or vtable.
stat(2) is a little tricky, so far my idea is to tie it to a AL_FILE handle,
so you can just call al_fs_file_ctime(handle), and you have your ctime. What
about directories you ask? Well thats what I want to know as well. You _can_
allocate an AL_FILE handle without actually opening it, and that will work on
dir's so a al_fs_file_ctime on a AL_FILE that is actually a directory WILL
work, but it seems wrong.
I was originally going to provide a AL_STAT handle to pass around, but that
also feels wrong, and makes the user have to free the handle (via the api).
Which also feels wrong.
So, do I/we just mirror the stdio api, and use a plain struct, no handle, no
pointer? If its ever changed, it could easily break things. And I would like
to make it harder to break the abi, and api.
I still want to keep the current AL_FILE embedded stat info, it just "feels"
right, especially after using Qt's QFile so much. (no it wont "stat" each
time stat info is requested, it stats once on handle creation, and when ever
the user calls al_fs_fstat on the handle)
So yes, I'd like some input here.
--
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx