[AD] Low-level file hooks - implemented and tested |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Hi,I have implemented the low-level file hooking system I proposed in an earlier e-mail. The attached zip contains a diff file to be applied over the tree, and two new files to be added (filehook.c and filehook.h). Sorry about the extra path components (cvs/allegro/) - my zip program is severely limited coughwinzipcough.
I've tested the Allegro demo on both DOS and Windows, and it worked without problems, so the existing packfile functionality is undamaged. I have also successfully ported Rock 'n' Spin to Windows using the new system to decrypt the main game file before decompressing it, a remnant of the registration system. (I've tested the new system on DOS but for legacy reasons I'm gonna continue using DJGPP's File System Extensions there.) I've written full documentation for the new parts of the API. Tests on Linux and other platforms would be welcome.
Rock 'n' Spin is available for download here: http://bdavis.strangesoft.net/rockspin/ . The Windows port is still a bit rough around the edges, so I'll do a better release sometime in the future. The exe files are installers for the DOS versions of the game and editor (you can safely put the DOS and Windows versions on top of each other). The editor has yet to be ported.
As far as Allegro is concerned, I'm aware that a new file system is around the corner, and Peter's argument is it will render these modifications redundant. However, I do not believe this is the case. Allegro 5 will be breaking backwards compatibility, so it would be a big undertaking to convert a game to use Allegro 5. Those who used DJGPP's File System Extensions would welcome this addition to the Allegro 4 API, even if it won't be used by many new users. Still, it isn't up to me... :)
Even if the patch doesn't get applied, note that there is a problem with the existing CVS tree. In file.c, the following appears:
#define OPEN_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
There's no problem on DJGPP, but (my version of) MinGW only defines S_IRUSR and S_IWUSR, so the build fails. I propose the following:
#ifdef S_IRGRP#define OPEN_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
#else #define OPEN_PERMS (S_IRUSR | S_IWUSR) #endifThis fix is taken care of in my patch, although the definition is moved to filehook.c.
Thanks, Ben _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
Attachment:
filehook.zip
Description: Zip compressed data
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |