exchange cocoa api to C api