Wow - sounds interesting - unluckily I still don't know anything about C (would it be C++)? It depends how long this will take you as to whether I may be able to help you in the future.
What are you doing then? Just out of curiousity!
A Knight is sworn to Honour. His heart knows only Virtue. His blade defends the helpless. His might upholds the Weak. His word speaks only truth. His wrath undoes the Wicked.