In answer to your comments in the code:
/*
* Bla, boring agument parsing crap, only reason i didn't use getopt
* (which i did for an earlyer version) is because i couldn't find a good
* port of it under Win32.. there probably is one, maybe i didn't look
* hard enough.
*/
I think this can help:
- http://freecode.com/projects/popt
- http://gnuwin32.sourceforge.net/packages/popt.htm