On Tue, 3 Jun 2008, Christoph Reichenbach wrote:
To my recollection, FILE * and its API functions are standardised as part of C89. (FreeSCI has historically targetted C89, though we have recently discussed migrating to C99). Thus, FILE * is not at all platform-specific beyond the `C89 platform'.
I thought we decided that we wouldn't purposefully break C89 compatibility, but that if we did we wouldn't go out of our way to fix it.
If such a change is needed, I propose making the decision statically (i.e., at compile time) as the dynamic approach seems to offer no benefits but requires additional type conversions. (For all the practical use cases I can think of, there is no need to be able to switch file representations at run-time).
Unless you wanted to inject the dependencies for unit tests, of course. You can also do this by sprinkling #ifdef's throughout the code, but that does end up being more of a maintenance/readability drag.
The easiest solution to me then seems to be the introduction of a file abstraction API (by refactoring the existing header files) with two underlying implementations, one relying on the one we already have in scicore/tools.c (plus extensions as needed) and one relying on the ScummVM mechanisms, with a flag triggering which one we use.
We discussed using a structure similar to that of the gfx and pcm drivers -- does that jive with you?
-- tangled strands of DNA explain the way that I behave. http://www.clock.org/~matt _______________________________________________ FreeSCI-develop mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/freesci-develop
