Hello Esteban,
Since I'm new at porting code I have a couple of questions: The idea would be 'rewrite' the code in order for it to use the subset of C supported by HelenSO right?
If such changes would be minimal and well contained (e.g. in a rather small patch that could be applied automatically on the upstream sources), changing the upstream source tree is fine. On the other hand, you probably don't want to fork a wildly diverge the upstream libpng. Having such a diverged libpng would be of little benefit compared to writing our own PNG library.
If you expect the required changes in libpng to be substantial, you should choose the other path -- extend the HelenOS native libc or the libposix compatibility library by functions that are required by linpng.
Generally speaking it is really a matter of taste whether you prefer changing the ported library or extending the environment. But the ultimate goal should be the same in both cases: A clean and well-designed solution.
In that case I have another doubt, the library contains some files which easily exceed the 3K lines. This kind of task is generally done by inspecting line by line or some kind of automation can be achieved?
The basic automation is based on link-time checks. If the library can link with the environment (libc, libposix), there is a reasonable chance that the environment will behave with respect to the library as expected (although there might be subtle differences, especially in corner cases (*)). You should use the test suite of libpng then to check for the behaviour compliance.
If these automated steps fail you would have to resort to manual inspection of the code.
(*) HelenOS is not POSIX compliant. Even the libc functions that have POSIX-similar names are not guaranteed to behave in a POSIXly compliant way (but they should behave reasonably). Even the functions in libposix are not guaranteed to be 100% POSIX compliant (since they might be unfinished). The keyword is "best effort" :)
M.D. _______________________________________________ HelenOS-devel mailing list [email protected] http://lists.modry.cz/listinfo/helenos-devel
