added auto generate function prototypes. err checks for no init variable

This one should acutally be final commit..

(inb4 more features)