My Mac::iTunes module reads the binary "iTunes Music Library" files that iTunes uses as its database (why can't iPhoto do that?). Each iTunes version changes it slightly, even for the minor versions. That is really no big whoop, but I still have to do a little work to discover how it changed.
I think a good way to handle all of these version issues in the module would be to step back a bit. I want to write a binary file description, in human readable text, then have a Perl module turn that into the parsing code. It is not as complicated as Parse::RecDescent sort of things because it is just going to be a list of things that come after each other and how long they are (with a few exceptions). For instance, a GIF image can be described by such a thing, because it is block-oriented too.
The file for iTunes would look something like this, where the numbers are the bytes, and the names somehow relate to Perl variables the program can access later.
MINOR_VERSION 1 # the second byte
FOO 1.3.7 # some bit field, bits 3 to 7
HTIM_BLOCK 4 * HTIM_LENGTH
I write a different description file for each version of iTunes, and I do not have to change the code when iTunes adds a couple of bytes to a block.
I have not really thought about this, so it is a very rough idea, but since I like to grok binary files (just for giggles, you know), this is a really interesting side project for me.
Perhaps, if I can figure out that stuff, I can make a color-coded hex dump utility that visualises all the pieces. That would really be something I would like to have since I am at the level of print-outs and multiple colors of highlighting pens. Even if I could just get it to print out with the colors I wanted I would be happy, but I would rather be thrilled.
So, worthy audience, tell me where this has already been done and why it is a stupid idea!