Are you proposing to write a simple constraint solver in C? If it's specific to your problem i.e. not too general, it's not the craziest idea I've ever heard.
I don't mind fielding questions over the basic theory if you want to email me (iain at my domain).