moved c interface work space functions to .c file